ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerSkimmingTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
6// TriggerSkimmingTool.cxx, (c) ATLAS Detector software
8// Author: James Catmore (james.catmore@cern.ch)
9//
10// Direct skimming via TrigDecisionTool
11// Only intended for cases where the triggers in question cannot be
12// handled by ExpressionEvaluation (dashes, dots)
13
15
16#include <vector>
17#include <string>
18
19
20
21namespace DerivationFramework {
22
24 const std::string& n,
25 const IInterface* p) :
26 base_class(t,n,p) {
27
28 }
29
31 {
32 ATH_CHECK(m_trigDec.retrieve());
33 return StatusCode::SUCCESS;
34 }
35
36
37
39 {
40
41 if (msgLvl(MSG::VERBOSE)){
42 const Trig::ChainGroup* Chain = m_trigDec->getChainGroup(".*");
43 const std::vector<std::string> fired_triggers = Chain->getListOfTriggers();
44 for (const std::string& fired : fired_triggers) {
45 if (m_trigDec->isPassed(fired)) ATH_MSG_VERBOSE("Fired trigger "<<fired);
46 }
47 }
48
49 unsigned int cntrAND{0}, cntrOR{0}, cntrORHLTOnly{0};
50 for (const std::string& trig_and : m_triggerListAND) {
51 ATH_MSG_DEBUG("AND - Trigger "<<trig_and<<" passed "<<m_trigDec->isPassed(trig_and));
52 cntrAND+=(m_trigDec->isPassed(trig_and));
53 }
54 for (const std::string& trig_or : m_triggerListOR) {
55 ATH_MSG_DEBUG("OR - Trigger "<<trig_or<<" passed "<<m_trigDec->isPassed(trig_or));
56 cntrOR +=(m_trigDec->isPassed(trig_or));
57 }
58 for (const std::string& trig_orhltonly : m_triggerListORHLTOnly) {
59 ATH_MSG_DEBUG("ORHLTOnly - Trigger "<<trig_orhltonly<<" passed "<<m_trigDec->isPassed(trig_orhltonly, TrigDefs::requireDecision));
60 cntrORHLTOnly +=(m_trigDec->isPassed(trig_orhltonly, TrigDefs::requireDecision));
61 }
62
63 bool passAND = (cntrAND==m_triggerListAND.size() && !m_triggerListAND.empty());
64 bool passOR = (cntrOR > 0);
65 bool passORHLTOnly = (cntrORHLTOnly > 0);
66
67 bool pass = passAND || passOR || passORHLTOnly;
68 return pass;
69 }
70}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
TriggerSkimmingTool(const std::string &t, const std::string &n, const IInterface *p)
Gaudi::Property< std::vector< std::string > > m_triggerListAND
Gaudi::Property< std::vector< std::string > > m_triggerListOR
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Gaudi::Property< std::vector< std::string > > m_triggerListORHLTOnly
std::vector< std::string > getListOfTriggers() const
THE reconstruction tool.