ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
DerivationFramework::TruthDecayCollectionMaker Class Reference

#include <TruthDecayCollectionMaker.h>

Inheritance diagram for DerivationFramework::TruthDecayCollectionMaker:
Collaboration diagram for DerivationFramework::TruthDecayCollectionMaker:

Public Member Functions

 TruthDecayCollectionMaker (const std::string &t, const std::string &n, const IInterface *p)
 
 ~TruthDecayCollectionMaker ()
 
StatusCode initialize ()
 
virtual StatusCode addBranches () const
 

Private Member Functions

int addTruthParticle (const EventContext &ctx, const xAOD::TruthParticle &old_part, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
 
int addTruthVertex (const EventContext &, const xAOD::TruthVertex &old_vert, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
 
bool id_ok (const xAOD::TruthParticle &part) const
 

Private Attributes

Gaudi::Property< std::vector< int > > m_pdgIdsToKeep {this, "PDGIDsToKeep", {}, "PDG IDs of particles to build the collection from"}
 < List of PDG IDs to build this collection from More...
 
Gaudi::Property< bool > m_keepBHadrons {this, "KeepBHadrons", false, "Keep b-hadrons (easier than by PDG ID)"}
 < Option to keep all b-hadrons (better than giving PDG IDs) More...
 
Gaudi::Property< bool > m_keepCHadrons {this, "KeepCHadrons", false, "Keep c-hadrons (easier than by PDG ID)"}
 < Option to keep all c-hadrons (better than giving PDG IDs) More...
 
Gaudi::Property< bool > m_keepBSM {this, "KeepBSM", false, "Keep BSM particles (easier than by PDG ID)"}
 < Option to keep all BSM particles (better than giving PDG IDs) More...
 
Gaudi::Property< bool > m_rejectHadronChildren {this, "RejectHadronChildren", false, "Drop hadron descendants"}
 < Option to reject hadron descendants More...
 
SG::ReadHandleKey< xAOD::TruthParticleContainerm_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_originAccessorKey {this, "Input_classifierParticleOrigin", m_particlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_typeAccessorKey {this, "Input_classifierParticleType", m_particlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_outcomeAccessorKey {this, "Input_classifierParticleOutCome", m_particlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
 
SG::ReadDecorHandleKey< xAOD::TruthParticleContainerm_classificationAccessorKey {this, "Input_Classification", m_particlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
 
SG::WriteHandleKey< xAOD::TruthVertexContainerm_outputVerticesKey {this, "NewVertexKey", "", "WriteHandleKey for new TruthVertexContainer"}
 
SG::WriteHandleKey< xAOD::TruthParticleContainerm_outputParticlesKey {this, "NewParticleKey", "", "WriteHandleKey for new TruthParticleContainer"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
 FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unnecessary. More...
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID","Name of the decoration which records the ID of the particle's mother"}
 
SG::WriteDecorHandleKey< xAOD::TruthParticleContainerm_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID","Name of the decoration which records the ID of the particle's daughter"}
 
Gaudi::Property< int > m_generations {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"}
 ^^^^ These should be replaced by SG::Accessor. More...
 

Detailed Description

Definition at line 26 of file TruthDecayCollectionMaker.h.

Constructor & Destructor Documentation

◆ TruthDecayCollectionMaker()

DerivationFramework::TruthDecayCollectionMaker::TruthDecayCollectionMaker ( const std::string &  t,
const std::string &  n,
const IInterface *  p 
)

Definition at line 30 of file TruthDecayCollectionMaker.cxx.

33  : base_class(t,n,p)
34 {
35 }

◆ ~TruthDecayCollectionMaker()

DerivationFramework::TruthDecayCollectionMaker::~TruthDecayCollectionMaker ( )

Definition at line 38 of file TruthDecayCollectionMaker.cxx.

38  {
39 }

Member Function Documentation

◆ addBranches()

StatusCode DerivationFramework::TruthDecayCollectionMaker::addBranches ( ) const
virtual

Definition at line 80 of file TruthDecayCollectionMaker.cxx.

81 {
82  // Event context for AthenaMT
83  const EventContext& ctx = Gaudi::Hive::currentContext();
84 
85  // Retrieve truth collections
87  if (!truthParticles.isValid()) {
88  ATH_MSG_ERROR("Couldn't retrieve TruthParticle collection with name " << m_particlesKey);
89  return StatusCode::FAILURE;
90  }
91 
92  // Create the new particle containers and WriteHandles
94  ATH_CHECK(newParticlesWriteHandle.record(std::make_unique<xAOD::TruthParticleContainer>(),
95  std::make_unique<xAOD::TruthParticleAuxContainer>()));
96  ATH_MSG_DEBUG( "Recorded new TruthParticleContainer with key: " << (m_outputParticlesKey.key()));
97  // Create the new vertex containers and WriteHandles
99  ATH_CHECK(newVerticesWriteHandle.record(std::make_unique<xAOD::TruthVertexContainer>(),
100  std::make_unique<xAOD::TruthVertexAuxContainer>()));
101  ATH_MSG_DEBUG( "Recorded new TruthVertexContainer with key: " << (m_outputVerticesKey.key()));
102 
103  // List of unique IDs for particles in our collection already. Because of the way we recurse,
104  // adding more particles as we go, there should be no need to add (or help from adding) the
105  // unique IDs of particles that we are *not* going to keep
106  std::vector<int> seen_particles;
107  // Go through that list of particles!
108  for (const auto * part : *truthParticles){
109  // If this passes my cuts, keep it
110  if (id_ok(*part)){
111  addTruthParticle( ctx, *part, newParticlesWriteHandle.ptr(), newVerticesWriteHandle.ptr(), seen_particles , m_generations );
112  }
113  } // Loop over the initial truth particle collection
114  return StatusCode::SUCCESS;
115 }

◆ addTruthParticle()

int DerivationFramework::TruthDecayCollectionMaker::addTruthParticle ( const EventContext &  ctx,
const xAOD::TruthParticle old_part,
xAOD::TruthParticleContainer part_cont,
xAOD::TruthVertexContainer vert_cont,
std::vector< int > &  seen_particles,
const int  generations = -1 
) const
private

Definition at line 117 of file TruthDecayCollectionMaker.cxx.

122  {
123  // See if we've seen it - note, could also do this with a unary function on the container itself
124  if (std::find(seen_particles.begin(),seen_particles.end(),HepMC::uniqueID(&old_part))!=seen_particles.end()){
125  for (size_t p=0;p<part_cont->size();++p){
126  // Was it a hit?
127  const xAOD::TruthParticle *theParticle = (*part_cont)[p];
128  if (HepMC::is_same_particle(theParticle,&old_part)) return p;
129  } // Look through the old container
130  } // Found it in the old container
131  // Now we have seen it
132  seen_particles.push_back(HepMC::uniqueID(&old_part));
133  // Set up decorators
140  // Make a truth particle and add it to the container
141  xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle();
142  part_cont->push_back( xTruthParticle );
143  // Fill with numerical content
144  xTruthParticle->setPdgId(old_part.pdgId());
145  xTruthParticle->setUid(HepMC::uniqueID(&old_part));
146  xTruthParticle->setStatus(old_part.status());
147  xTruthParticle->setM(old_part.m());
148  xTruthParticle->setPx(old_part.px());
149  xTruthParticle->setPy(old_part.py());
150  xTruthParticle->setPz(old_part.pz());
151  xTruthParticle->setE(old_part.e());
152  // Copy over the polarization information if it's there
153  if (old_part.polarization().valid()){
156  }
157  // Make a link to this particle
158  int my_index = part_cont->size()-1;
159  ElementLink<xAOD::TruthParticleContainer> eltp(*part_cont, my_index);
160  // Decay vertex information
161  if (old_part.hasDecayVtx()) {
162  int vert_index = addTruthVertex( ctx, *old_part.decayVtx(), part_cont, vert_cont, seen_particles, generations);
163  ElementLink<xAOD::TruthVertexContainer> eltv( *vert_cont, vert_index );
164  xTruthParticle->setDecayVtxLink( eltv );
165  (*vert_cont)[vert_index]->addIncomingParticleLink( eltp );
166  }
167  // Copy over the decorations if they are available
172 
173  typeDecorator(*xTruthParticle) = classifierParticleTypeAcc.withDefault (old_part, 0);
174  originDecorator(*xTruthParticle) = classifierParticleOriginAcc.withDefault (old_part, 0);
175  outcomeDecorator(*xTruthParticle) = classifierParticleOutcomeAcc.withDefault (old_part, 0);
176  classificationDecorator(*xTruthParticle) = ClassificationAcc.withDefault (old_part, 0);
177 
178  // Return a link to this particle
179  return my_index;
180 }

◆ addTruthVertex()

int DerivationFramework::TruthDecayCollectionMaker::addTruthVertex ( const EventContext &  ctx,
const xAOD::TruthVertex old_vert,
xAOD::TruthParticleContainer part_cont,
xAOD::TruthVertexContainer vert_cont,
std::vector< int > &  seen_particles,
const int  generations = -1 
) const
private

Definition at line 182 of file TruthDecayCollectionMaker.cxx.

187  {
188  // Make a new vertex and add it to the container
189  xAOD::TruthVertex* xTruthVertex = new xAOD::TruthVertex();
190  vert_cont->push_back( xTruthVertex );
191  // Get a link to this vertex -- will be used to set production vertices on all the next particles
192  int my_index = vert_cont->size()-1;
193  ElementLink<xAOD::TruthVertexContainer> eltv(*vert_cont, my_index);
194  // Set properties
195  xTruthVertex->setStatus(HepMC::status(old_vert));
196  xTruthVertex->setUid(HepMC::uniqueID(old_vert));
197  xTruthVertex->setX(old_vert.x());
198  xTruthVertex->setY(old_vert.y());
199  xTruthVertex->setZ(old_vert.z());
200  xTruthVertex->setT(old_vert.t());
201  // If we are done, then stop here
202  if (generations==0) return my_index;
203  // Add all the outgoing particles
204  for (size_t n=0;n<old_vert.nOutgoingParticles();++n){
205  if (!old_vert.outgoingParticle(n)) continue; // Just in case we removed some truth particles, e.g. G4 decays
206  if (m_rejectHadronChildren && old_vert.outgoingParticle(n)->isHadron()) { // Option to skip hadrons outright{
207  continue;
208  }
209  // Continue on the next generation; note that we only decrement the generation if this particle doesn't also pass our cuts
210  int part_index = addTruthParticle( ctx, *old_vert.outgoingParticle(n), part_cont, vert_cont, seen_particles,
211  generations-1+(id_ok(*old_vert.outgoingParticle(n))?1:0) );
212  ElementLink<xAOD::TruthParticleContainer> eltp( *part_cont, part_index);
213  xTruthVertex->addOutgoingParticleLink( eltp );
214  (*part_cont)[part_index]->setProdVtxLink( eltv );
215  }
216  // Return a link to this vertex
217  return my_index;
218 }

◆ id_ok()

bool DerivationFramework::TruthDecayCollectionMaker::id_ok ( const xAOD::TruthParticle part) const
private

Definition at line 220 of file TruthDecayCollectionMaker.cxx.

221 {
222  // Check list of PDG IDs to keep
223  for (int id : m_pdgIdsToKeep){
224  if (part.absPdgId()==id){
225  return true;
226  } // Found a particle of interest!
227  } // Loop over the PDG IDs we want to keep
228  // Also check functions for B/C/BSM
229  return (m_keepBHadrons && part.isBottomHadron()) ||
230 
231  (m_keepCHadrons && part.isCharmHadron()) ||
232 
233  (m_keepBSM && part.isBSM());
234 }

◆ initialize()

StatusCode DerivationFramework::TruthDecayCollectionMaker::initialize ( )

Definition at line 42 of file TruthDecayCollectionMaker.cxx.

43 {
44  ATH_MSG_VERBOSE("initialize() ...");
45 
46  // Input truth particles
48  ATH_MSG_INFO("Using " << m_particlesKey.key() << " as the input truth container key");
49 
50  // Accessors (ReadDecorHandleKeys) TODO Convert these to SG::ConstAccessor?
55 
56  // Output particle/vertex containers
58  ATH_MSG_INFO("New truth particles container key: " << m_outputParticlesKey.key() );
59  ATH_CHECK(m_outputVerticesKey.initialize());
60  ATH_MSG_INFO("New truth vertices container key: " << m_outputVerticesKey.key() );
61 
62  if (m_pdgIdsToKeep.empty() && !m_keepBHadrons && !m_keepCHadrons && !m_keepBSM) {
63  ATH_MSG_FATAL("No PDG IDs provided, not keeping b- or c-hadrons or BSM particles -- what do you want?");
64  return StatusCode::FAILURE;
65  }
66 
67  // Decorators TODO Convert these to SG::Accessor?
74 
75  return StatusCode::SUCCESS;
76 }

Member Data Documentation

◆ m_classificationAccessorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_classificationAccessorKey {this, "Input_Classification", m_particlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 54 of file TruthDecayCollectionMaker.h.

◆ m_classificationDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_classificationDecoratorKey {this, "Classification", m_outputParticlesKey, "Classification","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 69 of file TruthDecayCollectionMaker.h.

◆ m_daughterIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_daughterIDDecoratorKey {this, "daughterID", m_outputParticlesKey, "daughterID","Name of the decoration which records the ID of the particle's daughter"}
private

Definition at line 73 of file TruthDecayCollectionMaker.h.

◆ m_generations

Gaudi::Property<int> DerivationFramework::TruthDecayCollectionMaker::m_generations {this, "Generations", -1, "Number of generations after the particle in question to keep (-1 for all)"}
private

^^^^ These should be replaced by SG::Accessor.

< Number of generations after the particle in question to keep

Definition at line 77 of file TruthDecayCollectionMaker.h.

◆ m_keepBHadrons

Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_keepBHadrons {this, "KeepBHadrons", false, "Keep b-hadrons (easier than by PDG ID)"}
private

< Option to keep all b-hadrons (better than giving PDG IDs)

Definition at line 36 of file TruthDecayCollectionMaker.h.

◆ m_keepBSM

Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_keepBSM {this, "KeepBSM", false, "Keep BSM particles (easier than by PDG ID)"}
private

< Option to keep all BSM particles (better than giving PDG IDs)

Definition at line 40 of file TruthDecayCollectionMaker.h.

◆ m_keepCHadrons

Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_keepCHadrons {this, "KeepCHadrons", false, "Keep c-hadrons (easier than by PDG ID)"}
private

< Option to keep all c-hadrons (better than giving PDG IDs)

Definition at line 38 of file TruthDecayCollectionMaker.h.

◆ m_motherIDDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_motherIDDecoratorKey {this, "motherID", m_outputParticlesKey, "motherID","Name of the decoration which records the ID of the particle's mother"}
private

Definition at line 71 of file TruthDecayCollectionMaker.h.

◆ m_originAccessorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_originAccessorKey {this, "Input_classifierParticleOrigin", m_particlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
private

Definition at line 48 of file TruthDecayCollectionMaker.h.

◆ m_originDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_originDecoratorKey {this, "classifierParticleOrigin", m_outputParticlesKey, "classifierParticleOrigin","Name of the decoration which records the particle origin as determined by the MCTruthClassifier"}
private

FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unnecessary.

Definition at line 63 of file TruthDecayCollectionMaker.h.

◆ m_outcomeAccessorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_outcomeAccessorKey {this, "Input_classifierParticleOutCome", m_particlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 52 of file TruthDecayCollectionMaker.h.

◆ m_outcomeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_outcomeDecoratorKey {this, "classifierParticleOutCome", m_outputParticlesKey, "classifierParticleOutCome","Name of the decoration which records the particle outcome as determined by the MCTruthClassifier"}
private

Definition at line 67 of file TruthDecayCollectionMaker.h.

◆ m_outputParticlesKey

SG::WriteHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_outputParticlesKey {this, "NewParticleKey", "", "WriteHandleKey for new TruthParticleContainer"}
private

Definition at line 60 of file TruthDecayCollectionMaker.h.

◆ m_outputVerticesKey

SG::WriteHandleKey<xAOD::TruthVertexContainer> DerivationFramework::TruthDecayCollectionMaker::m_outputVerticesKey {this, "NewVertexKey", "", "WriteHandleKey for new TruthVertexContainer"}
private

Definition at line 58 of file TruthDecayCollectionMaker.h.

◆ m_particlesKey

SG::ReadHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_particlesKey {this, "ParticlesKey", "TruthParticles", "ReadHandleKey for input TruthParticleContainer"}
private

Definition at line 46 of file TruthDecayCollectionMaker.h.

◆ m_pdgIdsToKeep

Gaudi::Property<std::vector<int> > DerivationFramework::TruthDecayCollectionMaker::m_pdgIdsToKeep {this, "PDGIDsToKeep", {}, "PDG IDs of particles to build the collection from"}
private

< List of PDG IDs to build this collection from

Definition at line 34 of file TruthDecayCollectionMaker.h.

◆ m_rejectHadronChildren

Gaudi::Property<bool> DerivationFramework::TruthDecayCollectionMaker::m_rejectHadronChildren {this, "RejectHadronChildren", false, "Drop hadron descendants"}
private

< Option to reject hadron descendants

Definition at line 42 of file TruthDecayCollectionMaker.h.

◆ m_typeAccessorKey

SG::ReadDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_typeAccessorKey {this, "Input_classifierParticleType", m_particlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
private

Definition at line 50 of file TruthDecayCollectionMaker.h.

◆ m_typeDecoratorKey

SG::WriteDecorHandleKey<xAOD::TruthParticleContainer> DerivationFramework::TruthDecayCollectionMaker::m_typeDecoratorKey {this, "classifierParticleType", m_outputParticlesKey, "classifierParticleType","Name of the decoration which records the particle type as determined by the MCTruthClassifier"}
private

Definition at line 65 of file TruthDecayCollectionMaker.h.


The documentation for this class was generated from the following files:
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::TruthVertex_v1::nOutgoingParticles
size_t nOutgoingParticles() const
Get the number of outgoing particles.
xAOD::TruthParticle_v1::setStatus
void setStatus(int value)
Set status code.
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
DerivationFramework::TruthDecayCollectionMaker::m_rejectHadronChildren
Gaudi::Property< bool > m_rejectHadronChildren
< Option to reject hadron descendants
Definition: TruthDecayCollectionMaker.h:43
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
find
std::string find(const std::string &s)
return a remapped string
Definition: hcg.cxx:135
xAOD::TruthParticle_v1::pz
float pz() const
The z component of the particle's momentum.
SG::ReadHandle< xAOD::TruthParticleContainer >
xAOD::TruthParticle_v1::setE
void setE(float value)
Set the energy of the particle.
Definition: TruthParticle_v1.cxx:230
DerivationFramework::TruthDecayCollectionMaker::m_outputParticlesKey
SG::WriteHandleKey< xAOD::TruthParticleContainer > m_outputParticlesKey
Definition: TruthDecayCollectionMaker.h:61
xAOD::TruthParticle_v1::setPolarizationParameter
bool setPolarizationParameter(float value, PolParam parameter)
Set method for polarization parameter values.
Definition: TruthParticle_v1.cxx:348
xAOD::TruthParticle_v1::Polarization::valid
bool valid() const
Check if the stored values are valid.
Definition: TruthParticle_v1.h:374
DerivationFramework::TruthDecayCollectionMaker::m_keepBSM
Gaudi::Property< bool > m_keepBSM
< Option to keep all BSM particles (better than giving PDG IDs)
Definition: TruthDecayCollectionMaker.h:41
xAOD::TruthParticle_v1::polarization
Polarization polarization() const
Retrieve a full Polarization with a single call.
Definition: TruthParticle_v1.cxx:380
xAOD::TruthParticle_v1::px
float px() const
The x component of the particle's momentum.
xAOD::TruthVertex_v1::setT
void setT(float value)
Set the vertex time.
xAOD::TruthParticle_v1::setPx
void setPx(float value)
Set the x component of the particle's momentum.
DerivationFramework::TruthDecayCollectionMaker::m_keepBHadrons
Gaudi::Property< bool > m_keepBHadrons
< Option to keep all b-hadrons (better than giving PDG IDs)
Definition: TruthDecayCollectionMaker.h:37
xAOD::TruthParticle_v1::py
float py() const
The y component of the particle's momentum.
DerivationFramework::TruthDecayCollectionMaker::m_outcomeAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeAccessorKey
Definition: TruthDecayCollectionMaker.h:53
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
xAOD::TruthVertex_v1::addOutgoingParticleLink
void addOutgoingParticleLink(const TPLink_t &link)
Add one outgoing particle.
Definition: TruthVertex_v1.cxx:138
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAOD::TruthVertex_v1::setY
void setY(float value)
Set the y displacement of the vertex.
HepMC::is_same_particle
bool is_same_particle(const T1 &p1, const T2 &p2)
Method to establish if two particles in the GenEvent actually represent the same particle.
Definition: MagicNumbers.h:366
xAOD::TruthVertex_v1::y
float y() const
Vertex y displacement.
HepMC::BarcodeBased::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (only to be used in...
Definition: MagicNumbers.h:211
xAOD::TruthVertex_v1::t
float t() const
Vertex time.
DerivationFramework::TruthDecayCollectionMaker::m_originAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_originAccessorKey
Definition: TruthDecayCollectionMaker.h:49
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
DerivationFramework::TruthDecayCollectionMaker::m_keepCHadrons
Gaudi::Property< bool > m_keepCHadrons
< Option to keep all c-hadrons (better than giving PDG IDs)
Definition: TruthDecayCollectionMaker.h:39
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:209
xAOD::TruthParticle_v1::setM
void setM(float value)
Also store the mass.
Definition: TruthParticle_v1.cxx:236
DerivationFramework::TruthDecayCollectionMaker::addTruthVertex
int addTruthVertex(const EventContext &, const xAOD::TruthVertex &old_vert, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
Definition: TruthDecayCollectionMaker.cxx:182
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::TruthParticle_v1::e
virtual double e() const override final
The total energy of the particle.
SG::ReadDecorHandle
Handle class for reading a decoration on an object.
Definition: StoreGate/StoreGate/ReadDecorHandle.h:94
DerivationFramework::TruthDecayCollectionMaker::addTruthParticle
int addTruthParticle(const EventContext &ctx, const xAOD::TruthParticle &old_part, xAOD::TruthParticleContainer *part_cont, xAOD::TruthVertexContainer *vert_cont, std::vector< int > &seen_particles, const int generations=-1) const
Definition: TruthDecayCollectionMaker.cxx:117
SG::ReadDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
beamspotman.n
n
Definition: beamspotman.py:727
DerivationFramework::TruthDecayCollectionMaker::m_typeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_typeDecoratorKey
Definition: TruthDecayCollectionMaker.h:66
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
DerivationFramework::TruthDecayCollectionMaker::m_motherIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_motherIDDecoratorKey
Definition: TruthDecayCollectionMaker.h:72
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
SG::WriteDecorHandle
Handle class for adding a decoration to an object.
Definition: StoreGate/StoreGate/WriteDecorHandle.h:100
xAOD::TruthParticle
TruthParticle_v1 TruthParticle
Typedef to implementation.
Definition: Event/xAOD/xAODTruth/xAODTruth/TruthParticle.h:15
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:116
xAOD::TruthParticle_v1::setPy
void setPy(float value)
Set the y component of the particle's momentum.
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
DerivationFramework::TruthDecayCollectionMaker::m_outputVerticesKey
SG::WriteHandleKey< xAOD::TruthVertexContainer > m_outputVerticesKey
Definition: TruthDecayCollectionMaker.h:59
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
xAOD::TruthVertex
TruthVertex_v1 TruthVertex
Typedef to implementation.
Definition: TruthVertex.h:15
DerivationFramework::TruthDecayCollectionMaker::m_classificationDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_classificationDecoratorKey
Definition: TruthDecayCollectionMaker.h:70
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
xAOD::TruthParticle_v1::setPdgId
void setPdgId(int pid)
Set PDG ID code.
DerivationFramework::TruthDecayCollectionMaker::m_classificationAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_classificationAccessorKey
Definition: TruthDecayCollectionMaker.h:55
xAOD::TruthParticle_v1::setUid
void setUid(int value)
Set unique ID.
DerivationFramework::TruthDecayCollectionMaker::m_particlesKey
SG::ReadHandleKey< xAOD::TruthParticleContainer > m_particlesKey
Definition: TruthDecayCollectionMaker.h:47
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DerivationFramework::TruthDecayCollectionMaker::id_ok
bool id_ok(const xAOD::TruthParticle &part) const
Definition: TruthDecayCollectionMaker.cxx:220
DerivationFramework::TruthDecayCollectionMaker::m_typeAccessorKey
SG::ReadDecorHandleKey< xAOD::TruthParticleContainer > m_typeAccessorKey
Definition: TruthDecayCollectionMaker.h:51
xAOD::TruthParticle_v1::polarizationParameter
bool polarizationParameter(float &value, PolParam parameter) const
Accessor for polarization parameters.
Definition: TruthParticle_v1.cxx:325
xAOD::TruthVertex_v1::x
float x() const
Vertex x displacement.
xAOD::TruthVertex_v1::setZ
void setZ(float value)
Set the vertex's longitudinal distance from the origin.
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
xAOD::TruthParticle_v1::status
int status() const
Status code.
SG::WriteDecorHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
xAOD::TruthVertex_v1::setUid
void setUid(int value)
Set the vertex unique ID.
xAOD::TruthParticle_v1::polarizationTheta
@ polarizationTheta
Polarization in ( )
Definition: TruthParticle_v1.h:318
DerivationFramework::TruthDecayCollectionMaker::m_generations
Gaudi::Property< int > m_generations
^^^^ These should be replaced by SG::Accessor.
Definition: TruthDecayCollectionMaker.h:78
DerivationFramework::TruthDecayCollectionMaker::m_outcomeDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_outcomeDecoratorKey
Definition: TruthDecayCollectionMaker.h:68
xAOD::TruthParticle_v1::polarizationPhi
@ polarizationPhi
Polarization in ( )
Definition: TruthParticle_v1.h:317
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
xAOD::TruthParticle_v1::setPz
void setPz(float value)
Set the z component of the particle's momentum.
xAOD::TruthParticle_v1::setDecayVtxLink
void setDecayVtxLink(const ElementLink< TruthVertexContainer > &link)
Set the decay vertex of the particle.
DerivationFramework::TruthDecayCollectionMaker::m_pdgIdsToKeep
Gaudi::Property< std::vector< int > > m_pdgIdsToKeep
< List of PDG IDs to build this collection from
Definition: TruthDecayCollectionMaker.h:35
DerivationFramework::TruthDecayCollectionMaker::m_originDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_originDecoratorKey
FIXME Using WriteDecorHandles for decorations on a Container created in the current algorithm is unne...
Definition: TruthDecayCollectionMaker.h:64
DerivationFramework::TruthDecayCollectionMaker::m_daughterIDDecoratorKey
SG::WriteDecorHandleKey< xAOD::TruthParticleContainer > m_daughterIDDecoratorKey
Definition: TruthDecayCollectionMaker.h:74
HepMC::status
int status(const T &p)
Definition: MagicNumbers.h:143
xAOD::TruthParticle_v1::pdgId
int pdgId() const
PDG ID code.
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
xAOD::TruthVertex_v1::outgoingParticle
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
Definition: TruthVertex_v1.cxx:120
xAOD::TruthParticle_v1::m
virtual double m() const override final
The mass of the particle.
xAOD::TruthVertex_v1::setStatus
void setStatus(int value)
Set the vertex status.
xAOD::TruthParticle_v1::isHadron
bool isHadron() const
Whether the particle is a hadron.
xAOD::TruthVertex_v1::setX
void setX(float value)
Set the x displacement of the vertex.