ATLAS Offline Software
MuonSelector.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef IDPERFMON_MUONSELECTOR_H
6 #define IDPERFMON_MUONSELECTOR_H
7 
8 //==============================================================================
9 // Include files...
10 //==============================================================================
12 
13 #include <map>
14 #include "TH1.h"
15 
16 #include "xAODMuon/Muon.h"
17 #include "xAODTracking/Vertex.h"
19 #include <atomic>
20 #include "GaudiKernel/ServiceHandle.h"
21 #include "AsgTools/ToolHandle.h"
22 #include "AsgTools/AnaToolHandle.h"
24 
25 
26 #include "CLHEP/Units/SystemOfUnits.h"
27 #include "CLHEP/Units/PhysicalConstants.h"
28 
30 //==============================================================================
31 // Forward class declarations...
32 //==============================================================================
34 {
35  public:
36  MuonSelector();
37  ~MuonSelector();
38 
39  MuonSelector (const MuonSelector&) = delete;
41 
42  // for some cases one may need ATLAS_NOT_REENTRANT
43  bool passSelection ( const xAOD::Muon* pxMuon );
44  void setDebug(bool debug){m_doDebug = debug;}
45  ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool;
46 
47 
48  // Override functions from EventAnalysis
49  virtual void Init();
50  inline void doIsoSelection (bool doIso) {m_doIsoSelection = doIso;}
51  inline void doIPSelection (bool doIPsel) {m_doIPSelection = doIPsel;}
52  inline void doMCPSelection (bool domcp) {m_doMCPSelection = domcp;}
53  virtual void finalize();
54  inline void SetPtCut (double newvalue) {m_combPtCut = newvalue;}
55  inline double GetPtCut () {return m_combPtCut;}
56  virtual bool Reco();
57  void SetMuonQualityRequirement (std::string newname);
58  void SetCustomMuonSelectionTool (ToolHandle<CP::IMuonSelectionTool> mst) { m_muonSelectionTool = mst; };
59 
60  protected:
61  virtual void BookHistograms();
62 
63  private:
65 
66  //static unsigned int s_uNumInstances;
67  unsigned int m_uNumInstances = 0U;
68 
69  bool passQualCuts ();
70  bool passPtCuts ();
71  bool passIsolCuts ();
72  bool passIPCuts ();
73 
74  // message stream
75  MsgStream * m_msgStream;
76 
77  // Class variables
79 
80  // requested muon tag (tight, medium, loose..)
82 
83  // TrackIsolationTool* m_isolationTool;
84  double m_coneSize{};
85 
86 
87  // Cut variables. To go into a struct.
88  unsigned char m_ucJMuon_Cut;
89  double m_IsoCut;
90 
92  float m_fEtaCut;
93 
94  double m_combPtCut;
95  float m_ptMSCut;
96  float m_diffZCut; // mm
97  float m_diffPtCut;
98  float m_pVZCut; // mm
99 
100 
101  float m_fIDPtCut;
104  unsigned char m_ucID_PIXCut;
105  unsigned char m_ucID_SCTCut;
106  unsigned char m_ucID_TRTCut;
107 
108  bool m_doDebug;
114 
115  // Lock cut selection after first muon.
116  bool m_bLock;
117 
118  // stats
119  unsigned int m_testedmuons{};
120  unsigned int m_passqual{};
121  unsigned int m_passiso{};
122  unsigned int m_passpt{};
123  unsigned int m_passip{};
124  unsigned int m_passmcp{};
125  unsigned int m_passall{};
126 
127  // Graphs
129  {
132  };
133 
134 };
135 
136 #endif
MuonSelector::m_coneSize
double m_coneSize
Definition: MuonSelector.h:84
MuonSelector::m_doDebug
bool m_doDebug
Definition: MuonSelector.h:108
MuonSelector::ECONE
@ ECONE
Definition: MuonSelector.h:130
MuonSelector::m_pVZCut
float m_pVZCut
Definition: MuonSelector.h:98
MuonSelector::m_passmcp
unsigned int m_passmcp
Definition: MuonSelector.h:124
EventAnalysis.h
MuonSelector::m_fIDChiPerDofCut
float m_fIDChiPerDofCut
Definition: MuonSelector.h:102
MuonSelector::MuonSelector
MuonSelector(const MuonSelector &)=delete
Muon.h
MuonSelector::m_msgStream
MsgStream * m_msgStream
Definition: MuonSelector.h:75
MuonSelector::m_ptMSCut
float m_ptMSCut
Definition: MuonSelector.h:95
MuonSelector::PARENT
EventAnalysis PARENT
Definition: MuonSelector.h:64
MuonSelector::m_passip
unsigned int m_passip
Definition: MuonSelector.h:123
MuonSelector::m_ucID_SCTCut
unsigned char m_ucID_SCTCut
Definition: MuonSelector.h:105
MuonSelector::NCSC
@ NCSC
Definition: MuonSelector.h:130
EventAnalysis
Definition: EventAnalysis.h:32
MuonSelector::m_ucID_TRTCut
unsigned char m_ucID_TRTCut
Definition: MuonSelector.h:106
MuonSelector::m_passpt
unsigned int m_passpt
Definition: MuonSelector.h:122
MuonSelector::operator=
MuonSelector & operator=(const MuonSelector &)=delete
PerfMonServices.h
MuonSelector::m_bCutOnCombKine
bool m_bCutOnCombKine
Definition: MuonSelector.h:91
MuonSelector::m_ucID_PIXCut
unsigned char m_ucID_PIXCut
Definition: MuonSelector.h:104
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
MuonSelector::m_muonSelectionTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Definition: MuonSelector.h:45
MuonSelector::m_pxMuon
const xAOD::Muon * m_pxMuon
Definition: MuonSelector.h:78
MuonSelector::passPtCuts
bool passPtCuts()
Definition: MuonSelector.cxx:274
MuonSelector::NMDT
@ NMDT
Definition: MuonSelector.h:130
MuonSelector::setDebug
void setDebug(bool debug)
Definition: MuonSelector.h:44
IMuonSelectionTool.h
MuonSelector::m_uNumInstances
unsigned int m_uNumInstances
Definition: MuonSelector.h:67
MuonSelector::m_doPtSelection
bool m_doPtSelection
Definition: MuonSelector.h:111
MuonSelector::passIPCuts
bool passIPCuts()
Definition: MuonSelector.cxx:349
MuonSelector::SetCustomMuonSelectionTool
void SetCustomMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
Definition: MuonSelector.h:58
MuonSelector::m_diffPtCut
float m_diffPtCut
Definition: MuonSelector.h:97
MuonSelector::NUM_1HISTOS
@ NUM_1HISTOS
Definition: MuonSelector.h:131
MuonSelector::m_requestedMuonQuality
int m_requestedMuonQuality
Definition: MuonSelector.h:81
MuonSelector::doMCPSelection
void doMCPSelection(bool domcp)
Definition: MuonSelector.h:52
MuonSelector::m_combPtCut
double m_combPtCut
Definition: MuonSelector.h:94
MuonSelector::Reco
virtual bool Reco()
Definition: MuonSelector.cxx:129
MuonSelector::m_fIDPtCut
float m_fIDPtCut
Definition: MuonSelector.h:101
MuonSelector::m_IDSiHitsCut
int m_IDSiHitsCut
Definition: MuonSelector.h:103
MuonSelector::doIsoSelection
void doIsoSelection(bool doIso)
Definition: MuonSelector.h:50
MuonSelector::Init
virtual void Init()
Definition: MuonSelector.cxx:112
MuonSelector::m_IsoCut
double m_IsoCut
Definition: MuonSelector.h:89
MuonSelector::m_ucJMuon_Cut
unsigned char m_ucJMuon_Cut
Definition: MuonSelector.h:88
MuonSelector::m_testedmuons
unsigned int m_testedmuons
Definition: MuonSelector.h:119
MuonSelector::GetPtCut
double GetPtCut()
Definition: MuonSelector.h:55
MuonSelector::HISTOS_1D
HISTOS_1D
Definition: MuonSelector.h:129
MuonSelector::m_doIsoSelection
bool m_doIsoSelection
Definition: MuonSelector.h:110
Vertex.h
MuonSelector::SetMuonQualityRequirement
void SetMuonQualityRequirement(std::string newname)
Definition: MuonSelector.cxx:468
MuonSelector::passQualCuts
bool passQualCuts()
Definition: MuonSelector.cxx:219
MuonSelector
Definition: MuonSelector.h:34
AnaToolHandle.h
MuonSelector::m_doQualSelection
bool m_doQualSelection
Definition: MuonSelector.h:109
MuonSelector::m_doMCPSelection
bool m_doMCPSelection
Definition: MuonSelector.h:113
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
MuonSelector::MuonSelector
MuonSelector()
Definition: MuonSelector.cxx:43
MuonSelector::m_diffZCut
float m_diffZCut
Definition: MuonSelector.h:96
MuonSelector::passSelection
bool passSelection(const xAOD::Muon *pxMuon)
Definition: MuonSelector.cxx:136
MuonSelector::SetPtCut
void SetPtCut(double newvalue)
Definition: MuonSelector.h:54
MuonSelector::doIPSelection
void doIPSelection(bool doIPsel)
Definition: MuonSelector.h:51
MuonSelector::m_passiso
unsigned int m_passiso
Definition: MuonSelector.h:121
VertexContainer.h
MuonSelector::passIsolCuts
bool passIsolCuts()
Definition: MuonSelector.cxx:320
MuonSelector::m_doIPSelection
bool m_doIPSelection
Definition: MuonSelector.h:112
MuonSelector::~MuonSelector
~MuonSelector()
Definition: MuonSelector.cxx:105
MuonSelector::m_bLock
bool m_bLock
Definition: MuonSelector.h:116
MuonSelector::BookHistograms
virtual void BookHistograms()
Definition: MuonSelector.cxx:211
createCoolChannelIdFile.newname
newname
Definition: createCoolChannelIdFile.py:106
MuonSelector::m_passall
unsigned int m_passall
Definition: MuonSelector.h:125
ToolHandle.h
MuonSelector::m_fEtaCut
float m_fEtaCut
Definition: MuonSelector.h:92
MuonSelector::finalize
virtual void finalize()
Definition: MuonSelector.cxx:451
MuonSelector::m_passqual
unsigned int m_passqual
Definition: MuonSelector.h:120