ATLAS Offline Software
Loading...
Searching...
No Matches
TrigDecisionChecker.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
7
9
14
25#include "xAODTracking/Vertex.h"
36
37#include <algorithm>
38#include <iostream>
39#include <iomanip>
40
41
42TrigDecisionChecker::TrigDecisionChecker(const std::string &name, ISvcLocator *pSvcLocator)
43: AthAlgorithm(name, pSvcLocator),
44 m_first_event(true)
45{
46}
47
48
50
51
53{
54 // reset event counters
55 m_first_event=true;
57 m_muSum=0.0;
58
59 // Reset keys
60
61 // print out properties
62 ATH_MSG_INFO("Initializing...");
63 ATH_MSG_INFO("MonitoredChains: " << m_countSigNames);
64 //ATH_MSG_INFO("MonitoredTauItem: " << m_tauItem);
65 ATH_MSG_INFO("MonitoringBlock: " << m_monitoringBlockSize);
66 if (not m_printoutFileName.empty()) {
67 ATH_MSG_INFO("PrintOutFilename: " << m_printoutFileName);
68 }
69
70 // get handle to TrigDecisionTool
71 ATH_CHECK(m_trigDec.retrieve());
72
73 // reserve space for vectors
74 m_summary.reserve(700);
75 m_summaryChainPassRaw.reserve(700);
76 m_summaryChainPassRaw.reserve(700);
77 m_summaryChainPT.reserve(700);
78 m_summaryChainPS.reserve(700);
79 m_summaryPassRaw.reserve(700);
80 m_summaryPass.reserve(700);
81 m_summaryPassPhys.reserve(700);
82 m_chainPrescales.reserve(700);
83 m_chainPrescalesCalculated.reserve(700);
84 m_chain_passthrough.reserve(700);
86 m_lower_chain_accept.reserve(700);
87
88 // initialize vectors for chains to monitor
89 ATH_MSG_INFO("Monitoring number of events passing these chains (blocks of "
90 << m_monitoringBlockSize << " events):");
91 for (unsigned int i=0; i < m_countSigNames.size(); ++i) {
92 ATH_MSG_INFO("Initializing monitoring counters for " << m_countSigNames[i]);
93 m_countSigs.push_back(new std::vector<int>());
94 m_runCountSigs.push_back(0);
95 }
96
97
98 ATH_MSG_INFO("Initialization successful");
99
100 return StatusCode::SUCCESS;
101}
102
103
105{
106
107 // print summary of trigger decisions for each level
108 msg(MSG::INFO) << "==========================================================" << endmsg;
109 msg(MSG::INFO) << "TrigDecisionTool summary:" << endmsg;
110 msg(MSG::INFO) << "==========================================================" << endmsg;
111
112 // LVL1
113 std::map<std::string,int>::iterator itL1,itL1End=m_L1Summary.end();
114 for ( itL1=m_L1Summary.begin(); itL1!=itL1End; ++itL1 ) {
115 msg(MSG::INFO) << "REGTEST item " << (*itL1).first << " accepted events=" << (*itL1).second << endmsg;
116 }
117
118 // HLT
119 for ( unsigned int i=0; i<m_summary.size(); ++i) {
120 msg(MSG::INFO) << "REGTEST chain " << m_summary[i] << " accepted events= " << m_summaryPassPhys[i]
121 <<" ( PS: " << m_summaryChainPS[i] << " , PT: " << m_summaryChainPT[i] << ")" << endmsg;
122 }
123
124 // print out nr. of events passed in blocks of N events for specific chains (configurable)
125 ATH_MSG_INFO(" ");
126 ATH_MSG_INFO("TrigDecisionTool tests: monitored chain efficiency");
127 ATH_MSG_INFO("==================================================");
128 msg(MSG::INFO) << "REGTEST Nr.events: ";
129 for (unsigned int k=0; k<m_countEvent.size();++k) {
130 msg() << m_countEvent[k] << " ";
131 }
132 msg() << endmsg;
133 for (unsigned int i=0; i<m_countSigNames.size();++i) {
134 msg(MSG::INFO) << "REGTEST " << m_countSigNames[i] << " : ";
135 for (unsigned int j=0; j<(m_countSigs[i])->size();++j) {
136 msg() << (*m_countSigs[i])[j] << " ";
137 }
138 msg() << endmsg;
139 }
140
141 // compare prescale and passthrough fractions from configuration and by counting events
142 ATH_MSG_INFO(" ");
143 ATH_MSG_INFO("TrigDecisionTool tests: chain prescale/passthrough ");
144 ATH_MSG_INFO("==================================================");
145 // HLT
146 msg(MSG::INFO) << "REGTEST Chain (passed raw) PS(conf) PS(counts) PT(conf) PT(counts) (Lower chain)";
147 for ( unsigned int i=0; i<m_summary.size(); ++i) {
148 if (m_lower_chain_accept[i]!=0) {
149 msg(MSG::INFO) << "REGTEST " << m_summary[i] << " (" << m_summaryChainPT[i] << ") \t"
150 << " \t" << m_chainPrescales[i] << " \t" << m_chainPrescalesCalculated[i]
151 << " \t" << m_chain_passthrough[i] << " \t" << m_chain_passthrough_calculated[i]
152 << " (" << m_lower_chain_accept[i] << ")" << endmsg;
153 } else {
154 msg(MSG::INFO) << "REGTEST " << m_summary[i] << " (" << m_summaryChainPT[i] << ") \t"
155 << " \t" << m_chainPrescales[i] << " --- "
156 << " \t" << m_chain_passthrough[i] << " --- "
157 << " (lower chain passed no events)" << endmsg;
158 }
159 }
160 ATH_MSG_INFO("REGTEST ran on " << m_eventNumber << " events");
161 ATH_MSG_INFO("Average mu value " << m_muSum/float(m_eventNumber));
162
163 // open output file and write out counts
164 if (not m_printoutFileName.empty()) {
165 ATH_MSG_INFO("==================================================");
166 ATH_MSG_INFO("Opening " << m_printoutFileName << " for writing trigger counts");
167 std::ofstream printoutFile(m_printoutFileName);
168
169 /*
170 m_L1Summary - isPassed for L[1
171 m_summaryChainPassRaw - chainPassedRaw for HLT
172 m_summaryPass - chain Passed for HLT
173 m_summaryPassPhys - chain Physics Passed for HLT
174 m_summaryChainPS - chainPassedRaw && !isPrescaled for HLT
175 m_summaryChainPT - (chainPassedRaw && !isPrescaled) || isPassedThrough for HLT
176 */
177
178 printoutFile << std::setiosflags(std::ios::left) << std::setw(25) << "* L1 item"
179 << std::setw(15) << " #Passed " << std::endl;
180 std::map<std::string,int>::iterator l1,l1End=m_L1Summary.end();
181 for ( l1=m_L1Summary.begin(); l1!=l1End; ++l1 ) {
182 printoutFile << std::setiosflags(std::ios::left) << (*l1).first
183 << std::setw(10) << (*l1).second << std::endl;
184 }
185
186 printoutFile << std::setiosflags(std::ios::left) << std::setw(25) << "* Chain name"
187 << std::setw(15) << " #Passed Raw "
188 << std::setw(15) << " #passed "
189 << std::setw(15) << " #Physics Passed "<< std::endl;
190 for ( unsigned int i=0; i<m_summary.size(); ++i) {
191 printoutFile << std::setiosflags(std::ios::left) << std::setw(25) << m_summary[i]
192 << std::setw(15) << m_summaryPassRaw[i]
193 << std::setw(15) << m_summaryPass[i]
194 << std::setw(15) << m_summaryPassPhys[i] << std::endl;
195
196 // std::cout << std::setiosflags(std::ios::dec) << std::setw(6) << i << "|"
197 // << std::setiosflags(std::ios::dec) << std::setw(4) << (*(m_elink_vec[i]))->algorithmId() << "|"
198 // << std::setw(11) << *(m_elink_vec[i]) << "|";
199 }
200 ATH_MSG_INFO("Closing output file " << m_printoutFileName);
201 printoutFile.close();
202 }
203
204 // cleanup newed vectors
205 ATH_MSG_INFO("==================================================");
206 ATH_MSG_INFO("Cleaning up counters...");
207 for (unsigned int i=0; i<m_countSigs.size(); ++i) {
208 delete m_countSigs[i];
209 }
210 ATH_MSG_INFO("Finalised successfully");
211
212 return StatusCode::SUCCESS;
213}
214
215StatusCode TrigDecisionChecker::execute(const EventContext& /*ctx*/)
216{
218
219 // check mu value
220 const xAOD::EventInfo* eventInfo = nullptr;
221 //#sc = evtStore()->retrieve(eventInfo, m_eventInfoName);
222 StatusCode sc;
223 if (m_eventInfoName == "") {
224 sc=evtStore()->retrieve(eventInfo);
225 } else {
226 sc=evtStore()->retrieve(eventInfo, m_eventInfoName);
227 }
228 if ( sc.isFailure() || !eventInfo )
229 {
230 ATH_MSG_INFO("Container '" << m_eventInfoName << "' could not be retrieved from StoreGate !");
231 sc = StatusCode::SUCCESS;
232 return sc;
233 } else {
234 ATH_MSG_DEBUG("Container '" << m_eventInfoName << "' retrieved from StoreGate");
235 }
236
237 if ( eventInfo ) {
238 float mu = eventInfo->actualInteractionsPerCrossing();
239 float muave = eventInfo->averageInteractionsPerCrossing();
240 msg(MSG::INFO) << "run number " << eventInfo->runNumber() << " event number " << eventInfo->eventNumber() <<
241 " lumi block " << eventInfo->lumiBlock() << endmsg;
242 msg(MSG::INFO) << "mu value " << mu << " average mu value " << muave << " event number " << m_eventNumber << endmsg;
244 }
245
246
247 for(const auto& tauItem : m_TauItems) {
248 ATH_MSG_INFO("Check tau items " << tauItem);
249 sc = checkTauEDM(tauItem);
250 if ( sc.isFailure() ) {
251 msg(MSG::ERROR) << "Could not finish checkTauEDM test for chain " <<tauItem << endmsg;
252 return sc;
253 }
254 if(m_checkBits) {
255 if(checkEDM<xAOD::TauJetContainer>(tauItem).isFailure())
256 ATH_MSG_ERROR("Could not finish checkTauJetEDM test for chain " << tauItem);
257 }
258 }
259
260 for(const auto& muonItem : m_muonItems) {
261 sc = checkMuonEDM(muonItem);
262 if ( sc.isFailure() ) {
263 msg(MSG::ERROR) << "Could not finish checkMuonEDM test for chain " << muonItem << endmsg;
264 return sc;
265 }
266 if(m_checkBits) {
267 if(checkEDM<xAOD::MuonContainer>(muonItem).isFailure())
268 ATH_MSG_ERROR("Could not finish checkMuonEDM test for chain " << muonItem);
269 if(checkEDM<xAOD::L2CombinedMuonContainer>(muonItem).isFailure())
270 ATH_MSG_ERROR("Could not finish checkMuonEDM test for chain " << muonItem);
271 if(checkEDM<xAOD::L2StandAloneMuonContainer>(muonItem).isFailure())
272 ATH_MSG_ERROR("Could not finish checkMuonEDM test for chain " << muonItem);
273 }
274 }
275
276 for(const auto& bjetItem : m_bjetItems) {
277 sc = checkBjetEDM(bjetItem);
278 if ( sc.isFailure() ) {
279 msg(MSG::ERROR) << "Could not finish checkBjetEDM test for chain " << bjetItem << endmsg;
280 return sc;
281 }
282 if(m_checkBits) {
283 if(checkEDM<xAOD::BTaggingContainer>(bjetItem).isFailure())
284 ATH_MSG_ERROR("Could not finish checkBjetEDM test for chain " << bjetItem);
285 }
286 }
287
288 for(const auto& bphysItem : m_bphysItems) {
289 sc = checkBphysEDM(bphysItem);
290 if ( sc.isFailure() ) {
291 msg(MSG::ERROR) << "Could not finish checkBphysEDM test for chain " << bphysItem << endmsg;
292 // return sc; try not to return for other tests to run
293 }
294 if(m_checkBits) {
295 if(checkEDM<xAOD::TrigBphysContainer>(bphysItem).isFailure())
296 ATH_MSG_ERROR("Could not finish checkJetEDM test for chain " << bphysItem);
297 }
298 }
299
300 for(const auto& electronItem : m_electronItems) {
301 ATH_MSG_INFO("Check Electron items " << electronItem);
302 sc = checkElectronEDM(electronItem);
303 if ( sc.isFailure() ) {
304 msg(MSG::ERROR) << "Could not finish checkElectronEDM test for chain " << electronItem << endmsg;
305 }
306 if(m_checkBits) {
307 if(checkEDM<xAOD::ElectronContainer>(electronItem).isFailure())
308 ATH_MSG_ERROR("Could not finish checkElectronEDM test for chain " << electronItem);
309 if(checkEDM<xAOD::CaloClusterContainer>(electronItem).isFailure())
310 ATH_MSG_ERROR("Could not finish checkElectronEDM test for chain " << electronItem);
311 if(checkEDM<xAOD::TrigElectronContainer>(electronItem).isFailure())
312 ATH_MSG_ERROR("Could not finish checkElectronEDM test for chain " << electronItem);
313 }
314 }
315
316 for(const auto& photonItem : m_photonItems) {
317 sc = checkPhotonEDM(photonItem);
318 if ( sc.isFailure() ) {
319 ATH_MSG_ERROR("Could not finish checkPhotonEDM test for chain " << photonItem);
320 }
321 if(m_checkBits) {
322 if(checkEDM<xAOD::PhotonContainer>(photonItem).isFailure())
323 ATH_MSG_ERROR("Could not finish checkPhotonEDM test for chain " << photonItem);
324 if(checkEDM<xAOD::CaloClusterContainer>(photonItem).isFailure())
325 ATH_MSG_ERROR("Could not finish checkPhotonEDM test for chain " << photonItem);
326 }
327 }
328
329 for(const auto& minBiasItem : m_minBiasItems) {
330 sc = checkMinBiasEDM(minBiasItem);
331 if ( sc.isFailure() ) {
332 msg(MSG::ERROR) << "Could not finish checkMinBiasEDM test for chain " << minBiasItem << endmsg;
333 return sc;
334 }
335 }
336
337 ATH_MSG_INFO("REGTEST ==========START of Jet EDM/Navigation check===========");
338 for(const auto& jetItem : m_jetItems) {
339 sc = checkJetEDM(jetItem);
340 if ( sc.isFailure() ) {
341 ATH_MSG_INFO("REGTEST Could not finish checkJetEDM test for chain " << jetItem);
342 return sc;
343 }
344 if(m_checkBits) {
345 if(checkEDM<xAOD::JetContainer>(jetItem).isFailure())
346 ATH_MSG_ERROR("Could not finish checkJetEDM test for chain " << jetItem);
347 }
348 }
349 ATH_MSG_INFO("REGTEST ==========END of Jet EDM/Navigation check===========");
350
351 ATH_MSG_INFO("REGTEST ==========START of Met EDM/Navigation check===========");
352 for(const auto& metItem : m_metItems) {
353 sc = checkMetEDM(metItem);
354 if ( sc.isFailure() ) {
355 ATH_MSG_INFO("REGTEST Could not finish checkMetEDM test for chain " << metItem);
356 return sc;
357 }
358 }
359 ATH_MSG_INFO("REGTEST =========END of Met EDM/Navigation check============");
360
362 msg(MSG::INFO) << "TrigDecisionChecker::execute" << endmsg;
363
364 msg(MSG::INFO) << "Pass state = " << m_trigDec->isPassed("EF_.*") << endmsg;
365 msg(MSG::INFO) << "Pass state L1 = " << m_trigDec->isPassed("L1_.*") << endmsg;
366 msg(MSG::INFO) << "Pass state L2 = " << m_trigDec->isPassed("L2_.*") << endmsg;
367 msg(MSG::INFO) << "Pass state EF = " << m_trigDec->isPassed("EF_.*") << endmsg;
368 msg(MSG::INFO) << "Pass state HLT = " << m_trigDec->isPassed("HLT_.*") << endmsg;
369 }
370
371 // L1
372 std::vector<std::string> allItems = m_trigDec->getListOfTriggers("L1_.*");
373 if (!allItems.empty()) {
374 if (m_eventDecisionPrintout) msg(MSG::INFO) << "Items : " << allItems.size() << endmsg;
375
376 for (std::vector<std::string>::const_iterator itemIt = allItems.begin();
377 itemIt != allItems.end(); ++itemIt) {
378
379 const LVL1CTP::Lvl1Item* aItem = m_trigDec->ExperimentalAndExpertMethods().getItemDetails(*itemIt);
380
381 if (!aItem) continue;
382 if (aItem->name()=="") continue;
383
384 if (m_eventDecisionPrintout) msg(MSG::INFO) << "Item " << aItem->name() << " : Item ID " << aItem->hashId() << " : " << aItem->isPassed() << endmsg;
385
386 // fill bookkeeping map with zeros if first event
387 std::string item_name = aItem->name();
388 if (m_first_event) m_L1Summary[item_name] = 0;
389
390 // increment counter for L1 summary
391 if (aItem->isPassed()) m_L1Summary[item_name] = (m_L1Summary[item_name]+1);
392 int count = (m_L1Summary.find(item_name))->second;
393 if (m_eventDecisionPrintout) msg(MSG::INFO) << "L1_map[" << item_name << "] = " << count << endmsg;
394
395
396 }
397 } else {
398 ATH_MSG_WARNING("Could not retrieve L1 Items !!");
399 }
400
401
402 // HLT Chains
403
404 // Get all configured chain names from config
405 std::vector<std::string> confChains = m_trigDec->getListOfTriggers("L2_.*, EF_.*, HLT_.*");
406 msg(MSG::INFO) << "Configuring for " << confChains.size() << " HLT chain counters" << endmsg;
407
408 // resize & initialise counters in first event
409 if (m_first_event) {
410 m_summary.resize(0); // vector for chain names
411 m_summaryPassRaw.resize(confChains.size(),0);
412 m_summaryPass.resize(confChains.size(),0);
413 m_summaryPassPhys.resize(confChains.size(),0);
414 m_summaryChainPassRaw.resize(confChains.size(),0);
415 m_summaryChainPass.resize(confChains.size(),0);
416 m_summaryChainPassPhys.resize(confChains.size(),0);
417 m_summaryChainPT.resize(confChains.size(),0);
418 m_summaryChainPS.resize(confChains.size(),0);
419 m_chainPrescales.resize(confChains.size(),0);
420 m_chainPrescalesCalculated.resize(confChains.size(),0);
421 m_chain_passthrough.resize(confChains.size(),0);
422 m_chain_passthrough_calculated.resize(confChains.size(),0);
423 m_lower_chain_accept.resize(confChains.size(),0);
424
425 // make vector of names and sort alphabetically
426 std::map<std::string,float> t_pt_map;
427 std::map<std::string,float> t_ps_map;
428
429 for(std::vector<std::string>::iterator chIter = confChains.begin(); chIter != confChains.end(); ++chIter) {
430 const TrigConf::HLTChain * ch = m_trigDec->ExperimentalAndExpertMethods().getChainConfigurationDetails(*chIter);
431 std::string name = *chIter;
432 m_summary.push_back(name);
433 t_pt_map[name] = ch->pass_through();
434 t_ps_map[name] = ch->prescale();
435 m_lowerChainMap[name] = ch->lower_chain_name();
436 ATH_MSG_DEBUG("Configured chain: " << name
437 << "; prescale=" << ch->prescale()
438 << "; passthrough=" << ch->pass_through()
439 << "; lower chain=" << ch->lower_chain_name());
440 }
441 // sort by chain names to group together L2 and EF chains: do this for
442 // first event only and use ordering in m_summary for later processing
443 std::sort(m_summary.begin(),m_summary.end());
444
445 // store prescaled factor from *configuration* chain
446 for (unsigned int k=0; k<m_summary.size(); ++k) {
447 // prescales
448 std::map<std::string,float>::iterator psIt=t_ps_map.find(m_summary[k]);
449 float ps = -1;
450 if (psIt!=t_ps_map.end()) ps = (*psIt).second;
451 m_chainPrescales[k]=ps;
452 // passthrough
453 std::map<std::string,float>::iterator ptIt=t_pt_map.find(m_summary[k]);
454 float pt = -1;
455 if (ptIt!=t_pt_map.end()) pt = (*ptIt).second;
457 }
458 }
459
460 // all events: loop over names of configured chains, find their status,
461 // increment counters
462 for (unsigned int i=0; i<m_summary.size(); ++i){
463 std::string name = m_summary[i];
464 ATH_MSG_VERBOSE("Testing chain: " << name);
465
466 const HLT::Chain* aChain = m_trigDec->ExperimentalAndExpertMethods().getChainDetails(name);
467 if (! aChain) { // inactive chain
468 continue;
469 }
470
471 // use TrigDecisionTool methods directly
473 ATH_MSG_VERBOSE("chain: " << name << " Passed RAW");
474 ++m_summaryPassRaw[i];
475 }
476 if ( m_trigDec->isPassed(name) ) {
477 ATH_MSG_VERBOSE("chain: " << name << " Passed");
478 ++m_summaryPass[i];
479 }
480 if ( m_trigDec->isPassed(name) ) {
481 ATH_MSG_VERBOSE("chain: " << name << " Passed PHYSICS");
483 }
484
485
486 // Reproduce the definitions of raw, with PS, with PT, as used in monitoring:
487 // http://alxr.usatlas.bnl.gov/lxr/source/atlas/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigChainMoni.cxx#380
488 // chainPassed == (chainPassedRaw() && !aChain->isPrescaled()) || isPassedThrough
489 if (aChain->chainPassedRaw()){
491 }
492 if (aChain->chainPassedRaw() && !aChain->isPrescaled()){
493 ++m_summaryChainPS[i];
494 }
495 if (aChain->chainPassed()){
496 ++m_summaryChainPT[i];
497 }
498 if (!(aChain->isPrescaled())){ // get prescale fraction by counting events
500 }
501 if (aChain->isPassedThrough()){ // get passthrough fraction by counting events
503 }
504 // events accepted by the lower chain
505 std::map<std::string,std::string>::iterator lcIt=m_lowerChainMap.find(m_summary[i]);
506 if (lcIt!=m_lowerChainMap.end()) {
507 if ( !m_trigDec->getListOfTriggers((*lcIt).second).empty() &&m_trigDec->isPassed((*lcIt).second) ) {
509 }
510 }
511 // print info for each event
513 msg(MSG::INFO) << "chain " << name << " = "
515 }
516 }
517
518 // TrigDecisionTool tests on a few specific sigs:
519 for (unsigned int i=0; i < m_countSigNames.size(); ++i) {
520 ATH_MSG_DEBUG("Monitoring " << m_countSigNames[i]);
521 if ( !m_trigDec->getListOfTriggers(m_countSigNames[i]).empty() ) {
522 if ( m_trigDec->isPassed(m_countSigNames[i]) )
524 } else {
525 msg(MSG::WARNING) << m_countSigNames[i] << " not configured!" << endmsg;
526 }
527 }
528
530 m_countEvent.push_back(m_eventNumber);
531
532 for (unsigned int i=0; i < m_countSigNames.size(); ++i) {
533 (m_countSigs[i])->push_back(m_runCountSigs[i]);
534 m_runCountSigs[i]=0;
535 }
536 }
537
538 // reset first event flag
539 if (m_first_event) m_first_event = false;
540
541 return StatusCode::SUCCESS;
542}
543
544template <class T>
545StatusCode TrigDecisionChecker::checkEDM(const std::string& trigItem){
546 ATH_MSG_INFO("REGTEST Check TrigPassBits for " << trigItem << " and type " << ClassID_traits< T >::typeName() );
547 m_trigDec->isPassed(trigItem) ? ATH_MSG_INFO("REGTEST " << trigItem << " Passes ") : ATH_MSG_INFO("REGTEST " << trigItem << " Fails");
548 const auto fc = m_trigDec->features(trigItem,TrigDefs::alsoDeactivateTEs);
549 const auto vec = fc.get<T>();
550 const auto vecbits = fc.get<xAOD::TrigPassBits>();
551 std::string label="";
552 for(const auto& feat:vecbits){
553 const auto *xbits=feat.cptr();
554 TrigConf::HLTTriggerElement::getLabel(feat.te()->getId(), label );
555 const auto *cont=(m_trigDec->ancestor<T>(feat.te())).cptr();
556 if(cont){
557 ATH_MSG_INFO("REGTEST TrigPassBits for TE " << label
558 << " size " << cont->size());
559
560 if(cont->size()!=xbits->size()) {
561 ATH_MSG_WARNING("REGTEST Container and bit size not equal, continue");
562 continue;
563 }
564 int npassed=0;
565 for(const auto &ptr:*cont){
566 if(xbits->isPassing(ptr,cont))
567 npassed++;
568 }
569 ATH_MSG_INFO("REGTEST TrigPassBits for container type " << ClassID_traits< T >::typeName()
570 << " size " << cont->size() << " xbits " << xbits->size() << " selected " << npassed);
571 }
572 }
573
574
575
576 for(const auto& feat:vec){
577 const auto *cont=feat.cptr();
578 const TrigPassBits *bits=(m_trigDec->ancestor<TrigPassBits>(feat.te())).cptr();
579 const xAOD::TrigPassBits *xbits=(m_trigDec->ancestor<xAOD::TrigPassBits>(feat.te())).cptr();
580 TrigConf::HLTTriggerElement::getLabel(feat.te()->getId(), label );
581 if(!cont){
582 ATH_MSG_WARNING(label << " " << ClassID_traits< T >::typeName() << "REGTEST: TrigPassBits container is null ");
583 continue;
584 }
585 if(!bits){
586 ATH_MSG_WARNING(label << " " << ClassID_traits< T >::typeName() << " REGTEST: TrigPassBits old bits null ");
587 }
588 if(!xbits){
589 ATH_MSG_WARNING(label << " " << ClassID_traits< T >::typeName() << " REGTEST: TrigPassBits xbits null ");
590 continue;
591 }
592 //
593 const size_t bitlen = ( (cont->size() - 1)/32 ) + 1;
594 if(bits)
595 ATH_MSG_INFO("REGTEST Retrieved container type " << ClassID_traits< T >::typeName() << " size " << cont->size()
596 << " bits " << bits->size() << " Expect vector of bits " << bitlen);
597 int npassed=0;
598 if(xbits){
599 for(const auto &ptr:*cont){
600 if(xbits->isPassing(ptr,cont))
601 npassed++;
602 }
603 ATH_MSG_INFO("REGTEST TrigPassBits for container type " << ClassID_traits< T >::typeName()
604 << " size " << cont->size() << " xbits " << xbits->size() << " selected " << npassed);
605 }
606 }
607
608 return StatusCode::SUCCESS;
609}
610
611StatusCode TrigDecisionChecker::checkBjetEDM(const std::string& trigItem){
612
613 ATH_MSG_INFO("REGTEST ==========START of bjet EDM/Navigation check for chain " << trigItem << " ===========");
614
615 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
616
617 // Get feature container
618 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
619
620 // Get online combinations
621 const std::vector< Trig::Combination >& bjetCombs = fc.getCombinations();
622 ATH_MSG_INFO("REGTEST - RETRIEVED " << bjetCombs.size() << " COMBINATIONS FOR " << trigItem);
623
624 // Loop on combinations
625 std::vector< Trig::Combination >::const_iterator bjetComb;
626 for( bjetComb = bjetCombs.begin(); bjetComb != bjetCombs.end(); ++bjetComb ) {
627
628 const Trig::Combination& comb = *bjetComb;
629 ATH_MSG_INFO("REGTEST - ------------ NEW COMBINATION ------------");
630
631 // Get online pv - histo
632 const std::vector< Trig::Feature<xAOD::VertexContainer> > onlinepvs_histo = comb.get<xAOD::VertexContainer>("EFHistoPrmVtx");
633 ATH_MSG_INFO("REGTEST - RETRIEVED PV (HISTO) - size: " << onlinepvs_histo.size());
634 if(onlinepvs_histo.size()) {
635 const xAOD::VertexContainer* onlinepv_histo = onlinepvs_histo[0].cptr();
636 ATH_MSG_INFO("REGTEST - - nVert: " << onlinepv_histo->size());
637 if(onlinepv_histo->size()) {
638 ATH_MSG_INFO("REGTEST - - z[0]: " << (*(onlinepv_histo))[0]->z());
639 }
640 }
641
642 // Get online pv - id tracking
643 const std::vector< Trig::Feature<xAOD::VertexContainer> > onlinepvs_id = comb.get<xAOD::VertexContainer>("xPrimVx");
644 ATH_MSG_INFO("REGTEST - RETRIEVED PV (IDTRK) - size: " << onlinepvs_id.size());
645 if(onlinepvs_id.size()) {
646 const xAOD::VertexContainer* onlinepv_id = onlinepvs_id[0].cptr();
647 ATH_MSG_INFO("REGTEST - - nVert: " << onlinepv_id->size());
648 if(onlinepv_id->size()) {
649 ATH_MSG_INFO("REGTEST - - z[0]: " << (*(onlinepv_id))[0]->z());
650 }
651 }
652
653 // Get online jet - from EFBjetSequenceAllTE
654 const std::vector< Trig::Feature<xAOD::JetContainer> > onlinejets_efbjet = comb.get<xAOD::JetContainer>("TrigJetRec");
655 ATH_MSG_INFO("REGTEST - RETRIEVED JETS (EFBJET) - size: " << onlinejets_efbjet.size());
656 if(onlinejets_efbjet.size()) {
657 const xAOD::JetContainer* onlinejet_efbjet = onlinejets_efbjet[0].cptr();
658 ATH_MSG_INFO("REGTEST - - nJet: " << onlinejet_efbjet->size());
659 for(const auto* jet_efbjet : *onlinejet_efbjet) {
660 // Dump
661 ATH_MSG_INFO("REGTEST - - eta/phi: " << jet_efbjet->eta() << " / " << jet_efbjet->phi());
662 }
663 }
664
665 // Get online jet - from JetSplitter
666 const std::vector< Trig::Feature<xAOD::JetContainer> > onlinejets_split = comb.get<xAOD::JetContainer>("SplitJet");
667 ATH_MSG_INFO("REGTEST - RETRIEVED JETS (SPLIT) - size: " << onlinejets_split.size());
668 if(onlinejets_split.size()) {
669 const xAOD::JetContainer* onlinejet_split = onlinejets_split[0].cptr();
670 ATH_MSG_INFO("REGTEST - - nJet: " << onlinejet_split->size());
671 for(const auto* jet_split : *onlinejet_split) {
672 // Dump
673 ATH_MSG_INFO("REGTEST - - eta/phi: " << jet_split->eta() << " / " << jet_split->phi());
674 }
675 }
676
677 // Get online jet - from SuperRoiBuilder (will this work for superROI ??)
678 const std::vector< Trig::Feature<xAOD::JetContainer> > onlinejets_super = comb.get<xAOD::JetContainer>("SuperRoi");
679 ATH_MSG_INFO("REGTEST - RETRIEVED JETS (SUPER) - size: " << onlinejets_super.size());
680 if(onlinejets_super.size()) {
681 const xAOD::JetContainer* onlinejet_super = onlinejets_super[0].cptr();
682 ATH_MSG_INFO("REGTEST - - nJet: " << onlinejet_super->size());
683 for(const auto* jet_super : *onlinejet_super) {
684 // Dump
685 ATH_MSG_INFO("REGTEST - - eta/phi: " << jet_super->eta() << " / " << jet_super->phi());
686 }
687 }
688
689 // Get online track particles (InDetTrigTrackingxAODCnv_BjetPrmVtx_FTF)
690 const std::vector< Trig::Feature<xAOD::TrackParticleContainer> > onlinetracks_prmvtx = comb.get<xAOD::TrackParticleContainer>("InDetTrigTrackingxAODCnv_BjetPrmVtx_FTF");
691 ATH_MSG_INFO("REGTEST - RETRIEVED TRACKS (BJETPRMVTX_FTF) - size: " << onlinetracks_prmvtx.size());
692 if(onlinetracks_prmvtx.size()) {
693 const xAOD::TrackParticleContainer* onlinetrack_prmvtx = onlinetracks_prmvtx[0].cptr();
694 ATH_MSG_INFO("REGTEST - - nTrack: " << onlinetrack_prmvtx->size());
695 for(const auto* trk : *onlinetrack_prmvtx) {
696 // Dump
697 uint8_t nInn=0, nNext=0, nPix=0, nSCT=0;
698 trk->summaryValue(nInn, xAOD::numberOfInnermostPixelLayerHits);
699 trk->summaryValue(nNext, xAOD::numberOfNextToInnermostPixelLayerHits);
700 trk->summaryValue(nPix, xAOD::numberOfPixelHits);
701 trk->summaryValue(nSCT, xAOD::numberOfSCTHits);
702 ATH_MSG_INFO("REGTEST - - inn/next/pix/sct: " << (int)nInn << " / " << (int)nNext << " / " << (int)nPix << " / " << (int)nSCT);
703 }
704 }
705
706 // Get online track particles (InDetTrigTrackingxAODCnv_Bjet_FTF)
707 const std::vector< Trig::Feature<xAOD::TrackParticleContainer> > onlinetracks_bjetftf = comb.get<xAOD::TrackParticleContainer>("InDetTrigTrackingxAODCnv_Bjet_FTF");
708 ATH_MSG_INFO("REGTEST - RETRIEVED TRACKS (BJET_FTF) - size: " << onlinetracks_bjetftf.size());
709 if(onlinetracks_bjetftf.size()) {
710 const xAOD::TrackParticleContainer* onlinetrack_bjetftf = onlinetracks_bjetftf[0].cptr();
711 ATH_MSG_INFO("REGTEST - - nTrack: " << onlinetrack_bjetftf->size());
712 for(const auto* trk : *onlinetrack_bjetftf) {
713 // Dump
714 uint8_t nInn=0, nNext=0, nPix=0, nSCT=0;
715 trk->summaryValue(nInn, xAOD::numberOfInnermostPixelLayerHits);
716 trk->summaryValue(nNext, xAOD::numberOfNextToInnermostPixelLayerHits);
717 trk->summaryValue(nPix, xAOD::numberOfPixelHits);
718 trk->summaryValue(nSCT, xAOD::numberOfSCTHits);
719 ATH_MSG_INFO("REGTEST - - inn/next/pix/sct: " << (int)nInn << " / " << (int)nNext << " / " << (int)nPix << " / " << (int)nSCT);
720 }
721 }
722
723 // Get online track particles (InDetTrigTrackingxAODCnv_Bjet_IDTrig)
724 const std::vector< Trig::Feature<xAOD::TrackParticleContainer> > onlinetracks_bjetprec = comb.get<xAOD::TrackParticleContainer>("InDetTrigTrackingxAODCnv_Bjet_IDTrig");
725 ATH_MSG_INFO("REGTEST - RETRIEVED TRACKS (BJET_IDTRIG) - size: " << onlinetracks_bjetprec.size());
726 if(onlinetracks_bjetprec.size()) {
727 const xAOD::TrackParticleContainer* onlinetrack_bjetprec = onlinetracks_bjetprec[0].cptr();
728 ATH_MSG_INFO("REGTEST - - nTrack: " << onlinetrack_bjetprec->size());
729 for(const auto* trk : *onlinetrack_bjetprec) {
730 // Dump
731 uint8_t nInn=0, nNext=0, nPix=0, nSCT=0;
732 trk->summaryValue(nInn, xAOD::numberOfInnermostPixelLayerHits);
733 trk->summaryValue(nNext, xAOD::numberOfNextToInnermostPixelLayerHits);
734 trk->summaryValue(nPix, xAOD::numberOfPixelHits);
735 trk->summaryValue(nSCT, xAOD::numberOfSCTHits);
736 ATH_MSG_INFO("REGTEST - - inn/next/pix/sct: " << (int)nInn << " / " << (int)nNext << " / " << (int)nPix << " / " << (int)nSCT);
737 }
738 }
739
740 // Get online bjet
741 const std::vector< Trig::Feature<xAOD::BTaggingContainer> > onlinebjets = comb.get<xAOD::BTaggingContainer>();
742 ATH_MSG_INFO("REGTEST - RETRIEVED BJETS - size: " << onlinebjets.size());
743 if(onlinebjets.size()) {
744 const xAOD::BTaggingContainer* onlinebjet = onlinebjets[0].cptr();
745 ATH_MSG_INFO("REGTEST - - nBjet: " << onlinebjet->size());
746 for(const auto* bjet : *onlinebjet) {
747 // Dump
748 double wIP2D, wIP3D, wSV1, wCOMB, wMV1;
749 bjet->loglikelihoodratio("IP2D", wIP2D);
750 bjet->loglikelihoodratio("IP3D", wIP3D);
751 bjet->loglikelihoodratio("SV1", wSV1);
752 wCOMB = wIP3D+wSV1;
753 wMV1 = bjet->MV1_discriminant();
754 ATH_MSG_INFO("REGTEST - - IP2D/IP3D/SV1/IP3D+SV1/MV1: " << wIP2D << " / " << wIP3D << " / " << wSV1 << " / " << wCOMB << " / " << wMV1);
755 }
756 }
757
758 }
759
760 msg(MSG::INFO) << "REGTEST ==========END of bjet EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
761
762 return StatusCode::SUCCESS;
763}//checkBjetEDM
764
765StatusCode TrigDecisionChecker::checkMuonEDM(const std::string& trigItem){
766
767 msg(MSG::INFO) << "REGTEST ==========START of muon EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
768
769 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
770
771 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
772
773 const std::vector< Trig::Feature<xAOD::MuonContainer> > vec_muons = fc.get<xAOD::MuonContainer>();
774 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::MuonContainer> > = " << vec_muons.size());
775
776 for( const auto& mufeat : vec_muons ) {
777 ATH_MSG_INFO("REGTEST Got muon container, size = " << mufeat.cptr()->size());
778 for(auto muItr : *(mufeat.cptr())) {
779 ATH_MSG_INFO("REGTEST MuonFeature with pt, eta, phi = " << muItr->pt() << ", " << muItr->eta() << ", " << muItr->phi());
780 }
781 }// loop over muon features
782
783 const std::vector< Trig::Feature<xAOD::L2CombinedMuonContainer> > vec_L2CBmuons = fc.get<xAOD::L2CombinedMuonContainer>();
784 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::L2CombinedMuonContainer> > = " << vec_L2CBmuons.size());
785
786 for( const auto& l2cbmufeat : vec_L2CBmuons) {
787 ATH_MSG_INFO("REGTEST Got muon container, size = " << l2cbmufeat.cptr()->size());
788 for(auto l2cbmuItr : *(l2cbmufeat.cptr())) {
789 ATH_MSG_INFO("REGTEST MuonFeature with pt, eta, phi = " << l2cbmuItr->pt() << ", " << l2cbmuItr->eta() << ", " << l2cbmuItr->phi());
790 }
791 }// loop over muon L2 CB features
792
793 const std::vector< Trig::Feature<xAOD::L2StandAloneMuonContainer> > vec_L2SAmuons = fc.get<xAOD::L2StandAloneMuonContainer>();
794 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::L2StandAloneMuonContainer> > = " << vec_L2SAmuons.size());
795
796 for( const auto& l2samufeat : vec_L2SAmuons) {
797 ATH_MSG_INFO("REGTEST Got muon container, size = " << l2samufeat.cptr()->size());
798 for(auto l2samuItr : *(l2samufeat.cptr())) {
799 ATH_MSG_INFO("REGTEST MuonFeature with pt, eta, phi = " << l2samuItr->pt() << ", " << l2samuItr->eta() << ", " << l2samuItr->phi());
800 }
801 }// loop over muon L2 SA features
802
803 msg(MSG::INFO) << "REGTEST ==========END of muon EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
804
805 return StatusCode::SUCCESS;
806}//checkMuonEDM
807
808StatusCode TrigDecisionChecker::checkTauEDM(const std::string& trigItem){
809 msg(MSG::INFO)<< "REGTEST ==========START of tau EDM/Navigation check for chain " << trigItem<< "===========" << endmsg;
810 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
811 const std::vector< Trig::Feature<xAOD::TauJetContainer> > vec_tauHLTClust = fc.get<xAOD::TauJetContainer>();
812 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TauJetContainer> > = " << vec_tauHLTClust.size());
813 for(const auto& cont_tau : vec_tauHLTClust) {
814 ATH_MSG_INFO("REGTEST Got Tau container, size = " << cont_tau.cptr()->size());
815
816 for(auto tauItr : *(cont_tau.cptr())) {
817
818 msg(MSG::INFO) << "REGTEST "<<" HLT tau number of tracks: "<<tauItr->nTracks()<<endmsg;
819 msg(MSG::INFO) << "REGTEST "<<" HLT tau pt : "<<tauItr->pt()<<endmsg;
820 msg(MSG::INFO) << "REGTEST "<<" HLT tau phi : "<<tauItr->phi()<<endmsg;
821 msg(MSG::INFO) << "REGTEST "<<" HLT tau eta : "<<tauItr->eta()<<endmsg;
822 if( !tauItr->jetLink().isValid() ) {
823 ATH_MSG_WARNING("tau does not have jet seed");
824 return StatusCode::SUCCESS;
825 }
826
827 const xAOD::Jet* pJetSeed = *(tauItr->jetLink());
830 for (int clusCount = 0; clusItr != clusItrE; ++clusItr, ++clusCount) {
831 ATH_MSG_INFO( "REGTEST Tau Cluster " << clusCount << " pt = " << (*clusItr)->pt()<< " eta = " << (*clusItr)->eta()<< " phi = " << (*clusItr)->phi() );
832 }
833 for (unsigned int trackNum = 0; trackNum < tauItr->nTracks(); ++trackNum) {
834
835 const xAOD::TrackParticle *linkTrack = tauItr->track(trackNum)->track();
836 if (!linkTrack) {
837 ATH_MSG_WARNING("can't get tau linked track");
838 return StatusCode::SUCCESS;
839 } else {
840 ATH_MSG_DEBUG("Got the tau linked track");
841 }
842 ATH_MSG_INFO( "REGTEST Tau linked track " << trackNum << " pt = " << linkTrack->pt()<< " eta = " << linkTrack->eta() << " phi = " << linkTrack->phi() );
843 }
844
845 }
846 }
847
848 msg(MSG::INFO) << "REGTEST ==========END of Tau EDM/Navigation check ===========" << endmsg;
849 return StatusCode::SUCCESS;
850}
851
852
853
854StatusCode TrigDecisionChecker::checkBphysEDM(const std::string& trigItem){
855
856 msg(MSG::INFO) << "REGTEST ==========START of Bphysics EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
857
858 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
859
860 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
861
862 const std::vector< Trig::Feature<xAOD::TrigBphysContainer> > fc_bphys = fc.get<xAOD::TrigBphysContainer>();
863 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TrigBphysContainer> > = " << fc_bphys.size());
864
865 for( const auto& cont_bphys : fc_bphys ) {
866 ATH_MSG_INFO("REGTEST Got Bphysics container, size = " << cont_bphys.cptr()->size());
867 for ( auto bphys: *(cont_bphys.cptr()) ) {
868 ATH_MSG_INFO("REGTEST Bphysics Item mass, fitmass, secVx, nTP: "
869 << bphys->mass()*0.001 << " , " << bphys->fitmass() * 0.001 << " , "
870 << bphys->secondaryDecay() << " , " << bphys->nTrackParticles()
871 );
872 } // for
873
874 }// loop over bphys features
875
876 // const std::vector< Trig::Feature<CombinedMuonFeature> > vec_cbmufeats = fc.get<CombinedMuonFeature>();
877 // ATH_MSG_INFO("Size of vector< Trig::Feature<CombinedMuonFeature> > = " << vec_cbmufeats.size());
878 //
879 // for( auto cbmufeat : vec_cbmufeats) {
880 // ATH_MSG_INFO("REGTEST CombinedMuonFeature with pt, eta, phi = " << cbmufeat.cptr()->pt() << ", " << cbmufeat.cptr()->eta() << ", " << cbmufeat.cptr()->phi());
881 // }
882 //
883 ATH_MSG_INFO("REGTEST ==========END of Bphysics EDM/Navigation check for chain " << trigItem << " ===========");
884
885 return StatusCode::SUCCESS;
886}//checkBphysEDM
887
888
889
890
891
892
893StatusCode TrigDecisionChecker::checkElectronEDM(const std::string& trigItem){
894 msg(MSG::INFO) << "REGTEST ==========START of Electron EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
895
896 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
897
898 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
899 const std::vector< Trig::Feature<xAOD::ElectronContainer> > vec_el = fc.get<xAOD::ElectronContainer>();
900 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::ElectronContainer> > = " << vec_el.size());
901 float val_float=-99.;
902 for(const auto& elfeat : vec_el){
903 ATH_MSG_INFO("REGTEST: Got electron container, size = " << elfeat.cptr()->size());
904 const xAOD::ElectronContainer *elCont = elfeat.cptr();
905
906 for(const auto eg : *elCont){
907 if (eg) {
908 ATH_MSG_INFO(" REGTEST: egamma energy: " << eg->e() );
909 ATH_MSG_INFO(" REGTEST: egamma eta: " << eg->eta() );
910 ATH_MSG_INFO(" REGTEST: egamma phi: " << eg->phi() );
911 } else{
912 ATH_MSG_INFO(" REGTEST: problems with egamma pointer" );
913 return StatusCode::SUCCESS;
914 }
915 ATH_MSG_INFO(" REGTEST: caloCluster variables ");
916 if (eg->caloCluster()) {
917 ATH_MSG_INFO(" REGTEST: egamma cluster transverse energy: " << eg->caloCluster()->et() );
918 ATH_MSG_INFO(" REGTEST: egamma cluster eta: " << eg->caloCluster()->eta() );
919 ATH_MSG_INFO(" REGTEST: egamma cluster phi: " << eg->caloCluster()->phi() );
920 double tmpeta = -999.;
921 double tmpphi = -999.;
922 eg->caloCluster()->retrieveMoment(xAOD::CaloCluster::ETACALOFRAME,tmpeta);
923 eg->caloCluster()->retrieveMoment(xAOD::CaloCluster::PHICALOFRAME,tmpphi);
924 ATH_MSG_INFO(" REGTEST: egamma cluster calo-frame coords. etaCalo = " << tmpeta);
925 ATH_MSG_INFO(" REGTEST: egamma cluster calo-frame coords. phiCalo = " << tmpphi);
926 } else{
927 ATH_MSG_INFO(" REGTEST: problems with egamma cluster pointer" );
928 }
929 ATH_MSG_INFO(" REGTEST: trackmatch variables ");
930 if(eg->trackParticle()){
931 ATH_MSG_INFO(" REGTEST: pt= " << eg->trackParticle()->pt());
932 ATH_MSG_INFO(" REGTEST: charge= " << eg->trackParticle()->charge());
933 ATH_MSG_INFO(" REGTEST: E/p= " << eg->caloCluster()->et() / eg->trackParticle()->pt() );
934 eg->trackCaloMatchValue(val_float,xAOD::EgammaParameters::deltaEta1);
935 ATH_MSG_INFO(" REGTEST: Delta eta 1st sampling= " << val_float);
936 eg->trackCaloMatchValue(val_float,xAOD::EgammaParameters::deltaPhi2);
937 ATH_MSG_INFO(" REGTEST: Delta phi 2nd sampling= " << val_float);
938 } else{
939 ATH_MSG_INFO(" REGTEST: no electron eg->trackParticle() pointer");
940 }
941 }
942 }
943
944 msg(MSG::INFO) << "REGTEST ==========END of Electron EDM/Navigation check ===========" << endmsg;
945 return StatusCode::SUCCESS;
946}
947
948StatusCode TrigDecisionChecker::checkPhotonEDM(const std::string& trigItem){
949 msg(MSG::INFO) << "REGTEST ==========START of Photon EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
950
951 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
952
953 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
954 const std::vector< Trig::Feature<xAOD::PhotonContainer> > vec_ph = fc.get<xAOD::PhotonContainer>();
955 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::PhotonContainer> > = " << vec_ph.size());
956 //float val_float=-99.;
957 for(const auto& phfeat : vec_ph){
958 ATH_MSG_INFO("REGTEST: Got photon container, size = " << phfeat.cptr()->size());
959 const xAOD::PhotonContainer *phCont = phfeat.cptr();
960
961 for(const auto eg : *phCont){
962 if (eg) {
963 ATH_MSG_INFO(" REGTEST: egamma energy: " << eg->e() );
964 ATH_MSG_INFO(" REGTEST: egamma eta: " << eg->eta() );
965 ATH_MSG_INFO(" REGTEST: egamma phi: " << eg->phi() );
966 } else{
967 ATH_MSG_INFO(" REGTEST: problems with egamma pointer" );
968 return StatusCode::SUCCESS;
969 }
970 ATH_MSG_INFO(" REGTEST: caloCluster variables ");
971 if (eg->caloCluster()) {
972 ATH_MSG_INFO(" REGTEST: egamma cluster transverse energy: " << eg->caloCluster()->et() );
973 ATH_MSG_INFO(" REGTEST: egamma cluster eta: " << eg->caloCluster()->eta() );
974 ATH_MSG_INFO(" REGTEST: egamma cluster phi: " << eg->caloCluster()->phi() );
975 double tmpeta = -999.;
976 double tmpphi = -999.;
977 eg->caloCluster()->retrieveMoment(xAOD::CaloCluster::ETACALOFRAME,tmpeta);
978 eg->caloCluster()->retrieveMoment(xAOD::CaloCluster::PHICALOFRAME,tmpphi);
979 ATH_MSG_INFO(" REGTEST: egamma cluster calo-frame coords. etaCalo = " << tmpeta);
980 ATH_MSG_INFO(" REGTEST: egamma cluster calo-frame coords. phiCalo = " << tmpphi);
981 } else{
982 ATH_MSG_INFO(" REGTEST: problems with egamma cluster pointer" );
983 }
984 }
985 }
986
987 msg(MSG::INFO) << "REGTEST ==========END of Photon EDM/Navigation check ===========" << endmsg;
988 return StatusCode::SUCCESS;
989}
990
991StatusCode TrigDecisionChecker::checkMinBiasEDM(const std::string& trigItem){
992 msg(MSG::INFO) << "REGTEST ==========START of MinBias EDM/Navigation check for chain " << trigItem << " ===========" << endmsg;
993
994 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
995
996 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
997
1002
1003 msg(MSG::INFO) << "REGTEST ==========END of MinBias EDM/Navigation check ===========" << endmsg;
1004 return StatusCode::SUCCESS;
1005}
1006
1008
1009 const std::vector< Trig::Feature<xAOD::TrigSpacePointCounts> > vec_sp = fc.get<xAOD::TrigSpacePointCounts>();
1010 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TrigSpacePointCounts> > = " << vec_sp.size());
1011
1012 float sum;
1013 auto fun = [&sum](const std::vector<float>& vec){sum = 0.; for (const auto &i: vec) sum += i; return sum;};
1014
1015 for(const auto& spfeat : vec_sp){
1016 const xAOD::TrigSpacePointCounts *spCounts = spfeat.cptr();
1017 if (spCounts){
1018 ATH_MSG_INFO(" REGTEST: SUM of contentsPixelClusEndcapC: " << fun(spCounts->contentsPixelClusEndcapC()) );
1019 ATH_MSG_INFO(" REGTEST: SUM of contentsPixelClusBarrel: " << fun(spCounts->contentsPixelClusBarrel()) );
1020 ATH_MSG_INFO(" REGTEST: SUM of contentsPixelClusEndcapA: " << fun(spCounts->contentsPixelClusEndcapA()) );
1021
1022 ATH_MSG_INFO(" REGTEST: pixelClusTotBins: " << spCounts->pixelClusTotBins() );
1023 ATH_MSG_INFO(" REGTEST: pixelClusTotMin: " << spCounts->pixelClusTotMin() );
1024 ATH_MSG_INFO(" REGTEST: pixelClusTotMax: " << spCounts->pixelClusTotMax() );
1025 ATH_MSG_INFO(" REGTEST: pixelClusSizeBins: " << spCounts->pixelClusSizeBins() );
1026 ATH_MSG_INFO(" REGTEST: pixelClusSizeMin: " << spCounts->pixelClusSizeMin() );
1027 ATH_MSG_INFO(" REGTEST: pixelClusSizeMax: " << spCounts->pixelClusSizeMax() );
1028 ATH_MSG_INFO(" REGTEST: sctSpEndcapC: " << spCounts->sctSpEndcapC() );
1029 ATH_MSG_INFO(" REGTEST: sctSpBarrel: " << spCounts->sctSpBarrel() );
1030 ATH_MSG_INFO(" REGTEST: sctSpEndcapA: " << spCounts->sctSpEndcapA() );
1031 } else{
1032 ATH_MSG_INFO(" REGTEST: problems with TrigSpacePointCounts pointer" );
1033 return;
1034 }
1035 }
1036}
1037
1039
1040 const std::vector< Trig::Feature<xAOD::TrigT2MbtsBits> > vec_mbts = fc.get<xAOD::TrigT2MbtsBits>();
1041 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TrigT2MbtsBits> > = " << vec_mbts.size());
1042
1043 float sum;
1044 auto fun = [&sum](const std::vector<float>& vec){sum = 0.; for (const auto &i: vec) sum += i; return sum;};
1045
1046 for(const auto& mbtsfeat : vec_mbts){
1047 const xAOD::TrigT2MbtsBits *mbtsBits = mbtsfeat.cptr();
1048 if (mbtsBits){
1049 ATH_MSG_INFO(" REGTEST: SUM of triggerEnergies: " << fun(mbtsBits->triggerEnergies()) );
1050 ATH_MSG_INFO(" REGTEST: SUM of triggerTimes: " << fun(mbtsBits->triggerTimes()) );
1051 } else{
1052 ATH_MSG_INFO(" REGTEST: problems with TrigT2MBTSBits pointer" );
1053 return;
1054 }
1055 }
1056}
1057
1059
1060 const std::vector< Trig::Feature<xAOD::TrigVertexCounts> > vec_v = fc.get<xAOD::TrigVertexCounts>();
1061 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TrigVertexCounts> > = " << vec_v.size());
1062
1063 auto funu = [](const std::vector<uint>& vec){uint sum = 0; for (const auto &i: vec) sum += i; return sum;};
1064 auto funf = [](const std::vector<float>& vec){float sum = 0.; for (const auto &i: vec) sum += i; return sum;};
1065
1066 for(const auto& vfeat : vec_v){
1067 const xAOD::TrigVertexCounts *vCounts = vfeat.cptr();
1068 if (vCounts){
1069 ATH_MSG_INFO(" REGTEST: SUM of vtxNtrks: " << funu(vCounts->vtxNtrks()) );
1070 ATH_MSG_INFO(" REGTEST: SUM of vtxTrkPtSqSum: " << funf(vCounts->vtxTrkPtSqSum()) );
1071 } else{
1072 ATH_MSG_INFO(" REGTEST: problems with TrigVertexCounts pointer" );
1073 return;
1074 }
1075 }
1076}
1077
1079
1080 const std::vector< Trig::Feature<xAOD::TrigTrackCounts> > vec_t = fc.get<xAOD::TrigTrackCounts>();
1081 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TrigTrackCounts> > = " << vec_t.size());
1082
1083 float sum;
1084 auto fun = [&sum](const std::vector<float>& vec){sum = 0.; for (const auto &i: vec) sum += i; return sum;};
1085
1086 for(const auto& tfeat : vec_t){
1087 const xAOD::TrigTrackCounts *tCounts = tfeat.cptr();
1088 if (tCounts){
1089 ATH_MSG_INFO(" REGTEST: SUM of z0_pt: " << fun(tCounts->z0_pt()) );
1090 ATH_MSG_INFO(" REGTEST: SUM of eta_phi: " << fun(tCounts->eta_phi()) );
1091
1092 ATH_MSG_INFO(" REGTEST: z0Bins: " << tCounts->z0Bins() );
1093 ATH_MSG_INFO(" REGTEST: z0Min: " << tCounts->z0Min() );
1094 ATH_MSG_INFO(" REGTEST: z0Max: " << tCounts->z0Max() );
1095 ATH_MSG_INFO(" REGTEST: ptBins: " << tCounts->ptBins() );
1096 ATH_MSG_INFO(" REGTEST: ptMin: " << tCounts->ptMin() );
1097 ATH_MSG_INFO(" REGTEST: ptMax: " << tCounts->ptMax() );
1098 ATH_MSG_INFO(" REGTEST: etaBins: " << tCounts->etaBins() );
1099 ATH_MSG_INFO(" REGTEST: etaMin: " << tCounts->etaMin() );
1100 ATH_MSG_INFO(" REGTEST: etaMax: " << tCounts->etaMax() );
1101 } else{
1102 ATH_MSG_INFO(" REGTEST: problems with TrigTrackCounts pointer" );
1103 return;
1104 }
1105 }
1106}
1107
1108StatusCode TrigDecisionChecker::checkJetEDM(const std::string& trigItem){
1109 ATH_MSG_DEBUG("in checkJetEDM()");
1110
1111 ATH_MSG_INFO("REGTEST =====For chain " << trigItem << "=====");
1112
1113 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
1114
1115 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
1116 const std::vector< Trig::Feature<xAOD::JetContainer> > vec_jet = fc.get<xAOD::JetContainer>();
1117 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::JetContainer> > = " << vec_jet.size());
1118 for(const auto& jetfeat : vec_jet){
1119 const xAOD::JetContainer * jetCont = jetfeat.cptr();
1120
1121 int jetContsize = jetCont->size();
1122 ATH_MSG_INFO("REGTEST Got jet container, size: " << jetContsize);
1123
1124 int i = 0;
1125 for(const auto thisjet : *jetCont){
1126 ++i;
1127 ATH_MSG_INFO("REGTEST Looking at jet " << i);
1128 if (thisjet) {
1129 //checks jet variables
1130 ATH_MSG_DEBUG("REGTEST Checking jet variables");
1131 ATH_MSG_INFO("REGTEST pt: " << thisjet->pt() );
1132 ATH_MSG_INFO("REGTEST eta: " << thisjet->eta() );
1133 ATH_MSG_INFO("REGTEST phi: " << thisjet->phi() );
1134 ATH_MSG_INFO("REGTEST m: " << thisjet->m() );
1135 ATH_MSG_INFO("REGTEST e: " << thisjet->e() );
1136 ATH_MSG_INFO("REGTEST px: " << thisjet->px() );
1137 ATH_MSG_INFO("REGTEST py: " << thisjet->py() );
1138 ATH_MSG_INFO("REGTEST pz: " << thisjet->pz() );
1139 ATH_MSG_INFO("REGTEST type: " << thisjet->type() );
1140 ATH_MSG_INFO("REGTEST algorithm (kt: 0, cam: 1, antikt: 2, ...): " << thisjet->getAlgorithmType() );
1141 ATH_MSG_INFO("REGTEST size parameter: " << thisjet->getSizeParameter() );
1142 ATH_MSG_INFO("REGTEST input (LCTopo: 0, EMTopo: 1, ...): " << thisjet->getInputType() );
1143 ATH_MSG_INFO("REGTEST constituents signal state (uncalibrated: 0, calibrated: 1): " << thisjet->getConstituentsSignalState() );
1144 ATH_MSG_INFO("REGTEST number of constituents: " << thisjet->numConstituents() );
1145 }
1146 else{
1147 ATH_MSG_ERROR("REGTEST Problem with jet pointer" );
1148 return StatusCode::FAILURE;
1149 }
1150 }
1151 if (jetContsize == i) ATH_MSG_INFO("REGTEST size of jet container == number of displayed jets: " << (jetContsize == i) );
1152 else ATH_MSG_WARNING("REGTEST Problem with displaying jets");
1153 }
1154
1155 ATH_MSG_DEBUG("leaving checkJetEDM()");
1156
1157 return StatusCode::SUCCESS;
1158}
1159
1160StatusCode TrigDecisionChecker::checkMetEDM(const std::string& trigItem){
1161 ATH_MSG_DEBUG("in checkMetEDM()");
1162
1163 ATH_MSG_INFO("REGTEST =====For chain " << trigItem << "=====");
1164
1165 ATH_MSG_INFO("Chain passed = " << m_trigDec->isPassed(trigItem));
1166
1167 Trig::FeatureContainer fc = m_trigDec->features(trigItem);
1168 const std::vector< Trig::Feature<xAOD::TrigMissingETContainer> > vec_met = fc.get<xAOD::TrigMissingETContainer>();
1169 ATH_MSG_INFO("Size of vector< Trig::Feature<xAOD::TrigMissingETContainer> > = " << vec_met.size());
1170 for(const auto& metfeat : vec_met){
1171 const xAOD::TrigMissingETContainer * metCont = metfeat.cptr();
1172
1173 ATH_MSG_INFO("REGTEST Fot trigMet container, size: " << metCont->size());
1174
1175 const xAOD::TrigMissingET * metObj = metCont->front(); // the first object in the container typically holds the total MET, other objects hold components
1176
1177 if (metObj){
1178 ATH_MSG_DEBUG("REGTEST Checking met variables");
1179 ATH_MSG_INFO("REGTEST ex: " << metObj->ex() );
1180 ATH_MSG_INFO("REGTEST ey: " << metObj->ey() );
1181 ATH_MSG_INFO("REGTEST sumEt: " << metObj->sumEt() );
1182 ATH_MSG_INFO("REGTEST ez: " << metObj->ez() );
1183 ATH_MSG_INFO("REGTEST sumE: " << metObj->sumE() );
1184 ATH_MSG_INFO("REGTEST number of components: " << metObj->getNumberOfComponents() );
1185 }
1186 else{
1187 ATH_MSG_ERROR("REGTEST Problem with met pointer" );
1188 return StatusCode::FAILURE;
1189 }
1190 }
1191
1192 ATH_MSG_DEBUG("leaving checkMetEDM()");
1193
1194 return StatusCode::SUCCESS;
1195}
#define endmsg
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
#define ATH_MSG_INFO(x)
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
std::vector< size_t > vec
ElementLink< xAOD::TrackParticleContainer > linkTrack(const xAOD::TrackParticle *trk)
unsigned int uint
static Double_t sc
#define z
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
ServiceHandle< StoreGateSvc > & evtStore()
const T * front() const
Access the first element in the collection as an rvalue.
size_type size() const noexcept
Returns the number of elements in the collection.
This class represents one chain of signatures, i.e.
Definition Chain.h:61
bool chainPassed() const
Definition Chain.cxx:46
bool isPassedThrough() const
is chain passed through ?
Definition Chain.h:82
bool isPrescaled() const
is chain prescaled ?
Definition Chain.h:83
bool chainPassedRaw() const
Definition Chain.h:78
unsigned int hashId() const
Definition Lvl1Item.h:42
bool isPassed() const
Definition Lvl1Item.h:48
const std::string & name() const
Definition Lvl1Item.h:41
HLT chain configuration information.
static bool getLabel(unsigned int id, std::string &label)
find name from ID in the map m_IdToLabel
void checkTrigSpacePointCounts(const Trig::FeatureContainer &fc)
StatusCode checkMuonEDM(const std::string &trigItem)
std::vector< int > m_summaryChainPass
Gaudi::Property< std::vector< std::string > > m_jetItems
std::vector< std::vector< int > * > m_countSigs
std::vector< float > m_chainPrescalesCalculated
Gaudi::Property< std::vector< std::string > > m_photonItems
std::vector< int > m_countEvent
TrigDecisionChecker(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
StatusCode checkPhotonEDM(const std::string &trigItem)
StatusCode checkEDM(const std::string &trigItem)
StatusCode initialize()
std Gaudi initialize method
Gaudi::Property< std::vector< std::string > > m_muonItems
Muon triggers to test output for.
std::vector< float > m_chain_passthrough
StatusCode checkMetEDM(const std::string &trigItem)
StatusCode checkMinBiasEDM(const std::string &trigItem)
Gaudi::Property< std::vector< std::string > > m_minBiasItems
StatusCode checkBphysEDM(const std::string &trigItem)
Bphysics EDM checker.
Gaudi::Property< std::vector< std::string > > m_bjetItems
~TrigDecisionChecker()
std deconstructor
std::vector< int > m_summaryChainPassPhys
Gaudi::Property< std::vector< std::string > > m_countSigNames
void checkTrigTrackCounts(const Trig::FeatureContainer &fc)
std::vector< int > m_lower_chain_accept
Gaudi::Property< std::vector< std::string > > m_bphysItems
std::vector< int > m_summaryPassRaw
Gaudi::Property< std::vector< std::string > > m_metItems
std::map< std::string, std::string > m_lowerChainMap
Gaudi::Property< std::string > m_printoutFileName
StatusCode checkBjetEDM(const std::string &trigItem)
std::vector< int > m_runCountSigs
std::vector< int > m_summaryPassPhys
StatusCode checkElectronEDM(const std::string &trigItem)
StatusCode execute(const EventContext &ctx)
std Gaudi execute method -> use TrigDecisionTool to 'look' at the trigger data
Gaudi::Property< int > m_monitoringBlockSize
Gaudi::Property< std::vector< std::string > > m_TauItems
std::vector< std::string > m_summary
StatusCode checkTauEDM(const std::string &trigItem)
Gaudi::Property< bool > m_checkBits
ToolHandle< Trig::TrigDecisionTool > m_trigDec
interface to use the trigger data: TriggerTool
Gaudi::Property< bool > m_eventDecisionPrintout
std::vector< float > m_chain_passthrough_calculated
std::vector< int > m_summaryChainPS
StatusCode checkJetEDM(const std::string &trigItem)
void checkTrigVertexCounts(const Trig::FeatureContainer &fc)
Gaudi::Property< std::vector< std::string > > m_electronItems
Bphysics chains to test.
std::vector< float > m_chainPrescales
void checkTrigT2MBTSBits(const Trig::FeatureContainer &fc)
std::map< std::string, int > m_L1Summary
std::vector< int > m_summaryChainPassRaw
StatusCode finalize()
std Gaudi finalize method
std::vector< int > m_summaryPass
std::vector< int > m_summaryChainPT
unsigned int size() const
gets size of the bits array
is a connector between chains and object It store single combination of trigger elements.
std::vector< Trig::Feature< T > > get(const std::string &label="", unsigned int condition=TrigDefs::Physics, const std::string &teName="") const
Method used to get objects.
const std::vector< Trig::Feature< T > > get(const std::string &label="", unsigned int condition=TrigDefs::Physics, const std::string &teName="") const
returns flattened vector of Features of given type This method is in fact sullied by 3 arguments.
const std::vector< Trig::Combination > & getCombinations() const
gives back reference to combinations collected through append
@ ETACALOFRAME
Eta in the calo frame (for egamma).
@ PHICALOFRAME
Phi in the calo frame (for egamma).
uint32_t lumiBlock() const
The current event's luminosity block number.
float averageInteractionsPerCrossing() const
Average interactions per crossing for all BCIDs - for out-of-time pile-up.
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
iterator begin() const
iterator on the first constituent
iterator end() const
iterator after the last constituent
JetConstituentVector getConstituents() const
Return a vector of consituents. The object behaves like vector<const IParticle*>. See JetConstituentV...
Definition Jet_v1.cxx:149
float ex() const
Get the x component of the missing energy.
float sumE() const
Get the sum of the E of the missing energy.
unsigned int getNumberOfComponents() const
Get the number of components.
float sumEt() const
Get the sum of the ET of the missing energy.
float ez() const
Get the z component of the missing energy.
float ey() const
Get the y component of the missing energy.
uint32_t size() const
The size of the target container.
bool isPassing(const OBJ *obj, const CONT *container) const
Check if an element of a container is passing/failing.
unsigned int sctSpEndcapA() const
unsigned int pixelClusTotBins() const
unsigned int sctSpBarrel() const
unsigned int pixelClusSizeBins() const
const std::vector< float > & contentsPixelClusEndcapC() const
getters
const std::vector< float > & contentsPixelClusEndcapA() const
unsigned int sctSpEndcapC() const
const std::vector< float > & contentsPixelClusBarrel() const
const std::vector< float > & triggerEnergies() const
Return the trigger energies of each counter.
const std::vector< float > & triggerTimes() const
Return the relative times of the triggers.
const std::vector< float > & eta_phi() const
unsigned int etaBins() const
const std::vector< float > & z0_pt() const
getters
unsigned int z0Bins() const
unsigned int ptBins() const
const std::vector< float > & vtxTrkPtSqSum() const
const std::vector< unsigned int > & vtxNtrks() const
getters
int count(std::string s, const std::string &regx)
count how many occurances of a regx are in a string
Definition hcg.cxx:148
std::string label(const std::string &format, int i)
Definition label.h:19
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.
@ deltaPhi2
difference between the cluster phi (second sampling) and the phi of the track extrapolated to the sec...
@ deltaEta1
difference between the cluster eta (first sampling) and the eta of the track extrapolated to the firs...
Jet_v1 Jet
Definition of the current "jet version".
PhotonContainer_v1 PhotonContainer
Definition of the current "photon container version".
BTaggingContainer_v1 BTaggingContainer
Definition of the current "BTagging container version".
TrigMissingETContainer_v1 TrigMissingETContainer
DataVector of TrigMissingET - the current version.
ElectronContainer_v1 ElectronContainer
Definition of the current "electron container version".
EventInfo_v1 EventInfo
Definition of the latest event info version.
L2CombinedMuonContainer_v1 L2CombinedMuonContainer
Define the latest version of the muon CB container.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
TrigPassBits_v1 TrigPassBits
Define the latest version of the trigger pass bits class.
L2StandAloneMuonContainer_v2 L2StandAloneMuonContainer
Define the latest version of the muon SA container.
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
TrigMissingET_v1 TrigMissingET
Define the most recent version of the TrigMissingET class.
JetContainer_v1 JetContainer
Definition of the current "jet container version".
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
TrigBphysContainer_v1 TrigBphysContainer
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
@ numberOfSCTHits
number of hits in SCT [unit8_t].
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].