Skip to content
Snippets Groups Projects
Commit a3c459ae authored by John Derek Chapman's avatar John Derek Chapman Committed by Johannes Elmsheuser
Browse files

TrkValTools: migration from barcodes to GenParticle::id()

TrkValTools: migration from barcodes to GenParticle::id()
parent 3d438b1e
No related branches found
No related tags found
No related merge requests found
......@@ -90,7 +90,7 @@ private:
float m_mc_eta; //!< eta of MC truth particle's perigee parameters
int m_mc_particleID; //!< PDG ID of MC truth particle
int m_mc_barcode; //!< MC truth particle's barcode
int m_mc_uniqueID; //!< MC truth particle's uniqueID
float m_mc_energy; //!< MC truth particle's energy at production vertex
int m_mc_jetLinkIndex; //!< link to jet this particle belongs to (if jet tree is ON)
float m_mc_prodR; //!< Rxy of particle's production vertex
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
......@@ -118,7 +118,7 @@ Trk::InDetPrimaryConversionSelector::selectGenSignal (const McEventCollection* S
ATH_MSG_DEBUG ("Selected this electron/positron!");
break;
} // if (particle pt, eta)
} // if (mother is gamma wit barcode ...)
} // if (mother is electron or gamma ...)
} // loop over mother particles
} // if (have electron/positron)
} // if (have stable particle)
......
......@@ -69,7 +69,7 @@ Trk::PerigeeParametersNtupleTool::PerigeeParametersNtupleTool(
m_mc_pull_qOverP{},
m_mc_particleID{},
m_mc_barcode{},
m_mc_uniqueID{},
m_mc_truthTreeIndex{},
m_mc_energy{},
......@@ -147,7 +147,7 @@ StatusCode Trk::PerigeeParametersNtupleTool::addNtupleItems( TTree* tree ) {
tree->Branch( "trk_Mc_pull_qOverP", &m_mc_pull_qOverP );
tree->Branch( "trk_Mc_particleID", &m_mc_particleID );
tree->Branch( "trk_Mc_barcode", &m_mc_barcode );
tree->Branch( "trk_Mc_barcode", &m_mc_uniqueID ); // TODO update variable name to be consistent
tree->Branch( "trk_Mc_energy", &m_mc_energy );
tree->Branch( "trk_Mc_prob", &m_mc_prob );
tree->Branch( "trk_Mc_truthTreeIndex",&m_mc_truthTreeIndex );
......@@ -230,7 +230,7 @@ StatusCode Trk::PerigeeParametersNtupleTool::fillTrackTruthData ( const TrackPar
const HepMcParticleLink& particleLink = trackTruth.particleLink();
m_mc_barcode = particleLink.barcode();
m_mc_uniqueID = HepMC::uniqueID(particleLink);
m_mc_prob=trackTruth.probability();
m_mc_truthTreeIndex = indexInTruthTree;
......
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
......@@ -103,7 +103,7 @@ private:
float m_mc_pull_qOverP;//!< parameter-pull for q/p UNIT:1
int m_mc_particleID; //!< PDG-ID for matched truth track
int m_mc_barcode; //!< barcode for matched truth track
int m_mc_uniqueID; //!< unique ID for matched truth track
int m_mc_truthTreeIndex; //!< entry index linking to 'Truth' tree in ntuple
float m_mc_energy; //!< energy of the truth particle UNIT:MeV
......
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
//////////////////////////////////////////////////////////////////
......@@ -57,7 +57,7 @@ Trk::TruthNtupleTool::TruthNtupleTool(
m_mc_eta{},
m_mc_particleID{},
m_mc_barcode{},
m_mc_uniqueID{},
m_mc_energy{},
m_mc_jetLinkIndex{},
m_mc_prodR{},
......@@ -122,7 +122,7 @@ StatusCode Trk::TruthNtupleTool::initialize() {
m_nt->Branch( "truth_qOverPt", &m_mc_qOverPt );
m_nt->Branch( "truth_eta", &m_mc_eta );
m_nt->Branch( "truth_particleID", &m_mc_particleID );
m_nt->Branch( "truth_barcode", &m_mc_barcode );
m_nt->Branch( "truth_barcode", &m_mc_uniqueID ); // TODO Update variable name to be consistent
m_nt->Branch( "truth_energy", &m_mc_energy );
m_nt->Branch( "truth_prod_R", &m_mc_prodR );
m_nt->Branch( "truth_prod_z", &m_mc_prodz );
......@@ -279,7 +279,7 @@ StatusCode Trk::TruthNtupleTool::writeTruthData (
if (genParticle==nullptr) ATH_MSG_WARNING ("NULL pointer to gen particle at index "<<index<<
", problem with truth selection logic?");
else ATH_MSG_DEBUG ("NULL pointer perigee from TruthToTrack. Index is "<<index);
m_mc_barcode = 0;
m_mc_uniqueID = HepMC::UNDEFINED_ID;
for (unsigned int trackColIndex = 0; trackColIndex < m_mc_prob.size(); ++trackColIndex ) {
(m_mc_prob[trackColIndex])->clear();
(m_TrackLinkIndex[trackColIndex])->clear();
......@@ -298,7 +298,7 @@ StatusCode Trk::TruthNtupleTool::writeTruthData (
m_mc_prodR = 0.;
m_mc_prodz = 0.;
} else {
m_mc_barcode = HepMC::barcode(genParticle);
m_mc_uniqueID = HepMC::uniqueID(genParticle);
m_mc_particleID = genParticle->pdg_id();
m_mc_energy = genParticle->momentum().e();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment