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

#include <GenAodValidationTool.h>

Inheritance diagram for GenAodValidationTool:
Collaboration diagram for GenAodValidationTool:

Public Member Functions

 GenAodValidationTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters: More...
 
virtual ~GenAodValidationTool ()
 Destructor: More...
 
StatusCode initialize ()
 Athena Algorithm's Hooks. More...
 
StatusCode execute ()
 
StatusCode finalize ()
 
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
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 Inline methods:
More...
 

Protected Types

typedef ToolHandle< IIOHepMcToolHepMcTool_t
 shorthand for lazy people (good coders are lazy people, aren't they ?) More...
 

Protected Member Functions

 GenAodValidationTool ()
 Default constructor: More...
 
virtual StatusCode initializeTool ()
 Non-const methods:
More...
 
virtual StatusCode finalizeTool ()
 
virtual StatusCode executeTool ()
 Main method to perform the validation. More...
 
virtual StatusCode executeTool (const McEventCollection *refMcEvents, const McEventCollection *checkMcEvents)
 Main method to perform the validation: More...
 
virtual StatusCode executeTool (const HepMC::GenEvent *refMcEvents, const HepMC::GenEvent *checkMcEvents)
 Main method to perform the validation (directly onto the GenEvents): More...
 
bool compareVtx (const HepMC::ConstGenVertexPtr &vtx1, const HepMC::ConstGenVertexPtr &vtx2) const
 Check that 2 given vertices are the same: More...
 
bool compareParts (const HepMC::ConstGenParticlePtr &p1, const HepMC::ConstGenParticlePtr &p2) const
 Check that 2 given particles are the same: More...
 
StatusCode setupHepMcWriterTools ()
 Request pointers to the HepMcWriterTools to be able to write out HepMC::GenEvent for further comparison (off-framework) More...
 
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...
 

Protected Attributes

StringProperty m_refMcEventsName
 Location of the reference McEventCollection. More...
 
StringProperty m_checkMcEventsName
 Location of the 'to-be-validated' McEventCollection. More...
 
StringProperty m_hardVtxOutFileName
 Name of the output text file which will contain the hard-scattering vertices. More...
 
std::ofstream * m_outFile
 Pointer to the output text file containing hard-scattering vertices. More...
 
HepMcTool_t m_refMcEventWriter
 Tool to write the reference HepMC::GenEvent into a dedicated file. More...
 
HepMcTool_t m_checkMcEventWriter
 Tool to write the 'to-be-checked' HepMC::GenEvent into a dedicated file. More...
 
unsigned int m_nAnalysedEvents
 Counter of analysed events. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

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

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 31 of file GenAodValidationTool.h.

Member Typedef Documentation

◆ HepMcTool_t

typedef ToolHandle<IIOHepMcTool> GenAodValidationTool::HepMcTool_t
protected

shorthand for lazy people (good coders are lazy people, aren't they ?)

Definition at line 135 of file GenAodValidationTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ GenAodValidationTool() [1/2]

GenAodValidationTool::GenAodValidationTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor with parameters:

Public methods:

Constructors

Definition at line 41 of file GenAodValidationTool.cxx.

43  :
45  m_outFile( nullptr )
46 {
47  //
48  // Property declaration
49  //
50 
51  declareProperty( "RefMcEvents",
52  m_refMcEventsName = "TruthEvent",
53  "StoreGate location of the reference McEventCollection" );
54 
55  declareProperty( "CheckMcEvents",
56  m_checkMcEventsName = "GEN_AOD",
57  "Location of the 'to-be-validated' McEventCollection" );
58 
59  declareProperty( "HardScatteringVtxOutputFile",
60  m_hardVtxOutFileName = "hepmc.hard.vtx.txt",
61  "Name of the output text file which will contain the "
62  "hard-scattering vertices" );
63 
64  declareProperty( "RefHepMcWriterTool",
65  m_refMcEventWriter = HepMcTool_t( "HepMcWriterTool",
66  this ),
67  "Tool to write the reference HepMC::GenEvent into a dedicated file" );
68 
69  declareProperty( "CheckHepMcWriterTool",
70  m_checkMcEventWriter = HepMcTool_t( "HepMcWriterTool",
71  this ),
72  "Tool to write the \"to-be-checked\" HepMC::GenEvent "
73  "into a dedicated file" );
74 
75 }

◆ ~GenAodValidationTool()

GenAodValidationTool::~GenAodValidationTool ( )
virtual

Destructor:

Destructor.

Definition at line 79 of file GenAodValidationTool.cxx.

80 {
81  ATH_MSG_DEBUG("Calling destructor");
82 
83  if ( m_outFile ) {
84  m_outFile->close();
85  delete m_outFile;
86  m_outFile = nullptr;
87  }
88 
89 }

◆ GenAodValidationTool() [2/2]

GenAodValidationTool::GenAodValidationTool ( )
protected

Default constructor:

Member Function Documentation

◆ compareParts()

bool GenAodValidationTool::compareParts ( const HepMC::ConstGenParticlePtr p1,
const HepMC::ConstGenParticlePtr p2 
) const
protected

Check that 2 given particles are the same:

  • 4-mom
  • id
  • status
  • flow
  • polarization

Definition at line 406 of file GenAodValidationTool.cxx.

407 {
408  if ( !p1 || !p2 ) {
409  ATH_MSG_ERROR("One of particles is a NULL pointer !!" << endmsg
410  << " p1: " << p1 << endmsg
411  << " p2: " << p2);
412  return false;
413  }
414 
415  if ( HepMC::barcode(p1) != HepMC::barcode(p2) ) {
416  return false;
417  }
418 
419  const HepMC::FourVector hlv1 = p1->momentum();
420  const int id1 = p1->pdg_id();
421  const int status1 = p1->status();
422  auto flow1 = HepMC::flow(p1);
423  auto pol1 = HepMC::polarization(p1);
424 
425  const HepMC::FourVector hlv2 = p2->momentum();
426  const int id2 = p2->pdg_id();
427  const int status2 = p2->status();
428  auto flow2 = HepMC::flow(p2);
429  auto pol2 = HepMC::polarization(p2);
430 
431  const bool isOK = ( hlv1 == hlv2 &&
432  id1 == id2 &&
433  status1 == status2 &&
434  flow1 == flow2 &&
435  pol1 == pol2 );
436 
437 
438  if ( !isOK ) {
440  ("=============================" << endmsg
441  << "\thlv: " << std::boolalpha << (hlv1 == hlv2 ) << endmsg
442  << "\tid: " << std::boolalpha << (id1 == id2 ) << endmsg
443  << "\tstatus: " << std::boolalpha << (status1 == status2) << endmsg
444  << "\tflow: " << std::boolalpha << (flow1 == flow2 ) << endmsg
445  << "\tpolar: " << std::boolalpha << (pol1 == pol2 ) << endmsg
446  << "=============================");
447  }
448 
449  return isOK;
450 }

◆ compareVtx()

bool GenAodValidationTool::compareVtx ( const HepMC::ConstGenVertexPtr vtx1,
const HepMC::ConstGenVertexPtr vtx2 
) const
protected

Check that 2 given vertices are the same:

  • check same number of branches
  • check same particles (4-mom + id + status)

Definition at line 310 of file GenAodValidationTool.cxx.

311 {
312  if ( !vtx1 || !vtx2 ) {
313  ATH_MSG_ERROR("One of vertices is a NULL pointer !!" << endmsg
314  << " vtx1: " << vtx1 << endmsg
315  << " vtx2: " << vtx2);
316  return false;
317  }
318 
319 #ifdef HEPMC3
320  auto inVtx1 = vtx1->particles_in();
321  auto inVtx2 = vtx2->particles_in();
322  if (inVtx1.size() != inVtx2.size()) {
323  ATH_MSG_ERROR("Not the same number of branches !!" << endmsg << " in: " << inVtx1.size() << "\t" << inVtx2.size());
324  return false;
325  }
326  std::sort(inVtx1.begin(), inVtx1.end(), [](auto& a, auto& b) -> bool{return a->momentum().pz() > b->momentum().pz(); });
327  std::sort(inVtx2.begin(), inVtx2.end(), [](auto& a, auto& b) -> bool{return a->momentum().pz() > b->momentum().pz(); });
328  for (size_t i=0; i<inVtx1.size(); ++i){
329  if ( compareParts( inVtx1.at(i), inVtx2.at(i) ) ) continue;
330  ATH_MSG_ERROR("In-going particles are NOT matching !!");
331  return false;
332  }
333  auto outVtx1 = vtx1->particles_out();
334  auto outVtx2 = vtx2->particles_out();
335  if (outVtx1.size() != outVtx2.size()) {
336  ATH_MSG_ERROR("Not the same number of branches !!" << endmsg << " out: " << outVtx1.size() << "\t" << outVtx2.size());
337  return false;
338  }
339  std::sort(outVtx1.begin(), outVtx1.end(), [](auto& a, auto& b) -> bool{return a->momentum().pz() > b->momentum().pz(); });
340  std::sort(outVtx2.begin(), outVtx2.end(), [](auto& a, auto& b) -> bool{return a->momentum().pz() > b->momentum().pz(); });
341  for (size_t i=0; i<outVtx1.size(); ++i){
342  if ( compareParts( outVtx1.at(i), outVtx2.at(i) ) ) continue;
343  ATH_MSG_ERROR("Out-going particles are NOT matchiutg !!");
344  return false;
345  }
346 #else
347  const int inVtx1 = vtx1->particles_in_size();
348  const int inVtx2 = vtx2->particles_in_size();
349 
350  const int outVtx1 = vtx1->particles_out_size();
351  const int outVtx2 = vtx2->particles_out_size();
352 
353  if ( inVtx1 != inVtx2 || outVtx1 != outVtx2 ) {
354  ATH_MSG_ERROR("Not the same number of branches !!" << endmsg
355  << " in: " << inVtx1 << "\t" << inVtx2 << endmsg
356  << " out: " << outVtx1 << "\t" << outVtx2);
357  return false;
358  }
359 
360  for ( HepMC::GenVertex::particles_in_const_iterator inPart1 = vtx1->particles_in_const_begin();
361  inPart1 != vtx1->particles_in_const_end();
362  ++inPart1 ) {
363  bool inParticleOK = false;
364  for ( HepMC::GenVertex::particles_in_const_iterator inPart2 = vtx2->particles_in_const_begin();
365  inPart2 != vtx2->particles_in_const_end();
366  ++inPart2 ) {
367  if ( compareParts( *inPart1, *inPart2 ) ) {
368  inParticleOK = true;
369  break;
370  }
371  } //> end loop over in-part2
372 
373  if ( !inParticleOK ) {
374  ATH_MSG_ERROR("In-going particles are NOT matching !!");
375  return false;
376  }
377 
378  }//> end loop over in-part1
379 
380 
381  for ( HepMC::GenVertex::particles_out_const_iterator outPart1 = vtx1->particles_out_const_begin();
382  outPart1 != vtx1->particles_out_const_end();
383  ++outPart1 ) {
384  bool outParticleOK = false;
385  for ( HepMC::GenVertex::particles_out_const_iterator outPart2 = vtx2->particles_out_const_begin();
386  outPart2 != vtx2->particles_out_const_end();
387  ++outPart2 ) {
388  if ( compareParts( *outPart1, *outPart2 ) ) {
389  outParticleOK = true;
390  break;
391  }
392  } //> end loop over out-part2
393 
394  if ( !outParticleOK ) {
395  ATH_MSG_ERROR("Out-going particles are NOT matching !!");
396  return false;
397  }
398 
399  }//> end loop over out-part1
400 #endif
401 
402  return true;
403 }

◆ 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; }

◆ execute()

StatusCode TruthParticleValidationBaseTool::execute ( )
virtualinherited

Implements ITruthParticleValidationTool.

Definition at line 78 of file TruthParticleValidationBaseTool.cxx.

79 {
81  return executeTool();
82 }

◆ executeTool() [1/3]

StatusCode GenAodValidationTool::executeTool ( )
protectedvirtual

Main method to perform the validation.

Just a wrapper around the more API-detailed method.

Implements TruthParticleValidationBaseTool.

Definition at line 132 of file GenAodValidationTool.cxx.

133 {
134  // retrieve reference McEventCollection
135  const McEventCollection * refMcEvents = nullptr;
136  if ( evtStore()->retrieve( refMcEvents, m_refMcEventsName ).isFailure() ||
137  nullptr == refMcEvents ) {
138  ATH_MSG_ERROR("Could not retrieve reference McEventCollection at ["
139  << m_refMcEventsName << "] !!");
140  return StatusCode::FAILURE;
141  } else {
142  ATH_MSG_VERBOSE("Successfully retrieved reference McEventCollection at ["
143  << m_refMcEventsName << "]");
144 
145  if ( !m_refMcEventWriter ||
146  m_refMcEventWriter->execute().isFailure() ) {
147  ATH_MSG_WARNING("Failed to write the reference GenEvent !!");
148  }
149  }
150 
151  // retrieve checking McEventCollection
152  const McEventCollection * checkMcEvents = nullptr;
153  if ( evtStore()->retrieve(checkMcEvents, m_checkMcEventsName).isFailure() ||
154  nullptr == checkMcEvents ) {
155  ATH_MSG_ERROR("Could not retrieve 'to-be-validated' McEventCollection at ["
156  << m_checkMcEventsName << "] !!");
157  return StatusCode::FAILURE;
158  } else {
160  ("Successfully retrieved 'to-be-validated' McEventCollection at ["
161  << m_checkMcEventsName << "]");
162 
163  if ( !m_checkMcEventWriter ||
164  m_checkMcEventWriter->execute().isFailure() ) {
165  ATH_MSG_WARNING("Failed to write the reference GenEvent !!");
166  }
167  }
168 
169  return executeTool( refMcEvents, checkMcEvents );
170 }

◆ executeTool() [2/3]

StatusCode GenAodValidationTool::executeTool ( const HepMC::GenEvent *  refMcEvents,
const HepMC::GenEvent *  checkMcEvents 
)
protectedvirtual

Main method to perform the validation (directly onto the GenEvents):

  • check that each vertex is identical to the original one
  • check that missing particles are not there for a good reason

Definition at line 209 of file GenAodValidationTool.cxx.

211 {
212  if ( nullptr == refMcEvts ) {
213  ATH_MSG_ERROR("NULL pointer to reference HepMC::GenEvent !!");
214  return StatusCode::FAILURE;
215  }
216 
217  if ( nullptr == checkMcEvts ) {
218  ATH_MSG_ERROR("NULL pointer to the 'to-be-validated' HepMC::GenEvent !!");
219  return StatusCode::FAILURE;
220  }
221 
222  const unsigned int evtNbr = refMcEvts->event_number();
223  (*m_outFile) << ">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"
224  << std::endl
225  << "Event: " << evtNbr
226  << std::endl;
227 
228 #ifdef HEPMC3
229  std::map<int,int> ref_bc_to_id;
230  const auto& refvertices = refMcEvts->vertices();
231  for ( const auto& vtx: refvertices) {
232  // AV: this algorthm is not very correct
233  int partonsin = 0;
234  int showerout = 0;
235  for (auto& p: vtx->particles_in()) if (MC::isQuark(p) || MC::isGluon(p)) partonsin++;
236  for (auto& p: vtx->particles_out()) if (p->pdg_id() == 91||p->pdg_id() == 92||p->pdg_id() == 94) showerout++;
237  if ( partonsin >= 2 && showerout == 0 ) {
238  ref_bc_to_id[HepMC::barcode(vtx)] = vtx->id();
239  }
240  }
241  std::map<int,int> che_bc_to_id;
242  const auto& chevertices = checkMcEvts->vertices();
243  for (const auto& checkVtx: chevertices) {
244  che_bc_to_id[HepMC::barcode(checkVtx)] = checkVtx->id();
245  }
246  std::set<int> allbarcodes;
247  for (const auto &[bc,id]: ref_bc_to_id) allbarcodes.insert(bc);
248  for (const auto &[bc,id]: che_bc_to_id) allbarcodes.insert(bc);
249  for (const auto &bc: allbarcodes){
250  auto ref_it = ref_bc_to_id.find(bc);
251  auto che_it = che_bc_to_id.find(bc);
252  if (ref_it == ref_bc_to_id.end()) {ATH_MSG_WARNING("In Event [" << evtNbr << "]: got null ref-vertex (barcode: " << bc << ")"); continue; }
253  if (che_it == che_bc_to_id.end()) {ATH_MSG_WARNING("Output GenEvent is missing the selected HardScattering Vtx !!"<< " (" << bc << ")"); continue; }
254  if (-ref_it->second > int(refvertices.size()) ) { continue; }
255  if (-che_it->second > int(chevertices.size()) ) { continue; }
256  const auto& refvtx = refvertices[-ref_it->second-1];
257  const auto& chevtx = chevertices[-che_it->second-1];
258  (*m_outFile) << refvtx << std::endl;
259  (*m_outFile) << chevtx << std::endl;
260  (*m_outFile) << "---------" << std::endl;
261  if ( !compareVtx( refvtx, chevtx ) ) {
262  ATH_MSG_WARNING("Selected HardScattering vertices are NOT the same !!"<< " at Event [" << evtNbr << "]"<< " refVtx = " << refvtx<<" chevtx = " << chevtx);
263  }
264  }
265  (*m_outFile) << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
266 #else
267  std::set<int> ref_bc;
268  for ( auto vtxIt = refMcEvts->vertices_begin(); vtxIt != refMcEvts->vertices_end(); ++vtxIt ) {
269  auto vtx =*vtxIt;
270  int partonsin = 0;
271  int showerout = 0;
272 #ifdef HEPMC3
273  for (auto p = vtx->particles_in_begin();p!=vtx->particles_in_end();++p ) if (MC::isQuark(*p) || MC::isGluon(*p)) partonsin++;
274 #else
275  for (auto p = vtx->particles_in_const_begin();p!=vtx->particles_in_const_end();++p ) if (MC::isQuark(*p) || MC::isGluon(*p)) partonsin++;
276 #endif
277  for (auto& p : *vtx) if (p->pdg_id() == 91||p->pdg_id() == 92||p->pdg_id() == 94) showerout++;
278  if ( partonsin >= 2 && showerout == 0 ) {
279  ref_bc.insert(vtx->barcode());
280  }
281  }
282  std::set<int> che_bc;
283  for ( auto vtxIt = checkMcEvts->vertices_begin(); vtxIt != checkMcEvts->vertices_end(); ++vtxIt ) {
284  auto vtx =*vtxIt;
285  che_bc.insert(vtx->barcode());
286  }
287  std::set<int> allbarcodes;
288  for (const auto &bc: ref_bc) allbarcodes.insert(bc);
289  for (const auto &bc: che_bc) allbarcodes.insert(bc);
290  for (const auto &bc: allbarcodes){
291  auto ref_it = ref_bc.find(bc);
292  auto che_it = che_bc.find(bc);
293  if (ref_it == ref_bc.end()) {ATH_MSG_WARNING("In Event [" << evtNbr << "]: got null ref-vertex (barcode: " << bc << ")"); continue; }
294  if (che_it == che_bc.end()) {ATH_MSG_WARNING("Output GenEvent is missing the selected HardScattering Vtx !!"<< " (" << bc << ")"); continue; }
295  const auto refvtx = refMcEvts->barcode_to_vertex(bc);
296  const auto chevtx = checkMcEvts->barcode_to_vertex(bc);
297  (*m_outFile) << refvtx << std::endl;
298  (*m_outFile) << chevtx << std::endl;
299  (*m_outFile) << "---------" << std::endl;
300  if ( !compareVtx( refvtx, chevtx ) ) {
301  ATH_MSG_WARNING("Selected HardScattering vertices are NOT the same !!"<< " at Event [" << evtNbr << "]"<< " refVtx = " << refvtx<<" chevtx = " << chevtx);
302  }
303  }
304  (*m_outFile) << "<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<" << std::endl;
305 #endif
306 
307  return StatusCode::SUCCESS;
308 }

◆ executeTool() [3/3]

StatusCode GenAodValidationTool::executeTool ( const McEventCollection refMcEvents,
const McEventCollection checkMcEvents 
)
protectedvirtual

Main method to perform the validation:

  • check that each vertex is identical to the original one
  • check that missing particles are not there for a good reason

Definition at line 173 of file GenAodValidationTool.cxx.

175 {
176  if ( nullptr == refMcEvents ) {
177  ATH_MSG_ERROR("NULL pointer to reference McEventCollection !!");
178  return StatusCode::FAILURE;
179  }
180 
181  if ( nullptr == checkMcEvents ) {
182  ATH_MSG_ERROR("NULL pointer to the 'to-be-validated' McEventCollection !!");
183  return StatusCode::FAILURE;
184  }
185 
186  if ( refMcEvents->size() != checkMcEvents->size() ) {
187  ATH_MSG_ERROR("McEventCollections to be compared don't have the same size !"
188  << endmsg
189  << "Ref: " << refMcEvents->size() << endmsg
190  << "Current: " << checkMcEvents->size());
191  }
192 
193  const unsigned int nMaxEvts = std::min( refMcEvents->size(),
194  checkMcEvents->size() );
195  for ( unsigned int iEvt = 0; iEvt != nMaxEvts; ++iEvt ) {
196 
197  if ( executeTool( (*refMcEvents)[iEvt],
198  (*checkMcEvents)[iEvt] ).isFailure() ) {
199  ATH_MSG_WARNING("Could not VALIDATE this event ["
200  << (*refMcEvents)[iEvt]->event_number()
201  << "] !!");
202  }
203  }
204 
205  return StatusCode::SUCCESS;
206 }

◆ 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 TruthParticleValidationBaseTool::finalize ( )
virtualinherited

Implements ITruthParticleValidationTool.

Definition at line 64 of file TruthParticleValidationBaseTool.cxx.

65 {
66  ATH_MSG_INFO("Finalizing " << name() << "...");
67  ATH_MSG_INFO("Analysed [" << m_nAnalysedEvents << "] events.");
68 
69  // Give the concrete (derived) tool a chance to finalize itself
70  if ( finalizeTool().isFailure() ) {
71  ATH_MSG_ERROR("Could not finalize concrete tool !");
72  return StatusCode::FAILURE;
73  }
74 
75  return StatusCode::SUCCESS;
76 }

◆ finalizeTool()

StatusCode GenAodValidationTool::finalizeTool ( )
protectedvirtual

Reimplemented from TruthParticleValidationBaseTool.

Definition at line 125 of file GenAodValidationTool.cxx.

126 {
127  ATH_MSG_INFO("Finalizing " << name() << "...");
128 
129  return StatusCode::SUCCESS;
130 }

◆ initialize()

StatusCode TruthParticleValidationBaseTool::initialize ( )
virtualinherited

Athena Algorithm's Hooks.

Implements ITruthParticleValidationTool.

Definition at line 49 of file TruthParticleValidationBaseTool.cxx.

50 {
51  ATH_MSG_INFO("Initializing " << name() << "...");
52 
53  // Give the concrete (derived) tool a chance to initialize itself
54  if ( initializeTool().isFailure() ) {
55  ATH_MSG_ERROR("Could not initialize concrete tool !");
56  return StatusCode::FAILURE;
57  }
58 
59  // initializing the event counter
61  return StatusCode::SUCCESS;
62 }

◆ initializeTool()

StatusCode GenAodValidationTool::initializeTool ( )
protectedvirtual

Non-const methods:

Reimplemented from TruthParticleValidationBaseTool.

Definition at line 96 of file GenAodValidationTool.cxx.

97 {
98  ATH_MSG_INFO("Initializing " << name() << "...");
99 
100  if ( m_outFile ) {
101  delete m_outFile;
102  m_outFile = nullptr;
103  }
104  m_outFile = new std::ofstream( m_hardVtxOutFileName.value().c_str(),
105  std::ios::trunc );
106  if ( !m_outFile || !m_outFile->is_open() || m_outFile->bad() ) {
107  ATH_MSG_ERROR("Could not open output Hard-Scattering vertices file at : "
108  << m_hardVtxOutFileName.value());
109  if ( m_outFile ) {
110  delete m_outFile;
111  m_outFile = nullptr;
112  }
113  return StatusCode::FAILURE;
114  }
115 
116  // retrieve and configure HepMC writer tools
117  if ( setupHepMcWriterTools().isFailure() ) {
118  ATH_MSG_ERROR("Could not configure the HepMC::GenEvent writer tools !!");
119  return StatusCode::FAILURE;
120  }
121 
122  return StatusCode::SUCCESS;
123 }

◆ 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.

◆ interfaceID()

const InterfaceID & ITruthParticleValidationTool::interfaceID ( )
inlinestaticinherited

Inline methods:

Definition at line 65 of file ITruthParticleValidationTool.h.

66 {
67  return IID_ITruthParticleValidationTool;
68 }

◆ 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  }

