ATLAS Offline Software
Loading...
Searching...
No Matches
ZmumuEvent Class Reference

#include <ZmumuEvent.h>

Inheritance diagram for ZmumuEvent:
Collaboration diagram for ZmumuEvent:

Public Types

enum  {
  MUON1 , MUON2 , MUON3_OVR1 , MUON4_OVR2 ,
  NUM_MUONS
}
enum  { CENTRAL , FORWARD , BACKWARD , UNDEF }
enum  ZTYPE {
  MS , ME , ID , CB ,
  NUM_TYPES
}

Public Member Functions

 ZmumuEvent ()
virtual ~ZmumuEvent ()
virtual void Init ()
virtual bool Reco (int theLumiBlock=0)
void doIsoSelection (bool doIso)
void doIPSelection (bool doIPsel)
void doMCPSelection (bool doMCP)
bool AcceptEvent ()
void finalize ()
unsigned int getAcceptedEvents ()
const xAOD::MuongetCombMuon (unsigned int uPart)
const xAOD::TrackParticlegetIDTrack (unsigned int uPart)
double GetInvMass ()
const float & getLeptonOpeningAngle (ZTYPE eType)
const xAOD::TrackParticle *getLooseIDTk ATLAS_NOT_REENTRANT (unsigned int uPart)
const xAOD::TrackParticlegetMSTrack (unsigned int uPart)
unsigned int getNegMuon (ZTYPE eType)
unsigned int getNumberOfTaggedMuons ()
unsigned int getPosMuon (ZTYPE eType)
float getPtImbalance (ZTYPE eType)
const std::string getRegion () const
unsigned int getTestedMuonCount ()
int getZCharge (ZTYPE eType)
const float & getZEta (ZTYPE eType)
const float & getZMass (ZTYPE eType)
const float & getZPhi (ZTYPE eType)
const float & getZPt (ZTYPE eType)
void OrderMuonList ()
void setDebugMode (bool debug)
void SetMaxLumiBlock (int newlumiblock)
void SetMinLumiBlock (int newlumiblock)
void SetMuonPtCut (double newvalue)
void SetMuonQuality (const std::string &newname)
void SetMassWindowLow (double newvalue)
void SetMassWindowHigh (double newvalue)
void SetLeadingMuonPtCut (double newvalue)
void SetSecondMuonPtCut (double newvalue)
void SetOpeningAngleCut (double newvalue)
void SetZ0GapCut (double newvalue)
void SetSkipMSCheck (bool value)
void setContainer (PerfMonServices::CONTAINERS container)
void SetMuonSelectionTool (ToolHandle< CP::IMuonSelectionTool > mst)

Static Public Member Functions

template<class T>
static CLHEP::Hep3Vector calculateMomentum (const T *pP)
template<class T>
static float EvalInvMass (const T *pxP1, const T *pxP2, float fMass1, float fMass2=invalidAnswer)
template<class T>
static float EvalInvMass (const T *pxP1, const T *pxP2, const T *pxp3, const T *pxP4, float fMass1, float fMass2=-999.9, float fMass3=-999.9, float fMass4=invalidAnswer)
template<class T>
static float EvalDiMuInvMass (const T *pxP1, const T *pxP2)
template<class T>
static float EvalFourMuInvMass (const T *pxP1, const T *pxP2, const T *pxP3, const T *pxP4)
template<class T>
static float EvaluateAngle (const T *pxP1, const T *pxP2)
template<class T>
static float EvalPtDiff (const T *pxP1, const T *pxP2)
template<class T>
static float EvalPhiDiff (const T *pxP1, const T *pxP2)
template<class T>
static float EvalEtaDiff (const T *pxP1, const T *pxP2)
template<class T>
static float EvalPt (const T *pxP1, const T *pxP2)
template<class T>
static float EvalPhi (const T *pxP1, const T *pxP2)
template<class T>
static float EvalEta (const T *pxP1, const T *pxP2)
template<class T>
static float EvalCharge (const T *pxP1, const T *pxP2)
template<class T>
static float EvalTransverseMass (const T *pxP1, float fMETx, float fMETy, float fMass1, float fMass2=invalidAnswer)
template<class T>
static float EvalTransverseMass (const T *pxP1, float fMETx, float fMETy)
template<class T>
static float EvalTransverseMass (const T *pxP1, const T *pxP2, float fMETx, float fMETy, float fMass1, float fMass2=invalidAnswer)
template<class T>
static float EvalTransverseMass (const T *pxP1, const T *pxP2, float fMETx, float fMETy)

Static Public Attributes

static constexpr float invalidAnswer {-999.9f}

Protected Member Functions

virtual void BookHistograms ()

Protected Attributes

unsigned int m_uPassedEvents
std::map< unsigned int, TH1F * > m_x1DHistograms
std::map< unsigned int, TH2F * > m_x2DHistograms
std::map< unsigned int, TProfile * > m_x1DProfHistograms
std::map< unsigned int, TProfile2D * > m_x2DProfHistograms
std::string m_xSampleName

Private Types

enum  HISTOS_1D {
  ZMASS_MUON , ZMASS_MUONADJ , ZMASS_TRACK , ZMASS_COMB ,
  NUM_1HISTOS
}
typedef EventAnalysis PARENT

Private Member Functions

void Clear ()
bool EventSelection (ZTYPE eType)
void ReconstructKinematics ()
bool RecordMuon (const xAOD::Muon *pxMuon)
void Register ()

Private Attributes

MuonSelector m_xMuonID
PerfMonServices::CONTAINERS m_container
ToolHandle< CP::IMuonSelectionToolm_muonSelectionTool
unsigned int m_uMuonTags
unsigned int m_uTrackMatch
bool m_bLooseMatch
double m_etaCut
double m_DiMuonPairInvMass = 0.0
double m_LeadingMuonPtCut
double m_SecondMuonPtCut
double m_MassWindowLow
double m_MassWindowHigh
double m_OpeningAngleCut
double m_Z0GapCut
bool m_skipMScheck
int m_minGoodLumiBlock
int m_maxGoodLumiBlock
bool m_doDebug
unsigned int m_numberOfFullPassMuons {}
bool m_passedSelectionCuts {}
int m_analyzedEventCount {}
unsigned int m_eventsWithoutEnoughMuonsCount {}
unsigned int m_eventsWithEnoughMuonsCount {}
unsigned int m_acceptedEventCount {}
unsigned int m_testedMuonCount {}
unsigned int m_acceptedMuonCount {}
unsigned int m_eventselectioncount_toofewmuons {}
unsigned int m_eventselectioncount_notallmuonsfilled {}
unsigned int m_eventselectioncount_morethantwomuons {}
unsigned int m_eventselectioncount_ptofleadingmuon {}
unsigned int m_eventselectioncount_ptofsecondmuon {}
unsigned int m_eventselectioncount_masswindow {}
unsigned int m_eventselectioncount_openingangle {}
unsigned int m_eventselectioncount_dimuoncharge {}
unsigned int m_eventselectioncount_goodlumiblock {}
const xAOD::Muonm_pxRecMuon [NUM_MUONS] {}
const xAOD::TrackParticlem_pxMETrack [NUM_MUONS] {}
const xAOD::TrackParticlem_pxMSTrack [NUM_MUONS] {}
const xAOD::TrackParticlem_pxIDTrack [NUM_MUONS] {}
float m_fZPt [NUM_TYPES] {}
float m_fZEtaDir [NUM_TYPES] {}
float m_fZPhiDir [NUM_TYPES] {}
float m_fInvariantMass [NUM_TYPES] {}
float m_fMuonDispersion [NUM_TYPES] {}
bool m_SelectMuonByIso
bool m_SelectMuonByIP
int m_muon1 = 0
int m_muon2 = 0

Detailed Description

Definition at line 27 of file ZmumuEvent.h.

Member Typedef Documentation

◆ PARENT

Definition at line 109 of file ZmumuEvent.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MUON1 
MUON2 
MUON3_OVR1 
MUON4_OVR2 
NUM_MUONS 

Definition at line 33 of file ZmumuEvent.h.

34 {
35 MUON1,
36 MUON2,
40 };

◆ anonymous enum

anonymous enum
Enumerator
CENTRAL 
FORWARD 
BACKWARD 
UNDEF 

Definition at line 42 of file ZmumuEvent.h.

43 {
44 CENTRAL,
45 FORWARD,
47 UNDEF
48 };

◆ HISTOS_1D

enum ZmumuEvent::HISTOS_1D
private
Enumerator
ZMASS_MUON 
ZMASS_MUONADJ 
ZMASS_TRACK 
ZMASS_COMB 
NUM_1HISTOS 

Definition at line 173 of file ZmumuEvent.h.

◆ ZTYPE

