|
ATLAS Offline Software
|
Go to the documentation of this file.
50 m_container ( rhs.m_container ),
51 m_mothers ( rhs.m_mothers ),
52 m_children ( rhs.m_children ),
53 m_nGenEventIdx ( rhs.m_nGenEventIdx )
62 m_container ( container ),
74 INavigable::operator=(rhs);
75 I4Momentum::operator=(rhs);
76 INavigable4Momentum::operator=(rhs);
113 std::string
error =
"WRONG index for TruthParticle::genMother(index)";
114 throw std::out_of_range(
error);
124 std::string
error =
"WRONG index for TruthParticle::genChild(index)";
125 throw std::out_of_range(
error);
131 const std::size_t nMothers =
m_mothers.size();
132 for ( std::size_t iMother = 0; iMother != nMothers; ++iMother ) {
143 const std::size_t nChildren =
m_children.size();
144 for ( std::size_t iChild = 0; iChild != nChildren; ++iChild ) {
154 std::vector<unsigned int>&
indices )
const
157 const std::size_t nMothers =
m_mothers.size();
158 for ( std::size_t iMother = 0; iMother != nMothers; ++iMother ) {
169 std::vector<unsigned int>&
indices )
const
172 const std::size_t nChildren =
m_children.size();
173 for ( std::size_t iChild = 0; iChild != nChildren; ++iChild ) {
200 std::string
error =
"WRONG index for TruthParticle::etIsol(coneIdx)";
201 throw std::out_of_range(
error);
212 const std::string
error =
"Caught INVALID pointer to child in TruthParticle::pDecay call!";
213 throw std::out_of_range(
error);
216 std::string
error =
"Caught INVALID pointer to child in TruthParticle::pDecay call!";
217 throw std::out_of_range(
error);
228 const std::string
error =
"Caught INVALID pointer to child in TruthParticle::pdgDecay call!";
229 throw std::out_of_range(
error);
232 const std::string
error =
"Caught INVALID pointer to child in TruthParticle::pdgDecay call!";
233 throw std::out_of_range(
error);
245 this->
set4Mom(particle->momentum());
248 auto dcyVtx =
particle->end_vertex();
250 m_children.reserve( dcyVtx ? dcyVtx->particles_out().size() : 0 );
253 for (
const auto& itr: dcyVtx->particles_out()) {
259 auto prodVtx =
particle->production_vertex();
260 m_mothers.reserve( prodVtx ? prodVtx->particles_in().size() : 0 );
262 for (
const auto& itr: prodVtx->particles_in()) {
268 m_children.reserve( dcyVtx ? dcyVtx->particles_out_size() : 0 );
271 for ( HepMC::GenVertex::particles_out_const_iterator itr =
272 dcyVtx->particles_out_const_begin();
273 itr != dcyVtx->particles_out_const_end();
280 auto prodVtx =
particle->production_vertex();
281 m_mothers.reserve( prodVtx ? prodVtx->particles_in_size() : 0 );
283 for ( HepMC::GenVertex::particles_in_const_iterator itr =
284 prodVtx->particles_in_const_begin();
285 itr != prodVtx->particles_in_const_end();
287 m_mothers.push_back( (*itr)->barcode() );
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
virtual int pdgId() const
Return enum indicating particle id the enum file is available in Event/EventKernel/PdtPdg....
bool hasEtIsol() const
Return true if one has filled the Et isolation infos for this TruthParticle.
CLHEP::HepLorentzVector pDecay(const std::size_t i) const
Return the 4-vec of i-th child of this particle.
int barcode() const
Forwards the HepMC::GenParticle::barcode() information.
HepMC::ConstGenParticlePtr genChild(const std::size_t i) const
Retrieve the i-th child (GenParticle) of this TruthParticle.
std::pair< long int, long int > indices
const TruthParticle * mother(const std::size_t i=0) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
McAod::EtIsolations EtIsol_t
An array of doubles of fixed size to modelize the Et isolations for different values of isolation rad...
std::size_t genEventIdx() const
Retrieve the index (within a McEventCollection) of the HepMC::GenEvent this TruthParticleContainer is...
ConeSize
Enum for Cone size indexes (for isolation)
bool hasMother(const int pdgId) const
Return true if the given PDG::id to match can be found within the parents of this TruthParticle.
HepMC::ConstGenParticlePtr genParticle() const
Retrieve the GenParticle this TruthParticle has been made from (if any)
ParticleImpl & operator=(const ParticleImpl &rhs)
Assignment operator.
void setGenParticle(HepMC::ConstGenParticlePtr particle)
Fill the data members of ParticleBase from the GenParticle.
std::vector< int > m_children
vector of barcodes of all the children of this particle.
HepMC::ConstGenParticlePtr genMother(const std::size_t i=0) const
Retrieve the GenParticle mother of this TruthParticle.
double etIsol(const int barcode, const TruthParticleParameters::ConeSize coneIdx) const
Return the Et isolation for a given particle and a given cone size.
bool hasChild(const int pdgId) const
Return true if the given PDG::id to match can be found within the children of this TruthParticle.
const TruthEtIsolations::EtIsol_t * etIsol() const
Return the transverse energies for all the isolation cones.
virtual CLHEP::HepLorentzVector hlv() const
CLHEP HepLorentzVector.
const GenParticle * ConstGenParticlePtr
TruthParticle & operator=(const TruthParticle &rhs)
Assignment operator.
const TruthParticle * truthParticle(const int barcode, std::size_t genEventIdx=0) const
return a const pointer to an TruthParticle given the barcode of the HepMC::GenParticle it is wrapping
const particle_type & particleBase() const
access to underlying base type (IParticle-like)
const TruthParticleContainer * m_container
Pointer to the collection holding ourself.
void setGenParticle(HepMC::ConstGenParticlePtr particle)
Fill the data members of ParticleBase from the GenParticle.
int pdgDecay(const std::size_t i) const
Return the PDG-Id of the i-th child of this particle.
std::vector< int > m_mothers
vector of barcodes of all the mothers of this particle.
const TruthParticle * child(const std::size_t i) const
Retrieve the i-th child (TruthParticle) of this TruthParticle.
evtIndex_t m_nGenEventIdx
the index of the GenEvent this particle is in
const TruthEtIsolations::EtIsol_t * etIsolations(const int barcode) const
return the container of Truth Et isolations for a given TruthParticle (or a HepMC::GenParticle)
void set4Mom(const HepMC::FourVector &hlv)
bool hasEtIsol() const
tell if this TruthParticleContainer has been registered with a TruthEtIsolations container
TruthParticle()
Default constructor.