◆ 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.

◆ 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  }

◆ setupHepMcWriterTools()

StatusCode GenAodValidationTool::setupHepMcWriterTools ( )
protected

Request pointers to the HepMcWriterTools to be able to write out HepMC::GenEvent for further comparison (off-framework)

Definition at line 452 of file GenAodValidationTool.cxx.

453 {
454  if ( !m_refMcEventWriter.retrieve().isSuccess() ) {
455  ATH_MSG_ERROR("Creation of algTool ["
456  << m_refMcEventWriter.type() << "/"
457  << "] FAILED !");
458  return StatusCode::FAILURE;
459  }
460 
461  if ( !m_checkMcEventWriter.retrieve().isSuccess() ) {
462  ATH_MSG_ERROR("Creation of algTool ["
463  << m_checkMcEventWriter.type() << "/"
464  << "] FAILED !");
465  return StatusCode::FAILURE;
466  }
467 
468  // now we configure the tools
469  StringProperty refProp( "McEvents", m_refMcEventsName.value() );
470  if ( m_refMcEventWriter->setProperty( refProp ).isFailure() ) {
471  ATH_MSG_ERROR("Could not set property [" << refProp.name()
472  << "] for tool [" << m_refMcEventWriter.type() << "/"
473  << "] !");
474  return StatusCode::FAILURE;
475  }
476 
477  StringProperty checkProp( "McEvents", m_checkMcEventsName.value() );
478  if ( m_checkMcEventWriter->setProperty( checkProp ).isFailure() ) {
479  ATH_MSG_ERROR("Could not set property [" << checkProp.name()
480  << "] for tool [" << m_checkMcEventWriter.type() << "/"
481  << "] !");
482  return StatusCode::FAILURE;
483  }
484 
485  return StatusCode::SUCCESS;
486 }