Enumerator
MS 
ME 
ID 
CB 
NUM_TYPES 

Definition at line 50 of file ZmumuEvent.h.

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.
57 };

Constructor & Destructor Documentation

◆ ZmumuEvent()

ZmumuEvent::ZmumuEvent ( )

Definition at line 36 of file ZmumuEvent.cxx.

37{
38 m_xSampleName = "ZMM";
39
41
42 m_doDebug = false;
43
44 // Setup the muon tags
45 m_uMuonTags = 2;
46 m_uTrackMatch = 0;
47 m_bLooseMatch = true; // will use combined fit otherwise.
48 m_etaCut = 1.05;
49 m_LeadingMuonPtCut = 20.;
51 m_MassWindowLow = 60.0;
52 m_MassWindowHigh = 120.0;
53 m_OpeningAngleCut = 0.2; // in radians
54 m_Z0GapCut = 5.0; // in mm
57 m_SelectMuonByIso = true;
58 m_SelectMuonByIP = true;
74 m_skipMScheck = false;
75
76 return;
77}
std::string m_xSampleName
double m_LeadingMuonPtCut
Definition ZmumuEvent.h:129
bool m_doDebug
Definition ZmumuEvent.h:139
int m_analyzedEventCount
Definition ZmumuEvent.h:143
double m_Z0GapCut
Definition ZmumuEvent.h:134
unsigned int m_testedMuonCount
Definition ZmumuEvent.h:147
unsigned int m_eventselectioncount_masswindow
Definition ZmumuEvent.h:154
bool m_skipMScheck
Definition ZmumuEvent.h:135
unsigned int m_acceptedEventCount
Definition ZmumuEvent.h:146
bool m_SelectMuonByIP
Definition ZmumuEvent.h:181
double m_etaCut
Definition ZmumuEvent.h:126
bool m_SelectMuonByIso
Definition ZmumuEvent.h:180
unsigned int m_eventsWithEnoughMuonsCount
Definition ZmumuEvent.h:145
unsigned int m_eventselectioncount_toofewmuons
Definition ZmumuEvent.h:149
unsigned int m_eventselectioncount_goodlumiblock
Definition ZmumuEvent.h:157
int m_maxGoodLumiBlock
Definition ZmumuEvent.h:137
unsigned int m_eventselectioncount_ptofsecondmuon
Definition ZmumuEvent.h:153
int m_minGoodLumiBlock
Definition ZmumuEvent.h:136
double m_MassWindowHigh
Definition ZmumuEvent.h:132
unsigned int m_eventsWithoutEnoughMuonsCount
Definition ZmumuEvent.h:144
unsigned int m_uTrackMatch
Definition ZmumuEvent.h:124
unsigned int m_eventselectioncount_notallmuonsfilled
Definition ZmumuEvent.h:150
unsigned int m_uMuonTags
Definition ZmumuEvent.h:123
unsigned int m_eventselectioncount_openingangle
Definition ZmumuEvent.h:155
double m_SecondMuonPtCut
Definition ZmumuEvent.h:130
unsigned int m_acceptedMuonCount
Definition ZmumuEvent.h:148
double m_MassWindowLow
Definition ZmumuEvent.h:131
bool m_bLooseMatch
Definition ZmumuEvent.h:125
unsigned int m_eventselectioncount_morethantwomuons
Definition ZmumuEvent.h:151
double m_OpeningAngleCut
Definition ZmumuEvent.h:133
unsigned int m_eventselectioncount_dimuoncharge
Definition ZmumuEvent.h:156
unsigned int m_eventselectioncount_ptofleadingmuon
Definition ZmumuEvent.h:152
PerfMonServices::CONTAINERS m_container
Definition ZmumuEvent.h:119

◆ ~ZmumuEvent()

ZmumuEvent::~ZmumuEvent ( )
virtual

Definition at line 80 of file ZmumuEvent.cxx.

81{
82}

Member Function Documentation

◆ AcceptEvent()

bool ZmumuEvent::AcceptEvent ( )
inline

Definition at line 67 of file ZmumuEvent.h.

67{ return m_passedSelectionCuts; }
bool m_passedSelectionCuts
Definition ZmumuEvent.h:142

◆ ATLAS_NOT_REENTRANT()

const xAOD::TrackParticle *getLooseIDTk ZmumuEvent::ATLAS_NOT_REENTRANT ( unsigned int uPart)

◆ BookHistograms()

void ZmumuEvent::BookHistograms ( )
protectedvirtual

Reimplemented from EventAnalysis.

Definition at line 212 of file ZmumuEvent.cxx.

213{
214}

◆ calculateMomentum()

template<class T>
CLHEP::Hep3Vector EventAnalysis::calculateMomentum ( const T * pP)
staticinherited

Definition at line 92 of file EventAnalysis.h.

92 {
93 const auto & p4(pP->p4());
94 return CLHEP::Hep3Vector(p4.Px() * EAna::CGeV , p4.Py() * EAna::CGeV, p4.Pz() * EAna::CGeV);
95}
const float CGeV

◆ Clear()

void ZmumuEvent::Clear ( )
private

Definition at line 362 of file ZmumuEvent.cxx.

363{
365 m_passedSelectionCuts = false;
366 m_DiMuonPairInvMass = -1.; // flag as no reconstructed inv mass yet
367 m_muon1 = MUON1; // point to the first two
368 m_muon2 = MUON2;
369
370 for ( unsigned int u = 0; u < NUM_MUONS; ++u ) {
371 m_pxRecMuon[u] = nullptr;
372 m_pxMSTrack[u] = nullptr;
373 m_pxMETrack[u] = nullptr;
374 m_pxIDTrack[u] = nullptr;
375 }
376 for ( unsigned int v = 0; v < NUM_TYPES; ++v ) {
377 m_fZPt[v] = -999.9f;
378 m_fZEtaDir[v] = -999.9f;
379 m_fZPhiDir[v] = -999.9f;
380 m_fInvariantMass[v] = -999.9f;
381 m_fMuonDispersion[v] = -999.9f;
382 }
383 return;
384}
float m_fZEtaDir[NUM_TYPES]
Definition ZmumuEvent.h:167
const xAOD::TrackParticle * m_pxMSTrack[NUM_MUONS]
Definition ZmumuEvent.h:162
float m_fZPhiDir[NUM_TYPES]
Definition ZmumuEvent.h:168
float m_fZPt[NUM_TYPES]
Definition ZmumuEvent.h:166
const xAOD::TrackParticle * m_pxIDTrack[NUM_MUONS]
Definition ZmumuEvent.h:163
const xAOD::Muon * m_pxRecMuon[NUM_MUONS]
Definition ZmumuEvent.h:160
float m_fInvariantMass[NUM_TYPES]
Definition ZmumuEvent.h:169
float m_fMuonDispersion[NUM_TYPES]
Definition ZmumuEvent.h:170
unsigned int m_numberOfFullPassMuons
Definition ZmumuEvent.h:141
const xAOD::TrackParticle * m_pxMETrack[NUM_MUONS]
Definition ZmumuEvent.h:161
double m_DiMuonPairInvMass
Definition ZmumuEvent.h:127
@ u
Enums for curvilinear frames.
Definition ParamDefs.h:77

◆ doIPSelection()

void ZmumuEvent::doIPSelection ( bool doIPsel)
inline

Definition at line 65 of file ZmumuEvent.h.

65{ m_xMuonID.doIPSelection(doIPsel); }
MuonSelector m_xMuonID
Definition ZmumuEvent.h:118

◆ doIsoSelection()

void ZmumuEvent::doIsoSelection ( bool doIso)
inline

Definition at line 64 of file ZmumuEvent.h.

64{ m_xMuonID.doIsoSelection(doIso); }

◆ doMCPSelection()

void ZmumuEvent::doMCPSelection ( bool doMCP)
inline

Definition at line 66 of file ZmumuEvent.h.

66{ m_xMuonID.doMCPSelection(doMCP); }

◆ EvalCharge()

template<class T>
float EventAnalysis::EvalCharge ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 239 of file EventAnalysis.h.

240{
241 // Check integrity of inputs.
242 if ( !pxP1 || !pxP2 ) return invalidAnswer;
243 return static_cast<float>( pxP1->charge() + pxP2->charge() );
244}
static constexpr float invalidAnswer

◆ EvalDiMuInvMass()

template<class T>
float EventAnalysis::EvalDiMuInvMass ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 98 of file EventAnalysis.h.

99{
100 // Check integrity of inputs.
101 if ( !pxP1 || !pxP2 ) return invalidAnswer;
102
103 // Evaluate Di-mu invariant mass.
104 return EvalInvMass( pxP1, pxP2, EAna::g_fMuonMass );
105}
static float EvalInvMass(const T *pxP1, const T *pxP2, float fMass1, float fMass2=invalidAnswer)
const float g_fMuonMass

