ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
xAODtoHepMCTool Class Reference

#include <xAODtoHepMCTool.h>

Inheritance diagram for xAODtoHepMCTool:
Collaboration diagram for xAODtoHepMCTool:

Public Member Functions

 xAODtoHepMCTool (const std::string &name)
 
virtual ~xAODtoHepMCTool ()
 
virtual StatusCode initialize () override
 Dummy implementation of the initialisation function. More...
 
StatusCode finalize () override
 
std::vector< HepMC::GenEvent > getHepMCEvents (const xAOD::TruthEventContainer *xTruthEventContainer, const xAOD::EventInfo *eventInfo) const override
 
virtual void print () const
 Print the state of the tool. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

HepMC::GenEvent createHepMCEvent (const xAOD::TruthEvent *xEvt, const xAOD::EventInfo *eventInfo) const
 
HepMC::GenVertexPtr vertexHelper (const xAOD::TruthVertex *, std::map< const xAOD::TruthVertex *, HepMC::GenVertexPtr > &, bool &) const
 
HepMC::GenParticlePtr createHepMCParticle (const xAOD::TruthParticle *) const
 
HepMC::GenVertexPtr createHepMCVertex (const xAOD::TruthVertex *) const
 
void printxAODEvent (const xAOD::TruthEvent *event, const xAOD::EventInfo *eventInfo) const
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

Gaudi::Property< float > m_momFac
 Input container key (job property) More...
 
Gaudi::Property< float > m_lenFac
 
Gaudi::Property< bool > m_signalOnly
 
Gaudi::Property< int > m_maxCount
 
std::atomic< int > m_evtCount
 Counters. More...
 
std::atomic< int > m_badSuggest
 
int m_noProdVtx
 
int m_badBeams
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Detailed Description

Definition at line 22 of file xAODtoHepMCTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ xAODtoHepMCTool()

xAODtoHepMCTool::xAODtoHepMCTool ( const std::string &  name)

Definition at line 11 of file xAODtoHepMCTool.cxx.

13 {
14 }

◆ ~xAODtoHepMCTool()

virtual xAODtoHepMCTool::~xAODtoHepMCTool ( )
inlinevirtual

Definition at line 26 of file xAODtoHepMCTool.h.

26 { };

Member Function Documentation

◆ createHepMCEvent()

HepMC::GenEvent xAODtoHepMCTool::createHepMCEvent ( const xAOD::TruthEvent xEvt,
const xAOD::EventInfo eventInfo 
) const
private

EVENT LEVEL

Avoid double deletion

Definition at line 102 of file xAODtoHepMCTool.cxx.

103 {
104 
106  HepMC::GenEvent genEvt;
107  #ifdef HEPMC3
108  genEvt.set_units(HepMC3::Units::MEV, HepMC3::Units::MM);
109  #endif
110 
111  long long int evtNum = eventInfo->eventNumber();
112  genEvt.set_event_number(evtNum);
113  ATH_MSG_DEBUG("Start createHepMCEvent for event " << evtNum);
114 
115  //Weights
116  #ifndef XAOD_STANDALONE
117  const std::vector<float> weights = xEvt->weights();
118  std::map<std::string, int> weightNameMap;
119  if (AthAnalysisHelper::retrieveMetadata("/Generation/Parameters","HepMCWeightNames", weightNameMap).isFailure()) {
120  ATH_MSG_DEBUG("Couldn't find meta-data for weight names.");
121  }
122  #ifdef HEPMC3
123  std::shared_ptr<HepMC3::GenRunInfo> runinfo = std::make_shared<HepMC3::GenRunInfo>();
124  genEvt.set_run_info(runinfo);
125  std::vector<std::string> wnames;
126  wnames.reserve(weights.size());
127  for (int idx = 0; idx < int(weights.size()); ++idx) {
128  for (const auto& it : weightNameMap) {
129  if (it.second == idx) {
130  wnames.push_back(it.first);
131  break;
132  }
133  }
134  }
135  genEvt.run_info()->set_weight_names(wnames);
136  for ( std::vector<float>::const_iterator wgt = weights.begin(); wgt != weights.end(); ++wgt ) {
137  genEvt.weights().push_back(*wgt);
138  }
139  #else
140  if (weightNameMap.size()) {
141  HepMC::WeightContainer& wc = genEvt.weights();
142  wc.clear();
143  for (int idx = 0; idx < int(weights.size()); ++idx) {
144  for (const auto& it : weightNameMap) {
145  if (it.second == idx) {
146  wc[ it.first ] = weights[idx];
147  break;
148  }
149  }
150  }
151  }
152  else {
153  for ( std::vector<float>::const_iterator wgt = weights.begin(); wgt != weights.end(); ++wgt ) {
154  genEvt.weights().push_back(*wgt);
155  }
156  }
157  #endif
158  #endif
159 
160  // PARTICLES AND VERTICES
161  // Map of existing vertices - needed for the tree linking
162  std::map<const xAOD::TruthVertex *, HepMC::GenVertexPtr> vertexMap;
163 
164  // Loop over all of the particles in the event, call particle builder
165  // Call suggest_barcode only after insertion!
166  for (auto tlink : xEvt->truthParticleLinks()) {
167  if (!tlink.isValid()) { continue; }
168  const xAOD::TruthParticle *xPart = *tlink;
169 
170  // sanity check
171  if (xPart == nullptr) {
172  ATH_MSG_WARNING("xAOD TruthParticle is equal to NULL. This should not happen!");
173  continue;
174  }
175 
176  if (!xPart->hasProdVtx() && !xPart->hasDecayVtx()) {
177  ATH_MSG_WARNING("xAOD particle with no vertices, uniqueID = " << HepMC::uniqueID(xPart));
178  continue;
179  }
180 
181  // skip particles which are Geant4 secondaries
182  if (HepMC::is_simulation_particle(xPart)) { continue; }
183 
184  // Create GenParticle
185  // presumably the GenEvent takes ownership of this, but creating a unique_ptr here as that will only happen if there's an associated vertex
186 #ifdef HEPMC3
187  auto hepmcParticle = createHepMCParticle(xPart);
188 #else
189  std::unique_ptr<HepMC::GenParticle> hepmcParticle(createHepMCParticle(xPart));
190 #endif
191  int bcpart = HepMC::barcode(xPart);
192 
193  // status HepMC::SPECIALSTATUS should be treated just as status 2
194  if (hepmcParticle->status() == HepMC::SPECIALSTATUS) {
195  hepmcParticle->set_status(2);
196  }
197 
198  // Get the production and decay vertices
199  if (xPart->hasProdVtx()) {
200  const xAOD::TruthVertex *xAODProdVtx = xPart->prodVtx();
201  // skip production vertices which are Geant4 secondaries
202  if (HepMC::is_simulation_vertex(xAODProdVtx)) { continue; }
203  bool prodVtxSeenBefore(false); // is this new?
204  auto hepmcProdVtx = vertexHelper(xAODProdVtx, vertexMap, prodVtxSeenBefore);
205  // Set the decay/production links
206 #ifdef HEPMC3
207  hepmcProdVtx->add_particle_out(hepmcParticle);
208 #else
209  hepmcProdVtx->add_particle_out(hepmcParticle.get());
210 #endif
211  // Insert into Event
212  if (!prodVtxSeenBefore) {
213  genEvt.add_vertex(hepmcProdVtx);
214  if (!HepMC::suggest_barcode(hepmcProdVtx, HepMC::barcode(xAODProdVtx))) {
215  ATH_MSG_WARNING("suggest_barcode failed for vertex " << HepMC::barcode(xAODProdVtx));
216  ++m_badSuggest;
217  }
218  }
219  if (!HepMC::suggest_barcode(hepmcParticle, bcpart)) {
220  ATH_MSG_VERBOSE("suggest_barcode failed for particle " << bcpart);
221  ++m_badSuggest;
222  }
223  bcpart = 0;
224  }
225  else {
226  ATH_MSG_VERBOSE("No production vertex found for particle " << HepMC::uniqueID(xPart));
227  }
228 
229  if (xPart->hasDecayVtx()) {
230  const xAOD::TruthVertex *xAODDecayVtx = xPart->decayVtx();
231  // skip decay vertices which are Geant4 secondaries
232  if (HepMC::is_simulation_vertex(xAODDecayVtx)) {
234 #ifndef HEPMC3
235  if (xPart->hasProdVtx()) { (void)hepmcParticle.release(); }
236 #endif
237  continue;
238  }
239  bool decayVtxSeenBefore(false); // is this new?
240  auto hepmcDecayVtx = vertexHelper(xAODDecayVtx, vertexMap, decayVtxSeenBefore);
241  // Set the decay/production links
242 #ifdef HEPMC3
243  hepmcDecayVtx->add_particle_in(hepmcParticle);
244 #else
245  hepmcDecayVtx->add_particle_in(hepmcParticle.get());
246 #endif
247  // Insert into Event
248  if (!decayVtxSeenBefore) {
249  genEvt.add_vertex(hepmcDecayVtx);
250  if (!HepMC::suggest_barcode(hepmcDecayVtx, HepMC::barcode(xAODDecayVtx))) {
251  ATH_MSG_WARNING("suggest_barcode failed for vertex "
252  << HepMC::barcode(xAODDecayVtx));
253  ++m_badSuggest;
254  }
255  }
256  if (bcpart != 0) {
257  if (!HepMC::suggest_barcode(hepmcParticle, bcpart)) {
258  ATH_MSG_DEBUG("suggest_barcode failed for particle " << bcpart);
259  ++m_badSuggest;
260  }
261  bcpart = 0;
262  }
263  }
264 #ifndef HEPMC3
265  (void)hepmcParticle.release();
266 #endif
267 
268  } // end of particle loop
269 
270  return genEvt;
271 }

◆ createHepMCParticle()

HepMC::GenParticlePtr xAODtoHepMCTool::createHepMCParticle ( const xAOD::TruthParticle particle) const
private

Definition at line 300 of file xAODtoHepMCTool.cxx.

301 {
302  ATH_MSG_VERBOSE("Creating GenParticle for uniqueID " << HepMC::uniqueID(particle));
303  const HepMC::FourVector fourVec(m_momFac * particle->px(), m_momFac * particle->py(), m_momFac * particle->pz(), m_momFac * particle->e());
304  auto hepmcParticle = HepMC::newGenParticlePtr(fourVec, particle->pdgId(), particle->status());
305  hepmcParticle->set_generated_mass(m_momFac * particle->m());
306  return hepmcParticle;
307 }

◆ createHepMCVertex()

HepMC::GenVertexPtr xAODtoHepMCTool::createHepMCVertex ( const xAOD::TruthVertex vertex) const
private

Definition at line 311 of file xAODtoHepMCTool.cxx.

312 {
313  ATH_MSG_VERBOSE("Creating GenVertex for uniqueID " << HepMC::uniqueID(vertex));
314  HepMC::FourVector prod_pos(m_lenFac * vertex->x(), m_lenFac * vertex->y(), m_lenFac * vertex->z(), m_lenFac * vertex->t());
315  auto genVertex = HepMC::newGenVertexPtr(prod_pos);
316  return genVertex;
317 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode xAODtoHepMCTool::finalize ( )
overridevirtual

Implements IxAODtoHepMCTool.

Definition at line 27 of file xAODtoHepMCTool.cxx.

28 {
29  ATH_MSG_INFO("==============================================================");
30  ATH_MSG_INFO("========== xAOD -> HepMC Tool :: Run Summary ==========");
31  ATH_MSG_INFO("==============================================================");
32  if (m_badSuggest)
33  {
34  ATH_MSG_INFO("Number of suggest_barcode failures = " << m_badSuggest);
35  ATH_MSG_INFO(" ... check input particle/vertex barcodes.");
36  }
37  else
38  {
39  ATH_MSG_INFO("No suggest_barcode failures");
40  }
41  if (m_noProdVtx)
42  {
43  ATH_MSG_INFO("Number of events that have a missing production vertex = " << m_noProdVtx);
44  }
45  else
46  {
47  ATH_MSG_INFO("No missing production vertices");
48  }
49  if (m_badBeams)
50  {
51  ATH_MSG_INFO("Number events with improperly defined beamparticles = " << m_badBeams);
52  ATH_MSG_INFO("Inconsistencies with the beam particles storage in the event record!");
53  ATH_MSG_INFO("... check xAOD::TruthEvent record ...");
54  }
55  else
56  {
57  ATH_MSG_INFO("No events with undefined beams.");
58  }
59  ATH_MSG_INFO("==============================================================");
60  ATH_MSG_INFO("=================== End Run Summary ===================");
61  ATH_MSG_INFO("==============================================================");
62  return StatusCode::SUCCESS;
63 }

◆ getHepMCEvents()

std::vector< HepMC::GenEvent > xAODtoHepMCTool::getHepMCEvents ( const xAOD::TruthEventContainer xTruthEventContainer,
const xAOD::EventInfo eventInfo 
) const
overridevirtual

Implements IxAODtoHepMCTool.

Definition at line 65 of file xAODtoHepMCTool.cxx.

66 {
67  ++m_evtCount;
68  bool doPrint = m_evtCount < m_maxCount;
69  // CREATE HEPMC EVENT COLLECTION
70  std::vector<HepMC::GenEvent> mcEventCollection;
71  // Loop over xAOD truth container
72  // Signal event is always first, followed by pileup events
73  ATH_MSG_DEBUG("Start event loop");
74  for (const xAOD::TruthEvent *xAODEvent : *xTruthEventContainer)
75  {
76  if (doPrint)
77  ATH_MSG_DEBUG("XXX Printing xAOD Event");
78  if (doPrint)
79  printxAODEvent(xAODEvent, eventInfo);
80  // Create GenEvent for each xAOD truth event
81  ATH_MSG_DEBUG("Create new GenEvent");
82  HepMC::GenEvent&& hepmcEvent = createHepMCEvent(xAODEvent, eventInfo);
83  #ifdef HEPMC3
84  std::shared_ptr<HepMC3::GenRunInfo> runinfo = std::make_shared<HepMC3::GenRunInfo>(*(hepmcEvent.run_info().get()));
85  #endif
86  // Insert into McEventCollection
87  mcEventCollection.push_back(std::move(hepmcEvent));
88  #ifdef HEPMC3
89  mcEventCollection[mcEventCollection.size()-1].set_run_info(runinfo);
90  #endif
91  if (doPrint)
92  ATH_MSG_DEBUG("XXX Printing HepMC Event");
93  if (doPrint)
94  HepMC::Print::line(std::cout, hepmcEvent);
95  // Quit if signal only
96  if (m_signalOnly)
97  break;
98  }
99  return mcEventCollection;
100 }

◆ getKey()

SG::sgkey_t asg::AsgTool::getKey ( const void *  ptr) const
inherited

Get the (hashed) key of an object that is in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the SG::sgkey_t key for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getName
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The hashed key of the object in the store. If not found, an invalid (zero) key.

Definition at line 119 of file AsgTool.cxx.

119  {
120 
121 #ifdef XAOD_STANDALONE
122  // In case we use @c xAOD::TEvent, we have a direct function call
123  // for this.
124  return evtStore()->event()->getKey( ptr );
125 #else
126  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
127  return ( proxy == nullptr ? 0 : proxy->sgkey() );
128 #endif // XAOD_STANDALONE
129  }

◆ getName()

const std::string & asg::AsgTool::getName ( const void *  ptr) const
inherited

Get the name of an object that is / should be in the event store.

This is a bit of a special one. StoreGateSvc and xAOD::TEvent both provide ways for getting the std::string name for an object that is in the store, based on a bare pointer. But they provide different interfaces for doing so.

In order to allow tools to efficiently perform this operation, they can use this helper function.

See also
asg::AsgTool::getKey
Parameters
ptrThe bare pointer to the object that the event store should know about
Returns
The string name of the object in the store. If not found, an empty string.

Definition at line 106 of file AsgTool.cxx.

106  {
107 
108 #ifdef XAOD_STANDALONE
109  // In case we use @c xAOD::TEvent, we have a direct function call
110  // for this.
111  return evtStore()->event()->getName( ptr );
112 #else
113  const SG::DataProxy* proxy = evtStore()->proxy( ptr );
114  static const std::string dummy = "";
115  return ( proxy == nullptr ? dummy : proxy->name() );
116 #endif // XAOD_STANDALONE
117  }

◆ getProperty()

template<class T >
const T* asg::AsgTool::getProperty ( const std::string &  name) const
inherited

Get one of the tool's properties.

◆ initialize()

StatusCode xAODtoHepMCTool::initialize ( )
overridevirtual

Dummy implementation of the initialisation function.

It's here to allow the dual-use tools to skip defining an initialisation function. Since many are doing so...

Reimplemented from asg::AsgTool.

Definition at line 16 of file xAODtoHepMCTool.cxx.

17 {
18  ATH_MSG_INFO("Initializing xAODtoHepMCTool " << name() << "...");
19  ATH_MSG_INFO("SignalOnly = " << m_signalOnly);
20  m_evtCount = 0;
21  m_badSuggest = 0;
22  m_noProdVtx = 0;
23  m_badBeams = 0;
24  return StatusCode::SUCCESS;
25 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msg_level_name()

const std::string & asg::AsgTool::msg_level_name ( ) const
inherited

A deprecated function for getting the message level's name.

Instead of using this, weirdly named function, user code should get the string name of the current minimum message level (in case they really need it...), with:

MSG::name( msg().level() )

This function's name doesn't follow the ATLAS coding rules, and as such will be removed in the not too distant future.

Returns
The string name of the current minimum message level that's printed

Definition at line 101 of file AsgTool.cxx.

101  {
102 
103  return MSG::name( msg().level() );
104  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ print()

void asg::AsgTool::print ( ) const
virtualinherited

◆ printxAODEvent()

void xAODtoHepMCTool::printxAODEvent ( const xAOD::TruthEvent event,
const xAOD::EventInfo eventInfo 
) const
private

Definition at line 321 of file xAODtoHepMCTool.cxx.

322 {
323 
324  std::vector<int> uidPars;
325  std::vector<int> uidKids;
326 
327  long long int evtNum = eventInfo->eventNumber();
328 
329  std::cout << "======================================================================================" << std::endl;
330  std::cout << "xAODTruth Event " << evtNum << std::endl;
331  std::cout << " UniqueID PDG Id Status px(GeV) py(GeV) pz(GeV) E(GeV) Parent: Decay" << std::endl;
332  std::cout << " -----------------------------------------------------------------------------------" << std::endl;
333 
334  int nPart = event->nTruthParticles();
335  for (int i = 0; i < nPart; ++i)
336  {
337  const xAOD::TruthParticle *part = event->truthParticle(i);
338  if (part == nullptr) continue;
339  if (HepMC::generations(part) > 0) continue;
340  int id = part->pdgId();
341  if (id != 25) continue;
342  int stat = part->status();
343  float px = part->px() / 1000.;
344  float py = part->py() / 1000.;
345  float pz = part->pz() / 1000.;
346  float e = part->e() / 1000.;
347  uidPars.clear();
348  uidKids.clear();
349 
350  if (part->hasProdVtx())
351  {
352  const xAOD::TruthVertex *pvtx = part->prodVtx();
353  if (pvtx)
354  uidPars.push_back(HepMC::uniqueID(pvtx));
355  }
356 
357  if (part->hasDecayVtx())
358  {
359  const xAOD::TruthVertex *dvtx = part->decayVtx();
360  if (dvtx)
361  uidKids.push_back(HepMC::uniqueID(dvtx));
362  }
363 
364  std::cout << std::setw(10) << HepMC::uniqueID(part) << std::setw(12) << id
365  << std::setw(8) << stat
366  << std::setprecision(2) << std::fixed
367  << std::setw(10) << px << std::setw(10) << py
368  << std::setw(10) << pz << std::setw(10) << e << " ";
369  std::cout << "P: ";
370  for (unsigned int k = 0; k < uidPars.size(); ++k)
371  {
372  std::cout << uidPars[k] << " ";
373  }
374  std::cout << " D: ";
375  for (unsigned int k = 0; k < uidKids.size(); ++k)
376  {
377  std::cout << uidKids[k] << " ";
378  }
379  std::cout << std::endl;
380  }
381  std::cout << "======================================================================================" << std::endl;
382 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ vertexHelper()

HepMC::GenVertexPtr xAODtoHepMCTool::vertexHelper ( const xAOD::TruthVertex xaodVertex,
std::map< const xAOD::TruthVertex *, HepMC::GenVertexPtr > &  vertexMap,
bool &  seenBefore 
) const
private

Definition at line 275 of file xAODtoHepMCTool.cxx.

278 {
279 
280  HepMC::GenVertexPtr hepmcVertex;
282  vMapItr = vertexMap.find(xaodVertex);
283  // Vertex seen before?
284  if (vMapItr != vertexMap.end()) {
285  // YES: use the HepMC::Vertex already in the map
286  hepmcVertex = (*vMapItr).second;
287  seenBefore = true;
288  }
289  else {
290  // NO: create a new HepMC::Vertex
291  vertexMap[xaodVertex] = createHepMCVertex(xaodVertex);
292  hepmcVertex = vertexMap[xaodVertex];
293  seenBefore = false;
294  }
295  return hepmcVertex;
296 }

Member Data Documentation

◆ m_badBeams

int xAODtoHepMCTool::m_badBeams
private

Definition at line 60 of file xAODtoHepMCTool.h.

◆ m_badSuggest

std::atomic<int> xAODtoHepMCTool::m_badSuggest
mutableprivate

Definition at line 58 of file xAODtoHepMCTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtCount

std::atomic<int> xAODtoHepMCTool::m_evtCount
mutableprivate

Counters.

Definition at line 57 of file xAODtoHepMCTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_lenFac

Gaudi::Property<float> xAODtoHepMCTool::m_lenFac
private
Initial value:
{
this, "LengthFactor", 1.0,
"Scale factor to be applied to truth lengths to convert from mm, e.g. 0.01 to go to cm"}

Definition at line 46 of file xAODtoHepMCTool.h.

◆ m_maxCount

Gaudi::Property<int> xAODtoHepMCTool::m_maxCount
private
Initial value:
{
this, "PrintNevents", 0,
"Maximum number of events to print out"}

Definition at line 52 of file xAODtoHepMCTool.h.

◆ m_momFac

Gaudi::Property<float> xAODtoHepMCTool::m_momFac
private
Initial value:
{
this, "MomentFactor", 0.001,
"Scale factor to be applied to truth energy and momenta to convert from MeV, e.g. 0.001 to go to GeV"}

Input container key (job property)

Definition at line 43 of file xAODtoHepMCTool.h.

◆ m_noProdVtx

int xAODtoHepMCTool::m_noProdVtx
private

Definition at line 59 of file xAODtoHepMCTool.h.

◆ m_signalOnly

Gaudi::Property<bool> xAODtoHepMCTool::m_signalOnly
private
Initial value:
{
this, "SignalOnly", true,
"Convert only the signal event (true), or all events found"}

Definition at line 49 of file xAODtoHepMCTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
HepMC::GenVertexPtr
HepMC::GenVertex * GenVertexPtr
Definition: GenVertex.h:59
LArG4FSStartPointFilter.part
part
Definition: LArG4FSStartPointFilter.py:21
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
HepMC::suggest_barcode
bool suggest_barcode(T &p, int i)
Definition: GenEvent.h:548
asg::AsgTool
Base class for the dual-use tool implementation classes.
Definition: AsgTool.h:47
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
xAODtoHepMCTool::m_signalOnly
Gaudi::Property< bool > m_signalOnly
Definition: xAODtoHepMCTool.h:49
test_pyathena.px
px
Definition: test_pyathena.py:18
StateLessPT_NewConfig.proxy
proxy
Definition: StateLessPT_NewConfig.py:392
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
skel.it
it
Definition: skel.GENtoEVGEN.py:423
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
MM
@ MM
Definition: RegSelEnums.h:38
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
HepMC::Print::line
void line(std::ostream &os, const GenEvent &e)
Definition: GenEvent.h:554
DeMoUpdate.runinfo
def runinfo
Definition: DeMoUpdate.py:542
xAODtoHepMCTool::m_badBeams
int m_badBeams
Definition: xAODtoHepMCTool.h:60
xAODtoHepMCTool::printxAODEvent
void printxAODEvent(const xAOD::TruthEvent *event, const xAOD::EventInfo *eventInfo) const
Definition: xAODtoHepMCTool.cxx:321
xAODtoHepMCTool::m_evtCount
std::atomic< int > m_evtCount
Counters.
Definition: xAODtoHepMCTool.h:57
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
xAODtoHepMCTool::m_noProdVtx
int m_noProdVtx
Definition: xAODtoHepMCTool.h:59
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAODtoHepMCTool::m_maxCount
Gaudi::Property< int > m_maxCount
Definition: xAODtoHepMCTool.h:52
xAODtoHepMCTool::createHepMCEvent
HepMC::GenEvent createHepMCEvent(const xAOD::TruthEvent *xEvt, const xAOD::EventInfo *eventInfo) const
Definition: xAODtoHepMCTool.cxx:102
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
xAOD::TruthParticle_v1::hasDecayVtx
bool hasDecayVtx() const
Check for a decay vertex on this particle.
HepMC::SPECIALSTATUS
constexpr int SPECIALSTATUS
Constant that the meaning of which is currently lost, to be recovered...
Definition: MagicNumbers.h:41
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
HepMC::is_simulation_particle
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...
Definition: MagicNumbers.h:299
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:92
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
xAODtoHepMCTool::m_lenFac
Gaudi::Property< float > m_lenFac
Definition: xAODtoHepMCTool.h:46
xAOD::TruthParticle_v1::hasProdVtx
bool hasProdVtx() const
Check for a production vertex on this particle.
Definition: TruthParticle_v1.cxx:74
HepMC::uniqueID
int uniqueID(const T &p)
Definition: MagicNumbers.h:113
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
xAOD::TruthEvent_v1
Class describing a signal truth event in the MC record.
Definition: TruthEvent_v1.h:35
python.xAODType.dummy
dummy
Definition: xAODType.py:4
MSG::name
const std::string & name(Level lvl)
Convenience function for translating message levels to strings.
Definition: MsgLevel.cxx:19
HepMC::is_simulation_vertex
bool is_simulation_vertex(const T &v)
Method to establish if the vertex was created during simulation (TODO migrate to be based on status).
Definition: MagicNumbers.h:305
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
beamspotman.stat
stat
Definition: beamspotman.py:266
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
xAOD::TruthParticle_v1::decayVtx
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
xAOD::TruthEvent_v1::weights
const std::vector< float > & weights() const
Const access to the weights vector.
xAOD::TruthParticle_v1::prodVtx
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Definition: TruthParticle_v1.cxx:80
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:41
xAODtoHepMCTool::createHepMCParticle
HepMC::GenParticlePtr createHepMCParticle(const xAOD::TruthParticle *) const
Definition: xAODtoHepMCTool.cxx:300
Amg::py
@ py
Definition: GeoPrimitives.h:39
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
a
TList * a
Definition: liststreamerinfos.cxx:10
HepMC::newGenParticlePtr
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition: GenParticle.h:39
h
xAODtoHepMCTool::vertexHelper
HepMC::GenVertexPtr vertexHelper(const xAOD::TruthVertex *, std::map< const xAOD::TruthVertex *, HepMC::GenVertexPtr > &, bool &) const
Definition: xAODtoHepMCTool.cxx:275
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
xAODtoHepMCTool::createHepMCVertex
HepMC::GenVertexPtr createHepMCVertex(const xAOD::TruthVertex *) const
Definition: xAODtoHepMCTool.cxx:311
xAODtoHepMCTool::m_momFac
Gaudi::Property< float > m_momFac
Input container key (job property)
Definition: xAODtoHepMCTool.h:43
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
xAOD::TruthEventBase_v1::truthParticleLinks
const TruthParticleLinks_t & truthParticleLinks() const
Get all the truth particles.
HepMC::generations
int generations(const T &p)
Method to return how many interactions a particle has undergone during simulation (TODO migrate to be...
Definition: MagicNumbers.h:302
xAODtoHepMCTool::m_badSuggest
std::atomic< int > m_badSuggest
Definition: xAODtoHepMCTool.h:58
SG::DataProxy
Definition: DataProxy.h:44
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
fitman.k
k
Definition: fitman.py:528
AthAnalysisHelper::retrieveMetadata
static std::string retrieveMetadata(const std::string &folder, const std::string &key, const ServiceHandle< StoreGateSvc > &inputMetaStore)
method that always returns as a string you can use from, e.g, pyROOT with evt = ROOT....
Definition: AthAnalysisHelper.h:254