ATLAS Offline Software
TrigEgammaMatchingToolMT.h
Go to the documentation of this file.
1 /*
2  * (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef TrigEgammaMatchingToolMT_H
6 #define TrigEgammaMatchingToolMT_H
7 
8 #include "Gaudi/Property.h"
9 #include "AsgTools/AsgTool.h"
10 #include "AsgTools/ToolHandle.h"
22 
23 
24 
25 
26 
28 
29 {
32 
33  public:
34 
35  TrigEgammaMatchingToolMT( const std::string& name );
36 
37 
39 
41 
42  // check if the offline object passed by HLT step for one specific trigger
43  bool isPassed( const xAOD::Egamma *,const std::string&, unsigned int condition=TrigDefs::Physics ) const;
44 
45  bool match( const xAOD::Egamma *,const std::string&, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
46 
47 
48  template<class T> bool ancestorPassed( const TrigCompositeUtils::Decision*, const std::string& trigger , const std::string& key,
49  unsigned int condition=TrigDefs::Physics ) const;
50 
51 
52 
53  template<class T> TrigCompositeUtils::LinkInfo<T> getFeature( const TrigCompositeUtils::Decision *, const std::string& trigger,
54  unsigned int condition=TrigDefs::Physics ) const;
55  template<class T> std::vector<TrigCompositeUtils::LinkInfo<T>> getFeatures( const TrigCompositeUtils::Decision *, const std::string& trigger ,
56  unsigned int condition=TrigDefs::Physics ) const;
57  template<class T> std::vector<TrigCompositeUtils::LinkInfo<T>> getFeatures( const TrigCompositeUtils::Decision *, const std::string& trigger, const std::string& key ,
58  unsigned int condition=TrigDefs::Physics ) const;
59 
60  // access the feature from the container
63 
64  // access the feature from the container
66  // get the container key
67  std::string key( const std::string& ) const;
68 
69  private:
70 
71  bool matchHLTElectron(const xAOD::Electron *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
72  bool matchHLTPhoton( const xAOD::Photon *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
73  bool matchHLTCalo( const xAOD::Egamma *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
74  bool matchL2Electron( const xAOD::Electron *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
75  bool matchL2Photon( const xAOD::Photon *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
76  bool matchL2Calo( const xAOD::Egamma *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
77  bool matchL1( const xAOD::Egamma *,const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics ) const;
78 
79  template<class T> bool closestObject( const xAOD::Egamma *, const TrigCompositeUtils::Decision *&, const std::string &trigger,
80  const std::string &key, float dR_value, unsigned int condition=TrigDefs::Physics ) const;
81 
82 
83  inline double dR(const double eta1, const double phi1, const double eta2, const double phi2) const
84  {
85  double deta = std::abs(eta1 - eta2);
86  double dphi = std::abs(phi1 - phi2) < TMath::Pi() ? std::abs(phi1 - phi2) : 2*TMath::Pi() - std::abs(phi1 - phi2);
87  return sqrt(deta*deta + dphi*dphi);
88  };
89 
90 
91  std::map<std::string,std::string> m_keys;
92 
93  ToolHandle<Trig::TrigDecisionTool> m_trigDecTool{this, "TriggerTool", ""};
94  const ToolHandle<Trig::TrigDecisionTool>& tdt() const { return m_trigDecTool; };
95 
96  Gaudi::Property<float> m_dR{this, "DeltaR", 0.07};
97  Gaudi::Property<float> m_dRL1{this, "L1DeltaR", 0.15};
98  SG::ReadHandleKey<xAOD::EmTauRoIContainer> m_emTauRoIKey{this, "EmTauRoIKey" , "LVL1EmTauRoIs", ""};
99  SG::ReadHandleKey<xAOD::TrigRingerRingsContainer> m_ringerKey{this, "RingerKey" , "HLT_FastCaloRinger", ""};
100 
101 };
102 
103 
104 
105 
107 
108 #endif
TrigEgammaMatchingToolMT::m_keys
std::map< std::string, std::string > m_keys
Definition: TrigEgammaMatchingToolMT.h:88
TrigRingerRingsContainer.h
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
TrigElectronContainer.h
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
TrigEgammaMatchingToolMT::getL1eEMFeature
const xAOD::eFexEMRoI * getL1eEMFeature(const TrigCompositeUtils::Decision *) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:247
TrigEgammaMatchingToolMT::~TrigEgammaMatchingToolMT
~TrigEgammaMatchingToolMT()=default
TrigEgammaMatchingToolMT::matchHLTPhoton
bool matchHLTPhoton(const xAOD::Photon *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:131
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigDecisionTool.h
LArG4GenerateShowerLib.condition
condition
Definition: LArG4GenerateShowerLib.py:19
TrigEgammaMatchingToolMT::getFeatures
std::vector< TrigCompositeUtils::LinkInfo< T > > getFeatures(const TrigCompositeUtils::Decision *, const std::string &trigger, unsigned int condition=TrigDefs::Physics) const
TrigEgammaMatchingToolMT::dR
double dR(const double eta1, const double phi1, const double eta2, const double phi2) const
Definition: TrigEgammaMatchingToolMT.h:83
xAOD::Egamma_v1
Definition: Egamma_v1.h:56
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
xAOD::eFexEMRoI_v1
Class describing a LVL1 eFEX EM region of interest.
Definition: eFexEMRoI_v1.h:33
TrigEgammaMatchingToolMT::match
bool match(const xAOD::Egamma *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:95
TrigEgammaMatchingToolMT.icc
TrigEgammaMatchingToolMT::matchL2Calo
bool matchL2Calo(const xAOD::Egamma *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:198
EgammaxAODHelpers.h
ElectronContainer.h
TrigEgammaMatchingToolMT::ancestorPassed
bool ancestorPassed(const TrigCompositeUtils::Decision *, const std::string &trigger, const std::string &key, unsigned int condition=TrigDefs::Physics) const
TrigEgammaMatchingToolMT::matchHLTCalo
bool matchHLTCalo(const xAOD::Egamma *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:155
xAOD::EmTauRoI_v2
Class describing a LVL1 em/tau region of interest.
Definition: EmTauRoI_v2.h:35
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ASG_TOOL_CLASS0
#define ASG_TOOL_CLASS0(CLASSNAME)
Definition: AsgToolMacros.h:62
TrigEgammaMatchingToolMT::getL1Feature
const xAOD::EmTauRoI * getL1Feature(const TrigCompositeUtils::Decision *) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:227
TrigPhotonContainer.h
TrigEgammaMatchingToolMT::getRingsFeature
const xAOD::TrigRingerRings * getRingsFeature(const TrigCompositeUtils::Decision *) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:257
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
TrigEgammaMatchingToolMT::m_trigDecTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Definition: TrigEgammaMatchingToolMT.h:93
xAOD::TrigComposite_v1
Class used to describe composite objects in the HLT.
Definition: TrigComposite_v1.h:52
TrigEgammaMatchingToolMT::m_emTauRoIKey
SG::ReadHandleKey< xAOD::EmTauRoIContainer > m_emTauRoIKey
Definition: TrigEgammaMatchingToolMT.h:98
TrigEgammaMatchingToolMT::initialize
StatusCode initialize()
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:33
TrigEgammaMatchingToolMT::TrigEgammaMatchingToolMT
TrigEgammaMatchingToolMT(const std::string &name)
Definition: TrigEgammaMatchingToolMT.cxx:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
TrigEgammaMatchingToolMT::closestObject
bool closestObject(const xAOD::Egamma *, const TrigCompositeUtils::Decision *&, const std::string &trigger, const std::string &key, float dR_value, unsigned int condition=TrigDefs::Physics) const
TrigEgammaMatchingToolMT
Definition: TrigEgammaMatchingToolMT.h:29
TrigEgammaMatchingToolMT::getFeatures
std::vector< TrigCompositeUtils::LinkInfo< T > > getFeatures(const TrigCompositeUtils::Decision *, const std::string &trigger, const std::string &key, unsigned int condition=TrigDefs::Physics) const
xAOD::Electron_v1
Definition: Electron_v1.h:34
EmTauRoIContainer.h
TrigEgammaMatchingToolMT::m_dRL1
Gaudi::Property< float > m_dRL1
Definition: TrigEgammaMatchingToolMT.h:97
TrigEgammaMatchingToolMT::getFeature
TrigCompositeUtils::LinkInfo< T > getFeature(const TrigCompositeUtils::Decision *, const std::string &trigger, unsigned int condition=TrigDefs::Physics) const
xAOD::TrigRingerRings_v2
Definition: TrigRingerRings_v2.h:24
TrigEgammaMatchingToolMT::matchHLTElectron
bool matchHLTElectron(const xAOD::Electron *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:139
TrigEMClusterContainer.h
TrigCompositeUtils::LinkInfo
Helper to keep a Decision object, ElementLink and ActiveState (with respect to some requested ChainGr...
Definition: LinkInfo.h:28
TrigEgammaMatchingToolMT::m_dR
Gaudi::Property< float > m_dR
Definition: TrigEgammaMatchingToolMT.h:96
xAOD::Photon_v1
Definition: Photon_v1.h:37
TrigEgammaMatchingToolMT::matchL2Electron
bool matchL2Electron(const xAOD::Electron *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:186
TrigEgammaMatchingToolMT::m_ringerKey
SG::ReadHandleKey< xAOD::TrigRingerRingsContainer > m_ringerKey
Definition: TrigEgammaMatchingToolMT.h:99
CaloClusterContainer.h
TrigEgammaMatchingToolMT::matchL2Photon
bool matchL2Photon(const xAOD::Photon *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:178
TrigEgammaMatchingToolMT::tdt
const ToolHandle< Trig::TrigDecisionTool > & tdt() const
Definition: TrigEgammaMatchingToolMT.h:94
ToolHandle.h
AsgTool.h
TrigEgammaMatchingToolMT::matchL1
bool matchL1(const xAOD::Egamma *, const std::string &, const TrigCompositeUtils::Decision *&, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:206
TrigEgammaMatchingToolMT::key
std::string key(const std::string &) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:67
TrigEgammaMatchingToolMT::isPassed
bool isPassed(const xAOD::Egamma *, const std::string &, unsigned int condition=TrigDefs::Physics) const
=======================================================================
Definition: TrigEgammaMatchingToolMT.cxx:74
PhotonContainer.h
eFexEMRoIContainer.h
PhysDESDM_Quirks.trigger
trigger
Definition: PhysDESDM_Quirks.py:27