◆ EvalEta()

template<class T>
float EventAnalysis::EvalEta ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 230 of file EventAnalysis.h.

231{
232 // Check integrity of inputs.
233 if ( !pxP1 || !pxP2 ) return invalidAnswer;
234 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
235 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
236 return static_cast<float>( (xTmp1 + xTmp2).pseudoRapidity() );
237}
static CLHEP::Hep3Vector calculateMomentum(const T *pP)

◆ EvalEtaDiff()

template<class T>
float EventAnalysis::EvalEtaDiff ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 202 of file EventAnalysis.h.

203{
204 // Check integrity of inputs.
205 if ( !pxP1 || !pxP2 ) return invalidAnswer;
206 // Evaluate the angle.
207 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
208 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
209 return static_cast<float>( xTmp1.polarAngle(xTmp2) );
210}

◆ EvalFourMuInvMass()

template<class T>
float EventAnalysis::EvalFourMuInvMass ( const T * pxP1,
const T * pxP2,
const T * pxP3,
const T * pxP4 )
staticinherited

Definition at line 124 of file EventAnalysis.h.

125{
126 // Check integrity of inputs.
127 if ( !pxP1 || !pxP2 || !pxP3 || !pxP4) return invalidAnswer;
128
129 // Evaluate invariant mass.
130 return EvalInvMass( pxP1, pxP2, pxP3, pxP4, EAna::g_fMuonMass );
131}

◆ EvalInvMass() [1/2]

template<class T>
float EventAnalysis::EvalInvMass ( const T * pxP1,
const T * pxP2,
const T * pxp3,
const T * pxP4,
float fMass1,
float fMass2 = -999.9,
float fMass3 = -999.9,
float fMass4 = invalidAnswer )
staticinherited

Definition at line 133 of file EventAnalysis.h.

135{
136 // Check integrity of inputs.No tachyons.
137 if ( fMass1 < 0.0f ) return invalidAnswer;
138 if ( !pxP1 || !pxP2 || !pxP3 || !pxP4) return invalidAnswer;
139
140 // Set masses equal if required by user
141 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
142 fMass3 = ( fMass3 < 0.0f ) ? fMass1 : fMass3;
143 fMass4 = ( fMass4 < 0.0f ) ? fMass1 : fMass4;
144
145 // Evaluate invariant mass.
146 CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, pxP1->p4().Pz() * EAna::CGeV );
147 CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, pxP2->p4().Pz() * EAna::CGeV );
148 CLHEP::Hep3Vector xTmp3 = CLHEP::Hep3Vector( pxP3->p4().Px() * EAna::CGeV, pxP3->p4().Py() * EAna::CGeV, pxP3->p4().Pz() * EAna::CGeV );
149 CLHEP::Hep3Vector xTmp4 = CLHEP::Hep3Vector( pxP4->p4().Px() * EAna::CGeV, pxP4->p4().Py() * EAna::CGeV, pxP4->p4().Pz() * EAna::CGeV );
150
151 CLHEP::HepLorentzVector xLVec; xLVec.setVectM ( xTmp1, fMass1 );
152 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, fMass2 );
153 CLHEP::HepLorentzVector xLVec3; xLVec3.setVectM( xTmp3, fMass3 );
154 CLHEP::HepLorentzVector xLVec4; xLVec4.setVectM( xTmp4, fMass4 );
155
156 xLVec += xLVec2;
157 xLVec += xLVec3;
158 xLVec += xLVec4;
159
160 return static_cast<float>( xLVec.m() );
161}

◆ EvalInvMass() [2/2]

template<class T>
float EventAnalysis::EvalInvMass ( const T * pxP1,
const T * pxP2,
float fMass1,
float fMass2 = invalidAnswer )
staticinherited

Definition at line 107 of file EventAnalysis.h.

109{
110 // Check integrity of inputs.No tachyons.
111 if ( fMass1 < 0.0f ) return invalidAnswer;
112 if ( !pxP1 || !pxP2 ) return invalidAnswer;
113 // Set masses equal if required by user
114 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
115 // Evaluate invariant mass.
116 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
117 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
118 CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp1, fMass1 );
119 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, fMass2 );
120 return static_cast<float>( xLVec1.invariantMass( xLVec2 ) );
121}

◆ EvalPhi()

template<class T>
float EventAnalysis::EvalPhi ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 221 of file EventAnalysis.h.

222{
223 // Check integrity of inputs.
224 if ( !pxP1 || !pxP2 ) return invalidAnswer;
225 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
226 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
227 return static_cast<float>( (xTmp1 + xTmp2).phi() );
228}

◆ EvalPhiDiff()

template<class T>
float EventAnalysis::EvalPhiDiff ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 191 of file EventAnalysis.h.

192{
193 // Check integrity of inputs.
194 if ( !pxP1 || !pxP2 ) return invalidAnswer;
195 // Evaluate the angle.
196 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
197 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
198 return static_cast<float>( xTmp1.deltaPhi(xTmp2) );
199}

◆ EvalPt()

template<class T>
float EventAnalysis::EvalPt ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 212 of file EventAnalysis.h.

213{
214 // Check integrity of inputs.
215 if ( !pxP1 || !pxP2 ) return invalidAnswer;
216 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
217 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
218 return static_cast<float>( (xTmp1 + xTmp2).perp() );
219}

◆ EvalPtDiff()

template<class T>
float EventAnalysis::EvalPtDiff ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 174 of file EventAnalysis.h.

175{
176 // Check integrity of inputs.
177 if ( !pxP1 || !pxP2 ) return invalidAnswer;
178 // Evaluate the difference between the momenta. Signed using positive - negative if appropriate.
179 if ( pxP1->charge() > 0.5f )
180 {
181 return static_cast<float>( pxP1->pt() * EAna::CGeV - pxP2->pt() * EAna::CGeV );
182 }
183 else
184 {
185 return static_cast<float>( pxP2->pt() * EAna::CGeV - pxP1->pt() * EAna::CGeV );
186 }
187}

◆ EvalTransverseMass() [1/4]

template<class T>
float EventAnalysis::EvalTransverseMass ( const T * pxP1,
const T * pxP2,
float fMETx,
float fMETy )
staticinherited

Definition at line 272 of file EventAnalysis.h.

273{
274 // Check integrity of inputs.
275 if ( !pxP1 || !pxP2 ) return invalidAnswer;
276 // Evaluate Di-mu invariant mass.
277 return EvalTransverseMass( pxP1, pxP2, fMETx, fMETy, EAna::g_fMuonMass );
278}
static float EvalTransverseMass(const T *pxP1, float fMETx, float fMETy, float fMass1, float fMass2=invalidAnswer)

◆ EvalTransverseMass() [2/4]

template<class T>
float EventAnalysis::EvalTransverseMass ( const T * pxP1,
const T * pxP2,
float fMETx,
float fMETy,
float fMass1,
float fMass2 = invalidAnswer )
staticinherited

Definition at line 280 of file EventAnalysis.h.

282{
283 // Check integrity of inputs.No tachyons.
284 if ( fMass1 < 0.0f ) return invalidAnswer;
285 if ( !pxP1 || !pxP2 ) return invalidAnswer;
286 // Set masses equal if required by user.
287 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
288 // Evaluate invariant mass.
289 CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, 0.0f );
290 CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( pxP2->p4().Px() * EAna::CGeV, pxP2->p4().Py() * EAna::CGeV, 0.0f );
291 CLHEP::Hep3Vector xTmp12 = xTmp1 + xTmp2;
292 CLHEP::Hep3Vector xTmp3 = CLHEP::Hep3Vector( fMETx, fMETy, 0.0f );
293 CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp12, fMass1 );
294 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp3, 0.0f );
295 return static_cast<float>( xLVec1.invariantMass( xLVec2 ) );
296}

◆ EvalTransverseMass() [3/4]

template<class T>
float EventAnalysis::EvalTransverseMass ( const T * pxP1,
float fMETx,
float fMETy )
staticinherited

Definition at line 247 of file EventAnalysis.h.

248{
249 // Check integrity of inputs.
250 if ( !pxP1 ) return invalidAnswer;
251 // Evaluate Di-mu invariant mass.
252 return EvalInvMass( pxP1, fMETx, fMETy, EAna::g_fMuonMass );
253}

◆ EvalTransverseMass() [4/4]

template<class T>
float EventAnalysis::EvalTransverseMass ( const T * pxP1,
float fMETx,
float fMETy,
float fMass1,
float fMass2 = invalidAnswer )
staticinherited

Definition at line 255 of file EventAnalysis.h.

