ATLAS Offline Software
Loading...
Searching...
No Matches
PhysicsAnalysis
DerivationFramework
DerivationFrameworkMCTruth
src
TruthCollectionMakerPhotonSim.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3
*/
4
6
// TruthCollectionMakerPhotonSim.cxx
7
// Create truth photonsim collection decorated with photonsim decay specific variables
8
9
// Class header file
10
#include "
DerivationFrameworkMCTruth/TruthCollectionMakerPhotonSim.h
"
11
#include "
TruthUtils/HepMCHelpers.h
"
12
#include "
AthContainers/ConstAccessor.h
"
13
#include "GaudiKernel/SystemOfUnits.h"
14
15
std::vector<int>
DerivationFramework::TruthCollectionMakerPhotonSim::updateMask
(
const
xAOD::TruthParticleContainer
* truthParticles)
const
{
16
static
const
SG::ConstAccessor<unsigned int>
classifierParticleOriginAcc(
"classifierParticleOrigin"
);
17
std::vector<int>
entries
;
18
entries
.reserve(truthParticles->
size
());
19
for
(
const
auto
* truthParticle : *truthParticles) {
20
const
unsigned
int
origin = classifierParticleOriginAcc(*truthParticle);
21
entries
.push_back( ((std::abs(truthParticle->pdgId()) ==
MC::PHOTON
) && truthParticle->isGenStable() && ((origin != 42 && origin != 23 ) || (truthParticle->pt() > 20.0*Gaudi::Units::GeV))) ? 1 : 0);
22
}
23
return
entries
;
24
}
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
HepMCHelpers.h
ATLAS-specific HepMC functions.
TruthCollectionMakerPhotonSim.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
DerivationFramework::TruthCollectionMakerPhotonSim::updateMask
virtual std::vector< int > updateMask(const xAOD::TruthParticleContainer *) const override final
Definition
TruthCollectionMakerPhotonSim.cxx:15
SG::ConstAccessor
Helper class to provide constant type-safe access to aux data.
Definition
ConstAccessor.h:55
entries
double entries
Definition
listroot.cxx:49
MC::PHOTON
static const int PHOTON
Definition
HepMCHelpers.h:88
xAOD::TruthParticleContainer
TruthParticleContainer_v1 TruthParticleContainer
Declare the latest version of the truth particle container.
Definition
Event/xAOD/xAODTruth/xAODTruth/TruthParticleContainer.h:17
Generated on
for ATLAS Offline Software by
1.14.0