ATLAS Offline Software
Loading...
Searching...
No Matches
MMCTest::TrackInfo Class Reference

#include <TrackInfo.h>

Collaboration diagram for MMCTest::TrackInfo:

Public Member Functions

 TrackInfo (std::string type, std::vector< std::string > systs)
 ~TrackInfo ()
void Reset ()
void Register (TTree *t)
void Fill (const xAOD::TrackParticle *tp)
TLorentzVector GetFourMomentum (bool calib=false)
int GetCharge ()
void SetCalibPt (float calib_pt, const std::string &syst)

Private Attributes

std::string m_Type
std::vector< std::string > m_Systs
float m_Pt = 0.0F
float m_Eta = 0.0F
float m_Phi = 0.0F
float m_QoverP = 0.0F
float m_Chi2 = 0.0F
std::map< std::string, float > m_CalibPt
int m_Charge = 0
int m_NDoF = 0
std::vector< float > m_TrackPars
std::vector< float > m_TrackCovMatrix

Detailed Description

Constructor & Destructor Documentation

◆ TrackInfo()

MMCTest::TrackInfo::TrackInfo ( std::string type,
std::vector< std::string > systs )

◆ ~TrackInfo()

MMCTest::TrackInfo::~TrackInfo ( )
inline

Member Function Documentation

◆ Fill()

void MMCTest::TrackInfo::Fill ( const xAOD::TrackParticle * tp)

Definition at line 43 of file PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/src/TrackInfo.cxx.

43 {
44 m_Pt = tp->pt() * Gaudi::Units::perThousand;
45 m_Eta = tp->eta();
46 m_Phi = tp->phi();
47 m_Charge = (int)tp->charge();
48 m_QoverP = tp->qOverP() / Gaudi::Units::perThousand;
49 m_Chi2 = tp->chiSquared();
50 m_NDoF = (int)tp->numberDoF();
51 AmgVector(5) pars = tp->definingParameters();
52 AmgSymMatrix(5) cov = tp->definingParametersCovMatrix();
53
54 m_TrackPars.clear();
55 for (unsigned int i = 0; i < 5; i++) m_TrackPars.push_back(pars[i]);
56 m_TrackCovMatrix.clear();
57
58 for (unsigned int i = 0; i < 5; i++)
59 for (unsigned int j = 0; j < 5; j++) m_TrackCovMatrix.push_back(cov(i, j));
60 }
#define AmgSymMatrix(dim)
#define AmgVector(rows)

◆ GetCharge()

int MMCTest::TrackInfo::GetCharge ( )
inline

◆ GetFourMomentum()

TLorentzVector MMCTest::TrackInfo::GetFourMomentum ( bool calib = false)

Definition at line 62 of file PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/src/TrackInfo.cxx.

62 {
63 TLorentzVector result;
64 if (calib)
65 result.SetPtEtaPhiM(m_CalibPt[""], m_Eta, m_Phi, ParticleConstants::muonMassInMeV/1000.); // convert MeV to GeV
66 else
67 result.SetPtEtaPhiM(m_Pt, m_Eta, m_Phi, ParticleConstants::muonMassInMeV/1000.); // convert MeV to GeV
68 return result;
69 }
constexpr double muonMassInMeV
the mass of the muon (in MeV)

◆ Register()

void MMCTest::TrackInfo::Register ( TTree * t)

Definition at line 30 of file PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/src/TrackInfo.cxx.

30 {
31 t->Branch(("Muon_" + m_Type + "_Pt").c_str(), &m_Pt);
32 t->Branch(("Muon_" + m_Type + "_Eta").c_str(), &m_Eta);
33 t->Branch(("Muon_" + m_Type + "_Phi").c_str(), &m_Phi);
34 t->Branch(("Muon_" + m_Type + "_Charge").c_str(), &m_Charge);
35 t->Branch(("Muon_" + m_Type + "_QoverP").c_str(), &m_QoverP);
36 t->Branch(("Muon_" + m_Type + "_Chi2").c_str(), &m_Chi2);
37 t->Branch(("Muon_" + m_Type + "_NDoF").c_str(), &m_NDoF);
38 t->Branch(("Muon_" + m_Type + "_TrackPars").c_str(), &m_TrackPars);
39 t->Branch(("Muon_" + m_Type + "_TrackCovMatrix").c_str(), &m_TrackCovMatrix);
40 for (const auto& s : m_Systs) { t->Branch(("Muon_" + m_Type + "_" + s + "CalibPt").c_str(), &m_CalibPt[s]); }
41 }

◆ Reset()

void MMCTest::TrackInfo::Reset ( )

Definition at line 14 of file PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/src/TrackInfo.cxx.

14 {
15 m_Pt = -999.;
16 for (const auto& s : m_Systs) { m_CalibPt[s] = -999.; }
17 m_Eta = -999.;
18 m_Phi = -999.;
19 m_QoverP = -999.;
20 m_Chi2 = -999.;
21 m_Charge = -999;
22 m_NDoF = 0;
23 m_TrackPars.clear();
24 for (unsigned int i = 0; i < 5; i++) m_TrackPars.push_back(0.);
25 m_TrackCovMatrix.clear();
26 for (unsigned int i = 0; i < 5; i++)
27 for (unsigned int j = 0; j < 5; j++) m_TrackCovMatrix.push_back(0.);
28 }

◆ SetCalibPt()

void MMCTest::TrackInfo::SetCalibPt ( float calib_pt,
const std::string & syst )
inline

Definition at line 37 of file PhysicsAnalysis/MuonID/MuonIDAnalysis/MuonMomentumCorrections/src/TrackInfo.h.

37{ m_CalibPt[syst] = calib_pt * Gaudi::Units::perThousand; }

Member Data Documentation

◆ m_CalibPt

std::map<std::string, float> MMCTest::TrackInfo::m_CalibPt
private

◆ m_Charge

int MMCTest::TrackInfo::m_Charge = 0
private

◆ m_Chi2

float MMCTest::TrackInfo::m_Chi2 = 0.0F
private

◆ m_Eta

float MMCTest::TrackInfo::m_Eta = 0.0F
private

◆ m_NDoF

int MMCTest::TrackInfo::m_NDoF = 0
private

◆ m_Phi

float MMCTest::TrackInfo::m_Phi = 0.0F
private

◆ m_Pt

float MMCTest::TrackInfo::m_Pt = 0.0F
private

◆ m_QoverP

float MMCTest::TrackInfo::m_QoverP = 0.0F
private

◆ m_Systs

std::vector<std::string> MMCTest::TrackInfo::m_Systs
private

◆ m_TrackCovMatrix

std::vector<float> MMCTest::TrackInfo::m_TrackCovMatrix
private

◆ m_TrackPars

std::vector<float> MMCTest::TrackInfo::m_TrackPars
private

◆ m_Type

std::string MMCTest::TrackInfo::m_Type
private

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