257{
258 // Check integrity of inputs.No tachyons.
259 if ( fMass1 < 0.0f ) return invalidAnswer;
260 if ( !pxP1 ) return invalidAnswer;
261 // Set masses equal if required by user.
262 fMass2 = ( fMass2 < 0.0f ) ? fMass1 : fMass2;
263 // Evaluate invariant mass.
264 CLHEP::Hep3Vector xTmp1 = CLHEP::Hep3Vector( pxP1->p4().Px() * EAna::CGeV, pxP1->p4().Py() * EAna::CGeV, 0.0f );
265 CLHEP::Hep3Vector xTmp2 = CLHEP::Hep3Vector( fMETx, fMETy, 0.0f );
266 CLHEP::HepLorentzVector xLVec1; xLVec1.setVectM( xTmp1, fMass1 );
267 CLHEP::HepLorentzVector xLVec2; xLVec2.setVectM( xTmp2, 0.0f );
268 return static_cast<float>( xLVec1.invariantMass( xLVec2 ) );
269}

◆ EvaluateAngle()

template<class T>
float EventAnalysis::EvaluateAngle ( const T * pxP1,
const T * pxP2 )
staticinherited

Definition at line 164 of file EventAnalysis.h.

165{
166 // Check integrity of inputs.
167 if ( !pxP1 || !pxP2 ) return invalidAnswer;
168 // Evaluate the angle.
169 CLHEP::Hep3Vector xTmp1 = calculateMomentum(pxP1);
170 CLHEP::Hep3Vector xTmp2 = calculateMomentum(pxP2);
171 return static_cast<float>( xTmp1.angle(xTmp2) );
172}

◆ EventSelection()

bool ZmumuEvent::EventSelection ( ZTYPE eType)
private

Definition at line 219 of file ZmumuEvent.cxx.

220{
221 if(m_doDebug) {std::cout <<" * ZmumuEvent * Event selection ** START ** for type: " << eType << " m_NumberOfFullPassMuons: " << m_numberOfFullPassMuons << std::endl;}
222
223 // First require two muon-id's with cuts pre-applied.
224 if ( m_numberOfFullPassMuons < 2 ) {
225 if (m_doDebug) {std::cout <<" * ZmumuEvent * Failing number of good muons == 2 :( " << m_numberOfFullPassMuons << std::endl;}
226 return false;
227 }
229
230 // crosscheck all muons have been properly filled
231 bool allMuonsGood = true;
232 for (unsigned int muonid=0; muonid < m_numberOfFullPassMuons; muonid++) {
233 if (!m_pxMSTrack[muonid]) {
234 allMuonsGood = false;
235 }
236 }
237 if (!allMuonsGood){
238 return false;
239 }
241
242 if ( m_numberOfFullPassMuons > 2 ) {
243 if (m_doDebug) {std::cout <<" * ZmumuEvent * Failing number of good muons == 2 :( " << m_numberOfFullPassMuons << std::endl;}
244 return false;
245 }
247
248 // momentum of the muons
249 double leadingMuonPt, secondMuonPt;
250 switch ( eType )
251 {
252 case MS :
253 {
254 leadingMuonPt = m_pxMSTrack[m_muon1]->pt();
255 secondMuonPt = m_pxMSTrack[m_muon2]->pt();
256 break;
257 }
258 case ME:
259 {
260 leadingMuonPt = m_pxMETrack[m_muon1]->pt();
261 secondMuonPt = m_pxMETrack[m_muon2]->pt();
262 break;
263 }
264 case CB:
265 {
266 leadingMuonPt = m_pxRecMuon[m_muon1]->pt();
267 secondMuonPt = m_pxRecMuon[m_muon2]->pt();
268 break;
269 }
270 case ID:
271 {
272 leadingMuonPt = m_pxIDTrack[m_muon1]->pt();
273 secondMuonPt = m_pxIDTrack[m_muon2]->pt();
274 break;
275 }
276
277 default:
278 leadingMuonPt = m_pxRecMuon[m_muon1]->pt();
279 secondMuonPt = m_pxRecMuon[m_muon2]->pt();
280 }
281 // up to here the leading and second pt are not really in the right order.
282 // order the muon pt:
283 if (secondMuonPt > leadingMuonPt) {
284 double tempPt = leadingMuonPt;
285 leadingMuonPt = secondMuonPt;
286 secondMuonPt = tempPt;
287 }
288
289 // muon pt cut
290 // if ( !(leadingMuonPt > m_LeadingMuonPtCut*CLHEP::GeV && secondMuonPt > m_SecondMuonPtCut*CLHEP::GeV ) ) {
291 if ( leadingMuonPt < m_LeadingMuonPtCut*CLHEP::GeV ) {
292 if(m_doDebug){ std::cout <<" * ZmumuEvent * Failing 1st muon pt cut * Reco Pt: " << leadingMuonPt << " < " << m_LeadingMuonPtCut*CLHEP::GeV << std::endl;}
293 return false;
294 }
296
297 if ( secondMuonPt < m_SecondMuonPtCut*CLHEP::GeV ) {
298 if(m_doDebug){ std::cout <<" * ZmumuEvent * Failing 2nd muon pt cut * Reco Pt: " << secondMuonPt << " < " << m_SecondMuonPtCut*CLHEP::GeV << std::endl;}
299 return false;
300 }
302
303 // Invariant mass window
304 if ( m_fInvariantMass[eType] < m_MassWindowLow ) {
305 if(m_doDebug) {std::cout <<" * ZmumuEvent * Failing mass window low cut: reco m= " << m_fInvariantMass[eType] << " > " << m_MassWindowLow << std::endl;}
306 return false;
307 }
308 if ( m_fInvariantMass[eType] > m_MassWindowHigh ) {
309 if(m_doDebug) {std::cout <<" * ZmumuEvent * Failing mass window high cut: reco m= " << m_fInvariantMass[eType] << " > " << m_MassWindowHigh << std::endl;}
310 return false;
311 }
313
314 // opening angle
315 if ( m_fMuonDispersion[eType] < m_OpeningAngleCut ) {
316 if(m_doDebug) {std::cout <<" * ZmumuEvent * Failing opening angle cut. Opening angle " << m_fMuonDispersion[eType] << " < " << m_OpeningAngleCut << std::endl;}
317 return false;
318 }
320
321 // opposite charge
322 if ( getZCharge(eType) != 0 ) {
323 if(m_doDebug) {
324 std::cout <<" * ZmumuEvent * Failing get ZCharge != 0 cut * Reco q1= " << m_pxRecMuon[m_muon1]->charge()*m_pxRecMuon[m_muon1]->pt() <<std::endl;
325 //<< " q2= " << m_pxRecMuon[m_muon2]->charge()*m_pxRecMuon[m_muon2]->pt() << std::endl; //This might not exist!
326 std::cout <<" * ID q1= " << m_pxIDTrack[m_muon1]->charge()*m_pxIDTrack[m_muon1]->pt() << std::endl;
327 // << " q2= " << m_pxIDTrack[m_muon2]->charge()*m_pxIDTrack[m_muon2]->pt() << std::endl; //This might not exist!
328 }
329 return false;
330 }
332
333 //
334 // both muons should come from the same vertex
335 // if the vertex information is used, that is already guaranteed, but if not, one has to check the z0
336 if (eType == ID) {
337 double z0_muon1 = m_pxIDTrack[m_muon1]->vz() + m_pxIDTrack[m_muon1]->z0();
338 double z0_muon2 = m_pxIDTrack[m_muon2]->vz() + m_pxIDTrack[m_muon2]->z0();
339 if(m_doDebug) {
340 std::cout << " * ZmumuEvent * z0_muon1= " << z0_muon1 << " z0_muon2= " << z0_muon2 << " delta= " << z0_muon1-z0_muon2 << std::endl;
341 }
342 if ( std::abs(z0_muon1 - z0_muon2) > m_Z0GapCut) {
343 if(m_doDebug) {
344 std::cout << " * ZmumuEvent * Failing common vertex cut. z.vtx1= " << m_pxIDTrack[m_muon1]->vz() << " z.vtx2= " << m_pxIDTrack[m_muon2]->vz() << std::endl;
345 std::cout << " * ZmumuEvent * Failing common vertex cut. IDTrk.z0_1= " << m_pxIDTrack[m_muon1]->z0() << " IDTrk.z0_2= " << m_pxIDTrack[m_muon2]->z0() << std::endl;
346 std::cout << " * ZmumuEvent * z0_muon1= " << z0_muon1 << " z0_muon2= " << z0_muon2 << " delta= " << z0_muon1-z0_muon2 << " > " << m_Z0GapCut << " (cut)" << std::endl;
347 }
348 return false;
349 }
350 }
351
352
353 if(m_doDebug) {
354 std::cout <<" * ZmumuEvent * Good muon pair: pt= " << leadingMuonPt/1000
355 << " & " << secondMuonPt/1000
356 << " GeV dimuon invariant mass = " << m_fInvariantMass[eType] << " GeV " << std::endl;
357 }
358 return true;
359}
int getZCharge(ZTYPE eType)

