16TauTruthTrackMatchingTool::TauTruthTrackMatchingTool(
const std::string& name )
27 return StatusCode::SUCCESS;
37 bool avail = accIsHadronicTrack.
isAvailable(xTrackParticle);
41 ATH_MSG_DEBUG(
"IsHadronicTrack decoration is available on first track processed, switched of rerun for further taus.");
42 ATH_MSG_DEBUG(
"If a truth track matching needs to be redone, please pass a shallow copy of the original track.");
46 return StatusCode::SUCCESS;
50 return StatusCode::SUCCESS;
56 for (
auto xTrackParticle : vTrackParticles)
61 return StatusCode::SUCCESS;
74 return StatusCode::SUCCESS;
79 if (accTruthMatchProbability(*(xTrackParticle.
track())) < 0.5)
82 return StatusCode::SUCCESS;
87 if (
static_cast<bool>(accIsHadronicTrack(xTrackParticle)) and accIsHadronicTrackDecayDepth(xTrackParticle) == 0)
90 return StatusCode::SUCCESS;
102 ATH_MSG_DEBUG(
"unique ID not available for this truth track. Will mark as UnclassifiedTrack ");
104 return StatusCode::SUCCESS;
111 return StatusCode::SUCCESS;
121 return StatusCode::SUCCESS;
127 return StatusCode::SUCCESS;
129 for (
size_t iIncomingParticle = 0; iIncomingParticle < xProdVertex->
nIncomingParticles(); ++iIncomingParticle )
134 ATH_MSG_WARNING(
"Truth parent of tau decay was not found in TruthParticles container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.\nInformation on how to do this can be found here:\nhttps://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TauPreRecommendations2015#Accessing_Tau_Truth_Information");
136 return StatusCode::SUCCESS;
142 return StatusCode::SUCCESS;
146 size_t iElectrons = 0;
147 for (
size_t iOutgoingParticle = 0; iOutgoingParticle < xProdVertex->
nOutgoingParticles(); ++iOutgoingParticle )
152 ATH_MSG_WARNING(
"Truth daughter of tau decay was not found in TruthParticles container. Please ensure that this container has the full tau decay information or produce the TruthTaus container in AtlasDerivation.\nInformation on how to do this can be found here:\nhttps://twiki.cern.ch/twiki/bin/viewauth/AtlasProtected/TauPreRecommendations2015#Accessing_Tau_Truth_Information");
154 return StatusCode::SUCCESS;
160 return StatusCode::SUCCESS;
167 return StatusCode::SUCCESS;
170 return StatusCode::SUCCESS;
177 auto xTruthParticleLink = accTruthParticleLink(*(xTrackParticle.
track()));
179 if (xTruthParticleLink.isValid())
180 return (*xTruthParticleLink);
190 decIsHadronicTrack(xTrackParticle) = (char)
false;
193 std::string sHistory =
"";
196 sHistory = std::to_string(xTruthParticle->
pdgId());
199 decIsHadronicTrack(xTrackParticle) = (char)
true;
202 decIsHadronicTrackDecayDepth(xTrackParticle) = iDepth;
203 decDecayHistory(xTrackParticle) = sHistory;
205 return StatusCode::SUCCESS;
220 if (xTruthParticleParent) {
222 sHistory.insert(0, std::to_string(xTruthParticleParent->
pdgId())+
":");
232 ATH_MSG_WARNING(
"vertex has incoming particles but no valid parent particle");
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
ATLAS-specific HepMC functions.
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Helper class to provide type-safe access to aux data.
const TrackParticle * track() const
int pdgId() const
PDG ID code.
bool hasProdVtx() const
Check for a production vertex on this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
bool isElectron() const
Whether the particle is an electron (or positron)
bool isPhoton() const
Whether the particle is a photon.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
size_t nIncomingParticles() const
Get the number of incoming particles.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool no_truth_link(const T &p)
Method to establish if a if the object is linked to something which was never saved to the HepMC Trut...
TruthVertex_v1 TruthVertex
Typedef to implementation.
TauTrack_v1 TauTrack
Definition of the current version.
TruthParticle_v1 TruthParticle
Typedef to implementation.