ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Types | Private Member Functions | Private Attributes | List of all members
FourMuonEvent Class Reference

#include <FourMuonEvent.h>

Inheritance diagram for FourMuonEvent:
Collaboration diagram for FourMuonEvent:

Public Types

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

Public Member Functions

 FourMuonEvent ()
 
virtual ~FourMuonEvent ()
 
 FourMuonEvent (const FourMuonEvent &)=delete
 
FourMuonEventoperator= (const FourMuonEvent &)=delete
 
void Init ()
 
bool Reco ()
 
void doIsoSelection (bool doIso)
 
void doIPSelection (bool doIPsel)
 
void doMCPSelection (bool doMCP)
 
bool EventPassed ()
 
const float & get4MuInvMass (ZTYPE eType)
 
int getAcceptedEvents ()
 
const xAOD::MuongetCombMuon (unsigned int uPart)
 
const xAOD::TrackParticlegetELTrack (unsigned int uPart)
 
const xAOD::TrackParticlegetIDTrack (unsigned int uPart)
 
double GetInvMass ()
 
const xAOD::TrackParticlegetMSTrack (unsigned int uPart)
 
const xAOD::TrackParticlegetLooseIDTk (unsigned int uPart)
 
const float & getLeptonOpeningAngle (ZTYPE eType)
 
unsigned int getNegMuon (int eType)
 
unsigned int getNumberOfTaggedMuons ()
 
int GetNVertex ()
 
float getPtImbalance (ZTYPE eType)
 
const std::string getRegion () const
 
unsigned int getPosMuon (int eType)
 
int GetVertexElec (unsigned int uPart)
 
int GetVertexElNeg1 ()
 
int GetVertexElNeg2 ()
 
int GetVertexElPos1 ()
 
int GetVertexElPos2 ()
 
int GetVertexMuNeg1 ()
 
int GetVertexMuNeg2 ()
 
int GetVertexMuPos1 ()
 
int GetVertexMuPos2 ()
 
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 setContainer (PerfMonServices::CONTAINERS container)
 
void setDebugMode (bool debug)
 
void SetLeadingMuonPtCut (double newvalue)
 
void SetMassWindowLow (double newvalue)
 
void SetMassWindowHigh (double newvalue)
 
void SetMuonPtCut (double newvalue)
 
void SetMuonSelectionTool (ToolHandle< CP::IMuonSelectionTool > mst)
 
void SetSecondMuonPtCut (double newvalue)
 
void SetOpeningAngleCut (double newvalue)
 
void SetZ0GapCut (double newvalue)
 

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

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

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

Private Attributes

MsgStream * m_msgStream
 
MuonSelector m_xMuonID
 
ElectronSelector m_xElecID
 
PerfMonServices::CONTAINERS m_container
 
unsigned int m_uMuonTags {}
 
double m_FourMuonInvMass {}
 
double m_LeadingMuonPtCut {}
 
double m_SecondMuonPtCut {}
 
double m_MassWindowLow {}
 
double m_MassWindowHigh {}
 
double m_OpeningAngleCut {}
 
double m_deltaXYcut {}
 
double m_Z0GapCut {}
 
bool m_doDebug
 
bool m_workAsFourMuons
 
bool m_workAsFourElectrons
 
bool m_workAsFourLeptons
 
unsigned int m_numberOfFullPassMuons {}
 
unsigned int m_numberOfFullPassElectrons {}
 
bool m_passedSelectionCuts = false
 
bool m_passedFourMuonSelection = false
 
bool m_passedFourElectronSelection = false
 
bool m_passedFourLeptonSelection = false
 
const xAOD::Muonm_pxRecMuon [NUM_MUONS] {}
 
const xAOD::TrackParticlem_pxMETrack [NUM_MUONS] {}
 
const xAOD::TrackParticlem_pxMSTrack [NUM_MUONS] {}
 
const xAOD::TrackParticlem_pxIDTrack [NUM_MUONS] {}
 
const xAOD::TrackParticlem_pxELTrack [NUM_MUONS] {}
 