◆ finalize()

void ZmumuEvent::finalize ( )

Definition at line 670 of file ZmumuEvent.cxx.

671{
672 m_xMuonID.finalize();
673
674 std::cout << " ** ZmumuEvent ** -- STATS -- " << std::endl
675 << " Analyzed events : " << m_analyzedEventCount << std::endl
676 << " Events passing LumiBlock : " << m_eventselectioncount_goodlumiblock << std::endl
677 << " Tested muons : " << m_testedMuonCount << std::endl
678 << " Accepted muons : " << m_acceptedMuonCount << std::endl
679 << " Events without enough muon: " << m_eventsWithoutEnoughMuonsCount << std::endl
680 << " Events with enough muons : " << m_eventsWithEnoughMuonsCount << std::endl
681 << " pass few muons : " << m_eventselectioncount_toofewmuons << std::endl
682 << " pass not filled muons : " << m_eventselectioncount_notallmuonsfilled << std::endl
683 << " pass more than 2 muons : " << m_eventselectioncount_morethantwomuons << std::endl
684 << " pass pt lead : " << m_eventselectioncount_ptofleadingmuon << std::endl
685 << " pass pt 2nd : " << m_eventselectioncount_ptofsecondmuon << std::endl
686 << " pass mass window : " << m_eventselectioncount_masswindow << std::endl
687 << " pass opening angle : " << m_eventselectioncount_openingangle << std::endl
688 << " pass dimuon charge : " << m_eventselectioncount_dimuoncharge << std::endl
689 << " Accepted events : " << m_acceptedEventCount << std::endl
690 << std::endl;
691 return;
692}

◆ getAcceptedEvents()

unsigned int ZmumuEvent::getAcceptedEvents ( )
inline

Definition at line 69 of file ZmumuEvent.h.

69{ return m_acceptedEventCount; }

◆ getCombMuon()

const xAOD::Muon * ZmumuEvent::getCombMuon ( unsigned int uPart)
inline

Definition at line 70 of file ZmumuEvent.h.

70{ return (uPart < NUM_MUONS) ? m_pxRecMuon[uPart] : NULL; }

◆ getIDTrack()

const xAOD::TrackParticle * ZmumuEvent::getIDTrack ( unsigned int uPart)
inline

Definition at line 71 of file ZmumuEvent.h.

71{ return (uPart < NUM_MUONS) ? m_pxIDTrack[uPart] : NULL; }

◆ GetInvMass()

double ZmumuEvent::GetInvMass ( )
inline

Definition at line 72 of file ZmumuEvent.h.

72{return m_DiMuonPairInvMass;}

◆ getLeptonOpeningAngle()

const float & ZmumuEvent::getLeptonOpeningAngle ( ZTYPE eType)
inline

Definition at line 73 of file ZmumuEvent.h.

73{ return m_fMuonDispersion[eType]; }

◆ getMSTrack()

const xAOD::TrackParticle * ZmumuEvent::getMSTrack ( unsigned int uPart)
inline

Definition at line 75 of file ZmumuEvent.h.

75{ return (uPart < NUM_MUONS) ? m_pxMSTrack[uPart] : NULL; }

◆ getNegMuon()

unsigned int ZmumuEvent::getNegMuon ( ZTYPE eType)

Definition at line 550 of file ZmumuEvent.cxx.

551{
552 int uTmp = getPosMuon( eType );
553 if ( uTmp == 999 )
554 {
555 return 999;
556 }
557 else
558 {
559 return ( ( uTmp == m_muon1 ) ? m_muon2 : m_muon1 );
560 }
561}
unsigned int getPosMuon(ZTYPE eType)

◆ getNumberOfTaggedMuons()

unsigned int ZmumuEvent::getNumberOfTaggedMuons ( )
inline

Definition at line 77 of file ZmumuEvent.h.

◆ getPosMuon()

unsigned int ZmumuEvent::getPosMuon ( ZTYPE eType)

Definition at line 517 of file ZmumuEvent.cxx.

518{
519 if ( getNumberOfTaggedMuons() != 2 ) return 999;
520 if ( getZCharge(eType) != 0 ) return 999;
521
522 switch ( eType )
523 {
524 case MS :
525 {
526 if ( !m_pxMSTrack[m_muon1] || !m_pxMSTrack[m_muon2] ) return 999;
527 return ( static_cast<int>( m_pxMSTrack[m_muon1]->charge() ) == 1 ? m_muon1 : m_muon2 );
528 }
529 case ME:
530 {
531 if ( !m_pxMETrack[m_muon1] || !m_pxMETrack[m_muon2] ) return 999;
532 return ( static_cast<int>( m_pxMETrack[m_muon1]->charge() ) == 1 ? m_muon1 : m_muon2 );
533 }
534 case CB:
535 {
536 if ( !m_pxRecMuon[m_muon1] || !m_pxRecMuon[m_muon2] ) return 999;
537 return ( static_cast<int>( m_pxRecMuon[m_muon1]->charge() ) == 1 ? m_muon1 : m_muon2 );
538 }
539 case ID:
540 {
541 if ( !m_pxIDTrack[m_muon1] || !m_pxIDTrack[m_muon2] ) return 999;
542 return ( static_cast<int>( m_pxIDTrack[m_muon1]->charge() ) == 1 ? m_muon1 : m_muon2 );
543 }
544 default:
545 return 999;
546 }
547}
double charge(const T &p)
Definition AtlasPID.h:997
unsigned int getNumberOfTaggedMuons()
Definition ZmumuEvent.h:77

◆ getPtImbalance()

float ZmumuEvent::getPtImbalance ( ZTYPE eType)

Definition at line 457 of file ZmumuEvent.cxx.

458{
459 // First determine what's positive
460 if ( m_numberOfFullPassMuons == 2 )
461 {
462 switch ( eType )
463 {
464 case MS :
465 {
467 }
468 case ME:
469 {
471 }
472 case CB:
473 {
475 }
476 case ID:
477 {
479 }
480 default:
481 return -999.0;
482 }
483 }
484 else
485 {
486 return -999.0;
487 }
488}
static float EvalPtDiff(const T *pxP1, const T *pxP2)

◆ getRegion()

const std::string ZmumuEvent::getRegion ( ) const

Definition at line 95 of file ZmumuEvent.cxx.

95 {
96
97 const double eta1 = std::abs(m_pxRecMuon[m_muon1]->eta());
98 const double eta2 = std::abs(m_pxRecMuon[m_muon2]->eta());
99
100 if ( eta1 < m_etaCut && eta2 < m_etaCut )
101 return "BB";
102
103 else if( (eta1 < m_etaCut && eta2 > m_etaCut) || (eta1 > m_etaCut && eta2 < m_etaCut) )
104 return "BE";
105
106 else return "EE";
107}
Scalar eta() const
pseudorapidity method
setEt setPhi setE277 setWeta2 eta1

◆ getTestedMuonCount()

unsigned int ZmumuEvent::getTestedMuonCount ( )
inline

Definition at line 81 of file ZmumuEvent.h.

81{ return m_testedMuonCount; }

◆ getZCharge()

int ZmumuEvent::getZCharge ( ZTYPE eType)

Definition at line 491 of file ZmumuEvent.cxx.

492{
493 switch ( eType )
494 {
495 case MS :
496 {
497 return ( static_cast<int>( EvalCharge( m_pxMSTrack[m_muon1], m_pxMSTrack[m_muon2] ) ) );
498 }
499 case ME:
500 {
501 return ( static_cast<int>( EvalCharge( m_pxMETrack[m_muon1], m_pxMETrack[m_muon2] ) ) );
502 }
503 case CB:
504 {
505 return ( static_cast<int>( EvalCharge( m_pxRecMuon[m_muon1], m_pxRecMuon[m_muon2] ) ) );
506 }
507 case ID:
508 {
509 return ( static_cast<int>( EvalCharge( m_pxIDTrack[m_muon1], m_pxIDTrack[m_muon2] ) ) );
510 }
511 default:
512 return -999;
513 }
514}
static float EvalCharge(const T *pxP1, const T *pxP2)

◆ getZEta()

const float & ZmumuEvent::getZEta ( ZTYPE eType)
inline

Definition at line 83 of file ZmumuEvent.h.

83{ return m_fZEtaDir[eType]; }

◆ getZMass()

const float & ZmumuEvent::getZMass ( ZTYPE eType)
inline

Definition at line 84 of file ZmumuEvent.h.

