ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ISF::TruthSvc Class Referencefinal

#include <TruthSvc.h>

Inheritance diagram for ISF::TruthSvc:
Collaboration diagram for ISF::TruthSvc:

Public Member Functions

 TruthSvc (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor. More...
 
virtual ~TruthSvc ()=default
 Destructor. More...
 
StatusCode initialize () override
 Athena algorithm's interface method initialize() More...
 
StatusCode finalize () override
 Athena algorithm's interface method finalize() More...
 
void registerTruthIncident (ITruthIncident &truthincident, bool saveAllChildren=false) const override
 Register a truth incident. More...
 
StatusCode initializeTruthCollection (int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override
 Initialize the Truth Svc at the beginning of each event. More...
 
StatusCode releaseEvent () override
 Finalize the Truth Svc at the end of each event. More...
 

Private Member Functions

void recordIncidentToMCTruth (ITruthIncident &truthincident, bool passWholeVertex) const
 Record the given truth incident to the MC Truth. More...
 
HepMC::GenVertexPtr createGenVertexFromTruthIncident (ITruthIncident &truthincident) const
 Record and end vertex to the MC Truth for the parent particle. More...
 

Private Attributes

ServiceHandle< Barcode::IBarcodeSvcm_barcodeSvc {this, "BarcodeSvc", "BarcodeSvc", ""}
 The Barcode service. More...
 
ToolHandleArray< ITruthStrategym_truthStrategies {this, "TruthStrategies", {}, ""}
 the truth strategies applied (as AthenaToolHandle Array) More...
 
ITruthStrategy ** m_geoStrategies [AtlasDetDescr::fNumAtlasRegions]
 for faster access: using an internal pointer to the actual ITruthStrategy instances More...
 
unsigned short m_numStrategies [AtlasDetDescr::fNumAtlasRegions]
 
Gaudi::Property< bool > m_skipIfNoChildren {this, "SkipIfNoChildren", true, ""}
 MCTruth steering. More...
 
Gaudi::Property< bool > m_skipIfNoParentId {this, "SkipIfNoParentId", true, ""}
 do not record if parentId == HepMC::UNDEFINED_ID More...
 
Gaudi::Property< bool > m_ignoreUndefinedBarcodes {this, "IgnoreUndefinedBarcodes", false, ""}
 do/don't abort if retrieve an undefined barcode More...
 
Gaudi::Property< bool > m_passWholeVertex {this, "PassWholeVertices", true, ""}
 
Gaudi::Property< std::vector< unsigned int > > m_forceEndVtxRegionsVec {this, "ForceEndVtxInRegions", {}, ""}
 property containing AtlasRegions for which More...
 
std::array< bool, AtlasDetDescr::fNumAtlasRegionsm_forceEndVtx
 attach end vertex to More...
 
Gaudi::Property< bool > m_quasiStableParticlesIncluded {this, "QuasiStableParticlesIncluded", false, ""}
 does this job simulate quasi-stable particles. More...
 
Gaudi::Property< bool > m_quasiStableParticleOverwrite {this, "QuasiStableParticleOverwrite", true, ""}
 should the job be overwriting QS particles More...
 

Detailed Description

HepMC based version of the ISF::ITruthSvc, currently it takes an ITruthIncident base class

Author
Andreas.Salzburger -at- cern.ch , Elmar.Ritsch -at- cern.ch

Definition at line 50 of file TruthSvc.h.

Constructor & Destructor Documentation

◆ TruthSvc()

ISF::TruthSvc::TruthSvc ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Constructor.

Definition at line 49 of file TruthSvc.cxx.

49  :
50  base_class(name,svc),
53 {
54 }

◆ ~TruthSvc()

virtual ISF::TruthSvc::~TruthSvc ( )
virtualdefault

Destructor.

Member Function Documentation

◆ createGenVertexFromTruthIncident()

HepMC::GenVertexPtr ISF::TruthSvc::createGenVertexFromTruthIncident ( ISF::ITruthIncident ti) const
private

Record and end vertex to the MC Truth for the parent particle.

Record the given truth incident to the MC Truth.

Definition at line 300 of file TruthSvc.cxx.

300  {
301 
302  int processCode = ti.physicsProcessCode();
303  int parentBC = ti.parentBarcode();
304 
305  std::vector<double> weights(1);
306  int primaryBC = parentBC % HepMC::SIM_REGENERATION_INCREMENT;
307  weights[0] = static_cast<double>( primaryBC ); // FIXME vertex weights should not be used to encode other info.
308 
309  // Check for a previous end vertex on this particle. If one existed, then we should put down next to this
310  // a new copy of the particle. This is the agreed upon version of the quasi-stable particle truth, where
311  // the vertex at which we start Q-S simulation no longer conserves energy, but we keep both copies of the
312  // truth particles
314  if (!parent) {
315  ATH_MSG_ERROR("Unable to write particle interaction to MC truth due to missing parent HepMC::GenParticle instance");
316  abort();
317  }
318  HepMC::GenEvent *mcEvent = parent->parent_event();
319  if (!mcEvent) {
320  ATH_MSG_ERROR("Unable to write particle interaction to MC truth due to missing parent HepMC::GenEvent instance");
321  abort();
322  }
323 
324  // generate vertex
325  int vtxbcode = m_barcodeSvc->newSimulationVertex(); // TODO replace barcodeSvc
326  if ( vtxbcode == HepMC::UNDEFINED_ID) {
328  ATH_MSG_WARNING("Unable to generate new Truth Vertex Barcode. Continuing due to 'IgnoreUndefinedBarcodes'==True");
329  } else {
330  ATH_MSG_ERROR("Unable to generate new Truth Vertex Barcode. Aborting");
331  abort();
332  }
333  }
334  const int vtxStatus = 1000 + static_cast<int>(processCode) + HepMC::SIM_STATUS_THRESHOLD;
335 #ifdef HEPMC3
336  auto newVtx = HepMC::newGenVertexPtr( ti.position(),vtxStatus);
337 #else
338  // NB In HepMC2 there is no GenVertex status, so we set the GenVertex ID.
339  std::unique_ptr<HepMC::GenVertex> newVtx = std::make_unique<HepMC::GenVertex>( ti.position(), vtxStatus, weights );
340  HepMC::suggest_barcode( newVtx.get(), vtxbcode );
341 #endif
342 
343  if (parent->end_vertex()){
344  ATH_MSG_ERROR ("createGVfromTI: Parent particle found with an end vertex attached. This should not happen!");
345  ATH_MSG_ERROR ("createGVfromTI: Parent 1: " << parent << ", barcode: " << HepMC::barcode(parent));
346  ATH_MSG_ERROR ( "createGVfromTI: parent->end_vertex(): " << parent->end_vertex() << ", barcode: " << HepMC::barcode(parent->end_vertex()) );
347  abort();
348  } else { // Normal simulation
349 #ifdef DEBUG_TRUTHSVC
350  ATH_MSG_VERBOSE ("createGVfromTI Parent 1: " << parent << ", barcode: " << HepMC::barcode(parent));
351 #endif
352  // add parent particle to newVtx
353  newVtx->add_particle_in( parent );
354 #ifdef DEBUG_TRUTHSVC
355  ATH_MSG_VERBOSE ( "createGVfromTI End Vertex representing process: " << processCode << ", for parent with barcode "<<parentBC<<". Creating." );
356  ATH_MSG_VERBOSE ( "createGVfromTI Parent 2: " << parent << ", barcode: " << HepMC::barcode(parent));
357 #endif
358 #ifdef HEPMC3
359  mcEvent->add_vertex(newVtx);
360  HepMC::suggest_barcode( newVtx, vtxbcode );
361  newVtx->add_attribute("weights",std::make_shared<HepMC3::VectorDoubleAttribute>(weights));
362 #else
363  mcEvent->add_vertex( newVtx.release() );
364 #endif
365  }
366 
367  return parent->end_vertex();
368 }

◆ finalize()

StatusCode ISF::TruthSvc::finalize ( )
override

Athena algorithm's interface method finalize()

framework methods

Definition at line 105 of file TruthSvc.cxx.

106 {
107  ATH_MSG_VERBOSE("Finalizing ...");
108  return StatusCode::SUCCESS;
109 }

◆ initialize()

StatusCode ISF::TruthSvc::initialize ( )
override

Athena algorithm's interface method initialize()

framework methods

Definition at line 57 of file TruthSvc.cxx.

58 {
59  ATH_MSG_VERBOSE( "initialize()" );
60 
61  // Screen output
62  ATH_MSG_DEBUG("--------------------------------------------------------");
63 
64  // retrieve BarcodeSvc
65  if ( m_barcodeSvc.retrieve().isFailure() ) {
66  ATH_MSG_FATAL("Could not retrieve BarcodeService. Abort.");
67  return StatusCode::FAILURE;
68  }
69 
70  // copy a pointer to the strategy instance to the local
71  // array of pointers (for faster access)
72  ATH_CHECK(m_truthStrategies.retrieve());
73  // Would be nicer to make m_geoStrategies a vector of vectors
74  for ( unsigned short geoID=AtlasDetDescr::fFirstAtlasRegion; geoID<AtlasDetDescr::fNumAtlasRegions; ++geoID) {
75  m_numStrategies[geoID] = 0;
76  for ( const auto &truthStrategy : m_truthStrategies) {
77  if(truthStrategy->appliesToRegion(geoID)) {
78  ++m_numStrategies[geoID];
79  }
80  }
81  }
82  for ( unsigned short geoID=AtlasDetDescr::fFirstAtlasRegion; geoID<AtlasDetDescr::fNumAtlasRegions; ++geoID) {
84  unsigned short curNumStrategies = m_truthStrategies.size();
85  unsigned short nStrat(0);
86  for ( unsigned short i = 0; i < curNumStrategies; ++i) {
87  if(m_truthStrategies[i]->appliesToRegion(geoID)) {
88  m_geoStrategies[geoID][nStrat++] = &(*m_truthStrategies[i]);
89  }
90  }
91 
92  // setup whether we want to write end-vertices in this region whenever a truth particle dies
93  // create an end-vertex for all truth particles ending in the current AtlasRegion?
94  bool forceEndVtx = std::find( m_forceEndVtxRegionsVec.begin(),
96  geoID ) != m_forceEndVtxRegionsVec.end();
97  m_forceEndVtx[geoID] = forceEndVtx;
98  }
99  ATH_MSG_VERBOSE("initialize() successful");
100  return StatusCode::SUCCESS;
101 }

◆ initializeTruthCollection()

StatusCode ISF::TruthSvc::initializeTruthCollection ( int  largestGeneratedParticleBC = 0,
int  largestGeneratedVertexBC = 0 
)
override

Initialize the Truth Svc at the beginning of each event.

Initialize the TruthSvc and the truthSvc.

Definition at line 113 of file TruthSvc.cxx.

114 {
115  ATH_CHECK( m_barcodeSvc->initializeBarcodes(largestGeneratedParticleBC, largestGeneratedVertexBC) );
116  return StatusCode::SUCCESS;
117 }

◆ recordIncidentToMCTruth()

void ISF::TruthSvc::recordIncidentToMCTruth ( ISF::ITruthIncident ti,
bool  passWholeVertex 
) const
private

Record the given truth incident to the MC Truth.

Definition at line 199 of file TruthSvc.cxx.

199  {
200 #ifdef DEBUG_TRUTHSVC
201  ATH_MSG_INFO("Starting recordIncidentToMCTruth(...)");
202 #endif
203  int parentBC = ti.parentBarcode();
204 
205  if (ti.parentParticle()->end_vertex()) {
206  ATH_MSG_WARNING ("Attempting to record a TruthIncident for a particle which has already decayed!");
207  ATH_MSG_WARNING ("No action will be taken - please fix client code.");
208  return;
209  }
210 
211  // record the GenVertex
213  const ISF::InteractionClass_t classification = ti.interactionClassification();
214 #ifdef DEBUG_TRUTHSVC
215  const std::string survival = (ti.parentSurvivesIncident()) ? "parent survives" : "parent destroyed";
216  const std::string vtxType = (ti.interactionClassification()==ISF::STD_VTX) ? "Normal" : "Quasi-stable";
217  ATH_MSG_INFO("TruthSvc: " << vtxType << " vertex + " << survival
218  << ", TI Class: " << ti.interactionClassification()
219  << ", ProcessType: " << ti.physicsProcessCategory()
220  << ", ProcessSubType: " << ti.physicsProcessCode());
221 #endif
222 
223  ATH_MSG_VERBOSE ( "Outgoing particles:" );
224  // update parent barcode and add it to the vertex as outgoing particle
225  int newPrimaryBC = HepMC::UNDEFINED_ID;
226  if (classification == ISF::QS_SURV_VTX) {
227  // Special case when a particle with a pre-defined decay interacts
228  // and survives.
229  // Set the barcode to the next available value below the simulation
230  // barcode offset.
231  newPrimaryBC = m_barcodeSvc->newGeneratedParticle(parentBC);
232  }
233  else {
234  newPrimaryBC = parentBC + HepMC::SIM_REGENERATION_INCREMENT;
235  }
236 
237  HepMC::GenParticlePtr parentAfterIncident = ti.parentParticleAfterIncident( newPrimaryBC ); // This call changes ti.parentParticle() output
238  if(parentAfterIncident) {
239  if (classification==ISF::QS_SURV_VTX) {
240  // Special case when a particle with a pre-defined decay
241  // interacts and survives.
242  // As the parentParticleAfterIncident has a pre-defined decay
243  // its status should end in 2, but we should flag that it has
244  // survived an interaction.
245  if (!MC::isDecayed(parentAfterIncident)) {
246  ATH_MSG_WARNING ( "recordIncidentToMCTruth - check parentAfterIncident: " << parentAfterIncident );
247  }
248  }
249  vtxFromTI->add_particle_out( parentAfterIncident );
250 #ifdef HEPMC3
251  HepMC::suggest_barcode( parentAfterIncident, newPrimaryBC ); // TODO check this works correctly
252 #endif
253  // NB For ISFTruthIncident the m_parent ISFParticle still needs
254  // its id and particleLink properties to be properly updated at
255  // this point.
256  ATH_MSG_VERBOSE ( "Parent After Incident: " << parentAfterIncident << ", barcode: " << HepMC::barcode(parentAfterIncident));
257  }
258 
259  const bool isQuasiStableVertex = (classification == ISF::QS_PREDEF_VTX); // QS_DEST_VTX and QS_SURV_VTX should be treated as normal from now on.
260  // add child particles to the vertex
261  const unsigned short numSec = ti.numberOfChildren();
262  for ( unsigned short i=0; i<numSec; ++i) {
263  bool writeOutChild = isQuasiStableVertex || passWholeVertex || ti.childPassedFilters(i);
264  if (writeOutChild) {
265  HepMC::GenParticlePtr p = nullptr;
266  // generate a new barcode for the child particle
267  int secondaryParticleBC = (isQuasiStableVertex) ?
268  m_barcodeSvc->newGeneratedParticle(parentBC) : m_barcodeSvc->newSecondaryParticle(parentBC); // TODO replace m_barcodeSvc
269  if ( secondaryParticleBC == HepMC::UNDEFINED_ID) {
271  ATH_MSG_WARNING("Unable to generate new Secondary Particle Barcode. Continuing due to 'IgnoreUndefinedBarcodes'==True");
272  else {
273  ATH_MSG_ERROR("Unable to generate new Secondary Particle Barcode. Aborting");
274  abort();
275  }
276  }
277  p = ti.childParticle( i, secondaryParticleBC ); // potentially overrides secondaryParticleBC
278  if (p) {
279  // add particle to vertex
280  vtxFromTI->add_particle_out( p);
281 #ifdef HEPMC3
282  int secondaryParticleBCFromTI = ti.childBarcode(i);
283  HepMC::suggest_barcode( p, secondaryParticleBCFromTI ? secondaryParticleBCFromTI : secondaryParticleBC );
284  // NB For ISFTruthIncident the current child ISFParticle still needs
285  // its id and particleLink properties to be properly updated at
286  // this point.
287 #endif
288  }
289  ATH_MSG_VERBOSE ( "Writing out " << i << "th child particle: " << p << ", barcode: " << HepMC::barcode(p));
290  } // <-- if write out child particle
291  else {
292  ATH_MSG_VERBOSE ( "Not writing out " << i << "th child particle." );
293  }
294 
295  } // <-- loop over all child particles
296  ATH_MSG_VERBOSE("--------------------------------------------------------");
297 }

◆ registerTruthIncident()

void ISF::TruthSvc::registerTruthIncident ( ISF::ITruthIncident ti,
bool  saveAllChildren = false 
) const
override

Register a truth incident.

Definition at line 125 of file TruthSvc.cxx.

125  {
126 
127  const bool passWholeVertex = m_passWholeVertex || saveAllChildren;
128  // pass whole vertex or individual child particles
129  ti.setPassWholeVertices(passWholeVertex);
130 
131  // the GeoID
132  AtlasDetDescr::AtlasRegion geoID = ti.geoID();
133 
134  // check geoID assigned to the TruthIncident
135  if ( !validAtlasRegion(geoID) ) {
136  const auto& position = ti.position();
137  ATH_MSG_ERROR("Unable to register truth incident with unknown SimGeoID="<< geoID
138  << " at position z=" << position.z() << " r=" << position.perp());
139  return;
140  }
141 
142  ATH_MSG_VERBOSE( "Registering TruthIncident for SimGeoID="
144 
145  // number of child particles
146  const unsigned short numSec = ti.numberOfChildren();
147  if ( m_skipIfNoChildren && (numSec==0) ) {
148  ATH_MSG_VERBOSE( "No child particles present in the TruthIncident,"
149  << " will not record this TruthIncident.");
150  return;
151  }
152 
153  // the parent particle -> get its id
154  const int parentID = ti.parentUniqueID();
155  if ( m_skipIfNoParentId && (parentID == HepMC::UNDEFINED_ID) ) {
156  ATH_MSG_VERBOSE( "Parent particle in TruthIncident does not have an id,"
157  << " will not record this TruthIncident.");
158  return;
159  }
160 
161  // loop over registered truth strategies for given geoID
162  bool pass = false;
163  for ( unsigned short stratID=0; (!pass) && (stratID<m_numStrategies[geoID]); stratID++) {
164  // (*) test if given TruthIncident passes current strategy
165  pass = m_geoStrategies[geoID][stratID]->pass(ti);
166  }
167 
168  if (pass) {
169  ATH_MSG_VERBOSE("At least one TruthStrategy passed.");
170  // at least one truth strategy returned true
171  // -> record incident
172  recordIncidentToMCTruth(ti, passWholeVertex);
173 
174  } else {
175  // none of the truth strategies returned true
176  // -> child particles will NOT be added to the TruthEvent collection
177  // attach parent particle end vertex if it gets killed by this interaction
178  if ( m_forceEndVtx[geoID] && !ti.parentSurvivesIncident() ) {
179  ATH_MSG_VERBOSE("No TruthStrategies passed and parent destroyed - create end vertex.");
181 
182 #ifdef DEBUG_TRUTHSVC
183  const std::string survival = (ti.parentSurvivesIncident()) ? "parent survives" : "parent destroyed";
184  const std::string vtxType = (ti.interactionClassification()==ISF::STD_VTX) ? "Normal" : "Quasi-stable";
185  ATH_MSG_INFO("TruthSvc: " << vtxType << " vertex + " << survival
186  << ", TI Class: " << ti.interactionClassification()
187  << ", ProcessType: " << ti.physicsProcessCategory()
188  << ", ProcessSubType: " << ti.physicsProcessCode());
189 #endif
190 
191  }
192 
193  }
194 
195  return;
196 }

◆ releaseEvent()

StatusCode ISF::TruthSvc::releaseEvent ( )
override

Finalize the Truth Svc at the end of each event.

Definition at line 119 of file TruthSvc.cxx.

119  {
120  return StatusCode::SUCCESS;
121 }

Member Data Documentation

◆ m_barcodeSvc

ServiceHandle<Barcode::IBarcodeSvc> ISF::TruthSvc::m_barcodeSvc {this, "BarcodeSvc", "BarcodeSvc", ""}
private

The Barcode service.

Definition at line 83 of file TruthSvc.h.

◆ m_forceEndVtx

std::array<bool, AtlasDetDescr::fNumAtlasRegions> ISF::TruthSvc::m_forceEndVtx
private

attach end vertex to

Definition at line 100 of file TruthSvc.h.

◆ m_forceEndVtxRegionsVec

Gaudi::Property<std::vector<unsigned int> > ISF::TruthSvc::m_forceEndVtxRegionsVec {this, "ForceEndVtxInRegions", {}, ""}
private

property containing AtlasRegions for which

Definition at line 98 of file TruthSvc.h.

◆ m_geoStrategies

ITruthStrategy** ISF::TruthSvc::m_geoStrategies[AtlasDetDescr::fNumAtlasRegions]
private

for faster access: using an internal pointer to the actual ITruthStrategy instances

Definition at line 88 of file TruthSvc.h.

◆ m_ignoreUndefinedBarcodes

Gaudi::Property<bool> ISF::TruthSvc::m_ignoreUndefinedBarcodes {this, "IgnoreUndefinedBarcodes", false, ""}
private

do/don't abort if retrieve an undefined barcode

Definition at line 94 of file TruthSvc.h.

◆ m_numStrategies

unsigned short ISF::TruthSvc::m_numStrategies[AtlasDetDescr::fNumAtlasRegions]
private

Definition at line 89 of file TruthSvc.h.

◆ m_passWholeVertex

Gaudi::Property<bool> ISF::TruthSvc::m_passWholeVertex {this, "PassWholeVertices", true, ""}
private

Definition at line 96 of file TruthSvc.h.

◆ m_quasiStableParticleOverwrite

Gaudi::Property<bool> ISF::TruthSvc::m_quasiStableParticleOverwrite {this, "QuasiStableParticleOverwrite", true, ""}
private

should the job be overwriting QS particles

Definition at line 104 of file TruthSvc.h.

◆ m_quasiStableParticlesIncluded

Gaudi::Property<bool> ISF::TruthSvc::m_quasiStableParticlesIncluded {this, "QuasiStableParticlesIncluded", false, ""}
private

does this job simulate quasi-stable particles.

Definition at line 103 of file TruthSvc.h.

◆ m_skipIfNoChildren

Gaudi::Property<bool> ISF::TruthSvc::m_skipIfNoChildren {this, "SkipIfNoChildren", true, ""}
private

MCTruth steering.

do not record incident if numChildren==0

Definition at line 92 of file TruthSvc.h.

◆ m_skipIfNoParentId

Gaudi::Property<bool> ISF::TruthSvc::m_skipIfNoParentId {this, "SkipIfNoParentId", true, ""}
private

do not record if parentId == HepMC::UNDEFINED_ID

Definition at line 93 of file TruthSvc.h.

◆ m_truthStrategies

ToolHandleArray<ITruthStrategy> ISF::TruthSvc::m_truthStrategies {this, "TruthStrategies", {}, ""}
private

the truth strategies applied (as AthenaToolHandle Array)

Definition at line 86 of file TruthSvc.h.


The documentation for this class was generated from the following files:
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::ITruthIncident::position
virtual const HepMC::FourVector & position() const =0
Return HepMC position of the truth vertex.
HepMC::suggest_barcode
bool suggest_barcode(T &p, int i)
Definition: GenEvent.h:670
ISF::ITruthIncident::childParticle
virtual HepMC::GenParticlePtr childParticle(unsigned short index, int bc=HepMC::UNDEFINED_ID)=0
Return the i-th child as a HepMC particle type and assign the given Barcode to the simulator particle...
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ISF::TruthSvc::m_passWholeVertex
Gaudi::Property< bool > m_passWholeVertex
Definition: TruthSvc.h:96
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
ISF::ITruthIncident::physicsProcessCode
virtual int physicsProcessCode() const =0
Return specific physics process code of the truth incident (eg ionisation, bremsstrahlung,...
ISF::STD_VTX
@ STD_VTX
Definition: ITruthIncident.h:28
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::ITruthStrategy
Definition: ITruthStrategy.h:29
ISF::QS_PREDEF_VTX
@ QS_PREDEF_VTX
Definition: ITruthIncident.h:31
HepMC::GenParticlePtr
GenParticle * GenParticlePtr
Definition: GenParticle.h:37
ISF::TruthSvc::m_forceEndVtxRegionsVec
Gaudi::Property< std::vector< unsigned int > > m_forceEndVtxRegionsVec
property containing AtlasRegions for which
Definition: TruthSvc.h:98
ISF::ITruthIncident::childBarcode
virtual int childBarcode(unsigned short index) const =0
Return the barcode of the i-th child particle (if defined as part of the TruthIncident) otherwise ret...
ISF::ITruthIncident::interactionClassification
virtual ISF::InteractionClass_t interactionClassification() const
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: ITruthIncident.h:125
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
AtlasDetDescr::AtlasRegionHelper::getName
static const char * getName(int region)
Definition: AtlasRegionHelper.cxx:13
ISF::TruthSvc::m_barcodeSvc
ServiceHandle< Barcode::IBarcodeSvc > m_barcodeSvc
The Barcode service.
Definition: TruthSvc.h:83
ISF::ITruthIncident::parentParticleAfterIncident
virtual HepMC::GenParticlePtr parentParticleAfterIncident(int newBC)=0
Return the parent particle after the TruthIncident vertex (and assign a new barcode to it)
ISF::TruthSvc::m_geoStrategies
ITruthStrategy ** m_geoStrategies[AtlasDetDescr::fNumAtlasRegions]
for faster access: using an internal pointer to the actual ITruthStrategy instances
Definition: TruthSvc.h:88
ISF::ITruthIncident::parentParticle
virtual HepMC::GenParticlePtr parentParticle()=0
Return the parent particle as a HepMC particle type (only called for particles that will enter the He...
ISF::ITruthIncident::numberOfChildren
unsigned short numberOfChildren() const
Return total number of child particles.
Definition: ITruthIncident.h:139
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::ITruthStrategy::pass
virtual bool pass(ITruthIncident &incident) const =0
true if the ITruthStrategy implementation applies to the given ITruthIncident
HepMC::newGenVertexPtr
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
Definition: GenVertex.h:64
lumiFormat.i
int i
Definition: lumiFormat.py:85
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
ISF::QS_SURV_VTX
@ QS_SURV_VTX
Definition: ITruthIncident.h:29
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ISF::TruthSvc::createGenVertexFromTruthIncident
HepMC::GenVertexPtr createGenVertexFromTruthIncident(ITruthIncident &truthincident) const
Record and end vertex to the MC Truth for the parent particle.
Definition: TruthSvc.cxx:300
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
ISF::ITruthIncident::parentSurvivesIncident
virtual bool parentSurvivesIncident() const =0
Return a boolean whether or not the parent particle survives the incident.
ISF::TruthSvc::m_skipIfNoParentId
Gaudi::Property< bool > m_skipIfNoParentId
do not record if parentId == HepMC::UNDEFINED_ID
Definition: TruthSvc.h:93
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
HepMC::SIM_REGENERATION_INCREMENT
constexpr int SIM_REGENERATION_INCREMENT
Constant defining the barcode threshold for regenerated particles, i.e. particles surviving an intera...
Definition: MagicNumbers.h:39
ISF::TruthSvc::recordIncidentToMCTruth
void recordIncidentToMCTruth(ITruthIncident &truthincident, bool passWholeVertex) const
Record the given truth incident to the MC Truth.
Definition: TruthSvc.cxx:199
HepMC::SIM_STATUS_THRESHOLD
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
Definition: MagicNumbers.h:45
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ISF::InteractionClass_t
InteractionClass_t
The interaction classifications are described as follows: STD_VTX: interaction of a particle without ...
Definition: ITruthIncident.h:27
weights
Definition: herwig7_interface.h:44
ISF::TruthSvc::m_skipIfNoChildren
Gaudi::Property< bool > m_skipIfNoChildren
MCTruth steering.
Definition: TruthSvc.h:92
ISF::ITruthIncident::childPassedFilters
bool childPassedFilters(unsigned short index) const
Should a particular child be written out to the GenEvent.
Definition: ITruthIncident.h:186
ISF::TruthSvc::m_truthStrategies
ToolHandleArray< ITruthStrategy > m_truthStrategies
the truth strategies applied (as AthenaToolHandle Array)
Definition: TruthSvc.h:86
ISF::TruthSvc::m_forceEndVtx
std::array< bool, AtlasDetDescr::fNumAtlasRegions > m_forceEndVtx
attach end vertex to
Definition: TruthSvc.h:100
ISF::ITruthIncident::parentBarcode
virtual int parentBarcode()=0
Return the barcode of the parent particle.
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
MC::isDecayed
bool isDecayed(const T &p)
Identify if the particle decayed.
Definition: HepMCHelpers.h:42
ISF::ITruthIncident::setPassWholeVertices
void setPassWholeVertices(bool passWholeVertex)
Set whether this TruthIncident should pass the vertex as a whole or individual children.
Definition: ITruthIncident.h:190
ISF::TruthSvc::m_numStrategies
unsigned short m_numStrategies[AtlasDetDescr::fNumAtlasRegions]
Definition: TruthSvc.h:89
ISF::ITruthIncident::physicsProcessCategory
virtual int physicsProcessCategory() const =0
Return category of the physics process represented by the truth incident (eg hadronic,...
validAtlasRegion
#define validAtlasRegion(region)
Definition: AtlasRegion.h:15
ISF::TruthSvc::m_ignoreUndefinedBarcodes
Gaudi::Property< bool > m_ignoreUndefinedBarcodes
do/don't abort if retrieve an undefined barcode
Definition: TruthSvc.h:94
ISF::ITruthIncident::parentUniqueID
virtual int parentUniqueID()=0
Return the unique ID of the parent particle.
ISF::ITruthIncident::geoID
AtlasDetDescr::AtlasRegion geoID()
Return the SimGeoID corresponding to the vertex of the truth incident.
Definition: ITruthIncident.h:53
AtlasDetDescr::fFirstAtlasRegion
@ fFirstAtlasRegion
Definition: AtlasRegion.h:31