ATLAS Offline Software
ZmumuEvent.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_ZMUMUEVENT_H
6 #define IDPERFMON_ZMUMUEVENT_H
7 
8 //==============================================================================
9 // Include files...
10 //==============================================================================
11 #include "CLHEP/Vector/LorentzVector.h"
13 
16 
17 #include "AsgTools/ToolHandle.h"
19 //==============================================================================
20 // Forward class declarations...
21 //==============================================================================
22 class TrackParticle;
23 
24 //==============================================================================
25 // Class declaration...
26 //==============================================================================
27 class ZmumuEvent : public EventAnalysis
28 {
29  public:
30  ZmumuEvent();
31  virtual ~ZmumuEvent();
32 
33  enum
34  {
39  NUM_MUONS
40  };
41 
42  enum
43  {
47  UNDEF
48  };
49 
50  enum ZTYPE
51  {
52  MS, // Just the muon system ( uncorrected )
53  ME, // The adjusted muon system properties ( corr. for cal. )
54  ID, // Using the ID system.
55  CB, // Using both the muon & ID system.
56  NUM_TYPES
57  };
58 
59  virtual void Init();
60  // virtual bool Reco ATLAS_NOT_REENTRANT ();
61  virtual bool Reco (int theLumiBlock = 0);
62 
63  // Public access methods
64  inline void doIsoSelection (bool doIso) { m_xMuonID.doIsoSelection(doIso); }
65  inline void doIPSelection (bool doIPsel) { m_xMuonID.doIPSelection(doIPsel); }
66  inline void doMCPSelection (bool doMCP) { m_xMuonID.doMCPSelection(doMCP); }
67  inline bool AcceptEvent() { return m_passedSelectionCuts; }
68  void finalize();
69  inline unsigned int getAcceptedEvents () { return m_acceptedEventCount; }
70  const xAOD::Muon* getCombMuon( unsigned int uPart ) { return (uPart < NUM_MUONS) ? m_pxRecMuon[uPart] : NULL; }
71  const xAOD::TrackParticle* getIDTrack ( unsigned int uPart ) { return (uPart < NUM_MUONS) ? m_pxIDTrack[uPart] : NULL; }
72  inline double GetInvMass () {return m_DiMuonPairInvMass;}
73  const float& getLeptonOpeningAngle( ZTYPE eType ) { return m_fMuonDispersion[eType]; }
74  const xAOD::TrackParticle* getLooseIDTk ATLAS_NOT_REENTRANT ( unsigned int uPart );
75  const xAOD::TrackParticle* getMSTrack ( unsigned int uPart ) { return (uPart < NUM_MUONS) ? m_pxMSTrack[uPart] : NULL; }
76  unsigned int getNegMuon( ZTYPE eType );
77  inline unsigned int getNumberOfTaggedMuons() { return m_numberOfFullPassMuons; }
78  unsigned int getPosMuon( ZTYPE eType );
79  float getPtImbalance( ZTYPE eType );
80  const std::string getRegion() const ;
81  inline unsigned int getTestedMuonCount() { return m_testedMuonCount; }
82  int getZCharge( ZTYPE eType );
83  const float& getZEta( ZTYPE eType ) { return m_fZEtaDir[eType]; }
84  const float& getZMass( ZTYPE eType ) { return m_fInvariantMass[eType]; }
85  const float& getZPhi( ZTYPE eType ) { return m_fZPhiDir[eType]; }
86  const float& getZPt( ZTYPE eType ) { return m_fZPt[eType]; }
87  void OrderMuonList ();
88  inline void setDebugMode (bool debug) { m_doDebug=debug; }
89  inline void SetMaxLumiBlock (int newlumiblock) { m_maxGoodLumiBlock = newlumiblock; }
90  inline void SetMinLumiBlock (int newlumiblock) { m_minGoodLumiBlock = newlumiblock; }
91  inline void SetMuonPtCut (double newvalue) { m_xMuonID.SetPtCut(newvalue); }
92  inline void SetMuonQuality (const std::string& newname) { m_xMuonID.SetMuonQualityRequirement(newname); }
93 
94  inline void SetMassWindowLow (double newvalue) { m_MassWindowLow = newvalue; }
95  inline void SetMassWindowHigh (double newvalue) { m_MassWindowHigh = newvalue; }
96  void SetLeadingMuonPtCut (double newvalue);
97  void SetSecondMuonPtCut (double newvalue);
98  inline void SetOpeningAngleCut (double newvalue) {m_OpeningAngleCut = newvalue;}
99  inline void SetZ0GapCut (double newvalue) {m_Z0GapCut = newvalue;}
100  inline void SetSkipMSCheck (bool value) {m_skipMScheck = value;}
101 
102  inline void setContainer ( PerfMonServices::CONTAINERS container) { m_container = container; };
103  inline void SetMuonSelectionTool ( ToolHandle<CP::IMuonSelectionTool> mst ) { m_muonSelectionTool = mst; m_xMuonID.SetCustomMuonSelectionTool (mst); };
104 
105  protected:
106  virtual void BookHistograms();
107 
108  private:
110 
111  // Private methods
112  void Clear();
113  bool EventSelection (ZTYPE eType);
114  void ReconstructKinematics();
115  bool RecordMuon( const xAOD::Muon* pxMuon );
116 
117  // Active mu-cuts for the analysis
120  ToolHandle<CP::IMuonSelectionTool> m_muonSelectionTool;
121 
122  // Tag Setup variables
123  unsigned int m_uMuonTags;
124  unsigned int m_uTrackMatch;
126  double m_etaCut;
127  double m_DiMuonPairInvMass = 0.0;
128 
134  double m_Z0GapCut;
138 
139  bool m_doDebug;
140  // Member variables : Mostly to store relevant muon data for quick access.
141  unsigned int m_numberOfFullPassMuons{};
146  unsigned int m_acceptedEventCount{};
147  unsigned int m_testedMuonCount{};
148  unsigned int m_acceptedMuonCount{};
158 
159 
161  const xAOD::TrackParticle* m_pxMETrack[NUM_MUONS]{}; // Pointer to muon spectro ( corr. )
162  const xAOD::TrackParticle* m_pxMSTrack[NUM_MUONS]{}; // Pointer to muon spectro
163  const xAOD::TrackParticle* m_pxIDTrack[NUM_MUONS]{}; // Pointer to ID track
164 
165  // Keep kinematic information on the Z
166  float m_fZPt[NUM_TYPES]{};
171 
172  // Graphs
174  {
177  };
178 
179  // muon selector configuration
182 
183  // selected muon identifiers
184  int m_muon1 = 0;
185  int m_muon2 = 0;
186 
187 };
188 //==============================================================================
189 #endif
ZmumuEvent::m_fZPhiDir
float m_fZPhiDir[NUM_TYPES]
Definition: ZmumuEvent.h:168
ZmumuEvent::m_minGoodLumiBlock
int m_minGoodLumiBlock
Definition: ZmumuEvent.h:136
ZmumuEvent::Init
virtual void Init()
Definition: ZmumuEvent.cxx:85
ZmumuEvent::m_fZPt
float m_fZPt[NUM_TYPES]
Definition: ZmumuEvent.h:166
ZmumuEvent::getZMass
const float & getZMass(ZTYPE eType)
Definition: ZmumuEvent.h:84
ZmumuEvent::PARENT
EventAnalysis PARENT
Definition: ZmumuEvent.h:109
ZmumuEvent::m_pxIDTrack
const xAOD::TrackParticle * m_pxIDTrack[NUM_MUONS]
Definition: ZmumuEvent.h:163
ZmumuEvent::m_numberOfFullPassMuons
unsigned int m_numberOfFullPassMuons
Definition: ZmumuEvent.h:141
ZmumuEvent::m_LeadingMuonPtCut
double m_LeadingMuonPtCut
Definition: ZmumuEvent.h:129
EventAnalysis.h
ZmumuEvent::getRegion
const std::string getRegion() const
Definition: ZmumuEvent.cxx:95
ZmumuEvent::m_uTrackMatch
unsigned int m_uTrackMatch
Definition: ZmumuEvent.h:124
ZmumuEvent::getPtImbalance
float getPtImbalance(ZTYPE eType)
Definition: ZmumuEvent.cxx:456
ZmumuEvent::Clear
void Clear()
Definition: ZmumuEvent.cxx:361
ZmumuEvent::m_fZEtaDir
float m_fZEtaDir[NUM_TYPES]
Definition: ZmumuEvent.h:167
ZmumuEvent::m_Z0GapCut
double m_Z0GapCut
Definition: ZmumuEvent.h:134
ZmumuEvent::m_eventselectioncount_ptofleadingmuon
unsigned int m_eventselectioncount_ptofleadingmuon
Definition: ZmumuEvent.h:152
ZmumuEvent::m_acceptedMuonCount
unsigned int m_acceptedMuonCount
Definition: ZmumuEvent.h:148
ZmumuEvent::getMSTrack
const xAOD::TrackParticle * getMSTrack(unsigned int uPart)
Definition: ZmumuEvent.h:75
ZmumuEvent::m_eventselectioncount_masswindow
unsigned int m_eventselectioncount_masswindow
Definition: ZmumuEvent.h:154
ZmumuEvent::m_pxRecMuon
const xAOD::Muon * m_pxRecMuon[NUM_MUONS]
Definition: ZmumuEvent.h:160
ZmumuEvent::MS
@ MS
Definition: ZmumuEvent.h:52
EventAnalysis
Definition: EventAnalysis.h:32
MuonSelector.h
ZmumuEvent::m_uMuonTags
unsigned int m_uMuonTags
Definition: ZmumuEvent.h:123
athena.value
value
Definition: athena.py:124
ZmumuEvent::m_MassWindowHigh
double m_MassWindowHigh
Definition: ZmumuEvent.h:132
ZmumuEvent::MUON1
@ MUON1
Definition: ZmumuEvent.h:35
ZmumuEvent::m_eventselectioncount_goodlumiblock
unsigned int m_eventselectioncount_goodlumiblock
Definition: ZmumuEvent.h:157
ZmumuEvent::m_doDebug
bool m_doDebug
Definition: ZmumuEvent.h:139
ZmumuEvent::EventSelection
bool EventSelection(ZTYPE eType)
Definition: ZmumuEvent.cxx:218
ZmumuEvent::m_OpeningAngleCut
double m_OpeningAngleCut
Definition: ZmumuEvent.h:133
ZmumuEvent::getZPt
const float & getZPt(ZTYPE eType)
Definition: ZmumuEvent.h:86
PerfMonServices.h
ZmumuEvent::getAcceptedEvents
unsigned int getAcceptedEvents()
Definition: ZmumuEvent.h:69
ZmumuEvent::getNegMuon
unsigned int getNegMuon(ZTYPE eType)
Definition: ZmumuEvent.cxx:549
ZmumuEvent::ME
@ ME
Definition: ZmumuEvent.h:53
ZmumuEvent::MUON3_OVR1
@ MUON3_OVR1
Definition: ZmumuEvent.h:37
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
ZmumuEvent::m_muon1
int m_muon1
Definition: ZmumuEvent.h:184
ZmumuEvent::SetMaxLumiBlock
void SetMaxLumiBlock(int newlumiblock)
Definition: ZmumuEvent.h:89
ZmumuEvent::FORWARD
@ FORWARD
Definition: ZmumuEvent.h:45
ZmumuEvent::m_bLooseMatch
bool m_bLooseMatch
Definition: ZmumuEvent.h:125
ZmumuEvent::SetMuonPtCut
void SetMuonPtCut(double newvalue)
Definition: ZmumuEvent.h:91
xAOD::TrackParticle
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Definition: Event/xAOD/xAODTracking/xAODTracking/TrackParticle.h:13
ZmumuEvent::m_testedMuonCount
unsigned int m_testedMuonCount
Definition: ZmumuEvent.h:147
IMuonSelectionTool.h
ZmumuEvent::m_fMuonDispersion
float m_fMuonDispersion[NUM_TYPES]
Definition: ZmumuEvent.h:170
MuonSelector::SetCustomMuonSelectionTool
void SetCustomMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
Definition: MuonSelector.h:58
ZmumuEvent::ZMASS_TRACK
@ ZMASS_TRACK
Definition: ZmumuEvent.h:175
ZmumuEvent::m_container
PerfMonServices::CONTAINERS m_container
Definition: ZmumuEvent.h:119
ZmumuEvent::m_passedSelectionCuts
bool m_passedSelectionCuts
Definition: ZmumuEvent.h:142
MuonSelector::doMCPSelection
void doMCPSelection(bool domcp)
Definition: MuonSelector.h:52
ZmumuEvent::BookHistograms
virtual void BookHistograms()
Definition: ZmumuEvent.cxx:211
ZmumuEvent::m_eventselectioncount_morethantwomuons
unsigned int m_eventselectioncount_morethantwomuons
Definition: ZmumuEvent.h:151
ZmumuEvent::m_skipMScheck
bool m_skipMScheck
Definition: ZmumuEvent.h:135
ZmumuEvent::m_SecondMuonPtCut
double m_SecondMuonPtCut
Definition: ZmumuEvent.h:130
ZmumuEvent::m_fInvariantMass
float m_fInvariantMass[NUM_TYPES]
Definition: ZmumuEvent.h:169
ZmumuEvent::m_SelectMuonByIP
bool m_SelectMuonByIP
Definition: ZmumuEvent.h:181
ZmumuEvent::m_pxMETrack
const xAOD::TrackParticle * m_pxMETrack[NUM_MUONS]
Definition: ZmumuEvent.h:161
ZmumuEvent::HISTOS_1D
HISTOS_1D
Definition: ZmumuEvent.h:174
ZmumuEvent::ZMASS_MUON
@ ZMASS_MUON
Definition: ZmumuEvent.h:175
MuonSelector::doIsoSelection
void doIsoSelection(bool doIso)
Definition: MuonSelector.h:50
ZmumuEvent::getIDTrack
const xAOD::TrackParticle * getIDTrack(unsigned int uPart)
Definition: ZmumuEvent.h:71
ZmumuEvent::m_muonSelectionTool
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Definition: ZmumuEvent.h:120
ZmumuEvent
Definition: ZmumuEvent.h:28
ZmumuEvent::NUM_TYPES
@ NUM_TYPES
Definition: ZmumuEvent.h:56
ZmumuEvent::getZEta
const float & getZEta(ZTYPE eType)
Definition: ZmumuEvent.h:83
ZmumuEvent::m_DiMuonPairInvMass
double m_DiMuonPairInvMass
Definition: ZmumuEvent.h:127
ZmumuEvent::AcceptEvent
bool AcceptEvent()
Definition: ZmumuEvent.h:67
ZmumuEvent::~ZmumuEvent
virtual ~ZmumuEvent()
Definition: ZmumuEvent.cxx:80
PerfMonServices::CONTAINERS
CONTAINERS
Definition: PerfMonServices.h:22
ZmumuEvent::doMCPSelection
void doMCPSelection(bool doMCP)
Definition: ZmumuEvent.h:66
ZmumuEvent::getCombMuon
const xAOD::Muon * getCombMuon(unsigned int uPart)
Definition: ZmumuEvent.h:70
MuonSelector::SetMuonQualityRequirement
void SetMuonQualityRequirement(std::string newname)
Definition: MuonSelector.cxx:468
ZmumuEvent::m_acceptedEventCount
unsigned int m_acceptedEventCount
Definition: ZmumuEvent.h:146
MuonSelector
Definition: MuonSelector.h:34
ZmumuEvent::RecordMuon
bool RecordMuon(const xAOD::Muon *pxMuon)
Definition: ZmumuEvent.cxx:386
ZmumuEvent::ID
@ ID
Definition: ZmumuEvent.h:54
ZmumuEvent::getLeptonOpeningAngle
const float & getLeptonOpeningAngle(ZTYPE eType)
Definition: ZmumuEvent.h:73
ZmumuEvent::ATLAS_NOT_REENTRANT
const xAOD::TrackParticle *getLooseIDTk ATLAS_NOT_REENTRANT(unsigned int uPart)
ZmumuEvent::m_eventsWithEnoughMuonsCount
unsigned int m_eventsWithEnoughMuonsCount
Definition: ZmumuEvent.h:145
ZmumuEvent::m_eventselectioncount_openingangle
unsigned int m_eventselectioncount_openingangle
Definition: ZmumuEvent.h:155
ZmumuEvent::doIPSelection
void doIPSelection(bool doIPsel)
Definition: ZmumuEvent.h:65
ZmumuEvent::setDebugMode
void setDebugMode(bool debug)
Definition: ZmumuEvent.h:88
ZmumuEvent::ZTYPE
ZTYPE
Definition: ZmumuEvent.h:51
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
ZmumuEvent::SetMuonSelectionTool
void SetMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
Definition: ZmumuEvent.h:103
ZmumuEvent::getZPhi
const float & getZPhi(ZTYPE eType)
Definition: ZmumuEvent.h:85
ZmumuEvent::m_analyzedEventCount
int m_analyzedEventCount
Definition: ZmumuEvent.h:143
ZmumuEvent::doIsoSelection
void doIsoSelection(bool doIso)
Definition: ZmumuEvent.h:64
ZmumuEvent::m_xMuonID
MuonSelector m_xMuonID
Definition: ZmumuEvent.h:118
ZmumuEvent::m_eventselectioncount_toofewmuons
unsigned int m_eventselectioncount_toofewmuons
Definition: ZmumuEvent.h:149
ZmumuEvent::MUON2
@ MUON2
Definition: ZmumuEvent.h:36
ZmumuEvent::m_eventsWithoutEnoughMuonsCount
unsigned int m_eventsWithoutEnoughMuonsCount
Definition: ZmumuEvent.h:144
ZmumuEvent::SetSecondMuonPtCut
void SetSecondMuonPtCut(double newvalue)
Definition: ZmumuEvent.cxx:617
MuonSelector::SetPtCut
void SetPtCut(double newvalue)
Definition: MuonSelector.h:54
ZmumuEvent::SetMuonQuality
void SetMuonQuality(const std::string &newname)
Definition: ZmumuEvent.h:92
ZmumuEvent::ReconstructKinematics
void ReconstructKinematics()
Definition: ZmumuEvent.cxx:429
ZmumuEvent::BACKWARD
@ BACKWARD
Definition: ZmumuEvent.h:46
ZmumuEvent::SetLeadingMuonPtCut
void SetLeadingMuonPtCut(double newvalue)
Definition: ZmumuEvent.cxx:600
ZmumuEvent::SetMinLumiBlock
void SetMinLumiBlock(int newlumiblock)
Definition: ZmumuEvent.h:90
ZmumuEvent::GetInvMass
double GetInvMass()
Definition: ZmumuEvent.h:72
MuonSelector::doIPSelection
void doIPSelection(bool doIPsel)
Definition: MuonSelector.h:51
ZmumuEvent::CB
@ CB
Definition: ZmumuEvent.h:55
ZmumuEvent::finalize
void finalize()
Definition: ZmumuEvent.cxx:669
ZmumuEvent::m_eventselectioncount_ptofsecondmuon
unsigned int m_eventselectioncount_ptofsecondmuon
Definition: ZmumuEvent.h:153
ZmumuEvent::m_pxMSTrack
const xAOD::TrackParticle * m_pxMSTrack[NUM_MUONS]
Definition: ZmumuEvent.h:162
ZmumuEvent::NUM_MUONS
@ NUM_MUONS
Definition: ZmumuEvent.h:39
ZmumuEvent::NUM_1HISTOS
@ NUM_1HISTOS
Definition: ZmumuEvent.h:176
ZmumuEvent::CENTRAL
@ CENTRAL
Definition: ZmumuEvent.h:44
ZmumuEvent::ZmumuEvent
ZmumuEvent()
Definition: ZmumuEvent.cxx:36
ZmumuEvent::SetOpeningAngleCut
void SetOpeningAngleCut(double newvalue)
Definition: ZmumuEvent.h:98
ZmumuEvent::m_eventselectioncount_dimuoncharge
unsigned int m_eventselectioncount_dimuoncharge
Definition: ZmumuEvent.h:156
ZmumuEvent::OrderMuonList
void OrderMuonList()
Definition: ZmumuEvent.cxx:633
ZmumuEvent::UNDEF
@ UNDEF
Definition: ZmumuEvent.h:47
ZmumuEvent::m_MassWindowLow
double m_MassWindowLow
Definition: ZmumuEvent.h:131
createCoolChannelIdFile.newname
newname
Definition: createCoolChannelIdFile.py:106
ZmumuEvent::getZCharge
int getZCharge(ZTYPE eType)
Definition: ZmumuEvent.cxx:490
ZmumuEvent::ZMASS_COMB
@ ZMASS_COMB
Definition: ZmumuEvent.h:175
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
ZmumuEvent::m_SelectMuonByIso
bool m_SelectMuonByIso
Definition: ZmumuEvent.h:180
ZmumuEvent::m_maxGoodLumiBlock
int m_maxGoodLumiBlock
Definition: ZmumuEvent.h:137
ToolHandle.h
ZmumuEvent::SetSkipMSCheck
void SetSkipMSCheck(bool value)
Definition: ZmumuEvent.h:100
ZmumuEvent::SetMassWindowHigh
void SetMassWindowHigh(double newvalue)
Definition: ZmumuEvent.h:95
ZmumuEvent::SetZ0GapCut
void SetZ0GapCut(double newvalue)
Definition: ZmumuEvent.h:99
ZmumuEvent::getPosMuon
unsigned int getPosMuon(ZTYPE eType)
Definition: ZmumuEvent.cxx:516
ZmumuEvent::getNumberOfTaggedMuons
unsigned int getNumberOfTaggedMuons()
Definition: ZmumuEvent.h:77
ZmumuEvent::m_eventselectioncount_notallmuonsfilled
unsigned int m_eventselectioncount_notallmuonsfilled
Definition: ZmumuEvent.h:150
ZmumuEvent::MUON4_OVR2
@ MUON4_OVR2
Definition: ZmumuEvent.h:38
ZmumuEvent::setContainer
void setContainer(PerfMonServices::CONTAINERS container)
Definition: ZmumuEvent.h:102
ZmumuEvent::SetMassWindowLow
void SetMassWindowLow(double newvalue)
Definition: ZmumuEvent.h:94
ZmumuEvent::m_muon2
int m_muon2
Definition: ZmumuEvent.h:185
ZmumuEvent::ZMASS_MUONADJ
@ ZMASS_MUONADJ
Definition: ZmumuEvent.h:175
ZmumuEvent::m_etaCut
double m_etaCut
Definition: ZmumuEvent.h:126
ZmumuEvent::Reco
virtual bool Reco(int theLumiBlock=0)
Definition: ZmumuEvent.cxx:111
ZmumuEvent::getTestedMuonCount
unsigned int getTestedMuonCount()
Definition: ZmumuEvent.h:81