84{ return m_fInvariantMass[eType]; }

◆ getZPhi()

const float & ZmumuEvent::getZPhi ( ZTYPE eType)
inline

Definition at line 85 of file ZmumuEvent.h.

85{ return m_fZPhiDir[eType]; }

◆ getZPt()

const float & ZmumuEvent::getZPt ( ZTYPE eType)
inline

Definition at line 86 of file ZmumuEvent.h.

86{ return m_fZPt[eType]; }

◆ Init()

void ZmumuEvent::Init ( )
virtual

Reimplemented from EventAnalysis.

Definition at line 85 of file ZmumuEvent.cxx.

86{
87 m_xMuonID.Init();
88
90}
virtual void Init()

◆ OrderMuonList()

void ZmumuEvent::OrderMuonList ( )

Definition at line 634 of file ZmumuEvent.cxx.

635{
636 int muPlusId = -9;
637 int muMinusId = -9;
638 double muPlusPt = 0.;
639 double muMinusPt = 0.;
640
641 if (m_doDebug) {std::cout <<" * ZmumuEvent * OrderMuonList * START * input number of muons: " << m_numberOfFullPassMuons << std::endl;}
642
643 if (m_numberOfFullPassMuons >= 2) {
644 for (int imuon=0; imuon < (int) m_numberOfFullPassMuons; imuon++) {
645 if (m_pxRecMuon[imuon] != nullptr) {
646
647 if (m_pxRecMuon[imuon]->charge()== 1 && m_pxRecMuon[imuon]->pt()> muPlusPt) {
648 muPlusPt = m_pxRecMuon[imuon]->pt();
649 muPlusId = imuon;
650 }
651 if (m_pxRecMuon[imuon]->charge()==-1 && m_pxRecMuon[imuon]->pt()> muMinusPt) {
652 muMinusPt = m_pxRecMuon[imuon]->pt();
653 muMinusId = imuon;
654 }
655 } // muon exist
656 } // for (int imuon
657 } // if (m_numberOfFullPassMuons >= 2)
658 if (muPlusId>=0 && muMinusId>=0) {
659 m_muon1 = muPlusId;
660 m_muon2 = muMinusId;
661 m_numberOfFullPassMuons = 2; // the two muons have been selected. Let's pretend we have only two muons then.
662 }
663 if (m_doDebug) {std::cout <<" * ZmumuEvent * OrderMuonList * COMPLETED ** numberOfFullPassMuons: " << m_numberOfFullPassMuons
664 << " mu+: " << muPlusId << " mu-: " << muMinusId << std::endl;}
665 return;
666}

◆ Reco()

bool ZmumuEvent::Reco ( int theLumiBlock = 0)
virtual

Definition at line 111 of file ZmumuEvent.cxx.

112{
113 if (m_doDebug) { std::cout << " * ZmumuEvent * ZmumuEvent::Reco() starting " << std::endl; }
115
116 // Clear out the previous events record.
117 this->Clear();
118
119 // before getting into business, check lumiblock is in requested range
121 // lumiblock range is requested
122 if ( theLumiBlock < m_minGoodLumiBlock) return false;
123 if ( theLumiBlock > m_maxGoodLumiBlock) return false;
124 }
126
127 // retrieve muons
129
130 // START patch by Anthony to avoid crash when MuonSpetrometer::Pt was not defined mainly for data16
131 // WARNING thus is necessary for data16 !!
132 if (false) {
133 for( auto muon : *pxMuonContainer ){
134 const xAOD::TrackParticle* idtrk(nullptr);
135 const xAOD::TrackParticle* metrk(nullptr);
136 using enum xAOD::Muon::TrackParticleType;
137 idtrk = muon->trackParticle(InnerDetectorTrackParticle);
138 metrk = muon->trackParticle(ExtrapolatedMuonSpectrometerTrackParticle);
139 if (idtrk && metrk) {
140 static const SG::Decorator<float> InnerDetectorPtAcc("InnerDetectorPt");
141 static const SG::Decorator<float> MuonSpectrometerPtAcc("MuonSpectrometerPt");
142 InnerDetectorPtAcc(*muon) = idtrk->pt();
143 MuonSpectrometerPtAcc(*muon) = metrk->pt();
144 }
145 }
146 }
147 // END patch
148
149 if (pxMuonContainer != nullptr) {
150 if (m_doDebug) {std::cout << " * ZmumuEvent * track list has "<< pxMuonContainer->size() << " muon in xAOD::MuonContainer " << m_container <<std::endl; }
151 xAOD::MuonContainer::const_iterator xMuonItr = pxMuonContainer->begin();
152 xAOD::MuonContainer::const_iterator xMuonItrE = pxMuonContainer->end();
153
154 int attemptedMuonCount = 0;
155 int acceptedMuonCount = 0;
156
157 while ( xMuonItr != xMuonItrE ){ // this loops on the muons in the pxMuonContainer
158 const xAOD::Muon* pxCMuon = *xMuonItr;
159 attemptedMuonCount++;
161 if(m_doDebug){std::cout << " * ZmumuEvent * Reco() ** attempt on xMuonItr number "<< attemptedMuonCount << " (pointer: "<< *xMuonItr <<")" << std::endl; }
162 // Apply muon cuts
163 if ( m_xMuonID.passSelection( pxCMuon) ) {
164 if (RecordMuon( pxCMuon )) {
165 acceptedMuonCount++;
167 if (m_doDebug) {std::cout << " This muon is accepeted !! this is muon number " << acceptedMuonCount << " & full pass" << m_numberOfFullPassMuons << std::endl; }
168 }
169 }
170 ++xMuonItr;
171 } // end loop on muons
172 if (m_doDebug) {std::cout << " * ZmumuEvent * accepted " << acceptedMuonCount << " muons from the input list of "<< pxMuonContainer->size() <<std::endl; }
173
174 if (acceptedMuonCount < 2) m_eventsWithoutEnoughMuonsCount++;
175 if (acceptedMuonCount >= 2) m_eventsWithEnoughMuonsCount++;
176 } // muon container exist
177 else {
178 std::cout << " * ZmumuEvent * Can't retrieve combined muon collection (container: " << m_container <<") " << std::endl;
179 return false;
180 }
181
182 // Ordering of muons
183 this->OrderMuonList();
184
185 // Reconstruct the invariant mass ( based on mu-sys pt ).
187
190
192
193 if(m_doDebug) {
194 if ( m_passedSelectionCuts) std::cout << " * ZmumuEvent * Reco() * result of analyzed event " << m_analyzedEventCount << " --> Selected event :) " << std::endl;
195 if (!m_passedSelectionCuts) std::cout << " * ZmumuEvent * Reco() * result of analyzed event " << m_analyzedEventCount << " --> Rejected event :( " << std::endl;
196 }
197 if (m_doDebug) {
198 std::cout << " * ZmumuEvent::Reco * COMPLETED * Event has " << m_numberOfFullPassMuons
199 << " muons. " << m_acceptedEventCount
200 << " events accpeted out of " << m_analyzedEventCount
201 << " tested ";
202 if (m_passedSelectionCuts) std::cout << " This m= " << m_DiMuonPairInvMass;
203 std::cout << " * return " << m_passedSelectionCuts << std::endl;
204 }
206}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
static const T * getContainer(CONTAINERS eContainer)
void OrderMuonList()
void ReconstructKinematics()
bool EventSelection(ZTYPE eType)
bool RecordMuon(const xAOD::Muon *pxMuon)
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
Definition AuxElement.h:576
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".

◆ ReconstructKinematics()

void ZmumuEvent::ReconstructKinematics ( )
private

Definition at line 430 of file ZmumuEvent.cxx.

431{
432 // Three ways. No checks here. Thus make sure the pointers are ok before this.
433 if ( m_numberOfFullPassMuons == 2 )
434 {
435 // Note that all the util. functions will check the pointers & return -999.9f on failure.
441
447
453 }
454}
static float EvaluateAngle(const T *pxP1, const T *pxP2)
static float EvalDiMuInvMass(const T *pxP1, const T *pxP2)
static float EvalPhi(const T *pxP1, const T *pxP2)
static float EvalPt(const T *pxP1, const T *pxP2)
static float EvalEta(const T *pxP1, const T *pxP2)

◆ RecordMuon()

bool ZmumuEvent::RecordMuon ( const xAOD::Muon * pxMuon)
private

Definition at line 387 of file ZmumuEvent.cxx.

