2 #include <TObjString.h>
5 fFilledConfigTree(kFALSE),
7 fIsUsedForPreselection(kFALSE),
11 fDescription(
"Undefined"),
12 fCVSTagName(
"Undefined: Problem in derived class!"),
13 fCVSID(
"Undefined: Problem in derived class!") {}
18 ND280Error(
"No configurable options defined for this class");
23 switch (GetTreeType()) {
33 throw ND::EUndefinedTreeType();
41 fOutputTree->SetAutoFlush(3000000);
44 fOutputTree->Branch(
"RunID", &fRunID,
"RunID/I", fBufferSize);
45 fOutputTree->Branch(
"EventID", &fEventID,
"EventID/I", fBufferSize);
46 fOutputTree->Branch(
"Preselected", &fPreselected,
"Preselected/B",
48 fOutputTree->Branch(
"SubrunID", &fSubrunID,
"SubrunID/I", fBufferSize);
54 if(fFilledConfigTree){
55 ND280NamedWarn(
"TAnalysisModuleBase",
"Module: " << this->GetName()
56 <<
" has already written the config tree this run.");
59 TObjString * Description = 0;
60 TObjString * CVSTagName = 0;
61 TObjString *
CVSID = 0;
63 configTree->Branch(
"IsUsedForPreselection", &fIsUsedForPreselection,
64 "IsUsedForPreselection/O");
65 configTree->Branch(
"Description", &Description);
66 configTree->Branch(
"CVSTagName", &CVSTagName);
67 configTree->Branch(
"CVSID", &CVSID);
69 (*Description) = fDescription.c_str();
70 (*CVSTagName) = fCVSTagName.c_str();
71 (*CVSID) = fCVSID.c_str();
74 fFilledConfigTree =
true;
78 fRunID =
event.GetRunId();
79 fEventID =
event.GetEventId();
80 fSubrunID =
event.GetContext().GetSubRun();
81 fIsMC =
event.GetContext().IsMC();
82 if (!FillTree(event)) {
83 throw EAnalysisFailure();
85 fPreselected = IsFullEventWorthSaving(event);
101 ND280Log(
"Module: " << GetName()
102 << (IsEnabled() ?
" (Enabled) " :
" (Disabled) ")
103 << (IsUsedForPreselection() ?
" (Preselecting) "
104 :
" (Not Preselecting) "));
105 ND280Log(
"Description: " << GetDescription());
115 return fName.c_str();
119 return fTitle.c_str();
virtual void Print()
Prints a simple message describing the module.
virtual bool Process(ND::TND280Event &event)
Gets the run and event IDs and calls FillTree with the event, and then actually calls fOutputTree->Fi...
virtual bool IsFullEventWorthSaving(ND::TND280Event &event)
Whether the module thinks it is worth saving the entire oaEvent event tree entry for this event...
virtual Bool_t Configure(std::string &option)
A function that allows the module to be configured from an external class without any dependencies...
std::string const GetDirectoryName() const
Returns the name of the directory which the output of a particular module will be saved in...
void SetNameTitle(char const *name, char const *title)
void Initialize(TTree *tree)
virtual Bool_t ProcessFirstEvent(ND::TND280Event &)=0
Is called after the first event is loaded in.
virtual ~TAnalysisModuleBase()
virtual void FillConfigTree(TTree *)