5 |
|
#include <TTree.h> |
6 |
|
#include "MitAna/DataTree/interface/Names.h" |
7 |
|
#include "MitAna/DataTree/interface/TriggerName.h" |
8 |
+ |
#include "MitAna/DataTree/interface/TriggerMask.h" |
9 |
|
#include "MitAna/DataTree/interface/TriggerObject.h" |
10 |
+ |
#include "MitAna/DataTree/interface/TriggerObjectCol.h" |
11 |
+ |
#include "MitAna/DataTree/interface/TriggerObjectsTable.h" |
12 |
|
|
13 |
|
using namespace mithep; |
14 |
|
|
18 |
|
HLTMod::HLTMod(const char *name, const char *title) : |
19 |
|
BaseMod(name,title), |
20 |
|
fAbort(kTRUE), |
21 |
+ |
fPrintTable(kFALSE), |
22 |
+ |
fIgnoreBits(kFALSE), |
23 |
+ |
fObjMode(kHlt), |
24 |
|
fBitsName(Names::gkHltBitBrn), |
25 |
< |
fMyObjsNamePub(Form("%sObjsadafafa", name)), |
25 |
> |
fMyObjsNamePub(Form("%sTrigObjs", name)), |
26 |
|
fBits(0), |
27 |
|
fMyTrgObjs(0), |
28 |
|
fTriggers(0), |
60 |
|
const BitMask256 &ba = fTrigBitsAnd.at(tid); |
61 |
|
const BitMask256 &bm = fTrigBitsCmp.at(tid); |
62 |
|
for (UInt_t i=0; i<bm.Size(); ++i) { |
63 |
< |
if (ba.TestBit(i)==0) |
63 |
> |
if (ba.TestBit(i)==0 && !fIgnoreBits) |
64 |
|
continue; // not an active trigger bit |
65 |
|
if (fBitsDone.TestBit(i)) |
66 |
|
continue; // objects for this bit are already obtained |
68 |
|
continue; // excluded trigger bit (ie a !trgname) |
69 |
|
|
70 |
|
const TList *list = fTrigObjs->GetList(i); |
71 |
< |
fMyTrgObjs->Add(list); |
71 |
> |
|
72 |
> |
TIter iter(list->MakeIterator()); |
73 |
> |
const TriggerObject *to = dynamic_cast<const TriggerObject*>(iter.Next()); |
74 |
> |
while (to) { |
75 |
> |
if ( (fObjMode == kAll) || |
76 |
> |
((fObjMode==kHlt) && (to->IsHLT())) || |
77 |
> |
((fObjMode==kL1) && (to->IsL1())) ) |
78 |
> |
fMyTrgObjs->Add(to); |
79 |
> |
to = dynamic_cast<const TriggerObject*>(iter.Next()); |
80 |
> |
} |
81 |
|
fBitsDone.SetBit(i); |
82 |
|
} |
83 |
|
} |
96 |
|
for (UInt_t i=0; i<fTrigNames.size(); ++i) { |
97 |
|
BitMask256 tmask; //trigger mask |
98 |
|
BitMask256 amask; //bitand mask |
99 |
+ |
Bool_t gotamask = 0; |
100 |
|
TString names(fTrigNames.at(i).c_str()); |
101 |
|
|
102 |
|
TObjArray *arr = names.Tokenize("&"); |
116 |
|
Warning("BeginRun", "Trigger %s not found.", sptr); |
117 |
|
continue; |
118 |
|
} |
119 |
+ |
gotamask = 1; |
120 |
|
UShort_t bit = tn->Id(); |
121 |
|
amask.SetBit(bit); //always set and-mask bit |
122 |
|
if (!invert) |
124 |
|
} |
125 |
|
delete arr; |
126 |
|
} |
127 |
< |
fTrigBitsAnd.push_back(amask); |
128 |
< |
fTrigBitsCmp.push_back(tmask); |
127 |
> |
if (gotamask) { |
128 |
> |
fTrigBitsAnd.push_back(amask); |
129 |
> |
fTrigBitsCmp.push_back(tmask); |
130 |
> |
} |
131 |
|
} |
132 |
|
} |
133 |
|
|
168 |
|
|
169 |
|
// take action if accepted |
170 |
|
++fNAcceped; |
171 |
+ |
IncNEventsProcessed(); |
172 |
|
OnAccepted(); |
173 |
|
if (!AddObjThisEvt(fMyTrgObjs)) { |
174 |
|
SendError(kAbortAnalysis, "Process", |
197 |
|
return; |
198 |
|
} |
199 |
|
} |
200 |
+ |
|
201 |
+ |
//-------------------------------------------------------------------------------------------------- |
202 |
+ |
void HLTMod::SlaveTerminate() |
203 |
+ |
{ |
204 |
+ |
// Save number of accepted events. |
205 |
+ |
|
206 |
+ |
SaveNEventsProcessed("hDHLTEvents"); |
207 |
+ |
} |