388{
389 if(m_doDebug) { std::cout <<" * ZmumuEvent * RecordMuon * START ** muons recorded so far "<< m_numberOfFullPassMuons << " up to a maximum of " << NUM_MUONS << std::endl;}
390
391 // This shouldn't really ever happen but just in case.
392 if ( !pxMuon ) {
393 if(m_doDebug) { std::cout <<" * ZmumuEvent * RecordMuon * bad pxMuon --> EXIT "<< std::endl;}
394 return false;
395 }
396
398 // The main Muon
400 // Tracking Muon Spectrometer ( raw )
401 const xAOD::TrackParticle* pxMSTrack = pxMuon->trackParticle(xAOD::Muon::TrackParticleType::MuonSpectrometerTrackParticle);
402 if (!pxMSTrack) {
403 if(m_doDebug){ std::cout <<" * ZmumuEvent * RecordMuon * bad pxMSmuon --> EXIT "<< std::endl;}
404 return false;
405 }
407
408 // Tracking ID ( fix later to include loose match track conditions )
409 const xAOD::TrackParticle* pxIDTrack = pxMuon->trackParticle(xAOD::Muon::TrackParticleType::InnerDetectorTrackParticle);
410 if (!pxIDTrack) {
411 return false;
412 }
414 //
415 if(m_doDebug){ std::cout <<" m_pxRecMuon[" << m_numberOfFullPassMuons <<"]"
416 << " pt= " << m_pxRecMuon[m_numberOfFullPassMuons]->pt() << " q= "<< m_pxRecMuon[m_numberOfFullPassMuons]->charge() << std::endl;}
417 if(m_doDebug){ std::cout <<" m_pxMSTrack[" << m_numberOfFullPassMuons <<"]"
418 <<" pt= " << m_pxMSTrack[m_numberOfFullPassMuons]->pt() << " q= " << m_pxMSTrack[m_numberOfFullPassMuons]->charge() << std::endl;}
419 if(m_doDebug){ std::cout <<" m_pxIDTrack[" << m_numberOfFullPassMuons <<"]"
420 <<" pt= " << m_pxIDTrack[m_numberOfFullPassMuons]->pt() << " q= " << m_pxIDTrack[m_numberOfFullPassMuons]->charge() << std::endl;}
421 // update count
423 }
424 if(m_doDebug){ std::cout <<" * ZmumuEvent * RecordMuon * return with a total of " << m_numberOfFullPassMuons << std::endl;}
425 return true;
426}
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be NULL) to the TrackParticle used in identification of this muon.
Definition Muon_v1.cxx:482

◆ Register()

void EventAnalysis::Register ( )
privateinherited

Definition at line 63 of file EventAnalysis.cxx.

64{
65 ServiceHandle<ITHistSvc> histSvc ("THistSvc", "EventAnalysis");
66
67 // Register histograms in monitoring tool
68 registerHistogramType(*histSvc, m_x1DHistograms, m_xSampleName, "/1dhisto_");
69 registerHistogramType(*histSvc, m_x2DHistograms, m_xSampleName, "/2dhisto_");
70
71 registerHistogramType(*histSvc, m_x1DProfHistograms, m_xSampleName, "/1dprof_");
72 registerHistogramType(*histSvc, m_x2DProfHistograms, m_xSampleName, "/2dprof_");
73}
std::map< unsigned int, TProfile2D * > m_x2DProfHistograms
std::map< unsigned int, TH2F * > m_x2DHistograms
std::map< unsigned int, TH1F * > m_x1DHistograms
std::map< unsigned int, TProfile * > m_x1DProfHistograms

◆ setContainer()

void ZmumuEvent::setContainer ( PerfMonServices::CONTAINERS container)
inline

Definition at line 102 of file ZmumuEvent.h.

const SG::AuxVectorData * container() const
Return the container holding this element.

◆ setDebugMode()

void ZmumuEvent::setDebugMode ( bool debug)
inline

Definition at line 88 of file ZmumuEvent.h.

const bool debug

◆ SetLeadingMuonPtCut()

void ZmumuEvent::SetLeadingMuonPtCut ( double newvalue)

Definition at line 601 of file ZmumuEvent.cxx.

602{
603 // first set the new pt cut value
604 m_LeadingMuonPtCut = newvalue;
605
606
607 // the second muon pt cut can not be higher than the leading muon pt cut:
609
610 // this has to be translated to the MuonSelector
611 // but there one has to use the minimum momentum --> second muon
612 //this->SetMuonPtCut(m_SecondMuonPtCut);
613 if(m_doDebug && false){std::cout <<" * ZmumuEvent * SetLeadingMuonPtCut * new Pt cuts: " << m_LeadingMuonPtCut << " & " << m_SecondMuonPtCut << " MuonSelector: " << m_xMuonID.GetPtCut() << std::endl;}
614 return;
615}
void SetSecondMuonPtCut(double newvalue)

◆ SetMassWindowHigh()

void ZmumuEvent::SetMassWindowHigh ( double newvalue)
inline

Definition at line 95 of file ZmumuEvent.h.

95{ m_MassWindowHigh = newvalue; }

◆ SetMassWindowLow()

void ZmumuEvent::SetMassWindowLow ( double newvalue)
inline

Definition at line 94 of file ZmumuEvent.h.

94{ m_MassWindowLow = newvalue; }

◆ SetMaxLumiBlock()

void ZmumuEvent::SetMaxLumiBlock ( int newlumiblock)
inline

Definition at line 89 of file ZmumuEvent.h.

89{ m_maxGoodLumiBlock = newlumiblock; }

◆ SetMinLumiBlock()

void ZmumuEvent::SetMinLumiBlock ( int newlumiblock)
inline

Definition at line 90 of file ZmumuEvent.h.

90{ m_minGoodLumiBlock = newlumiblock; }

◆ SetMuonPtCut()

void ZmumuEvent::SetMuonPtCut ( double newvalue)
inline

Definition at line 91 of file ZmumuEvent.h.

91{ m_xMuonID.SetPtCut(newvalue); }

◆ SetMuonQuality()

void ZmumuEvent::SetMuonQuality ( const std::string & newname)
inline

Definition at line 92 of file ZmumuEvent.h.

92{ m_xMuonID.SetMuonQualityRequirement(newname); }

◆ SetMuonSelectionTool()

void ZmumuEvent::SetMuonSelectionTool ( ToolHandle< CP::IMuonSelectionTool > mst)
inline

Definition at line 103 of file ZmumuEvent.h.

103{ m_muonSelectionTool = mst; m_xMuonID.SetCustomMuonSelectionTool (mst); };
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
Definition ZmumuEvent.h:120

◆ SetOpeningAngleCut()

void ZmumuEvent::SetOpeningAngleCut ( double newvalue)
inline

Definition at line 98 of file ZmumuEvent.h.

98{m_OpeningAngleCut = newvalue;}

◆ SetSecondMuonPtCut()

void ZmumuEvent::SetSecondMuonPtCut ( double newvalue)

Definition at line 618 of file ZmumuEvent.cxx.

619{
620 m_SecondMuonPtCut = newvalue;
621
622 // second muon pt shouldn't be higher than the leading muon pt
624
625 // this has to be translated to the MuonSelector
627
628 if(m_doDebug && false){std::cout <<" * ZmumuEvent * SetSecondMuonPtCut * new Pt cuts: " << m_LeadingMuonPtCut << " & " << m_SecondMuonPtCut << " MuonSelector: " << m_xMuonID.GetPtCut() << std::endl;}
629
630 return;
631}
void SetLeadingMuonPtCut(double newvalue)
void SetMuonPtCut(double newvalue)
Definition ZmumuEvent.h:91

◆ SetSkipMSCheck()

void ZmumuEvent::SetSkipMSCheck ( bool value)
inline

Definition at line 100 of file ZmumuEvent.h.

◆ SetZ0GapCut()

void ZmumuEvent::SetZ0GapCut ( double newvalue)
inline

Definition at line 99 of file ZmumuEvent.h.

99{m_Z0GapCut = newvalue;}

Member Data Documentation

◆ invalidAnswer

float EventAnalysis::invalidAnswer {-999.9f}
staticconstexprinherited

Definition at line 40 of file EventAnalysis.h.

40{-999.9f};

◆ m_acceptedEventCount

unsigned int ZmumuEvent::m_acceptedEventCount {}
private

Definition at line 146 of file ZmumuEvent.h.

146{};

◆ m_acceptedMuonCount

unsigned int ZmumuEvent::m_acceptedMuonCount {}
private

Definition at line 148 of file ZmumuEvent.h.

148{};

◆ m_analyzedEventCount

int ZmumuEvent::m_analyzedEventCount {}
private

Definition at line 143 of file ZmumuEvent.h.

143{};

◆ m_bLooseMatch

bool ZmumuEvent::m_bLooseMatch
private

Definition at line 125 of file ZmumuEvent.h.

◆ m_container

PerfMonServices::CONTAINERS ZmumuEvent::m_container
private

Definition at line 119 of file ZmumuEvent.h.

◆ m_DiMuonPairInvMass

double ZmumuEvent::m_DiMuonPairInvMass = 0.0
private

Definition at line 127 of file ZmumuEvent.h.

◆ m_doDebug

bool ZmumuEvent::m_doDebug
private

Definition at line 139 of file ZmumuEvent.h.

◆ m_etaCut

double ZmumuEvent::m_etaCut
private

Definition at line 126 of file ZmumuEvent.h.

◆ m_eventselectioncount_dimuoncharge

unsigned int ZmumuEvent::m_eventselectioncount_dimuoncharge {}
private

Definition at line 156 of file ZmumuEvent.h.

156{};

◆ m_eventselectioncount_goodlumiblock

unsigned int ZmumuEvent::m_eventselectioncount_goodlumiblock {}
private

Definition at line 157 of file ZmumuEvent.h.

157{};

◆ m_eventselectioncount_masswindow

unsigned int ZmumuEvent::m_eventselectioncount_masswindow {}
private

Definition at line 154 of file ZmumuEvent.h.

154{};

◆ m_eventselectioncount_morethantwomuons

unsigned int ZmumuEvent::m_eventselectioncount_morethantwomuons {}
private

Definition at line 151 of file ZmumuEvent.h.

151{};

◆ m_eventselectioncount_notallmuonsfilled

unsigned int ZmumuEvent::m_eventselectioncount_notallmuonsfilled {}
private

Definition at line 150 of file ZmumuEvent.h.

150{};

◆ m_eventselectioncount_openingangle

unsigned int ZmumuEvent::m_eventselectioncount_openingangle {}
private

Definition at line 155 of file ZmumuEvent.h.

155{};

◆ m_eventselectioncount_ptofleadingmuon

unsigned int ZmumuEvent::m_eventselectioncount_ptofleadingmuon {}
private

Definition at line 152 of file ZmumuEvent.h.

152{};

◆ m_eventselectioncount_ptofsecondmuon

unsigned int ZmumuEvent::m_eventselectioncount_ptofsecondmuon {}
private

Definition at line 153 of file ZmumuEvent.h.

153{};

◆ m_eventselectioncount_toofewmuons

unsigned int ZmumuEvent::m_eventselectioncount_toofewmuons {}
private

Definition at line 149 of file ZmumuEvent.h.

149{};

◆ m_eventsWithEnoughMuonsCount

unsigned int ZmumuEvent::m_eventsWithEnoughMuonsCount {}
private

Definition at line 145 of file ZmumuEvent.h.

145{};

◆ m_eventsWithoutEnoughMuonsCount

unsigned int ZmumuEvent::m_eventsWithoutEnoughMuonsCount {}
private

Definition at line 144 of file ZmumuEvent.h.

144{};

◆ m_fInvariantMass

float ZmumuEvent::m_fInvariantMass[NUM_TYPES] {}
private

Definition at line 169 of file ZmumuEvent.h.

169{};

◆ m_fMuonDispersion

float ZmumuEvent::m_fMuonDispersion[NUM_TYPES] {}
private

Definition at line 170 of file ZmumuEvent.h.

170{};

◆ m_fZEtaDir

float ZmumuEvent::m_fZEtaDir[NUM_TYPES] {}
private

Definition at line 167 of file ZmumuEvent.h.

167{};

◆ m_fZPhiDir

float ZmumuEvent::m_fZPhiDir[NUM_TYPES] {}
private

Definition at line 168 of file ZmumuEvent.h.

168{};

◆ m_fZPt

float ZmumuEvent::m_fZPt[NUM_TYPES] {}
private

Definition at line 166 of file ZmumuEvent.h.

166{};

◆ m_LeadingMuonPtCut

double ZmumuEvent::m_LeadingMuonPtCut
private

Definition at line 129 of file ZmumuEvent.h.

◆ m_MassWindowHigh

double ZmumuEvent::m_MassWindowHigh
private

Definition at line 132 of file ZmumuEvent.h.

◆ m_MassWindowLow

double ZmumuEvent::m_MassWindowLow
private

Definition at line 131 of file ZmumuEvent.h.

◆ m_maxGoodLumiBlock

int ZmumuEvent::m_maxGoodLumiBlock
private

Definition at line 137 of file ZmumuEvent.h.

◆ m_minGoodLumiBlock

int ZmumuEvent::m_minGoodLumiBlock
private

Definition at line 136 of file ZmumuEvent.h.

◆ m_muon1

int ZmumuEvent::m_muon1 = 0
private

Definition at line 184 of file ZmumuEvent.h.

◆ m_muon2

int ZmumuEvent::m_muon2 = 0
private

Definition at line 185 of file ZmumuEvent.h.

◆ m_muonSelectionTool

ToolHandle<CP::IMuonSelectionTool> ZmumuEvent::m_muonSelectionTool
private

Definition at line 120 of file ZmumuEvent.h.

◆ m_numberOfFullPassMuons

unsigned int ZmumuEvent::m_numberOfFullPassMuons {}
private

Definition at line 141 of file ZmumuEvent.h.

141{};

◆ m_OpeningAngleCut

double ZmumuEvent::m_OpeningAngleCut
private

Definition at line 133 of file ZmumuEvent.h.

◆ m_passedSelectionCuts

bool ZmumuEvent::m_passedSelectionCuts {}
private

Definition at line 142 of file ZmumuEvent.h.

142{};

◆ m_pxIDTrack

const xAOD::TrackParticle* ZmumuEvent::m_pxIDTrack[NUM_MUONS] {}
private

Definition at line 163 of file ZmumuEvent.h.

163{}; // Pointer to ID track

◆ m_pxMETrack

const xAOD::TrackParticle* ZmumuEvent::m_pxMETrack[NUM_MUONS] {}
private

Definition at line 161 of file ZmumuEvent.h.

161{}; // Pointer to muon spectro ( corr. )

◆ m_pxMSTrack

const xAOD::TrackParticle* ZmumuEvent::m_pxMSTrack[NUM_MUONS] {}
private

Definition at line 162 of file ZmumuEvent.h.

162{}; // Pointer to muon spectro

◆ m_pxRecMuon

const xAOD::Muon* ZmumuEvent::m_pxRecMuon[NUM_MUONS] {}
private

Definition at line 160 of file ZmumuEvent.h.

160{};

◆ m_SecondMuonPtCut

double ZmumuEvent::m_SecondMuonPtCut
private

Definition at line 130 of file ZmumuEvent.h.

◆ m_SelectMuonByIP

bool ZmumuEvent::m_SelectMuonByIP
private

Definition at line 181 of file ZmumuEvent.h.

◆ m_SelectMuonByIso

bool ZmumuEvent::m_SelectMuonByIso
private

Definition at line 180 of file ZmumuEvent.h.

◆ m_skipMScheck

bool ZmumuEvent::m_skipMScheck
private

Definition at line 135 of file ZmumuEvent.h.

◆ m_testedMuonCount

unsigned int ZmumuEvent::m_testedMuonCount {}
private

Definition at line 147 of file ZmumuEvent.h.

147{};

◆ m_uMuonTags

unsigned int ZmumuEvent::m_uMuonTags
private

Definition at line 123 of file ZmumuEvent.h.

◆ m_uPassedEvents

unsigned int EventAnalysis::m_uPassedEvents
protectedinherited

Definition at line 75 of file EventAnalysis.h.

◆ m_uTrackMatch

unsigned int ZmumuEvent::m_uTrackMatch
private

Definition at line 124 of file ZmumuEvent.h.

◆ m_x1DHistograms

std::map<unsigned int, TH1F*> EventAnalysis::m_x1DHistograms
protectedinherited

Definition at line 76 of file EventAnalysis.h.

◆ m_x1DProfHistograms

std::map<unsigned int, TProfile*> EventAnalysis::m_x1DProfHistograms
protectedinherited

Definition at line 78 of file EventAnalysis.h.

◆ m_x2DHistograms

std::map<unsigned int, TH2F*> EventAnalysis::m_x2DHistograms
protectedinherited

Definition at line 77 of file EventAnalysis.h.

◆ m_x2DProfHistograms

std::map<unsigned int, TProfile2D*> EventAnalysis::m_x2DProfHistograms
protectedinherited

Definition at line 79 of file EventAnalysis.h.

◆ m_xMuonID

MuonSelector ZmumuEvent::m_xMuonID
private

Definition at line 118 of file ZmumuEvent.h.

◆ m_xSampleName

std::string EventAnalysis::m_xSampleName
protectedinherited

Definition at line 81 of file EventAnalysis.h.

◆ m_Z0GapCut

double ZmumuEvent::m_Z0GapCut
private

Definition at line 134 of file ZmumuEvent.h.


The documentation for this class was generated from the following files: