22#include "CLHEP/Random/RandFlat.h"
28#include "CLHEP/Units/SystemOfUnits.h"
29#include "CLHEP/Units/PhysicalConstants.h"
113 if (
m_doDebug) { std::cout <<
" * ZmumuEvent * ZmumuEvent::Reco() starting " << std::endl; }
133 for(
auto muon : *pxMuonContainer ){
136 using enum xAOD::Muon::TrackParticleType;
137 idtrk = muon->trackParticle(InnerDetectorTrackParticle);
138 metrk = muon->trackParticle(ExtrapolatedMuonSpectrometerTrackParticle);
139 if (idtrk && metrk) {
142 InnerDetectorPtAcc(*muon) = idtrk->
pt();
143 MuonSpectrometerPtAcc(*muon) = metrk->
pt();
149 if (pxMuonContainer !=
nullptr) {
150 if (
m_doDebug) {std::cout <<
" * ZmumuEvent * track list has "<< pxMuonContainer->
size() <<
" muon in xAOD::MuonContainer " <<
m_container <<std::endl; }
154 int attemptedMuonCount = 0;
155 int acceptedMuonCount = 0;
157 while ( xMuonItr != xMuonItrE ){
159 attemptedMuonCount++;
161 if(
m_doDebug){std::cout <<
" * ZmumuEvent * Reco() ** attempt on xMuonItr number "<< attemptedMuonCount <<
" (pointer: "<< *xMuonItr <<
")" << std::endl; }
163 if (
m_xMuonID.passSelection( pxCMuon) ) {
167 if (
m_doDebug) {std::cout <<
" This muon is accepeted !! this is muon number " << acceptedMuonCount <<
" & full pass" <<
m_numberOfFullPassMuons << std::endl; }
172 if (
m_doDebug) {std::cout <<
" * ZmumuEvent * accepted " << acceptedMuonCount <<
" muons from the input list of "<< pxMuonContainer->
size() <<std::endl; }
178 std::cout <<
" * ZmumuEvent * Can't retrieve combined muon collection (container: " <<
m_container <<
") " << std::endl;
221 if(
m_doDebug) {std::cout <<
" * ZmumuEvent * Event selection ** START ** for type: " << eType <<
" m_NumberOfFullPassMuons: " <<
m_numberOfFullPassMuons << std::endl;}
231 bool allMuonsGood =
true;
234 allMuonsGood =
false;
249 double leadingMuonPt, secondMuonPt;
283 if (secondMuonPt > leadingMuonPt) {
284 double tempPt = leadingMuonPt;
285 leadingMuonPt = secondMuonPt;
286 secondMuonPt = tempPt;
292 if(
m_doDebug){ std::cout <<
" * ZmumuEvent * Failing 1st muon pt cut * Reco Pt: " << leadingMuonPt <<
" < " <<
m_LeadingMuonPtCut*CLHEP::GeV << std::endl;}
298 if(
m_doDebug){ std::cout <<
" * ZmumuEvent * Failing 2nd muon pt cut * Reco Pt: " << secondMuonPt <<
" < " <<
m_SecondMuonPtCut*CLHEP::GeV << std::endl;}
340 std::cout <<
" * ZmumuEvent * z0_muon1= " << z0_muon1 <<
" z0_muon2= " << z0_muon2 <<
" delta= " << z0_muon1-z0_muon2 << std::endl;
342 if ( std::abs(z0_muon1 - z0_muon2) >
m_Z0GapCut) {
346 std::cout <<
" * ZmumuEvent * z0_muon1= " << z0_muon1 <<
" z0_muon2= " << z0_muon2 <<
" delta= " << z0_muon1-z0_muon2 <<
" > " <<
m_Z0GapCut <<
" (cut)" << std::endl;
354 std::cout <<
" * ZmumuEvent * Good muon pair: pt= " << leadingMuonPt/1000
355 <<
" & " << secondMuonPt/1000
356 <<
" GeV dimuon invariant mass = " <<
m_fInvariantMass[eType] <<
" GeV " << std::endl;
370 for (
unsigned int u = 0; u <
NUM_MUONS; ++u ) {
376 for (
unsigned int v = 0; v <
NUM_TYPES; ++v ) {
393 if(
m_doDebug) { std::cout <<
" * ZmumuEvent * RecordMuon * bad pxMuon --> EXIT "<< std::endl;}
403 if(
m_doDebug){ std::cout <<
" * ZmumuEvent * RecordMuon * bad pxMSmuon --> EXIT "<< std::endl;}
569 if ( pxTrackContainer )
573 while ( xTrkItr != xTrkItrE )
576 if ( !pxTrack )
continue;
578 if(!pxTrkTrack)
continue;
580 if ( !pxPerigee )
continue;
581 const float fTrkPhi = pxPerigee->parameters()[
Trk::phi];
582 const float fTrkEta = pxPerigee->
eta();
586 float fDR = sqrt( fDPhi*fDPhi + fDEta*fDEta );
638 double muPlusPt = 0.;
639 double muMinusPt = 0.;
658 if (muPlusId>=0 && muMinusId>=0) {
664 <<
" mu+: " << muPlusId <<
" mu-: " << muMinusId << std::endl;}
674 std::cout <<
" ** ZmumuEvent ** -- STATS -- " << std::endl
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
double charge(const T &p)
Helper class to provide type-safe access to aux data.
DataModel_detail::const_iterator< DataVector > const_iterator
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
static float EvaluateAngle(const T *pxP1, const T *pxP2)
static float EvalDiMuInvMass(const T *pxP1, const T *pxP2)
static float EvalCharge(const T *pxP1, const T *pxP2)
static float EvalPhi(const T *pxP1, const T *pxP2)
static float EvalPtDiff(const T *pxP1, const T *pxP2)
static float EvalPt(const T *pxP1, const T *pxP2)
static float EvalEta(const T *pxP1, const T *pxP2)
std::string m_xSampleName
static const T * getContainer(CONTAINERS eContainer)
double eta() const
Access method for pseudorapidity - from momentum.
const Perigee * perigeeParameters() const
return Perigee.
double m_LeadingMuonPtCut
float getPtImbalance(ZTYPE eType)
unsigned int m_testedMuonCount
unsigned int m_eventselectioncount_masswindow
int getZCharge(ZTYPE eType)
unsigned int m_acceptedEventCount
float m_fZEtaDir[NUM_TYPES]
const xAOD::TrackParticle * m_pxMSTrack[NUM_MUONS]
unsigned int m_eventsWithEnoughMuonsCount
void ReconstructKinematics()
unsigned int m_eventselectioncount_toofewmuons
unsigned int m_eventselectioncount_goodlumiblock
unsigned int m_eventselectioncount_ptofsecondmuon
float m_fZPhiDir[NUM_TYPES]
bool EventSelection(ZTYPE eType)
unsigned int m_eventsWithoutEnoughMuonsCount
unsigned int m_uTrackMatch
unsigned int m_eventselectioncount_notallmuonsfilled
unsigned int m_eventselectioncount_openingangle
const xAOD::TrackParticle * m_pxIDTrack[NUM_MUONS]
const xAOD::Muon * m_pxRecMuon[NUM_MUONS]
unsigned int getNumberOfTaggedMuons()
unsigned int getPosMuon(ZTYPE eType)
float m_fInvariantMass[NUM_TYPES]
float m_fMuonDispersion[NUM_TYPES]
unsigned int m_numberOfFullPassMuons
unsigned int m_acceptedMuonCount
bool m_passedSelectionCuts
unsigned int m_eventselectioncount_morethantwomuons
void SetSecondMuonPtCut(double newvalue)
const std::string getRegion() const
void SetLeadingMuonPtCut(double newvalue)
void SetMuonPtCut(double newvalue)
const xAOD::TrackParticle * m_pxMETrack[NUM_MUONS]
unsigned int m_eventselectioncount_dimuoncharge
unsigned int m_eventselectioncount_ptofleadingmuon
virtual bool Reco(int theLumiBlock=0)
PerfMonServices::CONTAINERS m_container
bool RecordMuon(const xAOD::Muon *pxMuon)
unsigned int getNegMuon(ZTYPE eType)
double m_DiMuonPairInvMass
virtual void BookHistograms()
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be NULL) to the TrackParticle used in identification of this muon.
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
SG::Decorator< T, ALLOC > Decorator
Helper class to provide type-safe access to aux data, specialized for JaggedVecElt.
ParametersT< TrackParametersDim, Charged, PerigeeSurface > Perigee
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TrackParticleContainer_v1 TrackParticleContainer
Definition of the current "TrackParticle container version".
Muon_v1 Muon
Reference the current persistent version:
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".