◆ 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  }

Member Data Documentation

◆ m_checkMcEventsName

StringProperty GenAodValidationTool::m_checkMcEventsName
protected

Location of the 'to-be-validated' McEventCollection.

Definition at line 122 of file GenAodValidationTool.h.

◆ m_checkMcEventWriter

HepMcTool_t GenAodValidationTool::m_checkMcEventWriter
protected

Tool to write the 'to-be-checked' HepMC::GenEvent into a dedicated file.

Definition at line 143 of file GenAodValidationTool.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_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_hardVtxOutFileName

StringProperty GenAodValidationTool::m_hardVtxOutFileName
protected

Name of the output text file which will contain the hard-scattering vertices.

Default = "hepmc.hard.vtx.txt"

Definition at line 127 of file GenAodValidationTool.h.

◆ m_nAnalysedEvents

unsigned int TruthParticleValidationBaseTool::m_nAnalysedEvents
protectedinherited

Counter of analysed events.

Definition at line 75 of file TruthParticleValidationBaseTool.h.

◆ m_outFile

std::ofstream* GenAodValidationTool::m_outFile
protected

Pointer to the output text file containing hard-scattering vertices.

Definition at line 131 of file GenAodValidationTool.h.

◆ m_refMcEventsName

StringProperty GenAodValidationTool::m_refMcEventsName
protected

