LDMX Software
EventProcessor.cxx
2
3// LDMX
4#include "Framework/Process.h"
5#include "TDirectory.h"
6
7namespace framework {
8
9EventProcessor::EventProcessor(const std::string& name, Process& process)
10 : histograms_{[this]() -> TDirectory* {
11 return this->getHistoDirectory();
12 }},
13 the_log_{logging::makeLogger(name)},
14 process_{process},
15 name_{name} {}
16
17Conditions& EventProcessor::getConditions() const {
18 return process_.getConditions();
19}
20
21const ldmx::EventHeader& EventProcessor::getEventHeader() const {
22 return *(process_.getEventHeader());
23}
24
25TDirectory* EventProcessor::getHistoDirectory() {
26 if (!histo_dir_) {
27 histo_dir_ = process_.makeHistoDirectory(name_);
28 }
29 histo_dir_->cd(); // make this the current directory
30 return histo_dir_;
31}
32
33void EventProcessor::setStorageHint(framework::StorageControl::Hint hint,
34 const std::string& purposeString) {
35 process_.getStorageController().addHint(name_, hint, purposeString);
36}
37
38int EventProcessor::getLogFrequency() const {
39 return process_.getLogFrequency();
40}
41
42int EventProcessor::getRunNumber() const { return process_.getRunNumber(); }
43
44void EventProcessor::createHistograms(
45 const std::vector<framework::config::Parameters>& histos) {
46 for (auto const& h : histos) {
47 histograms_.create(h);
48 }
49}
50
52
53Producer::Producer(const std::string& name, Process& process)
54 : EventProcessor(name, process) {}
55
56Analyzer::Analyzer(const std::string& name, Process& process)
57 : EventProcessor(name, process) {}
58} // namespace framework
Base classes for all user event processing components to extend.
#define DEFINE_FACTORY(classtype)
This should go into an implementation file for your prototype class.
Definition Factory.h:408
Class which represents the process under execution.
Analyzer(const std::string &name, Process &process)
Class constructor.
Container and cache for conditions and conditions providers.
Definition Conditions.h:40
Base class for all event processing components.
EventProcessor(const std::string &name, Process &process)
Class constructor.
TDirectory * getHistoDirectory()
Access/create a directory in the histogram file for this event processor to create histograms and ana...
Class which represents the process under execution.
Definition Process.h:34
Hint
Hints that can be provided by processors to the storage controller.
Provides header information an event such as event number and timestamp.
Definition EventHeader.h:44
All classes in the ldmx-sw project use this namespace.