const xAOD::TrackParticlem_pxMUTrack [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_eventCount
 
int m_acceptedEventCount
 
int m_acceptedMuonCount {}
 
int m_acceptedElecCount {}
 
int m_muon1 = 0
 
int m_muon2 = 0
 
int m_muonpos1 = 0
 
int m_muonpos2 = 0
 
int m_muonneg1 = 0
 
int m_muonneg2 = 0
 
int m_nVertex = 0
 
int m_muonneg1_vtx = 0
 
int m_muonneg2_vtx = 0
 
int m_muonpos1_vtx = 0
 
int m_muonpos2_vtx = 0
 
int m_muon_vtx [NUM_MUONS] {}
 
int m_elec_vtx [NUM_MUONS] {}
 

Detailed Description

Definition at line 34 of file FourMuonEvent.h.

Member Typedef Documentation

◆ PARENT

Definition at line 123 of file FourMuonEvent.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MUON1 
MUON2 
MUON3 
MUON4 
NUM_MUONS 

Definition at line 43 of file FourMuonEvent.h.

44  {
45  MUON1,
46  MUON2,
47  MUON3,
48  MUON4,
49  NUM_MUONS
50  };

◆ anonymous enum

anonymous enum
Enumerator
CENTRAL 
FORWARD 
BACKWARD 
UNDEF 

Definition at line 52 of file FourMuonEvent.h.

53  {
54  CENTRAL,
55  FORWARD,
56  BACKWARD,
57  UNDEF
58  };

◆ HISTOS_1D

Enumerator
ZMASS_MUON 
ZMASS_MUONADJ 
ZMASS_TRACK 
ZMASS_COMB 
NUM_1HISTOS 

Definition at line 184 of file FourMuonEvent.h.

185  {
188  };

◆ ZTYPE

Enumerator
MS 
ME 
ID 
CB 
NUM_TYPES 

Definition at line 60 of file FourMuonEvent.h.

61  {
62  MS, // Just the muon system ( uncorrected )
63  ME, // The adjusted muon system properties ( corr. for cal. )
64  ID, // Using the ID system.
65  CB, // Using both the muon & ID system.
66  NUM_TYPES
67  };

Constructor & Destructor Documentation

◆ FourMuonEvent() [1/2]

FourMuonEvent::FourMuonEvent ( )

Definition at line 29 of file FourMuonEvent.cxx.

30 {
31  m_xSampleName = "FourMuon";
32 
33  m_container = PerfMonServices::MUON_COLLECTION; //PerfMonServices::ELECTRON_COLLECTION
34 
35  m_doDebug = false;
36  m_workAsFourMuons = false;
37  m_workAsFourElectrons = false;
38  m_workAsFourLeptons = true;
39 
40  // Setup the muon tags
41  m_uMuonTags = 4;
42  m_LeadingMuonPtCut = 20.;
43  m_SecondMuonPtCut = 15.;
44  m_MassWindowLow = 10.0;
45  m_MassWindowHigh = 125.0;
46  m_deltaXYcut = 0.1; // in mm
47  m_Z0GapCut = 5.0; // in mm
48  m_SelectMuonByIso = true;
49  m_SelectMuonByIP = true;
50  m_eventCount = 0;
54 
55  m_msgStream = new MsgStream(Athena::getMessageSvc(), "InDetPerformanceMonitoring" );
56 }

◆ ~FourMuonEvent()

FourMuonEvent::~FourMuonEvent ( )
virtual

Definition at line 59 of file FourMuonEvent.cxx.

60 {
61  delete m_msgStream;
62 }

◆ FourMuonEvent() [2/2]

FourMuonEvent::FourMuonEvent ( const FourMuonEvent )
delete

Member Function Documentation

◆ BookHistograms()

void FourMuonEvent::BookHistograms ( )
protectedvirtual

Reimplemented from EventAnalysis.

Definition at line 255 of file FourMuonEvent.cxx.

256 {
257 }

◆ calculateMomentum()

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

Definition at line 91 of file EventAnalysis.h.

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

◆ CheckMuonVertices()

bool FourMuonEvent::CheckMuonVertices ( )
private

Definition at line 1471 of file FourMuonEvent.cxx.

1472 {
1473  (*m_msgStream) << MSG::DEBUG << " * FourMuonsEvents::CheckMuonVertices * -- START --" << endmsg;
1474 
1475  bool goodvertices = false;
1476  goodvertices = true; // R22 set true by default. Needs to be revisited
1477  int nverticesfound = 0;
1478 
1479  // loop on mu-, and for each mu-, loop on mu+ and check at least one mu+ and mu- come from the same vertex
1480  // mu- indices are 0 or 1
1481  for (unsigned int imuneg = 0; imuneg <= 1; imuneg++) {
1482  if (m_pxMUTrack[imuneg] != nullptr) {
1483  /* R21 SALVA --> vertex is not available in R22 --> A FIX IS NEEDED */
1484  /*
1485  if (m_pxMUTrack[imuneg]->vertex()) {
1486 
1487  if (m_doDebug) std::cout << " mu-(" << imuneg <<")->vertex()->v= (" << m_pxMUTrack[imuneg]->vertex()->x()
1488  << ", " << m_pxMUTrack[imuneg]->vertex()->y()
1489  << ", " << m_pxMUTrack[imuneg]->vertex()->z()
1490  << ") " << std::endl;
1491 
1492  for (unsigned int imupos = 2; imupos <= 3; imupos++) { // mu+ indices are 2 and 3
1493  if (m_pxMUTrack[imupos] != nullptr) {
1494  if (m_pxMUTrack[imupos]->vertex()) {
1495  if (m_doDebug) std::cout << " mu+(" << imupos <<")->vertex()->v= (" << m_pxMUTrack[imupos]->vertex()->x()
1496  << ", " << m_pxMUTrack[imupos]->vertex()->y()
1497  << ", " << m_pxMUTrack[imupos]->vertex()->z()
1498  << ") " << std::endl;
1499 
1500  float delta_x = fabs( m_pxMUTrack[imuneg]->vertex()->x() - m_pxMUTrack[imupos]->vertex()->x());
1501  float delta_y = fabs( m_pxMUTrack[imuneg]->vertex()->y() - m_pxMUTrack[imupos]->vertex()->y());
1502  float delta_z = fabs( m_pxMUTrack[imuneg]->vertex()->z() - m_pxMUTrack[imupos]->vertex()->z());
1503 
1504  if (delta_x < m_deltaXYcut && delta_y < m_deltaXYcut && delta_z < m_Z0GapCut) {
1505  nverticesfound++;
1506  if (m_doDebug) std::cout << " MUON-BINGO !!! mu+mu- pair in same vertex !!! mu-[" << imuneg
1507  << "] mu+[" << imupos<< "] count: " << nverticesfound << std::endl;
1508  } // vertex is the same
1509  } // mu+ has vertex
1510  } // mu+ exists
1511  } // loop on mu+
1512  } // mu- has vertex
1513  */
1514  } // mu- exists
1515  } // loop on mu-
1516 
1517  if (nverticesfound >= 1) goodvertices = true;
1518 
1519  if (nverticesfound == 0) if (m_doDebug) std::cout << " -- FourMuonEvent::CheckMuonVertices -- WARNING -- MUONS DO NOT COME FROM SAME VERTEX " << std::endl;
1520 
1521  (*m_msgStream) << MSG::DEBUG << " * FourMuonsEvents::CheckMuonVertices * -- COMPLETED -- status: " << goodvertices << endmsg;
1522  return goodvertices;
1523 }

◆ Clear()

void FourMuonEvent::Clear ( )
private

Definition at line 875 of file FourMuonEvent.cxx.

876 {
879  m_passedSelectionCuts = false;
883 
884 
885  m_FourMuonInvMass = -1.; // flag as no reconstructed inv mass yet
886  m_muon1 = MUON1; // point to the first two
887  m_muon2 = MUON2;
888  m_muonneg1 = -1;
889  m_muonneg2 = -1;
890  m_muonpos1 = -1;
891  m_muonpos2 = -1;
892 
893 
894  for ( unsigned int u = 0; u < NUM_MUONS; ++u ) {
895  m_pxRecMuon[u] = nullptr;
896  m_pxMSTrack[u] = nullptr;
897  m_pxMETrack[u] = nullptr;
898  m_pxIDTrack[u] = nullptr;
899  m_pxMUTrack[u] = nullptr;
900  m_pxELTrack[u] = nullptr;
901  }
902  for ( unsigned int v = 0; v < NUM_TYPES; ++v ) {
903  m_fZPt[v] = -999.9f;
904  m_fZEtaDir[v] = -999.9f;
905  m_fZPhiDir[v] = -999.9f;
906  m_fInvariantMass[v] = -999.9f;
907  m_fMuonDispersion[v] = -999.9f;
908  }
909 
910  // tell us to which vertex the muons are associated
911  m_nVertex = 0; // reset vertex count
912  m_muonneg1_vtx = 0;
913  m_muonneg2_vtx = 0;
914  m_muonpos1_vtx = 0;
915  m_muonpos2_vtx = 0;
916 
917  for (size_t i=0; i < NUM_MUONS; i++) m_muon_vtx[i] = 0; // reset the vertex ID to which the electrons are associated
918  for (size_t i=0; i < NUM_MUONS; i++) m_elec_vtx[i] = 0; // reset the vertex ID to which the electrons are associated
919  return;
920 }

◆ doIPSelection()

void FourMuonEvent::doIPSelection ( bool  doIPsel)
inline

Definition at line 74 of file FourMuonEvent.h.

74 { m_xMuonID.doIPSelection(doIPsel); }

◆ doIsoSelection()

void FourMuonEvent::doIsoSelection ( bool  doIso)
inline

Definition at line 73 of file FourMuonEvent.h.

73 { m_xMuonID.doIsoSelection(doIso); }

◆ doMCPSelection()

void FourMuonEvent::doMCPSelection ( bool  doMCP)
inline

Definition at line 75 of file FourMuonEvent.h.

75 { m_xMuonID.doMCPSelection(doMCP); }

◆ EvalCharge()

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

Definition at line 238 of file EventAnalysis.h.

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

◆ EvalDiMuInvMass()

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

Definition at line 97 of file EventAnalysis.h.

98 {
99  // Check integrity of inputs.
100  if ( !pxP1 || !pxP2 ) return invalidAnswer;
101 
102  // Evaluate Di-mu invariant mass.
103  return EvalInvMass( pxP1, pxP2, EAna::g_fMuonMass );
104 }

◆ EvalEta()

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

Definition at line 229 of file EventAnalysis.h.

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

◆ EvalEtaDiff()

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

Definition at line 201 of file EventAnalysis.h.

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

◆ EvalFourMuInvMass()

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

Definition at line 123 of file EventAnalysis.h.

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

◆ 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 132 of file EventAnalysis.h.

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

◆ EvalInvMass() [2/2]

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

Definition at line 106 of file EventAnalysis.h.

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

◆ EvalPhi()

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

Definition at line 220 of file EventAnalysis.h.

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

◆ EvalPhiDiff()

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

Definition at line 190 of file EventAnalysis.h.

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

◆ EvalPt()

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

Definition at line 211 of file EventAnalysis.h.

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

◆ EvalPtDiff()

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

Definition at line 173 of file EventAnalysis.h.

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

◆ EvalTransverseMass() [1/4]

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

Definition at line 271 of file EventAnalysis.h.

272 {
273  // Check integrity of inputs.
274  if ( !pxP1 || !pxP2 ) return invalidAnswer;
275  // Evaluate Di-mu invariant mass.
276  return EvalTransverseMass( pxP1, pxP2, fMETx, fMETy, EAna::g_fMuonMass );
277 }

◆ 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 279 of file EventAnalysis.h.

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

◆ EvalTransverseMass() [3/4]

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

Definition at line 246 of file EventAnalysis.h.

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

◆ 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 254 of file EventAnalysis.h.

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

◆ EvaluateAngle()

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

Definition at line 163 of file EventAnalysis.h.

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

◆ EventPassed()

bool FourMuonEvent::EventPassed ( )
inline

Definition at line 76 of file FourMuonEvent.h.

76 { return m_passedSelectionCuts; }

◆ EventSelection()

bool FourMuonEvent::EventSelection ( ZTYPE  eType)
private

Definition at line 555 of file FourMuonEvent.cxx.

556 {
557  if(m_doDebug){ std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") ** started ** " << std::endl
558  << " event count: " << m_eventCount << std::endl
559  << " m_NumberOfFullPassMuons: " << m_numberOfFullPassMuons << std::endl
560  << " m_NumberOfFullPassElectrons: " << m_numberOfFullPassElectrons
561  << std::endl;
562  }
563 
564  // First require two muon-id's with cuts pre-applied.
566  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing number of good muons and electrons == 4 :( "
568  << " = " << m_numberOfFullPassMuons << " + " << m_numberOfFullPassElectrons << std::endl;}
569  return false;
570  }
571 
572  if ( m_numberOfFullPassMuons > 4 ) {
573  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Too many muons !! Failing number of good muons == 4 :( "
574  << m_numberOfFullPassMuons << std::endl;}
575  return false;
576  }
577 
578  if ( m_numberOfFullPassElectrons > 4 ) {
579  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Too many electrons !! Failing number of good electrons == 4 :( "
580  << m_numberOfFullPassElectrons << std::endl;}
581  return false;
582  }
583 
584  // momentum of the muons
585  double leadingMuonPt = -1., secondMuonPt=-1., thirdMuonPt=-1, fourthMuonPt=-1.; // negative pt, means not computed yet
586  switch ( eType ) {
587  case MS :
588  {
589  if (m_muonpos1 >= 0) leadingMuonPt = m_pxMSTrack[m_muonpos1]->pt();
590  if (m_muonpos2 >= 0) secondMuonPt = m_pxMSTrack[m_muonpos2]->pt();
591  if (m_muonneg1 >= 0) thirdMuonPt = m_pxMSTrack[m_muonneg1]->pt();
592  if (m_muonneg2 >= 0) fourthMuonPt = m_pxMSTrack[m_muonneg2]->pt();
593  break;
594  }
595  case ME:
596  {
597  if (m_muonpos1 >= 0) leadingMuonPt = m_pxMETrack[m_muonpos1]->pt();
598  if (m_muonpos2 >= 0) secondMuonPt = m_pxMETrack[m_muonpos2]->pt();
599  if (m_muonneg1 >= 0) thirdMuonPt = m_pxMETrack[m_muonneg1]->pt();
600  if (m_muonneg2 >= 0) fourthMuonPt = m_pxMETrack[m_muonneg2]->pt();
601  break;
602  }
603  case CB:
604  {
605  if (m_muonpos1 >= 0) leadingMuonPt = m_pxRecMuon[m_muonpos1]->pt();
606  if (m_muonpos2 >= 0) secondMuonPt = m_pxRecMuon[m_muonpos2]->pt();
607  if (m_muonneg1 >= 0) thirdMuonPt = m_pxRecMuon[m_muonneg1]->pt();
608  if (m_muonneg2 >= 0) fourthMuonPt = m_pxRecMuon[m_muonneg2]->pt();
609  break;
610  }
611  case ID:
612  {
613  if (m_muonpos1 >= 0) leadingMuonPt = m_pxIDTrack[m_muonpos1]->pt();
614  if (m_muonpos2 >= 0) secondMuonPt = m_pxIDTrack[m_muonpos2]->pt();
615  if (m_muonneg1 >= 0) thirdMuonPt = m_pxIDTrack[m_muonneg1]->pt();
616  if (m_muonneg2 >= 0) fourthMuonPt = m_pxIDTrack[m_muonneg2]->pt();
617  break;
618  }
619 
620  default:
621  if (m_muonpos1 >= 0) leadingMuonPt = m_pxIDTrack[m_muonpos1]->pt();
622  if (m_muonpos2 >= 0) secondMuonPt = m_pxIDTrack[m_muonpos2]->pt();
623  if (m_muonneg1 >= 0) thirdMuonPt = m_pxIDTrack[m_muonneg1]->pt();
624  if (m_muonneg2 >= 0) fourthMuonPt = m_pxIDTrack[m_muonneg2]->pt();
625  } // end switch
626 
627  // up to here the leading and second pt are not really in the right order.
628  // order the muon pt:
629  double theLeadingPt = leadingMuonPt;
630  if (secondMuonPt > theLeadingPt) { theLeadingPt = secondMuonPt;}
631  if (thirdMuonPt > theLeadingPt) { theLeadingPt = thirdMuonPt;}
632  if (fourthMuonPt > theLeadingPt) { theLeadingPt = fourthMuonPt;}
633 
634  double theTrailingPt = leadingMuonPt;
635  if (secondMuonPt < theTrailingPt && secondMuonPt > 0) { theTrailingPt = secondMuonPt;}
636  if (thirdMuonPt < theTrailingPt && thirdMuonPt > 0) { theTrailingPt = thirdMuonPt;}
637  if (fourthMuonPt < theTrailingPt && fourthMuonPt > 0) { theTrailingPt = fourthMuonPt;}
638 
639  if (m_doDebug || true) {
640  std::cout << " * FourMuonEvent::EventSelection * muon pt selection -- cuts: Leading: " << m_LeadingMuonPtCut*CLHEP::GeV << std::endl
641  << " 2nd: " << m_SecondMuonPtCut*CLHEP::GeV << std::endl;
642  std::cout << " Pt of muons in this event 1: " << leadingMuonPt << std::endl
643  << " 2: " << secondMuonPt << std::endl
644  << " 3: " << thirdMuonPt << std::endl
645  << " 4: " << fourthMuonPt << std::endl
646  << " leading Pt: " << theLeadingPt << std::endl
647  << " trailing Pt: " << theTrailingPt << std::endl;
648  }
649 
650  // muon pt cut
651  if ( !(theLeadingPt > m_LeadingMuonPtCut*CLHEP::GeV && theTrailingPt > m_SecondMuonPtCut*CLHEP::GeV ) ) {
652  if(m_doDebug){
653  std::cout <<" * FourMuonEvent::EventSelection * Failing pt cut * Reco Pt: leading " << theLeadingPt << " --> trailing " << theTrailingPt << std::endl;
654  }
655  return false;
656  }
657  if(m_doDebug){
658  std::cout << " * FourMuonEvent::EventSelection * Event passed the pt cuts: leading muon pt: " << leadingMuonPt << std::endl;
659  std::cout << " trailing muon pt: " << theTrailingPt << std::endl;
660  }
661 
662 
663  // Invariant mass window
664  if ( m_fInvariantMass[eType] < m_MassWindowLow ) {
665  if(m_doDebug) {
666  std::cout <<" * FourMuonEvent::EventSelection * Failing mass window low cut: reco m= " << m_fInvariantMass[eType] << " > " << m_MassWindowLow << std::endl;
667  }
668  return false;
669  }
670  if ( m_fInvariantMass[eType] > m_MassWindowHigh ) {
671  if(m_doDebug) {
672  std::cout <<" * FourMuonEvent * Failing mass window high cut: reco m= " << m_fInvariantMass[eType] << " > " << m_MassWindowHigh << std::endl;
673  }
674  return false;
675  }
676  if(m_doDebug){
677  std::cout <<" * FourMuonEvent::EventSelection * Event passed the mass window: " << m_fInvariantMass[eType] << std::endl;
678  }
679 
680 
681  // All muons should come from the same vertex
682  // if the vertex information is used, that is already guaranteed, but if not, one has to check the z0
683 
684  /* R21 SALVA --> vertex is not available in R22 --> A FIX IS NEEDED */
685  /*
686  if (eType == ID) {
687  bool vertexstatus = true;
688  if (m_pxIDTrack[m_muonpos1]->vertex() != nullptr) {
689  if(m_doDebug) {
690  std::cout <<" * FourMuonEvent::EventSelection * vertex of the muons -- ID Tracks --" << std::endl;
691  std::cout << " vertex muonpos_1 (x,y,z): (" << m_pxIDTrack[m_muonpos1]->vertex()->x()
692  << ", " << m_pxIDTrack[m_muonpos1]->vertex()->y()
693  << ", " << m_pxIDTrack[m_muonpos1]->vertex()->z()
694  << ") --> pt: " << m_pxIDTrack[m_muonpos1]->pt()
695  << std::endl;
696  }
697  }
698  else {
699  vertexstatus = false;
700  if(m_doDebug) std::cout <<" * FourMuonEvent::EventSelection * WARNING muonpos_1 (" << m_muonpos1 << ") has no vertex " << std::endl;
701  }
702  if (m_pxIDTrack[m_muonpos2]->vertex() != nullptr) {
703  if(m_doDebug) {
704  std::cout << " vertex muonpos_2 (x,y,z): (" << m_pxIDTrack[m_muonpos2]->vertex()->x()
705  << ", " << m_pxIDTrack[m_muonpos2]->vertex()->y()
706  << ", " << m_pxIDTrack[m_muonpos2]->vertex()->z()
707  << ") --> pt: " << m_pxIDTrack[m_muonpos2]->pt()
708  << std::endl;
709  }
710  }
711  else{
712  vertexstatus = false;
713  if(m_doDebug) std::cout <<" * FourMuonEvent::EventSelection * WARNING muonpos_2 (" << m_muonpos2 << ") has no vertex " << std::endl;
714  }
715  if (m_pxIDTrack[m_muonneg1]->vertex() != nullptr) {
716  if(m_doDebug) {
717  std::cout << " vertex muonneg_1 (x,y,z): (" << m_pxIDTrack[m_muonneg1]->vertex()->x()
718  << ", " << m_pxIDTrack[m_muonneg1]->vertex()->y()
719  << ", " << m_pxIDTrack[m_muonneg1]->vertex()->z()
720  << ") --> pt: " << m_pxIDTrack[m_muonneg1]->pt()
721  << std::endl;
722  }
723  }
724  else{
725  vertexstatus = false;
726  if(m_doDebug) std::cout <<" * FourMuonEvent::EventSelection * WARNING muonneg_1 (" << m_muonneg1 << ") has no vertex " << std::endl;
727  }
728 
729  if (m_pxIDTrack[m_muonneg2]->vertex() != nullptr) {
730  if(m_doDebug) {
731  std::cout << " vertex muonneg_2 (x,y,z): (" << m_pxIDTrack[m_muonneg2]->vertex()->x()
732  << ", " << m_pxIDTrack[m_muonneg2]->vertex()->y()
733  << ", " << m_pxIDTrack[m_muonneg2]->vertex()->z()
734  << ") --> pt: " << m_pxIDTrack[m_muonneg2]->pt()
735  << std::endl;
736  }
737  }
738  else{
739  vertexstatus = false;
740  if(m_doDebug) std::cout <<" * FourMuonEvent::EventSelection * WARNING muonneg_2 (" << m_muonneg2 << ") has no vertex " << std::endl;
741  }
742  if (vertexstatus) { // this means: all muons have vertex associated. Let's check it is the same.
743  if(m_doDebug) std::cout << " -- debug -- * FourMuonEvent::EventSelection * let's find the number of muon-vertices... " << std::endl;
744 
745  std::vector <float> vtxListX;
746  std::vector <float> vtxListZ;
747  float rGapCut = 0.1;
748  // add the vertex of the 1st in the list (the muonneg1)
749  vtxListX.push_back(m_pxIDTrack[m_muonneg1]->vertex()->x());
750  vtxListZ.push_back(m_pxIDTrack[m_muonneg1]->vertex()->z());
751  m_nVertex = 1; // for the time being there is just one vertex
752  m_muonneg1_vtx = m_nVertex; // and the muonneg1 is in that one
753  if(m_doDebug) {
754  std::cout << " * FourMuonEvent::EventSelection * muonneg1 in vertex: " << m_muonneg1_vtx << std::endl;
755  }
756 
757  // m_muonneg 2
758  bool thisMuonIsInExistingVertex = false;
759  for (int ivtx=0; ivtx < (int) vtxListX.size(); ivtx++) {
760  if ( fabs(vtxListX.at(ivtx) - m_pxIDTrack[m_muonneg2]->vertex()->x()) < rGapCut &&
761  fabs(vtxListZ.at(ivtx) - m_pxIDTrack[m_muonneg2]->vertex()->z()) < m_Z0GapCut) {
762  // muonneg2 in an already listed vertex
763  m_muonneg2_vtx = ivtx+1;
764  thisMuonIsInExistingVertex = true;
765  }
766  }
767  if (thisMuonIsInExistingVertex) {
768  if(m_doDebug) {
769  std::cout << " * FourMuonEvent::EventSelection * muonneg2 in vertex: " << m_muonneg2_vtx << std::endl;
770  }
771  }
772  else {
773  m_nVertex += 1; // add new vertex
774  m_muonneg2_vtx = m_nVertex;
775  vtxListX.push_back(m_pxIDTrack[m_muonneg2]->vertex()->x());
776  vtxListZ.push_back(m_pxIDTrack[m_muonneg2]->vertex()->z());
777  if(m_doDebug) {
778  std::cout << " * FourMuonEvent::EventSelection * Add a new vertex to the list. Current size: " << vtxListX.size()
779  << " vtx.x= " << m_pxIDTrack[m_muonneg2]->vertex()->x()
780  << " vtx.y= " << m_pxIDTrack[m_muonneg2]->vertex()->y()
781  << " vtx.z= " << m_pxIDTrack[m_muonneg2]->vertex()->z()
782  << std::endl;
783  std::cout << " * FourMuonEvent::EventSelection * muonneg2 in vertex: " << m_muonneg2_vtx << std::endl;
784  }
785  }
786 
787  // m_muonpos 1
788  thisMuonIsInExistingVertex = false;
789  for (int ivtx=0; ivtx < (int) vtxListX.size(); ivtx++) {
790  if ( fabs(vtxListX.at(ivtx) - m_pxIDTrack[m_muonpos1]->vertex()->x()) < rGapCut &&
791  fabs(vtxListZ.at(ivtx) - m_pxIDTrack[m_muonpos1]->vertex()->z()) < m_Z0GapCut) {
792  // muonneg2 in an already listed vertex
793  m_muonpos1_vtx = ivtx+1;
794  thisMuonIsInExistingVertex = true;
795  }
796  }
797  if (thisMuonIsInExistingVertex) {
798  if(m_doDebug) {
799  std::cout << " * FourMuonEvent::EventSelection * muonpos1 in vertex: " << m_muonpos1_vtx << std::endl;
800  }
801  }
802  else {
803  m_nVertex += 1; // add new vertex
804  m_muonpos1_vtx = m_nVertex;
805  vtxListX.push_back(m_pxIDTrack[m_muonpos1]->vertex()->x());
806  vtxListZ.push_back(m_pxIDTrack[m_muonpos1]->vertex()->z());
807  if(m_doDebug) {
808  std::cout << " * FourMuonEvent::EventSelection * Add a new vertex to the list. Current size: " << vtxListX.size()
809  << " vtx.x= " << m_pxIDTrack[m_muonpos1]->vertex()->x()
810  << " vtx.y= " << m_pxIDTrack[m_muonpos1]->vertex()->y()
811  << " vtx.z= " << m_pxIDTrack[m_muonpos1]->vertex()->z()
812  << std::endl;
813  std::cout << " * FourMuonEvent::EventSelection * muonpos1 in vertex: " << m_muonpos1_vtx << std::endl;
814  }
815  }
816 
817  // m_muonpos 2
818  thisMuonIsInExistingVertex = false;
819  for (int ivtx=0; ivtx < (int) vtxListX.size(); ivtx++) {
820  if ( fabs(vtxListX.at(ivtx) - m_pxIDTrack[m_muonpos2]->vertex()->x()) < rGapCut &&
821  fabs(vtxListZ.at(ivtx) - m_pxIDTrack[m_muonpos2]->vertex()->z()) < m_Z0GapCut) {
822  // muonneg2 in an already listed vertex
823  m_muonpos2_vtx = ivtx+1;
824  thisMuonIsInExistingVertex = true;
825  }
826  }
827  if (thisMuonIsInExistingVertex) {
828  if(m_doDebug) {
829  std::cout << " * FourMuonEvent::EventSelection * muonpos2 in vertex: " << m_muonpos1_vtx << std::endl;
830  }
831  }
832  else {
833  m_nVertex += 1; // add new vertex
834  m_muonpos2_vtx = m_nVertex;
835  vtxListX.push_back(m_pxIDTrack[m_muonpos2]->vertex()->x());
836  vtxListZ.push_back(m_pxIDTrack[m_muonpos2]->vertex()->z());
837  if(m_doDebug) {
838  std::cout << " * FourMuonEvent::EventSelection * Add a new vertex to the list. Current size: " << vtxListX.size()
839  << " vtx.x= " << m_pxIDTrack[m_muonpos2]->vertex()->x()
840  << " vtx.y= " << m_pxIDTrack[m_muonpos2]->vertex()->y()
841  << " vtx.z= " << m_pxIDTrack[m_muonpos2]->vertex()->z()
842  << std::endl;
843  std::cout << " * FourMuonEvent::EventSelection * muonpos2 in vertex: " << m_muonpos2_vtx << std::endl;
844  }
845  }
846  }
847 
848  if (vertexstatus) {
849  if(m_doDebug) std::cout << " * FourMuonEvent::EventSelection ** All muons come from some vertex. " << std::endl
850  << " N listed vertex: " << m_nVertex << std::endl
851  << " muon- 1: " << m_muonneg1_vtx << std::endl
852  << " muon- 2: " << m_muonneg2_vtx << std::endl
853  << " muon+ 1: " << m_muonpos1_vtx << std::endl
854  << " muon+ 2: " << m_muonpos2_vtx << std::endl
855  << " Cut passed :) " << std::endl;
856  }
857  else { // vertex cut failed
858  if (m_doDebug) std::cout <<" * FourMuonEvent::EventSelection ** Failing all muons coming from a primary vertex cut :(" << std::endl;
859  return false;
860  }
861  } // if (eType == ID) {
862  */
863 
864 
865  if(m_doDebug) {
866  std::cout << " * FourMuonEvent::EventSelection( type= " << eType << ")* Good 4-muon set: pt range from " << leadingMuonPt/1000
867  << " to " << secondMuonPt/1000
868  << " GeV 4-muon invariant mass = " << m_fInvariantMass[eType] << " GeV " << std::endl;
869  std::cout << " * FourMuonEvent::EventSelection( type= " << eType << ")* completed * " << std::endl;
870  }
871  return true;
872 }

◆ EventSelectionNew()

bool FourMuonEvent::EventSelectionNew ( ZTYPE  eType)
private

Definition at line 262 of file FourMuonEvent.cxx.

263 {
264  bool inputdebug = m_doDebug;
265  //m_doDebug = true;
266 
267  bool eventisgood = true;
268  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::EventSelection( type= " << eType << ") ** started ** " << std::endl
269  << " event count: " << m_eventCount << std::endl
270  << " m_NumberOfFullPassMuons: " << m_numberOfFullPassMuons << std::endl
271  << " m_NumberOfFullPassElectrons: " << m_numberOfFullPassElectrons
272  << endmsg;
273 
274 
275  // Depending on mode: require a minimum of electrons or muons
276  if ( eventisgood && m_workAsFourMuons) {
277  if (m_numberOfFullPassMuons < 4) {
278  eventisgood = false;
279  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing number of good muons == 4 :( "
280  <<" m_numberOfFullPassMuons= " << m_numberOfFullPassMuons << std::endl;
281  }
282  }
283  }
284 
285  if ( eventisgood && m_workAsFourElectrons) {
286  if (m_numberOfFullPassElectrons < 4) {
287  eventisgood = false;
288  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing number of good electrons == 4 :( "
289  <<" m_numberOfFullPassElectrons= " << m_numberOfFullPassElectrons << std::endl;
290  }
291  }
292  }
293 
294  if ( eventisgood && m_workAsFourLeptons) {
295  bool thisselection = false;
296  if (m_numberOfFullPassMuons == 4) thisselection = true;
297  if (m_numberOfFullPassElectrons == 4) thisselection = true;
298  if (m_numberOfFullPassMuons >= 2 && m_numberOfFullPassElectrons >= 2) thisselection = true;
299  if (!thisselection) {
300  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing number of good muons >= 2 && electrons >= 2 :( "
301  <<" m_numberOfFullPassMuons= " << m_numberOfFullPassMuons
302  <<" m_numberOfFullPassElectrons= " << m_numberOfFullPassElectrons << std::endl;
303  }
304  }
305  eventisgood = thisselection;
306  }
307 
308  //
309  // momentum of the leptons
310  // loop over the muons and electrons and count how many pass the leadingPt and secondPt cut
311  unsigned int npassleadingpt = 0;
312  unsigned int npasssecondpt = 0;
313  if ( eventisgood && (m_workAsFourMuons || m_workAsFourLeptons) ) {
314  if (m_numberOfFullPassMuons >= 2) { // electrons pt cuts if there are some electrons
315  //for (unsigned int i=0; i < m_numberOfFullPassMuons; i++) {
316  for (unsigned int i=0; i < NUM_MUONS; i++) {
317  if (m_pxIDTrack[i] == nullptr) continue;
318  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * using muon " << i << " with pt: " << m_pxIDTrack[i]->pt() << std::endl;}
319  if (m_pxIDTrack[i]->pt() > m_LeadingMuonPtCut*CLHEP::GeV) npassleadingpt++;
320  if (m_pxIDTrack[i]->pt() > m_SecondMuonPtCut*CLHEP::GeV) npasssecondpt++;
321  }
322  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * #muons with pt > leading pt: " << m_LeadingMuonPtCut*CLHEP::GeV << " = " << npassleadingpt << std::endl;}
323  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * #muons with pt > second pt: " << m_SecondMuonPtCut*CLHEP::GeV << " = " << npasssecondpt << std::endl;}
324  if (npassleadingpt == 0) { // at least 1 muon must pass the leading pt cut
325  eventisgood = false;
326  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing leading muon pt cut " << m_LeadingMuonPtCut*CLHEP::GeV << std::endl;}
327  }
328  if (npasssecondpt < m_numberOfFullPassMuons) { // all muons must pass the second pt cut
329  eventisgood = false;
330  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing second muon pt cut " << m_LeadingMuonPtCut*CLHEP::GeV << std::endl;}
331  }
332  }
333  }
334 
335  // four electrons case
336  if ( eventisgood && (m_workAsFourElectrons || m_workAsFourLeptons) ) {
337  npassleadingpt = 0;
338  npasssecondpt = 0;
339  if (m_numberOfFullPassElectrons >= 2) { // electrons pt cuts if there are some electrons
340  for (unsigned int i=0; i < NUM_MUONS; i++) {
341  if (m_pxELTrack[i] == nullptr) continue;
342  if (m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * using electron " << i << " with pt: " << m_pxELTrack[i]->pt() << std::endl;}
343  if (m_pxELTrack[i]->pt() > m_LeadingMuonPtCut*CLHEP::GeV) npassleadingpt++;
344  if (m_pxELTrack[i]->pt() > m_SecondMuonPtCut*CLHEP::GeV) npasssecondpt++;
345  }
346  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * #elecs with pt > leading pt: " << m_LeadingMuonPtCut*CLHEP::GeV << " = " << npassleadingpt << std::endl;}
347  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * #elecs with pt > second pt: " << m_SecondMuonPtCut*CLHEP::GeV << " = " << npasssecondpt << std::endl;}
348  if (npassleadingpt == 0) { // at least 1 electron must pass the leading pt cut
349  eventisgood = false;
350  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing leading electron pt cut " << m_LeadingMuonPtCut*CLHEP::GeV << std::endl;}
351  }
352  if (npasssecondpt < m_numberOfFullPassElectrons) { // all electrons must pass the second pt cut
353  eventisgood = false;
354  if(m_doDebug) {std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") * Failing second electrons pt cut " << m_LeadingMuonPtCut*CLHEP::GeV << std::endl;}
355  }
356  } // electron pt cuts apply if there are some electrons
357  }
358 
359  // Invariant mass window
360  if (eventisgood) {
361  if ( m_fInvariantMass[eType] < m_MassWindowLow ) {
362  if(m_doDebug) {
363  std::cout <<" * FourMuonEvent::EventSelection * Failing mass window low cut: reco m= " << m_fInvariantMass[eType] << " > " << m_MassWindowLow << std::endl;
364  }
365  eventisgood = false;
366  }
367  if ( m_fInvariantMass[eType] > m_MassWindowHigh ) {
368  if(m_doDebug) {
369  std::cout <<" * FourMuonEvent::EventSelection * Failing mass window high cut: reco m= " << m_fInvariantMass[eType] << " > " << m_MassWindowHigh << std::endl;
370  }
371  eventisgood = false;
372  }
373  }
374 
375  // check on vertices
376  if (eventisgood) {
377  bool vertexstatus = false;
378 
379  std::vector <float> vtxListX; // coordinates of the vertex
380  std::vector <float> vtxListY;
381  std::vector <float> vtxListZ;
382  std::vector <int> vtxNpart; // count how many particles are in vertex
383 
384  int noVertexCountMuon = 0;
385  int noVertexCountElec = 0;
386  if ( m_workAsFourMuons || m_workAsFourLeptons ) { // till here we have the muon vertices list
387  // loop on muons first
388  for (unsigned int imu = 0; imu < NUM_MUONS; imu++) {
389  if (m_pxMUTrack[imu] != nullptr) {
390  /* R21 SALVA --> vertex is not available in R22 --> A FIX IS NEEDED */
391  /*
392  if (m_pxMUTrack[imu]->vertex()) {
393  if (vtxListX.size()==0) { // this is the first vertex found
394  vtxListX.push_back(m_pxMUTrack[imu]->vertex()->x());
395  vtxListY.push_back(m_pxMUTrack[imu]->vertex()->y());
396  vtxListZ.push_back(m_pxMUTrack[imu]->vertex()->z());
397  vtxNpart.push_back(0); // initialize particle count to 0
398  }
399  // loop on existing vertices. Check if this particle shares one of the existing ones. If not, add a new vertex to the list
400  for (size_t ivtx=0; ivtx < vtxListX.size(); ivtx++) {
401  float deltaX = fabs(m_pxMUTrack[imu]->vertex()->x() - vtxListX.at(ivtx));
402  float deltaY = fabs(m_pxMUTrack[imu]->vertex()->y() - vtxListY.at(ivtx));
403  float deltaZ = fabs(m_pxMUTrack[imu]->vertex()->z() - vtxListZ.at(ivtx));
404 
405  if (deltaX < m_deltaXYcut && deltaY < m_deltaXYcut && deltaZ < m_Z0GapCut) {
406  // this is an existing vertex
407  int npartinvtx = vtxNpart.at(ivtx);
408  npartinvtx++;
409  vtxNpart.at(ivtx) = npartinvtx;
410  // fill the variables that tells to which vertex is associated each muon // not very nice piece of code :(
411  m_muon_vtx[imu] = ivtx+1;
412  }
413  }
414  } // vertex exist
415 
416  else { // no vertex
417  noVertexCountMuon++;
418  }
419  */
420  } // muon exist
421  } // end of loop on muons
422  } // end of using muons
423 
424  if ( m_workAsFourElectrons || m_workAsFourLeptons ) { // till here we have the muon vertices list
425  // now loop on electrons
426  for (unsigned int iel = 0; iel < NUM_MUONS; iel++) {
427  if (m_pxELTrack[iel] != nullptr) {
428  /* R21 SALVA --> vertex is not available in R22 --> A FIX IS NEEDED */
429  /*
430  if (m_pxELTrack[iel]->vertex()) {
431  if (vtxListX.size()==0) { // this is the first vertex found
432  vtxListX.push_back(m_pxELTrack[iel]->vertex()->x());
433  vtxListY.push_back(m_pxELTrack[iel]->vertex()->y());
434  vtxListZ.push_back(m_pxELTrack[iel]->vertex()->z());
435  vtxNpart.push_back(0); // initialize particle count to 0
436  }
437  bool vertexmatchfound = false;
438  // loop on existing vertices. Check if this particle shares one of the existing ones. If not, add a new vertex to the list
439  for (unsigned int ivtx=0; ivtx < vtxListX.size(); ivtx++) {
440  float deltaX = fabs( m_pxELTrack[iel]->vertex()->x() - vtxListX.at(ivtx) );
441  float deltaY = fabs( m_pxELTrack[iel]->vertex()->y() - vtxListY.at(ivtx) );
442  float deltaZ = fabs( m_pxELTrack[iel]->vertex()->z() - vtxListZ.at(ivtx) );
443 
444  if (deltaX < m_deltaXYcut && deltaY < m_deltaXYcut && deltaZ < m_Z0GapCut) {
445  // this is an existing vertex
446  int npartinvtx = vtxNpart.at(ivtx);
447  npartinvtx++;
448  vtxNpart.at(ivtx) = npartinvtx;
449  // fill the variables that tells to which vertex is associated each muon
450  m_elec_vtx[iel] = ivtx+1;
451  vertexmatchfound = true;
452  }
453  }
454  if (!vertexmatchfound) { // the electron is not in any of the previous listed vertices
455  // this is a new vertex
456  vtxListX.push_back(m_pxELTrack[iel]->vertex()->x());
457  vtxListY.push_back(m_pxELTrack[iel]->vertex()->y());
458  vtxListZ.push_back(m_pxELTrack[iel]->vertex()->z());
459  vtxNpart.push_back(1); // initialize particle count to 1
460  m_elec_vtx[iel] = vtxListX.size(); // this electron is in this new vertex
461  }
462  } // vertex exist
463  else { // no vertex
464  noVertexCountElec++;
465  }
466  */
467  } // electron exists
468  } // end of loop on electrons
469  } // end of using electrons
470 
471  if ( m_workAsFourMuons ) { // till here we have the muon vertices list
472  m_nVertex = vtxListX.size();
473  if (vtxListX.size()>0) vertexstatus = true;
474  // check that the muons are not split into too many vertices
475  if (vtxListX.size() >= m_numberOfFullPassMuons - 1) vertexstatus = false;
476  // allow no muon without vertex
477  if (noVertexCountMuon > 0) vertexstatus = false;
478  if (m_doDebug || true) {
479  std::cout << " * FourMuonEvent::EventSelection(" << eType <<") * vertices ID of the muons = " << std::endl
480  << " mu- 1 " << m_muon_vtx[0] << " pt: " << m_pxMUTrack[0]->pt() << std::endl
481  << " mu- 2 " << m_muon_vtx[1] << " pt: " << m_pxMUTrack[1]->pt() << std::endl
482  << " mu+ 1 " << m_muon_vtx[2] << " pt: " << m_pxMUTrack[2]->pt() << std::endl
483  << " mu+ 2 " << m_muon_vtx[3] << " pt: " << m_pxMUTrack[3]->pt()
484  << std::endl;
485  } // end debug
486  } // end m_workAsFourMuons
487 
488  if ( m_workAsFourElectrons ) { // till here we have the electrons vertices list
489  m_nVertex = vtxListX.size();
490  if (vtxListX.size()>0) vertexstatus = true;
491  // check that the electrons are not split into too many vertices
492  if (vtxListX.size() >= m_numberOfFullPassElectrons - 1) vertexstatus = false;
493  // and allow no electron without vertex
494  if (noVertexCountElec > 0) vertexstatus = false;
495  if (m_doDebug || true) {
496  std::cout << " * FourMuonEvent::EventSelection(" << eType <<") * vertices ID of the electrons = " << std::endl
497  << " el- 1 " << m_elec_vtx[0] << " pt: " << m_pxELTrack[0]->pt() << std::endl
498  << " el- 2 " << m_elec_vtx[1] << " pt: " << m_pxELTrack[1]->pt() << std::endl
499  << " el+ 1 " << m_elec_vtx[2] << " pt: " << m_pxELTrack[2]->pt() << std::endl
500  << " el+ 2 " << m_elec_vtx[3] << " pt: " << m_pxELTrack[3]->pt()
501  << std::endl;
502  } // end debug
503  }
504 
505  if ( m_workAsFourLeptons ) { // till here we have the muons and electrons vertices list
506  m_nVertex = vtxListX.size();
507  if (vtxListX.size()>0) vertexstatus = true;
508  // check that the electrons are not split into too many vertices
509  // if (vtxListX.size() >= m_numberOfFullPassElectrons - 1) vertexstatus = false;
510  // and allow no electron without vertex
511  if (m_doDebug) {
512  std::cout << " * FourMuonEvent::EventSelection(" << eType <<") * vertices in event = " << vtxListX.size() << std::endl;
513  for (size_t imu=0; imu < NUM_MUONS; imu++) {
514  if (m_pxMUTrack[imu]) std::cout << " mu " << m_muon_vtx[imu] << " pt: " << m_pxMUTrack[imu]->pt() << std::endl;
515  }
516  for (size_t iel=0; iel < NUM_MUONS; iel++) {
517  if (m_pxELTrack[iel]) std::cout << " el " << m_elec_vtx[iel] << " pt: " << m_pxELTrack[iel]->pt() << std::endl;
518  }
519  }
520  }
521 
522  vertexstatus = true; // Temporary fix to work on R22
523 
524  if(m_doDebug) {
525  std::cout <<" * FourMuonEvent::EventSelection(" << eType <<") * Number of vertex found = " << vtxListX.size()
526  << " and mu without vertex: " << noVertexCountMuon
527  << " and elec without vertex: " << noVertexCountElec << std::endl;
528  for (unsigned int ivtx=0; ivtx < vtxListX.size(); ivtx++) {
529  std::cout << " vtx[" << ivtx << "]= "
530  << "( " << vtxListX.at(ivtx)
531  << ", " << vtxListY.at(ivtx)
532  << ", " << vtxListZ.at(ivtx)
533  << ") nparticles: " << vtxNpart.at(ivtx)
534  << std::endl;
535  }
536  }
537  //
538  if (!vertexstatus && m_doDebug) {
539  std::cout <<" * FourMuonEvent::EventSelection * FAILED * number of vertex found = " << vtxListX.size()
540  << " mu without vertex: " << noVertexCountMuon
541  << " elec without vertex: " << noVertexCountElec << std::endl;
542  }
543 
544  eventisgood = vertexstatus;
545  }
546 
547  //
548  if(m_doDebug){ std::cout <<" * FourMuonEvent::EventSelection(" << eType << ") ** completed ** result= " << eventisgood << std::endl;}
549 
550  m_doDebug = inputdebug;
551 
552  return eventisgood;
553 }

◆ get4MuInvMass()

const float& FourMuonEvent::get4MuInvMass ( ZTYPE  eType)
inline

Definition at line 77 of file FourMuonEvent.h.

77 { return m_fInvariantMass[eType]; }

◆ getAcceptedEvents()

int FourMuonEvent::getAcceptedEvents ( )
inline

Definition at line 78 of file FourMuonEvent.h.

78 { return m_acceptedEventCount; }

◆ getCombMuon()

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

Definition at line 79 of file FourMuonEvent.h.

79 { return (uPart < NUM_MUONS) ? m_pxRecMuon[uPart] : nullptr; }

◆ getELTrack()

const xAOD::TrackParticle* FourMuonEvent::getELTrack ( unsigned int  uPart)
inline

Definition at line 80 of file FourMuonEvent.h.

80 { return (uPart < NUM_MUONS) ? m_pxELTrack[uPart] : nullptr; }

◆ getIDTrack()

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

Definition at line 81 of file FourMuonEvent.h.

81 { return (uPart < NUM_MUONS) ? m_pxIDTrack[uPart] : nullptr; }

◆ GetInvMass()

double FourMuonEvent::GetInvMass ( )
inline

Definition at line 82 of file FourMuonEvent.h.

82 { return m_FourMuonInvMass; }

◆ getLeptonOpeningAngle()

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

Definition at line 85 of file FourMuonEvent.h.

85 { return m_fMuonDispersion[eType]; }

◆ getLooseIDTk()

const xAOD::TrackParticle * FourMuonEvent::getLooseIDTk ( unsigned int  uPart)
inline

Definition at line 1286 of file FourMuonEvent.cxx.

1287 {
1288  const xAOD::TrackParticleContainer* pxTrackContainer =
1289  PerfMonServices::getContainer<xAOD::TrackParticleContainer>( PerfMonServices::TRK_COLLECTION );
1290 
1291  if ( pxTrackContainer )
1292  {
1293  xAOD::TrackParticleContainer::const_iterator xTrkItr = pxTrackContainer->begin();
1294  xAOD::TrackParticleContainer::const_iterator xTrkItrE = pxTrackContainer->end();
1295  while ( xTrkItr != xTrkItrE )
1296  {
1297  const xAOD::TrackParticle* pxTrack = *xTrkItr;
1298  if ( !pxTrack ) continue;
1299  const Trk::Track* pxTrkTrack = pxTrack->track();
1300  if(!pxTrkTrack) continue;
1301  const Trk::Perigee* pxPerigee = pxTrkTrack->perigeeParameters() ;
1302  if ( !pxPerigee ) continue;
1303  const float fTrkPhi = pxPerigee->parameters()[Trk::phi];
1304  const float fTrkEta = pxPerigee->eta();
1305 
1306  float fDPhi = fabs( fTrkPhi - m_pxMETrack[m_muon1]->phi() );
1307  float fDEta = fabs( fTrkEta - m_pxMETrack[m_muon2]->eta() );
1308  float fDR = sqrt( fDPhi*fDPhi + fDEta*fDEta );
1309 
1310  if ( fDR < 0.3f )
1311  {
1312  return pxTrack;
1313  }
1314 
1315  ++xTrkItr;
1316  }
1317  }
1318  // if ()
1319  return nullptr;
1320 }

◆ getMSTrack()

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

Definition at line 83 of file FourMuonEvent.h.

83 { return (uPart < NUM_MUONS) ? m_pxMSTrack[uPart] : nullptr; }

◆ getNegMuon()

unsigned int FourMuonEvent::getNegMuon ( int  eType)

Definition at line 1278 of file FourMuonEvent.cxx.

1279 {
1280  unsigned int muid = m_muonneg1;
1281  if (eType==2) muid = m_muonneg2;
1282  return muid;
1283 }

◆ getNumberOfTaggedMuons()

unsigned int FourMuonEvent::getNumberOfTaggedMuons ( )
inline

Definition at line 87 of file FourMuonEvent.h.

87 { return m_numberOfFullPassMuons; }

◆ GetNVertex()

int FourMuonEvent::GetNVertex ( )
inline

Definition at line 88 of file FourMuonEvent.h.

88 { return m_nVertex; }

◆ getPosMuon()

unsigned int FourMuonEvent::getPosMuon ( int  eType)

Definition at line 1267 of file FourMuonEvent.cxx.

1268 {
1269  //if ( getNumberOfTaggedMuons() != 2 ) return 999;
1270  //if ( getZCharge(eType) != 0 ) return 999;
1271 
1272  unsigned int muid = m_muonpos1;
1273  if (eType==2) muid = m_muonpos2;
1274  return muid;
1275 }

◆ getPtImbalance()

float FourMuonEvent::getPtImbalance ( ZTYPE  eType)

Definition at line 1207 of file FourMuonEvent.cxx.

1208 {
1209  // First determine what's positive
1210  if ( m_numberOfFullPassMuons == 2 )
1211  {
1212  switch ( eType )
1213  {
1214  case MS :
1215  {
1217  }
1218  case ME:
1219  {
1221  }
1222  case CB:
1223  {
1225  }
1226  case ID:
1227  {
1229  }
1230  default:
1231  return -999.0;
1232  }
1233  }
1234  else
1235  {
1236  return -999.0;
1237  }
1238 }

◆ getRegion()

const std::string FourMuonEvent::getRegion ( ) const

◆ GetVertexElec()

int FourMuonEvent::GetVertexElec ( unsigned int  uPart)
inline

Definition at line 92 of file FourMuonEvent.h.

92 { return (uPart < NUM_MUONS) ? m_elec_vtx[uPart] : 0;}

◆ GetVertexElNeg1()

int FourMuonEvent::GetVertexElNeg1 ( )
inline

Definition at line 93 of file FourMuonEvent.h.

93 { return m_elec_vtx[0];}

◆ GetVertexElNeg2()

int FourMuonEvent::GetVertexElNeg2 ( )
inline

Definition at line 94 of file FourMuonEvent.h.

94 { return m_elec_vtx[1];}

◆ GetVertexElPos1()

int FourMuonEvent::GetVertexElPos1 ( )
inline

Definition at line 95 of file FourMuonEvent.h.

95 { return m_elec_vtx[2];}

◆ GetVertexElPos2()

int FourMuonEvent::GetVertexElPos2 ( )
inline

Definition at line 96 of file FourMuonEvent.h.

96 { return m_elec_vtx[3];}

◆ GetVertexMuNeg1()

int FourMuonEvent::GetVertexMuNeg1 ( )
inline

Definition at line 97 of file FourMuonEvent.h.

97 { return m_muon_vtx[0];}

◆ GetVertexMuNeg2()

int FourMuonEvent::GetVertexMuNeg2 ( )
inline

Definition at line 98 of file FourMuonEvent.h.

98 { return m_muon_vtx[1];}

◆ GetVertexMuPos1()

int FourMuonEvent::GetVertexMuPos1 ( )
inline

Definition at line 99 of file FourMuonEvent.h.

99 { return m_muon_vtx[2];}

◆ GetVertexMuPos2()

int FourMuonEvent::GetVertexMuPos2 ( )
inline

Definition at line 100 of file FourMuonEvent.h.

100 { return m_muon_vtx[3];}

◆ getZCharge()

int FourMuonEvent::getZCharge ( ZTYPE  eType)

Definition at line 1241 of file FourMuonEvent.cxx.

1242 {
1243  switch ( eType )
1244  {
1245  case MS :
1246  {
1247  return ( static_cast<int>( EvalCharge( m_pxMSTrack[m_muon1], m_pxMSTrack[m_muon2] ) ) );
1248  }
1249  case ME:
1250  {
1251  return ( static_cast<int>( EvalCharge( m_pxMETrack[m_muon1], m_pxMETrack[m_muon2] ) ) );
1252  }
1253  case CB:
1254  {
1255  return ( static_cast<int>( EvalCharge( m_pxRecMuon[m_muon1], m_pxRecMuon[m_muon2] ) ) );
1256  }
1257  case ID:
1258  {
1259  return ( static_cast<int>( EvalCharge( m_pxIDTrack[m_muon1], m_pxIDTrack[m_muon2] ) ) );
1260  }
1261  default:
1262  return -999;
1263  }
1264 }

◆ getZEta()

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

Definition at line 102 of file FourMuonEvent.h.

102 { return m_fZEtaDir[eType]; }

◆ getZMass()

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

Definition at line 103 of file FourMuonEvent.h.

103 { return m_fInvariantMass[eType];}

◆ getZPhi()

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

Definition at line 104 of file FourMuonEvent.h.

104 { return m_fZPhiDir[eType]; }

◆ getZPt()

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

Definition at line 105 of file FourMuonEvent.h.

105 { return m_fZPt[eType]; }

◆ Init()

void FourMuonEvent::Init ( )
virtual

Reimplemented from EventAnalysis.

Definition at line 65 of file FourMuonEvent.cxx.

66 {
67  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Init * START *" << endmsg;
68 
69  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Init * initializing muon selector *" << endmsg;
70  m_xMuonID.Init();
71  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Init * initializing electron selector *" << endmsg;
72  m_xElecID.Init();
73 
74  if (m_workAsFourMuons) {(*m_msgStream) << MSG::INFO << " * FourMuonEvent::Init * working mode: 4 muons" << endmsg; }
75  if (m_workAsFourElectrons) {(*m_msgStream) << MSG::INFO << " * FourMuonEvent::Init * working mode: 4 electrons" << endmsg; }
76  if (m_workAsFourLeptons) {(*m_msgStream) << MSG::INFO << " * FourMuonEvent::Init * working mode: 4 leptons" << endmsg; }
77 
78  PARENT::Init();
79  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Init * Completed * " << endmsg;
80 
81  return;
82 }

◆ operator=()

FourMuonEvent& FourMuonEvent::operator= ( const FourMuonEvent )
delete

◆ OrderMuonList()

void FourMuonEvent::OrderMuonList ( )

Definition at line 1366 of file FourMuonEvent.cxx.

1367 {
1368  // Salva: 20/January/2020 RecMuon -> IDTrack
1369  bool thisdebug = false;
1370 
1371  if (m_doDebug || thisdebug) {std::cout << " * FourMuonEvent::OrderMuonList * -- start -- " << std::endl
1372  << " #muons: " << m_numberOfFullPassMuons<< std::endl;}
1373 
1374  int muPlus1Id = -9;
1375  int muPlus2Id = -9;
1376  int muMinus1Id = -9;
1377  int muMinus2Id = -9;
1378  double muPlus1Pt = 0.;
1379  double muPlus2Pt = 0.;
1380  double muMinus1Pt = 0.;
1381  double muMinus2Pt = 0.;
1382 
1383  int muposcount = 0;
1384  int munegcount = 0;
1385 
1386  int nMuonsAtEntry = m_numberOfFullPassMuons;
1387  m_numberOfFullPassMuons = 0; // reset the number of full pass muons
1388 
1389  if (nMuonsAtEntry >= 2) { // we need at least 2 muons
1390  for (int imuon=0; imuon < (int) nMuonsAtEntry; imuon++) {
1391  if(m_doDebug && false ){ std::cout << " * FourMuonEvent::OrderMuonList * testing imuon= " << imuon
1392  << " with charge= " << m_pxRecMuon[imuon]->charge()
1393  << " and pt= " << m_pxRecMuon[imuon]->pt()
1394  << std::endl;
1395  }
1396  if (m_pxIDTrack[imuon] != nullptr) {
1397 
1398  if (m_pxIDTrack[imuon]->charge()==1) { // positive muon
1399  muposcount++;
1400  if (m_pxIDTrack[imuon]->pt()> muPlus1Pt) {
1401  // store 1st in 2nd
1402  muPlus2Pt = muPlus1Pt;
1403  muPlus2Id = muPlus1Id;
1404  // now store the new one in 1st place
1405  muPlus1Pt = m_pxIDTrack[imuon]->pt();
1406  muPlus1Id = imuon;
1407  }
1408  else if (m_pxIDTrack[imuon]->pt()> muPlus2Pt) {
1409  // store the new one in 2nd place
1410  muPlus2Pt = m_pxIDTrack[imuon]->pt();
1411  muPlus2Id = imuon;
1412  }
1413  }
1414  // Negative muons
1415  if (m_pxIDTrack[imuon]->charge()==-1) {
1416  munegcount++;
1417  if(m_pxIDTrack[imuon]->pt()> muMinus1Pt) {
1418  // store 1st in 2nd
1419  muMinus2Pt = muMinus1Pt;
1420  muMinus2Id = muMinus1Id;
1421  muMinus1Pt = m_pxIDTrack[imuon]->pt();
1422  muMinus1Id = imuon;
1423  }
1424  else if(m_pxRecMuon[imuon]->pt()> muMinus2Pt) {
1425  muMinus2Pt = m_pxIDTrack[imuon]->pt();
1426  muMinus2Id = imuon;
1427  }
1428  }
1429  } // muon exist
1430  } // for (int imuon)
1431  } // if (nMuonsAtEntry >= 2)
1432 
1433  // require at least one opposite charge muon pair
1434  if (nMuonsAtEntry >= 2 && (muposcount == 0 || munegcount == 0)) {
1435  if (m_doDebug) std::cout << " -- FourMuonEvent::OrderMuonList -- No opposite charge muons in the " << nMuonsAtEntry << " input muons"
1436  << " #mu+ " << muposcount
1437  << " #mu- " << munegcount
1438  << " --> DISCARD ALL MUONS -- " << std::endl;
1439  muPlus1Id = -1;
1440  muPlus1Id = -9;
1441  muPlus2Id = -9;
1442  muMinus1Id = -9;
1443  muMinus2Id = -9;
1444  }
1445 
1446 
1447  if (muPlus1Id>=0) {m_muonpos1 = muPlus1Id; m_numberOfFullPassMuons++;}
1448  if (muPlus2Id>=0) {m_muonpos2 = muPlus2Id; m_numberOfFullPassMuons++;}
1449  if (muMinus1Id>=0) {m_muonneg1 = muMinus1Id; m_numberOfFullPassMuons++;}
1450  if (muMinus2Id>=0) {m_muonneg2 = muMinus2Id; m_numberOfFullPassMuons++;}
1451 
1452  m_muon1 = m_muonpos1; // to be deleted when no more m_muon is left
1453  m_muon2 = m_muonneg1; // to be deleted when no more m_muon is left
1454 
1455  if ((m_doDebug || thisdebug) && m_numberOfFullPassMuons >= 2){
1456  std::cout << " * FourMuonEvent::OrderMuonList * taking " << m_numberOfFullPassMuons << " muons from the input list of " << nMuonsAtEntry << " muons: " << std::endl;
1457  if (muMinus1Id >= 0) std::cout << " leading mu-: " << muMinus1Id << " Pt = " << muMinus1Pt << std::endl;
1458  if (muMinus2Id >= 0) std::cout << " second mu-: " << muMinus2Id << " Pt = " << muMinus2Pt << std::endl;
1459  if (muPlus1Id >= 0) std::cout << " leading mu+: " << muPlus1Id << " Pt = " << muPlus1Pt << std::endl;
1460  if (muPlus2Id >= 0) std::cout << " second mu+: " << muPlus2Id << " Pt = " << muPlus2Pt << std::endl;
1461  }
1462  else {
1463  if (m_doDebug) std::cout << " * FourMuonEvent::OrderMuonList * This event has less than 2 muons :(" << std::endl;
1464  }
1465 
1466  if (m_doDebug || thisdebug) std::cout << " * FourMuonEvent::OrderMuonList * completed * m_numberOfFullPassMuons= " << m_numberOfFullPassMuons << std::endl;
1467  return;
1468 }

◆ Reco()

bool FourMuonEvent::Reco ( )

Definition at line 85 of file FourMuonEvent.cxx.

86 {
87  m_eventCount++;
88  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * STARTING ** New event ** eventCount " << m_eventCount << endmsg;
89 
90  // Clear out the previous events record.
91  this->Clear();
92 
93  // if muons are requested
95  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * retrieving xAOD::MuonContainer " << m_container << " of eventCount " << m_eventCount << std::endl;
96 
97  const xAOD::MuonContainer* pxMuonContainer = PerfMonServices::getContainer<xAOD::MuonContainer>( m_container );
98 
99  // check if muon container does exist
100  if (pxMuonContainer != nullptr) {
101  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * eventCount " << m_eventCount
102  << " track list has "<< pxMuonContainer->size()
103  << " combined muons in container " << m_container
104  << " container name: " << PerfMonServices::getContainerName ( m_container )
105  << endmsg;
106 
107  xAOD::MuonContainer::const_iterator xMuonItr = pxMuonContainer->begin();
108  xAOD::MuonContainer::const_iterator xMuonItrE = pxMuonContainer->end();
109  int theCount = 0;
110  while ( xMuonItr != xMuonItrE ){ // start loop on muons
111  const xAOD::Muon* pxCMuon = *xMuonItr;
112  theCount++;
113  // Apply muon cuts
114  if ( m_xMuonID.passSelection( pxCMuon)) {
115  RecordMuon( pxCMuon );
116  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco ** muon " << theCount << " is accepted " << endmsg;
117  }
118  ++xMuonItr;
119  } // end loop on muons
120 
121  // ordering of muons
122  this->OrderMuonList();
123  } // end muon container exists
124  if (!pxMuonContainer) {
125  std::cout << " * FourMuonEvent::Reco * Can't retrieve combined muon collection (container: " << m_container <<") " << std::endl;
126  return false;
127  } // end muon container does not exist
128  } // end requesting muons
129 
130  //
131  // Electron selection (in case electrons are requested)
133  // Get the electron AOD container
134  const xAOD::ElectronContainer* pxElecContainer = nullptr;
135  if (m_doDebug){ std::cout << " * FourMuonEvent::Reco * retrieving xAOD::ElectronContainer " << PerfMonServices::ELECTRON_COLLECTION << std::endl; }
136  pxElecContainer = PerfMonServices::getContainer<xAOD::ElectronContainer>( PerfMonServices::ELECTRON_COLLECTION );
137 
138  //pxElecContainer = evtStore()->retrieve( pxElecContainer, "Electrons" );
139 
140  if (pxElecContainer != nullptr) {
141  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * retrieving xAOD::ElectronContainer SUCCESS. "
143  << " size: " << pxElecContainer->size()
144  << endmsg;
145  if (pxElecContainer->size() > 0 ){
146  m_xElecID.PrepareElectronList (pxElecContainer);
149  }
150  }
151  else { // no pxElecContainer
152  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * retrieving xAOD::ElectronContainer -- FAILED -- eventcount: " << m_eventCount << endmsg;
153  }
154  }
155 
157  // reached this point one has the list of muons and electrons in this event
159 
160  // now check if the particles in the event make them to satisfy the event selection
161  if (m_workAsFourMuons) {
162  m_passedFourMuonSelection = false; // unless the event has 4 muons, assume it is not good
163 
164  if (m_numberOfFullPassMuons == 4) {
168 
170  m_FourMuonInvMass = m_fInvariantMass[ID]; // store invariant mass
171  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * === Event " << m_eventCount << " is a GOOD 4-muon event " << std::endl;
172  }
173  else {
174  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * === Event " << m_eventCount << " FAILS the 4-muon event selection " << std::endl;
175  }
176  }
177  } // end of workAsFourMuons
178 
179  if (m_workAsFourElectrons) {
180  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * applying 4 electron selection " << std::endl;
181  m_passedFourElectronSelection = false; // unless the event has 4 muons, assume it is not good
182 
183  if (m_numberOfFullPassElectrons == 4) {
186 
188  m_FourMuonInvMass = m_fInvariantMass[ID]; // store invariant mass
189  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * === Event " << m_eventCount << " is a GOOD 4-electrom event " << std::endl;
190  }
191  else {
192  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * === Event " << m_eventCount << " FAILS the 4-electron event selection " << std::endl;
193  }
194  }
195  else {
196  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * === Event " << m_eventCount << " is not a 4-electron event " << std::endl;
197  }
198  } // end of workAsFourElectrons
199 
200 
201  if (m_workAsFourLeptons) {
202  if (m_doDebug) std::cout << " * FourMuonEvent::Reco * applying 4 lepton selection " << std::endl;
204 
205  bool enoughleptons = false;
206  if (m_numberOfFullPassMuons == 4) enoughleptons = true;
207  if (m_numberOfFullPassElectrons == 4) enoughleptons = true;
208  if (m_numberOfFullPassMuons >= 2 && m_numberOfFullPassElectrons >= 2) enoughleptons = true;
209 
210  if ( enoughleptons) {
211  if (m_doDebug) {
212  std::cout << " * FourMuonEvent::Reco * Global statistics: Total number of accepted muons so far: " << m_acceptedMuonCount
213  << " & electrons: " << m_acceptedElecCount << " integrated over all events "
214  << std::endl;
215  std::cout << " * FourMuonEvent::Reco * This event has " << m_numberOfFullPassMuons
216  << " muons & " << m_numberOfFullPassElectrons << " electrons --> try kinematics, vertex and event selection"
217  << std::endl;
218  }
222 
224  m_FourMuonInvMass = m_fInvariantMass[ID]; // store invariant mass
225  (*m_msgStream) << MSG::INFO << " * FourMuonEvent::Reco * === Event " << m_eventCount << " is a GOOD 4-lepton event with inv mass: " << m_FourMuonInvMass << endmsg;
226  }
227  else {
228  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * === Event " << m_eventCount << " -- FAILS -- the 4-lepton event selection " << endmsg;
229  }
230  }
231  else {
232  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * 4lepton selection FAILURE. Not enough muons or electrons. Event has " << m_numberOfFullPassMuons
233  << " muons & " << m_numberOfFullPassElectrons << " electrons"
234  << endmsg;
235  }
236  }
237 
238  m_passedSelectionCuts = false; // assume event is not good, but check the selection according to the use case
242 
244 
245  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent::Reco * COMPLETED * Event has " << m_numberOfFullPassMuons << " muons & "
246  << m_numberOfFullPassElectrons << " electrons. "
247  << " So far: " << m_acceptedEventCount << " events were accepted out of " << m_eventCount << " tested" << endmsg;
248 
249  return m_passedSelectionCuts;
250 }

◆ ReconstructKinematics()

bool FourMuonEvent::ReconstructKinematics ( )
private

Definition at line 976 of file FourMuonEvent.cxx.

977 {
978  if(m_doDebug){ std::cout << " * FourMuonEvent * ReconstructKinematics * -- start -- " << std::endl; }
979  bool kinematicscomputed = false;
980 
981  // Three ways. No checks here. Thus make sure the pointers are ok before this.
982  if ( m_numberOfFullPassMuons == 4 ) {
983  // crosscheck identifiers are good:
984  bool goodidentifiers = true;
985  if (m_muonneg1 < 0) goodidentifiers = false;
986  if (m_muonneg2 < 0) goodidentifiers = false;
987  if (m_muonpos1 < 0) goodidentifiers = false;
988  if (m_muonpos2 < 0) goodidentifiers = false;
989 
990  if (goodidentifiers) {
991  // before computing the kinematic parameters check track particles are ok
992  bool goodtracks = true;
993  if (m_pxIDTrack[m_muonneg1] == nullptr) goodtracks = false;
994  if (m_pxIDTrack[m_muonneg2] == nullptr) goodtracks = false;
995  if (m_pxIDTrack[m_muonpos1] == nullptr) goodtracks = false;
996  if (m_pxIDTrack[m_muonpos2] == nullptr) goodtracks = false;
997 
998  if (m_pxIDTrack[m_muonneg1] != nullptr) m_pxMUTrack[0] = m_pxIDTrack[m_muonneg1];
999  if (m_pxIDTrack[m_muonneg2] != nullptr) m_pxMUTrack[1] = m_pxIDTrack[m_muonneg2];
1000  if (m_pxIDTrack[m_muonpos1] != nullptr) m_pxMUTrack[2] = m_pxIDTrack[m_muonpos1];
1001  if (m_pxIDTrack[m_muonpos2] != nullptr) m_pxMUTrack[3] = m_pxIDTrack[m_muonpos2];
1002 
1003  if (goodtracks) { // Everything is ready
1005  m_fMuonDispersion[ID] = EvaluateAngle( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1006  m_fZPt[ID] = EvalPt( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1007  m_fZEtaDir[ID] = EvalEta( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1008  m_fZPhiDir[ID] = EvalPhi( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1009 
1010  kinematicscomputed = true;
1011 
1012  if(m_doDebug){
1013  std::cout << " * FourMuonEvent * ReconstructKinematics4Elec * -- Muon ID Tracks -- new -- " << std::endl
1014  << " Pt(mu1-)= " << m_pxMUTrack[0]->pt() << std::endl
1015  << " Pt(mu2-)= " << m_pxMUTrack[1]->pt() << std::endl
1016  << " Pt(mu1+)= " << m_pxMUTrack[2]->pt() << std::endl
1017  << " Pt(mu2+)= " << m_pxMUTrack[3]->pt() << std::endl
1018  << " invariant mass (4mu) = " << m_fInvariantMass[ID] << std::endl
1019  << std::endl;
1020  }
1021 
1022  } // good tracks
1023  } // goodidentifiers
1024  } // goodmuons == 4
1025 
1026  if (!kinematicscomputed) {
1027  if(m_doDebug){ std::cout <<" * FourMuonEvent * ReconstructKinematics * -- FAILED -- " << std::endl; }
1028  }
1029 
1030  if(m_doDebug){ std::cout <<" * FourMuonEvent * ReconstructKinematics * -- completed -- status: " << kinematicscomputed << std::endl; }
1031  return kinematicscomputed;
1032 }

◆ ReconstructKinematics4Elec()

bool FourMuonEvent::ReconstructKinematics4Elec ( )
private

Definition at line 1035 of file FourMuonEvent.cxx.

1036 {
1037  if(m_doDebug){ std::cout << " * FourMuonEvent * ReconstructKinematics4Elec * -- start -- " << std::endl; }
1038  bool kinematicscomputed = false;
1039 
1040  // Three ways. No checks here. Thus make sure the pointers are ok before this.
1041  if ( m_numberOfFullPassElectrons == 4 ) {
1042  // before computing the kinematic parameters check track particles are ok
1043  bool goodtracks = true;
1048  if (m_pxELTrack[0] == nullptr) goodtracks = false;
1049  if (m_pxELTrack[1] == nullptr) goodtracks = false;
1050  if (m_pxELTrack[2] == nullptr) goodtracks = false;
1051  if (m_pxELTrack[3] == nullptr) goodtracks = false;
1052 
1053  if (goodtracks) { // Everything is ready
1054  // For the time being analysis is performed only with ID tracks
1056  m_fMuonDispersion[ID] = EvaluateAngle( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1057  m_fZPt[ID] = EvalPt( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1058  m_fZEtaDir[ID] = EvalEta( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1059  m_fZPhiDir[ID] = EvalPhi( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1060  kinematicscomputed = true;
1061 
1062  if(m_doDebug){
1063  std::cout << " * FourMuonEvent * ReconstructKinematics4Elec * -- Electron Tracks -- " << std::endl
1064  << " Pt(e1-)= " << m_pxELTrack[0]->pt() << std::endl
1065  << " Pt(e2-)= " << m_pxELTrack[1]->pt() << std::endl
1066  << " Pt(e1+)= " << m_pxELTrack[2]->pt() << std::endl
1067  << " Pt(e2+)= " << m_pxELTrack[3]->pt() << std::endl
1068  << " invariant mass (4e) = " << m_fInvariantMass[ID] << std::endl
1069  << std::endl;
1070  }
1071  } // good tracks
1072  } // goodidentifiers
1073 
1074  if (!kinematicscomputed) {
1075  if(m_doDebug){ std::cout <<" * FourMuonEvent * ReconstructKinematics4Elec * -- FAILED -- " << std::endl; }
1076  }
1077 
1078  if(m_doDebug){ std::cout <<" * FourMuonEvent * ReconstructKinematics4Elec * -- completed -- status: " << kinematicscomputed << std::endl; }
1079  return kinematicscomputed;
1080 }

◆ ReconstructKinematicsNew()

bool FourMuonEvent::ReconstructKinematicsNew ( )
private

Definition at line 1083 of file FourMuonEvent.cxx.

1084 {
1085  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent * ReconstructKinematicsNew * -- START -- " << endmsg;
1086 
1087  bool kinematicscomputed = false;
1088 
1089  // first step get the list of TrackParticles for muons and electrons
1090  // -- muons (a bit more complex than for electrons)
1091  if (m_muonneg1 >= 0) m_pxMUTrack[0] = m_pxIDTrack[m_muonneg1];
1092  if (m_muonneg2 >= 0) m_pxMUTrack[1] = m_pxIDTrack[m_muonneg2];
1093  if (m_muonpos1 >= 0) m_pxMUTrack[2] = m_pxIDTrack[m_muonpos1];
1094  if (m_muonpos2 >= 0) m_pxMUTrack[3] = m_pxIDTrack[m_muonpos2];
1095  // add an extra proteccion
1096  if (m_numberOfFullPassMuons < 2) {
1097  for (int i=0; i<4; i++) m_pxMUTrack[i] = nullptr;
1098  }
1099 
1100  // -- electrons
1105  // add an extra proteccion
1106  if (m_numberOfFullPassElectrons < 2) {
1107  for (int i=0; i<4; i++) m_pxELTrack[i] = nullptr;
1108  }
1109 
1110  if ( m_numberOfFullPassMuons == 4 ) {
1111  bool goodtracks = true;
1112  if (m_pxMUTrack[0] == nullptr) goodtracks = false;
1113  if (m_pxMUTrack[1] == nullptr) goodtracks = false;
1114  if (m_pxMUTrack[2] == nullptr) goodtracks = false;
1115  if (m_pxMUTrack[3] == nullptr) goodtracks = false;
1116 
1117  if (goodtracks) { // Everything is ready
1119  m_fMuonDispersion[ID] = EvaluateAngle ( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1120  m_fZPt[ID] = EvalPt ( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1121  m_fZEtaDir[ID] = EvalEta ( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1122  m_fZPhiDir[ID] = EvalPhi ( m_pxMUTrack[0], m_pxMUTrack[2]); // leading mu- and leading mu+
1123  kinematicscomputed = true;
1124  }
1125  }
1126 
1127  if(m_doDebug){
1128  std::cout << " * FourMuonEvent * ReconstructKinematicsNew * -- Muon ID Tracks -- new -- " << std::endl;
1129  if (m_pxMUTrack[0] != nullptr) std::cout << " Pt(mu1-)= " << m_pxMUTrack[0]->pt() << std::endl;
1130  if (m_pxMUTrack[1] != nullptr) std::cout << " Pt(mu2-)= " << m_pxMUTrack[1]->pt() << std::endl;
1131  if (m_pxMUTrack[2] != nullptr) std::cout << " Pt(mu1+)= " << m_pxMUTrack[2]->pt() << std::endl;
1132  if (m_pxMUTrack[3] != nullptr) std::cout << " Pt(mu2+)= " << m_pxMUTrack[3]->pt() << std::endl;
1133  if (kinematicscomputed) std::cout << " invariant mass (4mu) = " << m_fInvariantMass[ID] << std::endl;
1134  }
1135 
1136  double invmass_test = -1.; // default value
1137  if ( m_numberOfFullPassElectrons == 4) {
1138  // before computing the kinematic parameters check track particles are ok
1139  bool goodtracks = true;
1140  if (m_pxELTrack[0] == nullptr) goodtracks = false;
1141  if (m_pxELTrack[1] == nullptr) goodtracks = false;
1142  if (m_pxELTrack[2] == nullptr) goodtracks = false;
1143  if (m_pxELTrack[3] == nullptr) goodtracks = false;
1144 
1145  if (goodtracks && !kinematicscomputed) { // Everything is ready
1146  // For the time being analysis is performed only with ID tracks
1148  invmass_test = m_fInvariantMass[ID];
1149  m_fMuonDispersion[ID] = EvaluateAngle( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1150  m_fZPt[ID] = EvalPt( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1151  m_fZEtaDir[ID] = EvalEta( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1152  m_fZPhiDir[ID] = EvalPhi( m_pxELTrack[0], m_pxELTrack[2]); // leading e- and leading e+
1153  kinematicscomputed = true;
1154  } // good tracks
1155  }
1156  if(m_doDebug){
1157  std::cout << " * FourMuonEvent * ReconstructKinematicsNew * -- Electron Tracks -- " << std::endl;
1158  if (m_pxELTrack[0] != nullptr) std::cout << " Pt(e1-)= " << m_pxELTrack[0]->pt() << std::endl;
1159  if (m_pxELTrack[1] != nullptr) std::cout << " Pt(e2-)= " << m_pxELTrack[1]->pt() << std::endl;
1160  if (m_pxELTrack[2] != nullptr) std::cout << " Pt(e1+)= " << m_pxELTrack[2]->pt() << std::endl;
1161  if (m_pxELTrack[3] != nullptr) std::cout << " Pt(e2+)= " << m_pxELTrack[3]->pt() << std::endl;
1162  std::cout << " invariant mass (4e) = " << invmass_test << std::endl;
1163  }
1164 
1165  if ( m_numberOfFullPassMuons >= 2 && m_numberOfFullPassElectrons >= 2 && !kinematicscomputed) {
1166  // before computing the kinematic parameters check track particles are ok
1167  bool goodtracks = true;
1168  if (m_pxMUTrack[0] == nullptr) goodtracks = false; // leading mu-
1169  if (m_pxMUTrack[2] == nullptr) goodtracks = false; // leading mu+
1170  if (m_pxELTrack[0] == nullptr) goodtracks = false; // leading e-
1171  if (m_pxELTrack[2] == nullptr) goodtracks = false; // leading e+
1172 
1173  if (goodtracks && !kinematicscomputed) { // Everything is ready
1174  // For the time being analysis is performed only with ID tracks
1176  invmass_test = m_fInvariantMass[ID];
1177  m_fMuonDispersion[ID] = EvaluateAngle ( m_pxMUTrack[0], m_pxELTrack[0]); // leading mu- and leading e-
1178  m_fZPt[ID] = EvalPt ( m_pxMUTrack[0], m_pxELTrack[0]); // leading mu- and leading e-
1179  m_fZEtaDir[ID] = EvalEta ( m_pxMUTrack[0], m_pxELTrack[0]); // leading mu- and leading e-
1180  m_fZPhiDir[ID] = EvalPhi ( m_pxMUTrack[0], m_pxELTrack[0]); // leading mu- and leading e-
1181  kinematicscomputed = true;
1182  } // good tracks
1183  }
1184  if(m_doDebug){
1185  std::cout << " * FourMuonEvent * ReconstructKinematicsNew * -- Muon and Electron Tracks -- " << std::endl;
1186  if (m_pxMUTrack[0] != nullptr) std::cout << " Pt(mu1-)= " << m_pxMUTrack[0]->pt() << std::endl;
1187  if (m_pxMUTrack[1] != nullptr) std::cout << " Pt(mu2-)= " << m_pxMUTrack[1]->pt() << std::endl;
1188  if (m_pxMUTrack[2] != nullptr) std::cout << " Pt(mu1+)= " << m_pxMUTrack[2]->pt() << std::endl;
1189  if (m_pxMUTrack[3] != nullptr) std::cout << " Pt(mu2+)= " << m_pxMUTrack[3]->pt() << std::endl;
1190  if (m_pxELTrack[0] != nullptr) std::cout << " Pt(e1-)= " << m_pxELTrack[0]->pt() << std::endl;
1191  if (m_pxELTrack[1] != nullptr) std::cout << " Pt(e2-)= " << m_pxELTrack[1]->pt() << std::endl;
1192  if (m_pxELTrack[2] != nullptr) std::cout << " Pt(e1+)= " << m_pxELTrack[2]->pt() << std::endl;
1193  if (m_pxELTrack[3] != nullptr) std::cout << " Pt(e2+)= " << m_pxELTrack[3]->pt() << std::endl;
1194  std::cout << " invariant mass used = " << m_fInvariantMass[ID] << std::endl;
1195  std::cout << " invariant mass test = " << invmass_test << std::endl;
1196  }
1197 
1198  if (!kinematicscomputed) {
1199  if(m_doDebug){ std::cout <<" * FourMuonEvent * ReconstructKinematicsNew * -- FAILED -- " << std::endl; }
1200  }
1201 
1202  (*m_msgStream) << MSG::DEBUG << " * FourMuonEvent * ReconstructKinematicsNew * -- COMPLETED -- status " << kinematicscomputed << endmsg;
1203  return kinematicscomputed;
1204 }

◆ RecordMuon()

void FourMuonEvent::RecordMuon ( const xAOD::Muon pxMuon)
private

Definition at line 923 of file FourMuonEvent.cxx.

924 {
925  bool thisdebug = false;
926  // if(m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * started "<< std::endl;}
927  // This shouldn't really ever happen but just in case.
928  if ( !pxMuon ) {
929  if(m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxMuon --> EXIT "<< std::endl;}
930  return;
931  }
932 
934  // The main Muon
936  if (thisdebug) {
937  std::cout <<" * FourMuonEvent * RecordMuon * m_pxRecMuon for this muon--> pt "<< m_pxRecMuon[m_numberOfFullPassMuons]->pt() << std::endl;
938  std::cout <<" d0 "<< m_pxRecMuon[m_numberOfFullPassMuons]->primaryTrackParticle()->d0() << std::endl;
939  std::cout <<" sigma_d0 "<< m_pxRecMuon[m_numberOfFullPassMuons]->primaryTrackParticle()->definingParametersCovMatrixVec()[0] << std::endl;
940  }
941 
942  const xAOD::TrackParticle* pxMSTrack = pxMuon->trackParticle(xAOD::Muon::MuonSpectrometerTrackParticle);
943  if (!pxMSTrack) {
944  if (m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxMSmuon --> EXIT "<< std::endl;}
945  return;
946  }
948  if (thisdebug) {
949  std::cout <<" * FourMuonEvent * RecordMuon * m_pxMSTrack for this muon--> pt "<< m_pxMSTrack[m_numberOfFullPassMuons]->pt() << std::endl;
950  std::cout <<" d0 "<< m_pxMSTrack[m_numberOfFullPassMuons]->d0() << std::endl;
951  std::cout <<" sigma_d0 "<< m_pxMSTrack[m_numberOfFullPassMuons]->definingParametersCovMatrixVec()[0] << std::endl;
952  }
953 
954  // ID muon
955  const xAOD::TrackParticle* pxIDTrack = pxMuon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
956  if (!pxIDTrack) {
957  if (m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * bad pxIDTrack for this muon--> EXIT "<< std::endl;}
958  return;
959  }
961  if (thisdebug) {
962  std::cout <<" * FourMuonEvent * RecordMuon * m_pxIDTrack for this muon--> pt "<< m_pxIDTrack[m_numberOfFullPassMuons]->pt() << std::endl;
963  std::cout <<" d0 "<< m_pxIDTrack[m_numberOfFullPassMuons]->d0() << std::endl;
964  std::cout <<" sigma_d0 "<< m_pxIDTrack[m_numberOfFullPassMuons]->definingParametersCovMatrixVec()[0] << std::endl;
965  }
966  //
969  }
970  // if(m_doDebug){ std::cout <<" * FourMuonEvent * RecordMuon * completed -- return with a total of " << m_numberOfFullPassMuons << std::endl;}
971  return;
972 }

◆ 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 }

◆ setContainer()

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

Definition at line 107 of file FourMuonEvent.h.

107 { m_container = container; };

◆ setDebugMode()

void FourMuonEvent::setDebugMode ( bool  debug)
inline

Definition at line 108 of file FourMuonEvent.h.

108 { m_doDebug=debug; }

◆ SetLeadingMuonPtCut()

void FourMuonEvent::SetLeadingMuonPtCut ( double  newvalue)

Definition at line 1323 of file FourMuonEvent.cxx.

1324 {
1325  // first set the new pt cut value
1326  m_LeadingMuonPtCut = newvalue;
1327 
1328  // the second muon pt cut can not be higher than the leading muon pt cut:
1330 
1331  // this has to be translated to the MuonSelector
1332  // but there one has to use the minimum momentum --> second muon
1333  //this->SetMuonPtCut(m_SecondMuonPtCut);
1334  if(m_doDebug){
1335  std::cout <<" * FourMuonEvent * SetLeadingMuonPtCut * new Pt cuts: " << m_LeadingMuonPtCut << " & "
1336  << m_SecondMuonPtCut
1337  << " MuonSelector: " << m_xMuonID.GetPtCut() << std::endl;
1338  }
1339  return;
1340 }

◆ SetMassWindowHigh()

void FourMuonEvent::SetMassWindowHigh ( double  newvalue)
inline

Definition at line 111 of file FourMuonEvent.h.

111 { m_MassWindowHigh = newvalue; }

◆ SetMassWindowLow()

void FourMuonEvent::SetMassWindowLow ( double  newvalue)
inline

Definition at line 110 of file FourMuonEvent.h.

110 { m_MassWindowLow = newvalue; }

◆ SetMuonPtCut()

void FourMuonEvent::SetMuonPtCut ( double  newvalue)
inline

Definition at line 112 of file FourMuonEvent.h.

112 { m_xMuonID.SetPtCut(newvalue); }

◆ SetMuonSelectionTool()

void FourMuonEvent::SetMuonSelectionTool ( ToolHandle< CP::IMuonSelectionTool mst)
inline

Definition at line 113 of file FourMuonEvent.h.

◆ SetOpeningAngleCut()

void FourMuonEvent::SetOpeningAngleCut ( double  newvalue)
inline

Definition at line 115 of file FourMuonEvent.h.

115 { m_OpeningAngleCut = newvalue; }

◆ SetSecondMuonPtCut()

void FourMuonEvent::SetSecondMuonPtCut ( double  newvalue)

Definition at line 1343 of file FourMuonEvent.cxx.

1344 {
1345  m_SecondMuonPtCut = newvalue;
1346 
1347  // use same for electrons
1349 
1350  // second muon pt shouldn't be higher than the leading muon pt
1352 
1353  // this has to be translated to the MuonSelector
1355 
1356  if(m_doDebug) {
1357  std::cout <<" * FourMuonEvent * SetSecondMuonPtCut * new Pt cuts: " << m_LeadingMuonPtCut
1358  << " & " << m_SecondMuonPtCut
1359  << " MuonSelector: " << m_xMuonID.GetPtCut() << std::endl;
1360  }
1361 
1362  return;
1363 }

◆ SetZ0GapCut()

void FourMuonEvent::SetZ0GapCut ( double  newvalue)
inline

Definition at line 116 of file FourMuonEvent.h.

116 { m_Z0GapCut = newvalue; }

Member Data Documentation

◆ invalidAnswer

constexpr float EventAnalysis::invalidAnswer {-999.9f}
staticconstexprinherited

Definition at line 39 of file EventAnalysis.h.

◆ m_acceptedElecCount

int FourMuonEvent::m_acceptedElecCount {}
private

Definition at line 199 of file FourMuonEvent.h.

◆ m_acceptedEventCount

int FourMuonEvent::m_acceptedEventCount
private

Definition at line 196 of file FourMuonEvent.h.

◆ m_acceptedMuonCount

int FourMuonEvent::m_acceptedMuonCount {}
private

Definition at line 198 of file FourMuonEvent.h.

◆ m_container

PerfMonServices::CONTAINERS FourMuonEvent::m_container
private

Definition at line 141 of file FourMuonEvent.h.

◆ m_deltaXYcut

double FourMuonEvent::m_deltaXYcut {}
private

Definition at line 152 of file FourMuonEvent.h.

◆ m_doDebug

bool FourMuonEvent::m_doDebug
private

Definition at line 155 of file FourMuonEvent.h.

◆ m_elec_vtx

int FourMuonEvent::m_elec_vtx[NUM_MUONS] {}
private

Definition at line 219 of file FourMuonEvent.h.

◆ m_eventCount

int FourMuonEvent::m_eventCount
private

Definition at line 195 of file FourMuonEvent.h.

◆ m_fInvariantMass

float FourMuonEvent::m_fInvariantMass[NUM_TYPES] {}
private

Definition at line 180 of file FourMuonEvent.h.

◆ m_fMuonDispersion

float FourMuonEvent::m_fMuonDispersion[NUM_TYPES] {}
private

Definition at line 181 of file FourMuonEvent.h.

◆ m_FourMuonInvMass

double FourMuonEvent::m_FourMuonInvMass {}
private

Definition at line 145 of file FourMuonEvent.h.

◆ m_fZEtaDir

float FourMuonEvent::m_fZEtaDir[NUM_TYPES] {}
private

Definition at line 178 of file FourMuonEvent.h.

◆ m_fZPhiDir

float FourMuonEvent::m_fZPhiDir[NUM_TYPES] {}
private

Definition at line 179 of file FourMuonEvent.h.

◆ m_fZPt

float FourMuonEvent::m_fZPt[NUM_TYPES] {}
private

Definition at line 177 of file FourMuonEvent.h.

◆ m_LeadingMuonPtCut

double FourMuonEvent::m_LeadingMuonPtCut {}
private

Definition at line 147 of file FourMuonEvent.h.

◆ m_MassWindowHigh

double FourMuonEvent::m_MassWindowHigh {}
private

Definition at line 150 of file FourMuonEvent.h.

◆ m_MassWindowLow

double FourMuonEvent::m_MassWindowLow {}
private

Definition at line 149 of file FourMuonEvent.h.

◆ m_msgStream

MsgStream* FourMuonEvent::m_msgStream
private

Definition at line 136 of file FourMuonEvent.h.

◆ m_muon1

int FourMuonEvent::m_muon1 = 0
private

Definition at line 203 of file FourMuonEvent.h.

◆ m_muon2

int FourMuonEvent::m_muon2 = 0
private

Definition at line 204 of file FourMuonEvent.h.

◆ m_muon_vtx

int FourMuonEvent::m_muon_vtx[NUM_MUONS] {}
private

Definition at line 218 of file FourMuonEvent.h.

◆ m_muonneg1

int FourMuonEvent::m_muonneg1 = 0
private

Definition at line 208 of file FourMuonEvent.h.

◆ m_muonneg1_vtx

int FourMuonEvent::m_muonneg1_vtx = 0
private

Definition at line 213 of file FourMuonEvent.h.

◆ m_muonneg2

int FourMuonEvent::m_muonneg2 = 0
private

Definition at line 209 of file FourMuonEvent.h.

◆ m_muonneg2_vtx

int FourMuonEvent::m_muonneg2_vtx = 0
private

Definition at line 214 of file FourMuonEvent.h.

◆ m_muonpos1

int FourMuonEvent::m_muonpos1 = 0
private

Definition at line 206 of file FourMuonEvent.h.

◆ m_muonpos1_vtx

int FourMuonEvent::m_muonpos1_vtx = 0
private

Definition at line 215 of file FourMuonEvent.h.

◆ m_muonpos2

int FourMuonEvent::m_muonpos2 = 0
private

Definition at line 207 of file FourMuonEvent.h.

◆ m_muonpos2_vtx

int FourMuonEvent::m_muonpos2_vtx = 0
private

Definition at line 216 of file FourMuonEvent.h.

◆ m_numberOfFullPassElectrons

unsigned int FourMuonEvent::m_numberOfFullPassElectrons {}
private

Definition at line 162 of file FourMuonEvent.h.

◆ m_numberOfFullPassMuons

unsigned int FourMuonEvent::m_numberOfFullPassMuons {}
private

Definition at line 161 of file FourMuonEvent.h.

◆ m_nVertex

int FourMuonEvent::m_nVertex = 0
private

Definition at line 212 of file FourMuonEvent.h.

◆ m_OpeningAngleCut

double FourMuonEvent::m_OpeningAngleCut {}
private

Definition at line 151 of file FourMuonEvent.h.

◆ m_passedFourElectronSelection

bool FourMuonEvent::m_passedFourElectronSelection = false
private

Definition at line 165 of file FourMuonEvent.h.

◆ m_passedFourLeptonSelection

bool FourMuonEvent::m_passedFourLeptonSelection = false
private

Definition at line 166 of file FourMuonEvent.h.

◆ m_passedFourMuonSelection

bool FourMuonEvent::m_passedFourMuonSelection = false
private

Definition at line 164 of file FourMuonEvent.h.

◆ m_passedSelectionCuts

bool FourMuonEvent::m_passedSelectionCuts = false
private

Definition at line 163 of file FourMuonEvent.h.

◆ m_pxELTrack

const xAOD::TrackParticle* FourMuonEvent::m_pxELTrack[NUM_MUONS] {}
private

Definition at line 173 of file FourMuonEvent.h.

◆ m_pxIDTrack

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

Definition at line 171 of file FourMuonEvent.h.

◆ m_pxMETrack

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

Definition at line 169 of file FourMuonEvent.h.

◆ m_pxMSTrack

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

Definition at line 170 of file FourMuonEvent.h.

◆ m_pxMUTrack

const xAOD::TrackParticle* FourMuonEvent::m_pxMUTrack[NUM_MUONS] {}
private

Definition at line 174 of file FourMuonEvent.h.

◆ m_pxRecMuon

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

Definition at line 168 of file FourMuonEvent.h.

◆ m_SecondMuonPtCut

double FourMuonEvent::m_SecondMuonPtCut {}
private

Definition at line 148 of file FourMuonEvent.h.

◆ m_SelectMuonByIP

bool FourMuonEvent::m_SelectMuonByIP
private

Definition at line 192 of file FourMuonEvent.h.

◆ m_SelectMuonByIso

bool FourMuonEvent::m_SelectMuonByIso
private

Definition at line 191 of file FourMuonEvent.h.

◆ m_uMuonTags

unsigned int FourMuonEvent::m_uMuonTags {}
private

Definition at line 144 of file FourMuonEvent.h.

◆ m_uPassedEvents

unsigned int EventAnalysis::m_uPassedEvents
protectedinherited

Definition at line 74 of file EventAnalysis.h.

◆ m_workAsFourElectrons

bool FourMuonEvent::m_workAsFourElectrons
private

Definition at line 157 of file FourMuonEvent.h.

◆ m_workAsFourLeptons

bool FourMuonEvent::m_workAsFourLeptons
private

Definition at line 158 of file FourMuonEvent.h.

◆ m_workAsFourMuons

bool FourMuonEvent::m_workAsFourMuons
private

Definition at line 156 of file FourMuonEvent.h.

◆ m_x1DHistograms

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

Definition at line 75 of file EventAnalysis.h.

◆ m_x1DProfHistograms

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

Definition at line 77 of file EventAnalysis.h.

◆ m_x2DHistograms

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

Definition at line 76 of file EventAnalysis.h.

◆ m_x2DProfHistograms

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

Definition at line 78 of file EventAnalysis.h.

◆ m_xElecID

ElectronSelector FourMuonEvent::m_xElecID
private

Definition at line 140 of file FourMuonEvent.h.

◆ m_xMuonID

MuonSelector FourMuonEvent::m_xMuonID
private

Definition at line 139 of file FourMuonEvent.h.

◆ m_xSampleName

std::string EventAnalysis::m_xSampleName
protectedinherited

Definition at line 80 of file EventAnalysis.h.

◆ m_Z0GapCut

double FourMuonEvent::m_Z0GapCut {}
private

Definition at line 153 of file FourMuonEvent.h.


The documentation for this class was generated from the following files:
EventAnalysis::EvalInvMass
static float EvalInvMass(const T *pxP1, const T *pxP2, float fMass1, float fMass2=invalidAnswer)
Definition: EventAnalysis.h:106
EventAnalysis::EvaluateAngle
static float EvaluateAngle(const T *pxP1, const T *pxP2)
Definition: EventAnalysis.h:163
ElectronSelector::GetElecNegTrackParticle
const xAOD::TrackParticle * GetElecNegTrackParticle(size_t i)
Definition: ElectronSelector.cxx:349
FourMuonEvent::NUM_TYPES
@ NUM_TYPES
Definition: FourMuonEvent.h:66
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
FourMuonEvent::m_acceptedElecCount
int m_acceptedElecCount
Definition: FourMuonEvent.h:199
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
FourMuonEvent::m_acceptedEventCount
int m_acceptedEventCount
Definition: FourMuonEvent.h:196
PerfMonServices::getContainerName
static const std::string & getContainerName(CONTAINERS eContainer)
Definition: PerfMonServices.h:52
FourMuonEvent::EventSelectionNew
bool EventSelectionNew(ZTYPE eType)
Definition: FourMuonEvent.cxx:262
FourMuonEvent::m_muon_vtx
int m_muon_vtx[NUM_MUONS]
Definition: FourMuonEvent.h:218
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
ID
std::vector< Identifier > ID
Definition: CalibHitIDCheck.h:24
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
FourMuonEvent::m_fZEtaDir
float m_fZEtaDir[NUM_TYPES]
Definition: FourMuonEvent.h:178
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::Muon_v1::trackParticle
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:486
perp
Scalar perp() const
perp method - perpenticular length
Definition: AmgMatrixBasePlugin.h:44
ElectronSelector::GetElecPosTrackParticle
const xAOD::TrackParticle * GetElecPosTrackParticle(size_t i)
Definition: ElectronSelector.cxx:358
FourMuonEvent::ZMASS_COMB
@ ZMASS_COMB
Definition: FourMuonEvent.h:186
FourMuonEvent::m_SelectMuonByIP
bool m_SelectMuonByIP
Definition: FourMuonEvent.h:192
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
FourMuonEvent::m_xElecID
ElectronSelector m_xElecID
Definition: FourMuonEvent.h:140
FourMuonEvent::m_SecondMuonPtCut
double m_SecondMuonPtCut
Definition: FourMuonEvent.h:148
FourMuonEvent::m_pxIDTrack
const xAOD::TrackParticle * m_pxIDTrack[NUM_MUONS]
Definition: FourMuonEvent.h:171
FourMuonEvent::CheckMuonVertices
bool CheckMuonVertices()
Definition: FourMuonEvent.cxx:1471
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
FourMuonEvent::OrderMuonList
void OrderMuonList()
Definition: FourMuonEvent.cxx:1366
EventAnalysis::EvalFourMuInvMass
static float EvalFourMuInvMass(const T *pxP1, const T *pxP2, const T *pxP3, const T *pxP4)
Definition: EventAnalysis.h:123
FourMuonEvent::m_muonpos1
int m_muonpos1
Definition: FourMuonEvent.h:206
FourMuonEvent::m_msgStream
MsgStream * m_msgStream
Definition: FourMuonEvent.h:136
FourMuonEvent::NUM_MUONS
@ NUM_MUONS
Definition: FourMuonEvent.h:49
FourMuonEvent::m_muonneg2_vtx
int m_muonneg2_vtx
Definition: FourMuonEvent.h:214
test_pyathena.pt
pt
Definition: test_pyathena.py:11
FourMuonEvent::m_numberOfFullPassMuons
unsigned int m_numberOfFullPassMuons
Definition: FourMuonEvent.h:161
FourMuonEvent::ID
@ ID
Definition: FourMuonEvent.h:64
FourMuonEvent::ZMASS_MUON
@ ZMASS_MUON
Definition: FourMuonEvent.h:186
xAOD::TrackParticle_v1::definingParametersCovMatrixVec
std::vector< float > definingParametersCovMatrixVec() const
Returns the length 6 vector containing the elements of defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:385
FourMuonEvent::MUON2
@ MUON2
Definition: FourMuonEvent.h:46
FourMuonEvent::ReconstructKinematicsNew
bool ReconstructKinematicsNew()
Definition: FourMuonEvent.cxx:1083
FourMuonEvent::ZMASS_TRACK
@ ZMASS_TRACK
Definition: FourMuonEvent.h:186
FourMuonEvent::m_muonneg1_vtx
int m_muonneg1_vtx
Definition: FourMuonEvent.h:213
FourMuonEvent::RecordMuon
void RecordMuon(const xAOD::Muon *pxMuon)
Definition: FourMuonEvent.cxx:923
ElectronSelector::SetPtCut
void SetPtCut(float newpt)
Definition: ElectronSelector.h:48
EventAnalysis::EvalCharge
static float EvalCharge(const T *pxP1, const T *pxP2)
Definition: EventAnalysis.h:238
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
EventAnalysis::m_x1DHistograms
std::map< unsigned int, TH1F * > m_x1DHistograms
Definition: EventAnalysis.h:75
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
FourMuonEvent::m_passedFourLeptonSelection
bool m_passedFourLeptonSelection
Definition: FourMuonEvent.h:166
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
FourMuonEvent::m_elec_vtx
int m_elec_vtx[NUM_MUONS]
Definition: FourMuonEvent.h:219
FourMuonEvent::m_workAsFourElectrons
bool m_workAsFourElectrons
Definition: FourMuonEvent.h:157
FourMuonEvent::m_muon2
int m_muon2
Definition: FourMuonEvent.h:204
xAOD::Muon_v1::charge
float charge() const
FourMuonEvent::ME
@ ME
Definition: FourMuonEvent.h:63
FourMuonEvent::m_muonpos1_vtx
int m_muonpos1_vtx
Definition: FourMuonEvent.h:215
FourMuonEvent::m_MassWindowHigh
double m_MassWindowHigh
Definition: FourMuonEvent.h:150
MuonSelector::SetCustomMuonSelectionTool
void SetCustomMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
Definition: MuonSelector.h:58
FourMuonEvent::m_OpeningAngleCut
double m_OpeningAngleCut
Definition: FourMuonEvent.h:151
EventAnalysis::m_x2DHistograms
std::map< unsigned int, TH2F * > m_x2DHistograms
Definition: EventAnalysis.h:76
FourMuonEvent::ZMASS_MUONADJ
@ ZMASS_MUONADJ
Definition: FourMuonEvent.h:186
EventAnalysis::EvalTransverseMass
static float EvalTransverseMass(const T *pxP1, float fMETx, float fMETy, float fMass1, float fMass2=invalidAnswer)
Definition: EventAnalysis.h:254
EventAnalysis::calculateMomentum
static CLHEP::Hep3Vector calculateMomentum(const T *pP)
Definition: EventAnalysis.h:91
MuonSelector::doMCPSelection
void doMCPSelection(bool domcp)
Definition: MuonSelector.h:52
EventAnalysis::EvalPtDiff
static float EvalPtDiff(const T *pxP1, const T *pxP2)
Definition: EventAnalysis.h:173
lumiFormat.i
int i
Definition: lumiFormat.py:85
PerfMonServices::ELECTRON_COLLECTION
@ ELECTRON_COLLECTION
Definition: PerfMonServices.h:30
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ElectronSelector::PrepareElectronList
void PrepareElectronList(const xAOD::ElectronContainer *pxElecContainer)
Definition: ElectronSelector.cxx:94
MuonSelector::doIsoSelection
void doIsoSelection(bool doIso)
Definition: MuonSelector.h:50
MuonSelector::Init
virtual void Init()
Definition: MuonSelector.cxx:112
FourMuonEvent::m_numberOfFullPassElectrons
unsigned int m_numberOfFullPassElectrons
Definition: FourMuonEvent.h:162
MuonSegmentReaderConfig.histSvc
histSvc
Definition: MuonSegmentReaderConfig.py:96
FourMuonEvent::SetLeadingMuonPtCut
void SetLeadingMuonPtCut(double newvalue)
Definition: FourMuonEvent.cxx:1323
FourMuonEvent::m_xMuonID
MuonSelector m_xMuonID
Definition: FourMuonEvent.h:139
xAOD::Muon_v1::pt
virtual double pt() const
The transverse momentum ( ) of the particle.
FourMuonEvent::m_passedFourElectronSelection
bool m_passedFourElectronSelection
Definition: FourMuonEvent.h:165
FourMuonEvent::MUON4
@ MUON4
Definition: FourMuonEvent.h:48
FourMuonEvent::m_doDebug
bool m_doDebug
Definition: FourMuonEvent.h:155
FourMuonEvent::FORWARD
@ FORWARD
Definition: FourMuonEvent.h:55
hist_file_dump.f
f
Definition: hist_file_dump.py:135
FourMuonEvent::m_fZPt
float m_fZPt[NUM_TYPES]
Definition: FourMuonEvent.h:177
FourMuonEvent::m_container
PerfMonServices::CONTAINERS m_container
Definition: FourMuonEvent.h:141
FourMuonEvent::MS
@ MS
Definition: FourMuonEvent.h:62
MuonSelector::GetPtCut
double GetPtCut()
Definition: MuonSelector.h:55
FourMuonEvent::m_eventCount
int m_eventCount
Definition: FourMuonEvent.h:195
PerfMonServices::TRK_COLLECTION
@ TRK_COLLECTION
Definition: PerfMonServices.h:42
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
FourMuonEvent::m_nVertex
int m_nVertex
Definition: FourMuonEvent.h:212
EventAnalysis::m_x1DProfHistograms
std::map< unsigned int, TProfile * > m_x1DProfHistograms
Definition: EventAnalysis.h:77
FourMuonEvent::m_pxMETrack
const xAOD::TrackParticle * m_pxMETrack[NUM_MUONS]
Definition: FourMuonEvent.h:169
FourMuonEvent::BACKWARD
@ BACKWARD
Definition: FourMuonEvent.h:56
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
FourMuonEvent::MUON1
@ MUON1
Definition: FourMuonEvent.h:45
FourMuonEvent::CENTRAL
@ CENTRAL
Definition: FourMuonEvent.h:54
FourMuonEvent::UNDEF
@ UNDEF
Definition: FourMuonEvent.h:57
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
ElectronSelector::GetElectronCollectionSize
unsigned int GetElectronCollectionSize()
Definition: ElectronSelector.h:43
charge
double charge(const T &p)
Definition: AtlasPID.h:756
EventAnalysis::EvalEta
static float EvalEta(const T *pxP1, const T *pxP2)
Definition: EventAnalysis.h:229
FourMuonEvent::MUON3
@ MUON3
Definition: FourMuonEvent.h:47
FourMuonEvent::m_LeadingMuonPtCut
double m_LeadingMuonPtCut
Definition: FourMuonEvent.h:147
FourMuonEvent::Clear
void Clear()
Definition: FourMuonEvent.cxx:875
FourMuonEvent::m_fMuonDispersion
float m_fMuonDispersion[NUM_TYPES]
Definition: FourMuonEvent.h:181
FourMuonEvent::m_workAsFourLeptons
bool m_workAsFourLeptons
Definition: FourMuonEvent.h:158
MuonSelector::passSelection
bool passSelection(const xAOD::Muon *pxMuon)
Definition: MuonSelector.cxx:136
EventAnalysis::EvalPt
static float EvalPt(const T *pxP1, const T *pxP2)
Definition: EventAnalysis.h:211
FourMuonEvent::m_passedFourMuonSelection
bool m_passedFourMuonSelection
Definition: FourMuonEvent.h:164
FourMuonEvent::m_muonneg2
int m_muonneg2
Definition: FourMuonEvent.h:209
MuonSelector::SetPtCut
void SetPtCut(double newvalue)
Definition: MuonSelector.h:54
FourMuonEvent::m_workAsFourMuons
bool m_workAsFourMuons
Definition: FourMuonEvent.h:156
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
python.PyAthena.v
v
Definition: PyAthena.py:154
MuonSelector::doIPSelection
void doIPSelection(bool doIPsel)
Definition: MuonSelector.h:51
FourMuonEvent::m_pxELTrack
const xAOD::TrackParticle * m_pxELTrack[NUM_MUONS]
Definition: FourMuonEvent.h:173
FourMuonEvent::m_fZPhiDir
float m_fZPhiDir[NUM_TYPES]
Definition: FourMuonEvent.h:179
FourMuonEvent::m_MassWindowLow
double m_MassWindowLow
Definition: FourMuonEvent.h:149
EventAnalysis::m_x2DProfHistograms
std::map< unsigned int, TProfile2D * > m_x2DProfHistograms
Definition: EventAnalysis.h:78
FourMuonEvent::m_fInvariantMass
float m_fInvariantMass[NUM_TYPES]
Definition: FourMuonEvent.h:180
FourMuonEvent::m_Z0GapCut
double m_Z0GapCut
Definition: FourMuonEvent.h:153
FourMuonEvent::m_muonpos2_vtx
int m_muonpos2_vtx
Definition: FourMuonEvent.h:216
EAna::g_fMuonMass
const float g_fMuonMass
Definition: EventAnalysis.h:26
FourMuonEvent::m_muon1
int m_muon1
Definition: FourMuonEvent.h:203
DEBUG
#define DEBUG
Definition: page_access.h:11
FourMuonEvent::m_pxMSTrack
const xAOD::TrackParticle * m_pxMSTrack[NUM_MUONS]
Definition: FourMuonEvent.h:170
FourMuonEvent::m_pxRecMuon
const xAOD::Muon * m_pxRecMuon[NUM_MUONS]
Definition: FourMuonEvent.h:168
FourMuonEvent::m_passedSelectionCuts
bool m_passedSelectionCuts
Definition: FourMuonEvent.h:163
FourMuonEvent::m_muonpos2
int m_muonpos2
Definition: FourMuonEvent.h:207
EventAnalysis::EvalPhi
static float EvalPhi(const T *pxP1, const T *pxP2)
Definition: EventAnalysis.h:220
FourMuonEvent::SetMuonPtCut
void SetMuonPtCut(double newvalue)
Definition: FourMuonEvent.h:112
Trk::phi
@ phi
Definition: ParamDefs.h:75
xAOD::Muon_v1::primaryTrackParticle
const TrackParticle * primaryTrackParticle() const
Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of in...
Definition: Muon_v1.cxx:400
FourMuonEvent::m_pxMUTrack
const xAOD::TrackParticle * m_pxMUTrack[NUM_MUONS]
Definition: FourMuonEvent.h:174
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
xAOD::TrackParticle_v1::track
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
Definition: TrackParticle_v1.cxx:805
FourMuonEvent::m_uMuonTags
unsigned int m_uMuonTags
Definition: FourMuonEvent.h:144
EventAnalysis::Init
virtual void Init()
Definition: EventAnalysis.cxx:44
FourMuonEvent::m_muonneg1
int m_muonneg1
Definition: FourMuonEvent.h:208
FourMuonEvent::m_FourMuonInvMass
double m_FourMuonInvMass
Definition: FourMuonEvent.h:145
EventAnalysis::m_xSampleName
std::string m_xSampleName
Definition: EventAnalysis.h:80
ElectronSelector::Init
void Init()
Definition: ElectronSelector.cxx:53
EAna::CGeV
const float CGeV
Definition: EventAnalysis.h:28
MooRTT_summarizeCPU.muid
int muid
Definition: MooRTT_summarizeCPU.py:44
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
FourMuonEvent::m_acceptedMuonCount
int m_acceptedMuonCount
Definition: FourMuonEvent.h:198
FourMuonEvent::m_SelectMuonByIso
bool m_SelectMuonByIso
Definition: FourMuonEvent.h:191
FourMuonEvent::SetSecondMuonPtCut
void SetSecondMuonPtCut(double newvalue)
Definition: FourMuonEvent.cxx:1343
EventAnalysis::invalidAnswer
static constexpr float invalidAnswer
Definition: EventAnalysis.h:39
PerfMonServices::MUON_COLLECTION
@ MUON_COLLECTION
Definition: PerfMonServices.h:26
FourMuonEvent::NUM_1HISTOS
@ NUM_1HISTOS
Definition: FourMuonEvent.h:187
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
FourMuonEvent::m_deltaXYcut
double m_deltaXYcut
Definition: FourMuonEvent.h:152
FourMuonEvent::CB
@ CB
Definition: FourMuonEvent.h:65
ServiceHandle< ITHistSvc >