Location of the reference McEventCollection.

Definition at line 118 of file GenAodValidationTool.h.

◆ m_refMcEventWriter

HepMcTool_t GenAodValidationTool::m_refMcEventWriter
protected

Tool to write the reference HepMC::GenEvent into a dedicated file.

Definition at line 139 of file GenAodValidationTool.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:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
GenAodValidationTool::compareVtx
bool compareVtx(const HepMC::ConstGenVertexPtr &vtx1, const HepMC::ConstGenVertexPtr &vtx2) const
Check that 2 given vertices are the same:
Definition: GenAodValidationTool.cxx:310
GenAodValidationTool::m_refMcEventWriter
HepMcTool_t m_refMcEventWriter
Tool to write the reference HepMC::GenEvent into a dedicated file.
Definition: GenAodValidationTool.h:139
HepMC::polarization
Polarization polarization(const T &a)
Definition: Polarization.h:47
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TruthParticleValidationBaseTool::TruthParticleValidationBaseTool
TruthParticleValidationBaseTool()
Default constructor:
GenAodValidationTool::m_checkMcEventsName
StringProperty m_checkMcEventsName
Location of the 'to-be-validated' McEventCollection.
Definition: GenAodValidationTool.h:122
TruthParticleValidationBaseTool::finalizeTool
virtual StatusCode finalizeTool()
Definition: TruthParticleValidationBaseTool.h:94
TRTCalib_cfilter.p1
p1
Definition: TRTCalib_cfilter.py:130
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
GenAodValidationTool::executeTool
virtual StatusCode executeTool()
Main method to perform the validation.
Definition: GenAodValidationTool.cxx:132
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
GenAodValidationTool::m_outFile
std::ofstream * m_outFile
Pointer to the output text file containing hard-scattering vertices.
Definition: GenAodValidationTool.h:131
isGluon
bool isGluon(const T &p)
Definition: AtlasPID.h:167
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
isQuark
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to dot...
Definition: AtlasPID.h:122
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
TRTCalib_cfilter.p2
p2
Definition: TRTCalib_cfilter.py:131
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
GenAodValidationTool::m_hardVtxOutFileName
StringProperty m_hardVtxOutFileName
Name of the output text file which will contain the hard-scattering vertices.
Definition: GenAodValidationTool.h:127
GenAodValidationTool::HepMcTool_t
ToolHandle< IIOHepMcTool > HepMcTool_t
shorthand for lazy people (good coders are lazy people, aren't they ?)
Definition: GenAodValidationTool.h:135
TruthParticleValidationBaseTool::executeTool
virtual StatusCode executeTool()=0
Main method to perform the validation.
id2
HWIdentifier id2
Definition: LArRodBlockPhysicsV0.cxx:562
HepMC::flow
int flow(const T &a, int i)
Definition: Flow.h:51
lumiFormat.i
int i
Definition: lumiFormat.py:85
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TruthParticleValidationBaseTool::initializeTool
virtual StatusCode initializeTool()
I/O operators.
Definition: TruthParticleValidationBaseTool.h:87
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
min
#define min(a, b)
Definition: cfImp.cxx:40
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
GenAodValidationTool::setupHepMcWriterTools
StatusCode setupHepMcWriterTools()
Request pointers to the HepMcWriterTools to be able to write out HepMC::GenEvent for further comparis...
Definition: GenAodValidationTool.cxx:452
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
GenAodValidationTool::compareParts
bool compareParts(const HepMC::ConstGenParticlePtr &p1, const HepMC::ConstGenParticlePtr &p2) const
Check that 2 given particles are the same:
Definition: GenAodValidationTool.cxx:406
GenAodValidationTool::m_checkMcEventWriter
HepMcTool_t m_checkMcEventWriter
Tool to write the 'to-be-checked' HepMC::GenEvent into a dedicated file.
Definition: GenAodValidationTool.h:143
a
TList * a
Definition: liststreamerinfos.cxx:10
h
std::sort
void sort(typename std::reverse_iterator< DataModel_detail::iterator< DVL > > beg, typename std::reverse_iterator< DataModel_detail::iterator< DVL > > end, const Compare &comp)
Specialization of sort for DataVector/List.
Definition: DVL_algorithms.h:623
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
TruthParticleValidationBaseTool::m_nAnalysedEvents
unsigned int m_nAnalysedEvents
Counter of analysed events.
Definition: TruthParticleValidationBaseTool.h:75
GenAodValidationTool::m_refMcEventsName
StringProperty m_refMcEventsName
Location of the reference McEventCollection.
Definition: GenAodValidationTool.h:118
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
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