|
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "GaudiKernel/SystemOfUnits.h"
46 "Prefix to add to aux data items.");
49 "Minimum pt for electrons.");
51 "Minimum pt for photons.");
55 "Isolation cone width.");
57 "Maximum isolation cone energy allowed to keep a photon.");
71 return StatusCode::SUCCESS;
82 auto pout = std::make_unique<xAOD::TruthParticleContainer>();
83 auto pout_aux = std::make_unique<xAOD::TruthParticleAuxContainer>();
84 pout->setStore (pout_aux.get());
86 #define DECOR(TYPE,N) xAOD::TruthParticle::Decorator<TYPE> N (m_auxPrefix + #N)
87 DECOR(
float, etaCalo);
88 DECOR(
float, phiCalo);
89 DECOR(
float, depthCalo);
90 DECOR(
float, Etcone20);
96 pout->push_back (std::make_unique<xAOD::TruthParticle>());
100 etaCalo(*
pout->back()),
101 phiCalo(*
pout->back()),
102 depthCalo(*
pout->back())) );
103 Etcone20(*
pout->back()) = iso;
110 return StatusCode::SUCCESS;
130 if (aid != abs(MC::ELECTRON) && !
MC::isPhoton(aid))
return false;
139 if(
tp.hasDecayVtx() ) {
141 size_t sz =
v->nOutgoingParticles();
142 for (
size_t i = 0;
i <
sz;
i++) {
154 if (aid == abs(MC::PHOTON)) {
194 float& depthCalo)
const
200 std::unique_ptr<Trk::CaloExtension> extension =
201 m_exten->caloExtension(Gaudi::Hive::currentContext(),
tp);
204 return StatusCode::FAILURE;
209 for (
const auto& [sampling,
entry,
exit] : lvec) {
211 etaCalo =
entry.eta();
212 phiCalo =
entry.phi();
213 depthCalo =
entry.perp();
217 etaCalo =
entry.eta();
218 phiCalo =
entry.phi();
219 depthCalo = std::abs(
entry.z());
223 return StatusCode::SUCCESS;
virtual StatusCode initialize() override
Standard Gaudi initialize method.
def pout(output, newline=True)
bool isSpecialNonInteracting(const T &p)
Identify a special non-interacting particles.
ToolHandle< Trk::IParticleCaloExtensionTool > m_exten
Property: Extrapolation tool to calorimeter.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::string m_auxPrefix
Property: Prefix to add to aux data items.
bool isAccepted(const xAOD::TruthParticle &tp, const xAOD::TruthParticleContainer &cont, float &iso) const
Test to see if we accept a particle.
float m_etaMax
Property: Maximum eta.
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
float m_photonEtIsoMax
Property: Maximum isolation cone energy allowed to keep a photon.
An algorithm that can be simultaneously executed in multiple threads.
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputKey
Property: Name of the output container.
Handle class for recording to StoreGate.
Block filler tool for noisy FEB information.
float m_photonPtMin
Property: Minimum pt for photons.
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...
Select egtruth particles.
::StatusCode StatusCode
StatusCode definition for legacy code.
Class describing a truth particle in the MC record.
egammaTruthAlg(const std::string &name, ISvcLocator *svcloc)
Standard Gaudi algorithm constructor.
#define CHECK(...)
Evaluate an expression and check for errors.
virtual StatusCode execute(const EventContext &ctx) const override
Standard Gaudi execute method.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
std::vector< std::tuple< CaloSampling::CaloSample, Amg::Vector3D, Amg::Vector3D > > EntryExitPerLayerVector
Class describing a truth vertex in the MC record.
float m_isoCone
Property: Isolation cone width.
void entryExitPerLayerVector(const Trk::CaloExtension &extension, EntryExitPerLayerVector &result, const LayersToSelect *selection=nullptr)
#define REPORT_MESSAGE(LVL)
Report a message.
bool isStableOrSimDecayed(const T &p)
Identify if particle is satble or decayed in simulation.
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_inputKey
Property: Name of the input container.
Handle class for reading from StoreGate.
bool isZeroEnergyPhoton(const T &p)
Identify a photon with zero energy. Probably a workaround for a generator bug.
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
int pdgId() const
PDG ID code.
float computeIso(const xAOD::TruthParticle &tp, const xAOD::TruthParticleContainer &cont) const
Compute isolation around a particle.
float m_electronPtMin
Property: Minimum pt for electrons.
StatusCode findImpact(const xAOD::TruthParticle &tp, float &etaCalo, float &phiCalo, float &depthCalo) const
Find the impact of a particle in the calorimeter.