|
ATLAS Offline Software
|
Go to the documentation of this file.
17 InDetTrackTruthOriginTool::InDetTrackTruthOriginTool(
const std::string&
name) :
21 #ifndef XAOD_STANDALONE
22 declareInterface<IInDetTrackTruthOriginTool>(
this);
25 declareProperty(
"matchingProbabilityCut", m_matchingProbabilityCut = 0.5);
27 declareProperty(
"truthParticleLinkName", m_truthParticleLinkName =
"truthParticleLink");
28 declareProperty(
"truthMatchProbabilityAuxName", m_truthMatchProbabilityAuxName =
"truthMatchProbability");
29 declareProperty(
"isFullPileUpTruth", m_isFullPileupTruth =
false);
33 InDetTrackTruthOriginTool::~InDetTrackTruthOriginTool() =
default;
37 return StatusCode::SUCCESS;
47 truthParticleLinkAcc (
"truthParticleLink");
109 int pdgId = truth->
pdgId();
118 else if(
parent->isStrangeMeson() &&
parent->nChildren() == 2) {
121 if (abs(pdgId) == 211 &&
parentId == 310) {
127 else if(
parent->isStrangeBaryon() &&
parent->nChildren() == 2) {
130 if ((abs(pdgId) == 211 || abs(pdgId) == 2212) && abs(
parentId) == 3122) {
136 else if(
parent->isHadron() &&
parent->nChildren() == 2) {
141 else if(
parent->nChildren() > 2) {
170 float truthProb = tmpAcc( *
track );
183 ATH_MSG_ERROR(
"InDetTrackTruthOriginTool configured for full pile-up truth but could not retrieve TruthEvents container");
185 const xAOD::TruthEvent*
event = truthEventContainer ? truthEventContainer->
at(0) :
nullptr;
188 const auto&
links =
event->truthParticleLinks();
190 bool isFromHSProdVtx =
false;
191 for (
const auto& link :
links){
192 if(link.isValid() && truth == *link){
193 isFromHSProdVtx =
true;
221 if ( truth ==
nullptr )
return false;
223 if (
depth > 30 )
return false;
225 if( flav != 5 && flav != 4 && flav != 15 )
return false;
231 if( flav == 15 && abs(truth->
pdgId()) == 15 )
return true;
236 if(
parent == truth ) continue ;
def retrieve(aClass, aKey=None)
const TruthParticle_v1 * parent(size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
@ depth
pointing depth of the shower as calculated in egammaqgcld
bool isElectron() const
Whether the particle is an electron (or positron)
bool isCharmHadron() const
Determine if the PID is that of a c-hadron.
Helper class to provide constant type-safe access to aux data.
bool isValid() const
Test to see if the link can be dereferenced.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
size_t nParents() const
Number of parents of this particle.
POOL::TEvent event(POOL::TEvent::kClassAccess)
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...
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
Class describing a signal truth event in the MC record.
ElementLink implementation for ROOT usage.
bool isBottomHadron() const
Determine if the PID is that of a b-hadron.
bool isFragmentation(int origin)
not from B, D, or any secondary
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class describing a TrackParticle.
const T * at(size_type n) const
Access an element, as an rvalue.
Helper class to provide constant type-safe access to aux data.
int pdgId() const
PDG ID code.