ATLAS Offline Software
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 
21 namespace 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 }
DerivationFramework::TriggerSkimmingTool::m_triggerListAND
Gaudi::Property< std::vector< std::string > > m_triggerListAND
Definition: TriggerSkimmingTool.h:28
DerivationFramework::TriggerSkimmingTool::eventPassesFilter
bool eventPassesFilter() const override
Definition: TriggerSkimmingTool.cxx:38
DerivationFramework::TriggerSkimmingTool::TriggerSkimmingTool
TriggerSkimmingTool(const std::string &t, const std::string &n, const IInterface *p)
Definition: TriggerSkimmingTool.cxx:23
DerivationFramework::TriggerSkimmingTool::m_triggerListORHLTOnly
Gaudi::Property< std::vector< std::string > > m_triggerListORHLTOnly
Definition: TriggerSkimmingTool.h:30
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TriggerSkimmingTool.h
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
beamspotman.n
n
Definition: beamspotman.py:729
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework
THE reconstruction tool.
Definition: ParticleSortingAlg.h:24
Trig::ChainGroup
Definition: ChainGroup.h:51
DerivationFramework::TriggerSkimmingTool::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: TriggerSkimmingTool.h:31
DerivationFramework::TriggerSkimmingTool::initialize
StatusCode initialize() override
Definition: TriggerSkimmingTool.cxx:30
DerivationFramework::TriggerSkimmingTool::m_triggerListOR
Gaudi::Property< std::vector< std::string > > m_triggerListOR
Definition: TriggerSkimmingTool.h:29
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:13
Trig::ChainGroup::getListOfTriggers
std::vector< std::string > getListOfTriggers() const
Definition: ChainGroup.cxx:467
passOR
@ passOR
Definition: SUSYToolsTester.cxx:100