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 |
|
fBitsName(Names::gkHltBitBrn), |
23 |
< |
fMyObjsNamePub(Form("%sObjsadafafa", name)), |
23 |
> |
fMyObjsNamePub(Form("%sTrigObjs", name)), |
24 |
|
fBits(0), |
25 |
|
fMyTrgObjs(0), |
26 |
|
fTriggers(0), |
47 |
|
// "A", "!A", "A&B", "A&!B" or "A&B&C" |
48 |
|
|
49 |
|
string tname(expr); |
50 |
< |
fTrigNames.AddCopy(tname); |
50 |
> |
fTrigNames.push_back(tname); |
51 |
|
} |
52 |
|
|
53 |
|
//-------------------------------------------------------------------------------------------------- |
55 |
|
{ |
56 |
|
// Add trigger objects corresponding to trigger id. |
57 |
|
|
58 |
< |
const BitMask256 &ba = fTrigBitsAnd.Ref(tid); |
59 |
< |
const BitMask256 &bm = fTrigBitsCmp.Ref(tid); |
58 |
> |
const BitMask256 &ba = fTrigBitsAnd.at(tid); |
59 |
> |
const BitMask256 &bm = fTrigBitsCmp.at(tid); |
60 |
|
for (UInt_t i=0; i<bm.Size(); ++i) { |
61 |
|
if (ba.TestBit(i)==0) |
62 |
|
continue; // not an active trigger bit |
76 |
|
{ |
77 |
|
// Get HLT tree and set branches. Compute bitmasks to be used when comparing to the HLT bits. |
78 |
|
|
79 |
< |
fTrigBitsAnd.Reset(); |
80 |
< |
fTrigBitsCmp.Reset(); |
79 |
> |
fTrigBitsAnd.clear(); |
80 |
> |
fTrigBitsCmp.clear(); |
81 |
|
|
82 |
|
if (fPrintTable) |
83 |
|
fTriggers->Print(); |
84 |
|
|
85 |
< |
for (UInt_t i=0; i<fTrigNames.Entries(); ++i) { |
85 |
> |
for (UInt_t i=0; i<fTrigNames.size(); ++i) { |
86 |
|
BitMask256 tmask; //trigger mask |
87 |
|
BitMask256 amask; //bitand mask |
88 |
< |
TString names(fTrigNames.At(i)->c_str()); |
88 |
> |
TString names(fTrigNames.at(i).c_str()); |
89 |
> |
|
90 |
|
TObjArray *arr = names.Tokenize("&"); |
91 |
|
if (arr) { |
92 |
|
for(Int_t j=0; j<arr->GetEntries(); j++){ |
101 |
|
} |
102 |
|
const TriggerName *tn = fTriggers->Get(sptr); |
103 |
|
if (!tn) { |
104 |
< |
Warning("BeginRun", "Trigger %s not found.", tn->Name()); |
104 |
> |
Warning("BeginRun", "Trigger %s not found.", sptr); |
105 |
|
continue; |
106 |
|
} |
107 |
|
UShort_t bit = tn->Id(); |
111 |
|
} |
112 |
|
delete arr; |
113 |
|
} |
114 |
< |
fTrigBitsAnd.AddCopy(amask); |
115 |
< |
fTrigBitsCmp.AddCopy(tmask); |
114 |
> |
fTrigBitsAnd.push_back(amask); |
115 |
> |
fTrigBitsCmp.push_back(tmask); |
116 |
|
} |
117 |
|
} |
118 |
|
|
131 |
|
fMyTrgObjs->SetOwner(kFALSE); // the objects are owned by the object table |
132 |
|
fBitsDone.Clear(); |
133 |
|
Bool_t accept = kFALSE; |
134 |
< |
for (UInt_t i = 0; i<fTrigBitsAnd.Entries(); ++i) { |
135 |
< |
BitMask256 bitmask(*fBits); |
136 |
< |
bitmask &= fTrigBitsAnd.Ref(i); |
137 |
< |
if (bitmask==fTrigBitsCmp.Ref(i)) { |
134 |
> |
for (UInt_t i = 0; i<fTrigBitsAnd.size(); ++i) { |
135 |
> |
BitMask256 bitmask(fBits->Get()); |
136 |
> |
bitmask &= fTrigBitsAnd.at(i); |
137 |
> |
if (bitmask==fTrigBitsCmp.at(i)) { |
138 |
|
accept = kTRUE; |
139 |
|
AddTrigObjs(i); |
140 |
|
} |
153 |
|
|
154 |
|
// take action if accepted |
155 |
|
++fNAcceped; |
156 |
+ |
IncNEventsProcessed(); |
157 |
|
OnAccepted(); |
158 |
|
if (!AddObjThisEvt(fMyTrgObjs)) { |
159 |
|
SendError(kAbortAnalysis, "Process", |
182 |
|
return; |
183 |
|
} |
184 |
|
} |
185 |
+ |
|
186 |
+ |
//-------------------------------------------------------------------------------------------------- |
187 |
+ |
void HLTMod::SlaveTerminate() |
188 |
+ |
{ |
189 |
+ |
// Save number of accepted events. |
190 |
+ |
|
191 |
+ |
SaveNEventsProcessed("hDHLTEvents"); |
192 |
+ |
} |