6 |
|
#include "MitAna/DataUtil/interface/Debug.h" |
7 |
|
#include "MitAna/DataTree/interface/Names.h" |
8 |
|
#include "MitAna/DataTree/interface/TriggerName.h" |
9 |
< |
#include "MitAna/DataTree/interface/TriggerObject.h" |
9 |
> |
#include "MitAna/DataTree/interface/TriggerTable.h" |
10 |
> |
#include "MitAna/DataTree/interface/TriggerObjectBaseCol.h" |
11 |
> |
#include "MitAna/DataTree/interface/TriggerObjectRelCol.h" |
12 |
> |
#include "MitAna/DataTree/interface/TriggerObjectCol.h" |
13 |
> |
#include "MitAna/DataTree/interface/TriggerObjectsTable.h" |
14 |
|
|
15 |
|
using namespace mithep; |
16 |
|
|
28 |
|
fHLTTabNamePub(Form("%sFwk",fHLTTabName.Data())), |
29 |
|
fHLTLabNamePub(Form("%sFwk",fHLTLabName.Data())), |
30 |
|
fObjsNamePub(Form("%sFwk",fObjsName.Data())), |
31 |
+ |
fL1ATabNamePub("L1AlgoTableFwk"), |
32 |
+ |
fL1TTabNamePub("L1TechTableFwk"), |
33 |
|
fNMaxTriggers(256), |
34 |
|
fObjs(0), |
35 |
|
fRels(0), |
40 |
|
fCurEnt(-2), |
41 |
|
fTriggers(new TriggerTable(fNMaxTriggers)), |
42 |
|
fLabels(new TriggerTable(fNMaxTriggers*16)), |
43 |
< |
fTrigObjs(new TriggerObjectsTable(fTriggers,fNMaxTriggers)) |
43 |
> |
fTrigObjs(new TriggerObjectsTable(fTriggers,fNMaxTriggers)), |
44 |
> |
fL1Algos(new TriggerTable(fNMaxTriggers)), |
45 |
> |
fL1Techs(new TriggerTable(fNMaxTriggers)) |
46 |
|
{ |
47 |
|
// Constructor. |
48 |
|
|
52 |
|
fLabels->SetOwner(); |
53 |
|
fTrigObjs->SetName(fObjsNamePub); |
54 |
|
fTrigObjs->SetOwner(); |
55 |
+ |
fL1Algos->SetName(fL1ATabNamePub); |
56 |
+ |
fL1Algos->SetOwner(); |
57 |
+ |
fL1Techs->SetName(fL1TTabNamePub); |
58 |
+ |
fL1Techs->SetOwner(); |
59 |
|
} |
60 |
|
|
61 |
|
//-------------------------------------------------------------------------------------------------- |
74 |
|
fLabels = 0; |
75 |
|
delete fTrigObjs; |
76 |
|
fTrigObjs = 0; |
77 |
+ |
delete fL1Algos; |
78 |
+ |
|
79 |
|
} |
80 |
|
|
81 |
|
//-------------------------------------------------------------------------------------------------- |
133 |
|
// load trigger table |
134 |
|
if (runinfo->HltEntry()!=fCurEnt) { |
135 |
|
MDB(kAnalysis, 1) |
136 |
< |
Info("BeginRun", "Loading trigger table for run %ld", runinfo->RunNum()); |
136 |
> |
Info("BeginRun", "Loading trigger table for run %u", runinfo->RunNum()); |
137 |
|
|
138 |
|
fCurEnt = runinfo->HltEntry(); |
139 |
|
Bool_t load = LoadTriggerTable(); |
144 |
|
} |
145 |
|
|
146 |
|
MDB(kAnalysis, 2) { |
147 |
< |
Info("BeginRun", "Printing tables for run %ld", runinfo->RunNum()); |
147 |
> |
Info("BeginRun", "Printing tables for run %u", runinfo->RunNum()); |
148 |
|
cout << " --- Trigger table ---" << endl; |
149 |
|
fTriggers->Print(); |
150 |
|
cout << " --- Module lables ---" << endl; |
151 |
|
fLabels->Print(); |
152 |
+ |
if (fL1Algos->GetEntries()) { |
153 |
+ |
cout << " --- L1 Algos ---" << endl; |
154 |
+ |
fL1Algos->Print(); |
155 |
+ |
} |
156 |
+ |
if (fL1Techs->GetEntries()) { |
157 |
+ |
cout << " --- L1 Techs ---" << endl; |
158 |
+ |
fL1Techs->Print(); |
159 |
+ |
} |
160 |
|
} |
161 |
|
} |
162 |
|
} |
169 |
|
if (fCurEnt<0) |
170 |
|
return kFALSE; |
171 |
|
|
150 |
– |
if ((fCurEnt==1) && (fHLTTree->GetEntries()==1)) { |
151 |
– |
if (1) |
152 |
– |
SendError(kWarning, "LoadTriggerTable", |
153 |
– |
"Loading trigger table omitted due to a bug fix for Mit_006."); |
154 |
– |
return kTRUE; |
155 |
– |
} |
156 |
– |
|
172 |
|
// delete old tables |
173 |
|
fTriggers->Delete(); |
174 |
|
fLabels->Delete(); |
175 |
+ |
fL1Algos->Delete(); |
176 |
+ |
fL1Techs->Delete(); |
177 |
|
|
178 |
|
// load next event in HLT tree |
179 |
|
fHLTTab = 0; |
180 |
|
fHLTLab = 0; |
181 |
|
Int_t ret = fHLTTree->GetEvent(fCurEnt); |
182 |
|
if (ret<0 || fHLTTab==0 || fHLTTab==0 ) { |
183 |
< |
::Error("LoadTriggerTable", "Could not get trigger data for next entry (%ld).", fCurEnt); |
183 |
> |
SendError(kAbortAnalysis, "LoadTriggerTable", |
184 |
> |
"Could not get trigger data for next entry (%ld).", fCurEnt); |
185 |
|
return kFALSE; |
186 |
|
} |
187 |
|
|
200 |
|
} |
201 |
|
|
202 |
|
// add module labels |
203 |
< |
for (UInt_t i=0; i<fHLTLab->size(); ++i) { |
204 |
< |
TriggerName *tname = new TriggerName(fHLTLab->at(i),i); |
205 |
< |
fLabels->Add(tname); |
203 |
> |
UInt_t counter = 0; |
204 |
> |
UInt_t bitnum = 0; |
205 |
> |
UInt_t which = 0; |
206 |
> |
while (counter<fHLTLab->size()) { |
207 |
> |
TString tmpn(fHLTLab->at(counter)); |
208 |
> |
++counter; |
209 |
> |
if (tmpn.CompareTo("xxx-L1AlgoNames-xxx",TString::kIgnoreCase)==0) { |
210 |
> |
bitnum = 0; |
211 |
> |
which = 1; |
212 |
> |
continue; |
213 |
> |
} else if (tmpn.CompareTo("xxx-L1TechNames-xxx",TString::kIgnoreCase)==0) { |
214 |
> |
bitnum = 0; |
215 |
> |
which = 2; |
216 |
> |
continue; |
217 |
> |
} |
218 |
> |
TriggerName *tname = new TriggerName(tmpn,bitnum); |
219 |
> |
if (which==0) |
220 |
> |
fLabels->Add(tname); |
221 |
> |
else if (which==1) |
222 |
> |
fL1Algos->Add(tname); |
223 |
> |
else |
224 |
> |
fL1Techs->Add(tname); |
225 |
> |
++bitnum; |
226 |
|
} |
227 |
|
|
228 |
|
return kTRUE; |
247 |
|
LoadBranch(fObjsName); |
248 |
|
LoadBranch(fRelsName); |
249 |
|
|
250 |
< |
for (UInt_t i=0; i<fRels->Entries(); ++i) { |
250 |
> |
const UInt_t n = fRels->GetEntries(); |
251 |
> |
for (UInt_t i=0; i<n; ++i) { |
252 |
|
const TriggerObjectRel *rel = fRels->At(i); |
253 |
|
if (!rel) continue; |
254 |
|
|
261 |
|
obj->SetTrigName(fHLTTab->at(rel->TrgId()).c_str()); |
262 |
|
obj->SetModuleName(fHLTLab->at(rel->ModInd()).c_str()); |
263 |
|
obj->SetFilterName(fHLTLab->at(rel->FilterInd()).c_str()); |
264 |
+ |
if (obj->TagInd()>=0) |
265 |
+ |
obj->SetTagName(fHLTLab->at(obj->TagInd()).c_str()); |
266 |
+ |
else |
267 |
+ |
obj->SetTagName("Unknown"); |
268 |
+ |
|
269 |
|
fTrigObjs->Add(obj); |
270 |
|
} |
271 |
|
} |
275 |
|
{ |
276 |
|
// Request branches for trigger objects and relation, and publish our tables. |
277 |
|
|
278 |
+ |
if (fObjsName != Names::gkHltObjBrn) |
279 |
+ |
fRelsName = Form("%sRelation",fObjsName.Data()); |
280 |
+ |
|
281 |
|
ReqBranch(fObjsName, fObjs); |
282 |
|
ReqBranch(fRelsName, fRels); |
283 |
|
|
296 |
|
"Could not publish HLT labels with name %s.", fLabels->GetName()); |
297 |
|
return; |
298 |
|
} |
299 |
+ |
if (!PublishObj(fL1Algos)) { |
300 |
+ |
SendError(kAbortAnalysis, "SlaveBegin", |
301 |
+ |
"Could not publish L1 algo table with name %s.", fL1Algos->GetName()); |
302 |
+ |
return; |
303 |
+ |
} |
304 |
+ |
if (!PublishObj(fL1Techs)) { |
305 |
+ |
SendError(kAbortAnalysis, "SlaveBegin", |
306 |
+ |
"Could not publish L1 tech table with name %s.", fL1Techs->GetName()); |
307 |
+ |
return; |
308 |
+ |
} |
309 |
|
} |
310 |
|
|
311 |
|
//-------------------------------------------------------------------------------------------------- |
316 |
|
RetractObj(fTriggers->GetName()); |
317 |
|
RetractObj(fLabels->GetName()); |
318 |
|
RetractObj(fTrigObjs->GetName()); |
319 |
+ |
RetractObj(fL1Algos->GetName()); |
320 |
+ |
RetractObj(fL1Techs->GetName()); |
321 |
|
} |