ATLAS Offline Software
TrigMuonMatching.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGMUONEFFICIENCY_MUONEFFICIENCYTOOL_H
6 #define TRIGMUONEFFICIENCY_MUONEFFICIENCYTOOL_H
7 
8 
10 
12 #include "AsgTools/AsgTool.h"
13 #include "AsgTools/ToolHandle.h"
14 #include <iostream>
15 
17 
18 namespace Trig {
19 
21  public asg::AsgMetadataTool,
22  public virtual ITrigMuonMatching
23  {
26 
27  public:
28 
29  TrigMuonMatching( const std::string& name );
30 
31  virtual ~TrigMuonMatching();
32 
33  virtual StatusCode initialize(void) override;
34 
35  virtual Bool_t match(const xAOD::Muon* mu,
36  const std::string &chain,
37  const double mindelR = 0.1) const override;
38 
39  virtual Bool_t matchL1(const xAOD::Muon* mu,
40  const std::string &l1item,
41  const double DelR = 0.2) const override;
42 
43  virtual Bool_t matchL2SA(const xAOD::Muon* mu,
44  const std::string &l1item,
45  const std::string & chain,
46  const double DelR = 0.2) const override;
47 
48  virtual Bool_t matchL2CB(const xAOD::Muon* mu,
49  const std::string & chain,
50  const double DelR = 0.2) const override;
51 
52  virtual Double_t minDelR(const xAOD::Muon* mu,
53  const std::string &chain,
54  const double mindelR = 0.1) const override;
55 
56  virtual Double_t minDelRL1(const xAOD::Muon* mu,
57  const std::string &l1item,
58  const double DelR = 0.2) const override;
59 
60  virtual Bool_t matchDimuon(const xAOD::Muon* mu1,
61  const xAOD::Muon* mu2,
62  const std::string& chain,
63  std::pair<Bool_t, Bool_t>& result1,
64  std::pair<Bool_t, Bool_t>& result2,
65  const Double_t& mindelR = 0.1) override;
66 
67  virtual Bool_t match(const double eta,
68  const double phi,
69  const std::string &chain,
70  const double mindelR = 0.1) const override;
71 
72  virtual Bool_t matchL1(const double eta,
73  const double phi,
74  const std::string &l1item,
75  const double DelR = 0.2) const override;
76 
77  virtual Bool_t matchDimuon(const TLorentzVector& muon1,
78  const TLorentzVector& muon2,
79  const std::string& chain,
80  std::pair<Bool_t, Bool_t>& result1,
81  std::pair<Bool_t, Bool_t>& result2,
82  const Double_t& mindelR = 0.1) override;
83 
84  virtual Bool_t isPassedRerun(const std::string& trigger) const override;
85 
86  struct EFmuon {
87  bool valid;
88  float pt;
89  float eta;
90  float phi;
91 
92  EFmuon() : valid(false), pt(-1.e30), eta(-1.e30), phi(-1.e30) {}
93  };
94 
95  private:
96 
97  ToolHandle<Trig::TrigDecisionTool> m_trigDecTool;
98 
99  std::map<std::string, DimuonChainInfo> m_DimuonChainMap;
100 
101  std::pair<bool,bool> matchDimuon(const TLorentzVector& muon1,
102  const TLorentzVector& muon2,
103  const DimuonChainInfo& chainInfo,
104  const double mindelR);
105 
106  double dR(const double eta1,
107  const double phi1,
108  const double eta2,
109  const double phi2) const;
110 
111  int getL1pt(const std::string& l1item) const;
112 
113  void tokenize(const std::string& str,
114  std::vector<std::string>& tokens,
115  const std::string& delimiters) const;
116 
117  /*
118  double matchedTrackDetail(const double eta,
119  const double phi,
120  const std::string chain,
121  const std::string l1item);
122  */
123 
124  Double_t matchedTrackDetail(EFmuon& efMuonId,
125  const EFmuon& usedEFMuonId,
126  const double eta,
127  const double phi,
128  const double mindelR,
129  const std::string& chainEventTrigger) const;
130 
131  bool decodeDimuonChain(DimuonChainInfo& chainInfo);
132 
133  bool isEqual(const double x,
134  const double y) const;
135 
136 
137  };
138 }
139 
140 #endif
Trig::TrigMuonMatching::initialize
virtual StatusCode initialize(void) override
Definition: TrigMuonMatching.cxx:32
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
ParticleGun_SamplingFraction.eta2
eta2
Definition: ParticleGun_SamplingFraction.py:96
Trig::TrigMuonMatching::EFmuon::eta
float eta
Definition: TrigMuonMatching.h:89
Trig::TrigMuonMatching
Definition: TrigMuonMatching.h:23
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
ASG_TOOL_CLASS2
#define ASG_TOOL_CLASS2(CLASSNAME, INT1, INT2)
Definition: AsgToolMacros.h:77
Trig::TrigMuonMatching::matchL1
virtual Bool_t matchL1(const xAOD::Muon *mu, const std::string &l1item, const double DelR=0.2) const override
Definition: TrigMuonMatching.cxx:48
xAOD::eta1
setEt setPhi setE277 setWeta2 eta1
Definition: TrigEMCluster_v1.cxx:41
TrigDecisionTool.h
beamspotman.tokens
tokens
Definition: beamspotman.py:1284
x
#define x
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
Trig::TrigMuonMatching::isEqual
bool isEqual(const double x, const double y) const
Definition: TrigMuonMatching.cxx:442
Trig::TrigMuonMatching::m_DimuonChainMap
std::map< std::string, DimuonChainInfo > m_DimuonChainMap
Definition: TrigMuonMatching.h:99
Trig::TrigMuonMatching::dR
double dR(const double eta1, const double phi1, const double eta2, const double phi2) const
Definition: TrigMuonMatching.cxx:281
Trig::TrigMuonMatching::match
virtual Bool_t match(const xAOD::Muon *mu, const std::string &chain, const double mindelR=0.1) const override
Definition: TrigMuonMatching.cxx:41
Trig::TrigMuonMatching::m_trigDecTool
ToolHandle< Trig::TrigDecisionTool > m_trigDecTool
Definition: TrigMuonMatching.h:97
Trig::TrigMuonMatching::matchedTrackDetail
Double_t matchedTrackDetail(EFmuon &efMuonId, const EFmuon &usedEFMuonId, const double eta, const double phi, const double mindelR, const std::string &chainEventTrigger) const
Definition: TrigMuonMatching.cxx:339
Trig::TrigMuonMatching::getL1pt
int getL1pt(const std::string &l1item) const
Definition: TrigMuonMatching.cxx:293
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ASG_TOOL_INTERFACE
#define ASG_TOOL_INTERFACE(CLASSNAME)
Definition: AsgToolMacros.h:40
Trig::TrigMuonMatching::EFmuon::EFmuon
EFmuon()
Definition: TrigMuonMatching.h:92
Trig::TrigMuonMatching::EFmuon::pt
float pt
Definition: TrigMuonMatching.h:88
Trig::TrigMuonMatching::~TrigMuonMatching
virtual ~TrigMuonMatching()
Definition: TrigMuonMatching.cxx:29
Trig::TrigMuonMatching::matchL2SA
virtual Bool_t matchL2SA(const xAOD::Muon *mu, const std::string &l1item, const std::string &chain, const double DelR=0.2) const override
Definition: TrigMuonMatching.cxx:147
DimuonChainInfo
Definition: ITrigMuonMatching.h:13
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ITrigMuonMatching.h
Trig::TrigMuonMatching::minDelR
virtual Double_t minDelR(const xAOD::Muon *mu, const std::string &chain, const double mindelR=0.1) const override
Definition: TrigMuonMatching.cxx:55
Trig::TrigMuonMatching::minDelRL1
virtual Double_t minDelRL1(const xAOD::Muon *mu, const std::string &l1item, const double DelR=0.2) const override
Definition: TrigMuonMatching.cxx:64
Trig::TrigMuonMatching::matchDimuon
virtual Bool_t matchDimuon(const xAOD::Muon *mu1, const xAOD::Muon *mu2, const std::string &chain, std::pair< Bool_t, Bool_t > &result1, std::pair< Bool_t, Bool_t > &result2, const Double_t &mindelR=0.1) override
Definition: TrigMuonMatching.cxx:89
y
#define y
asg::AsgMetadataTool
Base class for dual-use tools that provide file metadata access.
Definition: AsgMetadataTool.h:48
Trig::TrigMuonMatching::EFmuon::phi
float phi
Definition: TrigMuonMatching.h:90
Trig::TrigMuonMatching::decodeDimuonChain
bool decodeDimuonChain(DimuonChainInfo &chainInfo)
Definition: TrigMuonMatching.cxx:407
AsgMetadataTool.h
Trig::TrigMuonMatching::isPassedRerun
virtual Bool_t isPassedRerun(const std::string &trigger) const override
Definition: TrigMuonMatching.cxx:242
str
Definition: BTagTrackIpAccessor.cxx:11
Trig::ITrigMuonMatching
Definition: ITrigMuonMatching.h:29
ToolHandle.h
Trig::TrigMuonMatching::TrigMuonMatching
TrigMuonMatching(const std::string &name)
Definition: TrigMuonMatching.cxx:22
AsgTool.h
Trig::TrigMuonMatching::tokenize
void tokenize(const std::string &str, std::vector< std::string > &tokens, const std::string &delimiters) const
Definition: TrigMuonMatching.cxx:323
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
Trig::TrigMuonMatching::EFmuon
Definition: TrigMuonMatching.h:86
Trig::TrigMuonMatching::matchL2CB
virtual Bool_t matchL2CB(const xAOD::Muon *mu, const std::string &chain, const double DelR=0.2) const override
Definition: TrigMuonMatching.cxx:190
Trig::TrigMuonMatching::EFmuon::valid
bool valid
Definition: TrigMuonMatching.h:87