LDMX Software
EventProcessor.cxx
2
3// LDMX
4#include "Framework/Process.h"
5#include "Framework/RunHeader.h"
6#include "TDirectory.h"
7
8namespace framework {
9
10EventProcessor::EventProcessor(const std::string &name, Process &process)
11 : histograms_{[this]() -> TDirectory * {
12 return this->getHistoDirectory();
13 }},
14 the_log_{logging::makeLogger(name)},
15 process_{process},
16 name_{name} {}
17
18Conditions &EventProcessor::getConditions() const {
19 return process_.getConditions();
20}
21
22const ldmx::EventHeader &EventProcessor::getEventHeader() const {
23 return *(process_.getEventHeader());
24}
25
26TDirectory *EventProcessor::getHistoDirectory() {
27 if (!histo_dir_) {
28 histo_dir_ = process_.makeHistoDirectory(name_);
29 }
30 histo_dir_->cd(); // make this the current directory
31 return histo_dir_;
32}
33
34void EventProcessor::setStorageHint(framework::StorageControl::Hint hint,
35 const std::string &purposeString) {
36 process_.getStorageController().addHint(name_, hint, purposeString);
37}
38
39int EventProcessor::getLogFrequency() const {
40 return process_.getLogFrequency();
41}
42
43int EventProcessor::getRunNumber() const { return process_.getRunNumber(); }
44
45void EventProcessor::createHistograms(
46 const std::vector<framework::config::Parameters> &histos) {
47 for (auto const &h : histos) {
48 histograms_.create(h);
49 }
50}
51
53
54Producer::Producer(const std::string &name, Process &process)
55 : EventProcessor(name, process) {}
56
57Analyzer::Analyzer(const std::string &name, Process &process)
58 : EventProcessor(name, process) {}
59} // 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:411
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:43
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:36
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.