ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DerivationFramework::TriggerGenericObjectThinningTool Class Reference

#include <TriggerGenericObjectThinningTool.h>

Inheritance diagram for DerivationFramework::TriggerGenericObjectThinningTool:
Collaboration diagram for DerivationFramework::TriggerGenericObjectThinningTool:

Public Member Functions

 TriggerGenericObjectThinningTool (const std::string &t, const std::string &n, const IInterface *p)
 
 ~TriggerGenericObjectThinningTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode finalize () override
 
virtual StatusCode doThinning () const override
 

Private Member Functions

bool eventPassedFilter () const
 

Private Attributes

StringProperty m_streamName { this, "StreamName", "", "Name of the stream being thinned" }
 
SG::ThinningHandleKey< xAOD::IParticleContainerm_SGKey { this, "ContainerName", "", "" }
 
Gaudi::Property< std::vector< std::string > > m_triggerListAND {this,"TriggerListAND", {}}
 
Gaudi::Property< std::vector< std::string > > m_triggerListOR {this,"TriggerListOR", {}}
 
Gaudi::Property< std::vector< std::string > > m_triggerListORHLTOnly {this,"TriggerListORHLTOnly", {}, "Decision is based on HLT only (unseeded triggers)"}
 
PublicToolHandle< Trig::TrigDecisionToolm_trigDec {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool"}
 

Detailed Description

Definition at line 30 of file TriggerGenericObjectThinningTool.h.

Constructor & Destructor Documentation

◆ TriggerGenericObjectThinningTool()

DerivationFramework::TriggerGenericObjectThinningTool::TriggerGenericObjectThinningTool ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 38 of file TriggerGenericObjectThinningTool.cxx.

40  :
41  base_class(t,n,p)
42  {
43  }

◆ ~TriggerGenericObjectThinningTool()

DerivationFramework::TriggerGenericObjectThinningTool::~TriggerGenericObjectThinningTool ( )

Definition at line 46 of file TriggerGenericObjectThinningTool.cxx.

46  {
47  }

Member Function Documentation

◆ doThinning()

StatusCode DerivationFramework::TriggerGenericObjectThinningTool::doThinning ( ) const
overridevirtual

Definition at line 68 of file TriggerGenericObjectThinningTool.cxx.

69  {
70  const EventContext& ctx = Gaudi::Hive::currentContext();
71 
72  // Retrieve main object collection
74 
75  // Check the event contains objects
76  unsigned int nObjects = particles->size();
77  if (nObjects==0) return StatusCode::SUCCESS;
78 
79  //check if the trigger passed for the event
80  bool keep_container = eventPassedFilter();
81 
82  // Set up a mask with the same entries as the full collection
83  std::vector<bool> mask;
84  mask.assign(nObjects,keep_container);
85 
86 
87  // Execute the thinning based on the mask. Finish.
88  particles.keep (mask);
89 
90  return StatusCode::SUCCESS;
91  }

◆ eventPassedFilter()

bool DerivationFramework::TriggerGenericObjectThinningTool::eventPassedFilter ( ) const
private

Definition at line 6 of file TriggerGenericObjectThinningTool.cxx.

7  {
8  if (msgLvl(MSG::VERBOSE)){
9  const Trig::ChainGroup* Chain = m_trigDec->getChainGroup(".*");
10  const std::vector<std::string> fired_triggers = Chain->getListOfTriggers();
11  for (const std::string& fired : fired_triggers) {
12  if (m_trigDec->isPassed(fired)) ATH_MSG_VERBOSE("Fired trigger "<<fired);
13  }
14  }
15 
16  unsigned int cntrAND{0}, cntrOR{0}, cntrORHLTOnly{0};
17  for (const std::string& trig_and : m_triggerListAND) {
18  ATH_MSG_DEBUG("AND - Trigger "<<trig_and<<" passed "<<m_trigDec->isPassed(trig_and));
19  cntrAND+=(m_trigDec->isPassed(trig_and));
20  }
21  for (const std::string& trig_or : m_triggerListOR) {
22  ATH_MSG_DEBUG("OR - Trigger "<<trig_or<<" passed "<<m_trigDec->isPassed(trig_or));
23  cntrOR +=(m_trigDec->isPassed(trig_or));
24  }
25  for (const std::string& trig_orhltonly : m_triggerListORHLTOnly) {
26  ATH_MSG_DEBUG("ORHLTOnly - Trigger "<<trig_orhltonly<<" passed "<<m_trigDec->isPassed(trig_orhltonly, TrigDefs::requireDecision));
27  cntrORHLTOnly +=(m_trigDec->isPassed(trig_orhltonly, TrigDefs::requireDecision));
28  }
29 
30  bool passAND = (cntrAND==m_triggerListAND.size() && !m_triggerListAND.empty());
31  bool passOR = (cntrOR > 0);
32  bool passORHLTOnly = (cntrORHLTOnly > 0);
33 
34  bool pass = passAND || passOR || passORHLTOnly;
35  return pass;
36  }

◆ finalize()

StatusCode DerivationFramework::TriggerGenericObjectThinningTool::finalize ( )
overridevirtual

Definition at line 61 of file TriggerGenericObjectThinningTool.cxx.

62  {
63  ATH_MSG_VERBOSE("finalize() ...");
64  return StatusCode::SUCCESS;
65  }

◆ initialize()

StatusCode DerivationFramework::TriggerGenericObjectThinningTool::initialize ( )
overridevirtual

Definition at line 50 of file TriggerGenericObjectThinningTool.cxx.

51  {
52  ATH_MSG_VERBOSE("initialize() ...");
53 
54  //check xAOD::InDetTrackParticle collection
55  ATH_CHECK( m_SGKey.initialize (m_streamName) );
56  ATH_MSG_INFO("Using " << m_SGKey << "as the source collection");
57 
58  return StatusCode::SUCCESS;
59  }

Member Data Documentation

◆ m_SGKey

SG::ThinningHandleKey<xAOD::IParticleContainer> DerivationFramework::TriggerGenericObjectThinningTool::m_SGKey { this, "ContainerName", "", "" }
private

Definition at line 41 of file TriggerGenericObjectThinningTool.h.

◆ m_streamName

StringProperty DerivationFramework::TriggerGenericObjectThinningTool::m_streamName { this, "StreamName", "", "Name of the stream being thinned" }
private

Definition at line 39 of file TriggerGenericObjectThinningTool.h.

◆ m_trigDec

PublicToolHandle<Trig::TrigDecisionTool> DerivationFramework::TriggerGenericObjectThinningTool::m_trigDec {this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool"}
private

Definition at line 48 of file TriggerGenericObjectThinningTool.h.

◆ m_triggerListAND

Gaudi::Property<std::vector<std::string> > DerivationFramework::TriggerGenericObjectThinningTool::m_triggerListAND {this,"TriggerListAND", {}}
private

Definition at line 45 of file TriggerGenericObjectThinningTool.h.

◆ m_triggerListOR

Gaudi::Property<std::vector<std::string> > DerivationFramework::TriggerGenericObjectThinningTool::m_triggerListOR {this,"TriggerListOR", {}}
private

Definition at line 46 of file TriggerGenericObjectThinningTool.h.

◆ m_triggerListORHLTOnly

Gaudi::Property<std::vector<std::string> > DerivationFramework::TriggerGenericObjectThinningTool::m_triggerListORHLTOnly {this,"TriggerListORHLTOnly", {}, "Decision is based on HLT only (unseeded triggers)"}
private

Definition at line 47 of file TriggerGenericObjectThinningTool.h.


The documentation for this class was generated from the following files:
DerivationFramework::TriggerGenericObjectThinningTool::m_streamName
StringProperty m_streamName
Definition: TriggerGenericObjectThinningTool.h:40
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
DerivationFramework::TriggerGenericObjectThinningTool::m_triggerListAND
Gaudi::Property< std::vector< std::string > > m_triggerListAND
Definition: TriggerGenericObjectThinningTool.h:45
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
python.utils.AtlRunQueryLookup.mask
string mask
Definition: AtlRunQueryLookup.py:460
SG::ThinningHandle
Handle for requesting thinning for a data object.
Definition: ThinningHandle.h:84
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::TriggerGenericObjectThinningTool::m_triggerListORHLTOnly
Gaudi::Property< std::vector< std::string > > m_triggerListORHLTOnly
Definition: TriggerGenericObjectThinningTool.h:47
DerivationFramework::TriggerGenericObjectThinningTool::m_SGKey
SG::ThinningHandleKey< xAOD::IParticleContainer > m_SGKey
Definition: TriggerGenericObjectThinningTool.h:42
Trig::ChainGroup
Definition: ChainGroup.h:51
DerivationFramework::TriggerGenericObjectThinningTool::m_triggerListOR
Gaudi::Property< std::vector< std::string > > m_triggerListOR
Definition: TriggerGenericObjectThinningTool.h:46
DerivationFramework::TriggerGenericObjectThinningTool::m_trigDec
PublicToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: TriggerGenericObjectThinningTool.h:48
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
DerivationFramework::TriggerGenericObjectThinningTool::eventPassedFilter
bool eventPassedFilter() const
Definition: TriggerGenericObjectThinningTool.cxx:6
python.Constants.VERBOSE
int VERBOSE
Definition: Control/AthenaCommon/python/Constants.py:14
Trig::ChainGroup::getListOfTriggers
std::vector< std::string > getListOfTriggers() const
Definition: ChainGroup.cxx:467
passOR
@ passOR
Definition: SUSYToolsTester.cxx:105