15 |
|
HLTMod::HLTMod(const char *name, const char *title) : |
16 |
|
BaseMod(name,title), |
17 |
|
fAbort(kTRUE), |
18 |
+ |
fPrintTable(kFALSE), |
19 |
|
fBitsName(Names::gkHltBitBrn), |
20 |
< |
fMyObjsNamePub(Form("%sObjsadafafa", name)), |
20 |
> |
fMyObjsNamePub(Form("%sTrigObjs", name)), |
21 |
|
fBits(0), |
22 |
|
fMyTrgObjs(0), |
23 |
|
fTriggers(0), |
44 |
|
// "A", "!A", "A&B", "A&!B" or "A&B&C" |
45 |
|
|
46 |
|
string tname(expr); |
47 |
< |
fTrigNames.AddCopy(tname); |
47 |
> |
fTrigNames.push_back(tname); |
48 |
|
} |
49 |
|
|
50 |
|
//-------------------------------------------------------------------------------------------------- |
52 |
|
{ |
53 |
|
// Add trigger objects corresponding to trigger id. |
54 |
|
|
55 |
< |
const BitMask256 &ba = fTrigBitsAnd.Ref(tid); |
56 |
< |
const BitMask256 &bm = fTrigBitsCmp.Ref(tid); |
55 |
> |
const BitMask256 &ba = fTrigBitsAnd.at(tid); |
56 |
> |
const BitMask256 &bm = fTrigBitsCmp.at(tid); |
57 |
|
for (UInt_t i=0; i<bm.Size(); ++i) { |
58 |
|
if (ba.TestBit(i)==0) |
59 |
|
continue; // not an active trigger bit |
73 |
|
{ |
74 |
|
// Get HLT tree and set branches. Compute bitmasks to be used when comparing to the HLT bits. |
75 |
|
|
76 |
< |
fTrigBitsAnd.Reset(); |
77 |
< |
fTrigBitsCmp.Reset(); |
76 |
> |
fTrigBitsAnd.clear(); |
77 |
> |
fTrigBitsCmp.clear(); |
78 |
|
|
79 |
|
if (fPrintTable) |
80 |
|
fTriggers->Print(); |
81 |
|
|
82 |
< |
for (UInt_t i=0; i<fTrigNames.Entries(); ++i) { |
82 |
> |
for (UInt_t i=0; i<fTrigNames.size(); ++i) { |
83 |
|
BitMask256 tmask; //trigger mask |
84 |
|
BitMask256 amask; //bitand mask |
85 |
< |
TString names(fTrigNames.At(i)->c_str()); |
85 |
> |
TString names(fTrigNames.at(i).c_str()); |
86 |
> |
|
87 |
|
TObjArray *arr = names.Tokenize("&"); |
88 |
|
if (arr) { |
89 |
|
for(Int_t j=0; j<arr->GetEntries(); j++){ |
98 |
|
} |
99 |
|
const TriggerName *tn = fTriggers->Get(sptr); |
100 |
|
if (!tn) { |
101 |
< |
Warning("BeginRun", "Trigger %s not found.", tn->Name()); |
101 |
> |
Warning("BeginRun", "Trigger %s not found.", sptr); |
102 |
|
continue; |
103 |
|
} |
104 |
|
UShort_t bit = tn->Id(); |
108 |
|
} |
109 |
|
delete arr; |
110 |
|
} |
111 |
< |
fTrigBitsAnd.AddCopy(amask); |
112 |
< |
fTrigBitsCmp.AddCopy(tmask); |
111 |
> |
fTrigBitsAnd.push_back(amask); |
112 |
> |
fTrigBitsCmp.push_back(tmask); |
113 |
|
} |
114 |
|
} |
115 |
|
|
121 |
|
// in a derived class, call it. Do not stop processing this event, if fAbort is kFALSE. |
122 |
|
|
123 |
|
++fNEvents; |
124 |
< |
LoadBranch(fBitsName.Data()); |
124 |
> |
LoadBranch(fBitsName); |
125 |
|
|
126 |
|
// match trigger bits to trigger mask and obtain trigger objects |
127 |
|
fMyTrgObjs = new TriggerObjectOArr(0,fMyObjsNamePub); |
128 |
|
fMyTrgObjs->SetOwner(kFALSE); // the objects are owned by the object table |
129 |
|
fBitsDone.Clear(); |
130 |
|
Bool_t accept = kFALSE; |
131 |
< |
for (UInt_t i = 0; i<fTrigBitsAnd.Entries(); ++i) { |
132 |
< |
BitMask256 bitmask(*fBits); |
133 |
< |
bitmask &= fTrigBitsAnd.Ref(i); |
134 |
< |
if (bitmask==fTrigBitsCmp.Ref(i)) { |
131 |
> |
for (UInt_t i = 0; i<fTrigBitsAnd.size(); ++i) { |
132 |
> |
BitMask256 bitmask(fBits->Get()); |
133 |
> |
bitmask &= fTrigBitsAnd.at(i); |
134 |
> |
if (bitmask==fTrigBitsCmp.at(i)) { |
135 |
|
accept = kTRUE; |
136 |
|
AddTrigObjs(i); |
137 |
|
} |
150 |
|
|
151 |
|
// take action if accepted |
152 |
|
++fNAcceped; |
153 |
+ |
IncNEventsProcessed(); |
154 |
|
OnAccepted(); |
155 |
|
if (!AddObjThisEvt(fMyTrgObjs)) { |
156 |
|
SendError(kAbortAnalysis, "Process", |
166 |
|
{ |
167 |
|
// Request trigger bit branch and obtain trigger table and objects. |
168 |
|
|
169 |
< |
ReqBranch(fBitsName.Data(), fBits); |
169 |
> |
ReqBranch(fBitsName, fBits); |
170 |
|
|
171 |
|
fTriggers = GetHLTTable(); |
172 |
|
if (!fTriggers) { |
179 |
|
return; |
180 |
|
} |
181 |
|
} |
182 |
+ |
|
183 |
+ |
//-------------------------------------------------------------------------------------------------- |
184 |
+ |
void HLTMod::SlaveTerminate() |
185 |
+ |
{ |
186 |
+ |
// Save number of accepted events. |
187 |
+ |
|
188 |
+ |
SaveNEventsProcessed("hDHLTEvents"); |
189 |
+ |
} |