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
SpclMcValidationTool Class Reference

#include <SpclMcValidationTool.h>

Inheritance diagram for SpclMcValidationTool:
Collaboration diagram for SpclMcValidationTool:

Public Member Functions

 SpclMcValidationTool (const std::string &type, const std::string &name, const IInterface *parent)
 Constructor with parameters: More...
 
virtual ~SpclMcValidationTool ()
 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< IIOMcAodToolMcAodTool_t
 

Protected Member Functions

 SpclMcValidationTool ()
 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 TruthParticleContainer *mcParts)
 Main method to perform the validation: More...
 
StatusCode setupMcAodWriterTool ()
 Request pointers to the IIOMcAodTool to be able to write out TruthParticleContainer 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_mcEventsName
 Location of the reference McEventCollection. More...
 
StringProperty m_truthParticlesName
 Location of the 'to-be-validated' TruthParticleContainer. More...
 
McAodTool_t m_mcAodWriterTool
 Tool to write the TruthParticleContainer 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 27 of file SpclMcValidationTool.h.

Member Typedef Documentation

◆ McAodTool_t

typedef ToolHandle<IIOMcAodTool> SpclMcValidationTool::McAodTool_t
protected

Definition at line 95 of file SpclMcValidationTool.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ SpclMcValidationTool() [1/2]

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

Constructor with parameters:

Public methods:

Constructors

Definition at line 31 of file SpclMcValidationTool.cxx.

33  :
35 {
36  //
37  // Property declaration
38  //
39  declareProperty( "McEvents",
40  m_mcEventsName = "GEN_AOD",
41  "Name of the reference McEventCollection" );
42 
43  declareProperty( "TruthParticles",
44  m_truthParticlesName = "SpclMC",
45  "Name of the 'to-be-validated' TruthParticleContainer" );
46 
47  declareProperty( "McAodWriterTool",
48  m_mcAodWriterTool = McAodTool_t( "McAodWriterTool", this ),
49  "Tool to write the TruthParticleContainer into a "
50  "dedicated file" );
51 }

◆ ~SpclMcValidationTool()

SpclMcValidationTool::~SpclMcValidationTool ( )
virtual

Destructor:

Destructor.

Definition at line 55 of file SpclMcValidationTool.cxx.

56 {
57  ATH_MSG_DEBUG("Calling destructor");
58 }

◆ SpclMcValidationTool() [2/2]

SpclMcValidationTool::SpclMcValidationTool ( )
protected

Default constructor:

Member Function Documentation

◆ 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/2]

StatusCode SpclMcValidationTool::executeTool ( )
protectedvirtual

Main method to perform the validation.

Just a wrapper around the more API-detailed method.

Implements TruthParticleValidationBaseTool.

Definition at line 82 of file SpclMcValidationTool.cxx.

83 {
84  // retrieve McEventCollection
85  const McEventCollection * mcEvents = nullptr;
86  if ( evtStore()->retrieve( mcEvents, m_mcEventsName ).isFailure() ||
87  nullptr == mcEvents ) {
88  ATH_MSG_ERROR("Could not retrieve McEventCollection at ["
89  << m_mcEventsName << "] !!");
90  return StatusCode::FAILURE;
91  } else {
92  ATH_MSG_VERBOSE("Successfully retrieved McEventCollection at ["
93  << m_mcEventsName << "]");
94  }
95 
96  // retrieve TruthParticleContainer
97  const TruthParticleContainer * mcParts = nullptr;
98  if ( evtStore()->retrieve( mcParts, m_truthParticlesName ).isFailure() ||
99  nullptr == mcParts ) {
100  ATH_MSG_ERROR("Could not retrieve TruthParticleContainer at ["
101  << m_truthParticlesName << "] !!");
102  return StatusCode::FAILURE;
103  } else {
104  ATH_MSG_VERBOSE("Successfully TruthParticleContainer at ["
105  << m_truthParticlesName << "]");
106  }
107 
108  return executeTool( mcEvents, mcParts );
109 }

◆ executeTool() [2/2]

StatusCode SpclMcValidationTool::executeTool ( const McEventCollection refMcEvents,
const TruthParticleContainer mcParts 
)
protectedvirtual

Main method to perform the validation:

  • check that each vertex is identical to the original one

Definition at line 112 of file SpclMcValidationTool.cxx.

114 {
115  if ( nullptr == mcEvents ) {
116  ATH_MSG_ERROR("NULL pointer to reference McEventCollection !!");
117  return StatusCode::FAILURE;
118  }
119 
120  if ( nullptr == mcParts ) {
121  ATH_MSG_ERROR("NULL pointer to the 'to-be-validated' "\
122  "TruthParticleContainer !!");
123  return StatusCode::FAILURE;
124  }
125 
126  if ( mcEvents->empty() ) {
127  ATH_MSG_WARNING("Empty McEventCollection !");
128  return mcParts->empty() ? StatusCode::SUCCESS : StatusCode::FAILURE;
129  }
130 
131  const HepMC::GenEvent * genEvt = (*mcEvents)[0];
132  if ( nullptr == genEvt ) {
133  ATH_MSG_ERROR("NULL pointer to reference GenEvent !!");
134  return StatusCode::FAILURE;
135  }
136 
137  int particles_size=genEvt->particles_size();
138  if ( static_cast<int>( mcParts->size() ) != particles_size ) {
139  ATH_MSG_ERROR("TruthParticleContainer and McEventCollection don't have "\
140  "the same number of particles !!" << endmsg
141  << "\tTruthParticleContainer: " << mcParts->size() << endmsg
142  << "\tHepMC::GenEvent: " << particles_size);
143  return StatusCode::FAILURE;
144  }
145 
146  if ( !m_mcAodWriterTool->execute().isSuccess() ) {
147  ATH_MSG_WARNING("Could NOT write out the TruthParticleContainer through the IIOMcAodTool !!");
148  }
149 
150  const TruthParticleContainer::const_iterator itrEnd = mcParts->end();
151  for ( TruthParticleContainer::const_iterator itrPart = mcParts->begin();
152  itrPart != itrEnd;
153  ++itrPart ) {
154  const TruthParticle * mc = *itrPart;
155  auto hepMc = mc->genParticle();
156 
157  if ( hepMc->momentum() != HepMC::FourVector(mc->hlv().x(),mc->hlv().y(),mc->hlv().z(),mc->hlv().t()) ) {
158  ATH_MSG_ERROR("TruthParticle and GenParticle-link don't have same 4-mom !!");
159  return StatusCode::FAILURE;
160  }
161 
162  auto genPart = HepMC::barcode_to_particle(genEvt,HepMC::barcode(hepMc));
163 
164  if ( hepMc->momentum() != genPart->momentum() ) {
165  ATH_MSG_ERROR("GenParticle-link and GenParticle from McEvtColl "\
166  "don't have same 4-mom !!");
167  return StatusCode::FAILURE;
168  }
169 
170 
171  }
172  return StatusCode::SUCCESS;
173 }

◆ 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 SpclMcValidationTool::finalizeTool ( )
protectedvirtual

Reimplemented from TruthParticleValidationBaseTool.

Definition at line 76 of file SpclMcValidationTool.cxx.

77 {
78  ATH_MSG_INFO("Finalizing " << name() << "...");
79  return StatusCode::SUCCESS;
80 }

◆ 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 SpclMcValidationTool::initializeTool ( )
protectedvirtual

Non-const methods:

Reimplemented from TruthParticleValidationBaseTool.

Definition at line 64 of file SpclMcValidationTool.cxx.

65 {
66  ATH_MSG_INFO("Initializing " << name() << "...");
67  // retrieve and configure McAod writer tool
68  if ( setupMcAodWriterTool().isFailure() ) {
69  ATH_MSG_ERROR("Could not configure the McAod writer tools !!");
70  return StatusCode::FAILURE;
71  }
72 
73  return StatusCode::SUCCESS;
74 }

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

◆ setupMcAodWriterTool()

StatusCode SpclMcValidationTool::setupMcAodWriterTool ( )
protected

Request pointers to the IIOMcAodTool to be able to write out TruthParticleContainer for further comparison (off-framework)

Definition at line 175 of file SpclMcValidationTool.cxx.

176 {
177  if ( !m_mcAodWriterTool.retrieve().isSuccess() ) {
178  ATH_MSG_ERROR("Creation of algTool ["
179  << m_mcAodWriterTool.type() << "/"
180  //<< m_mcAodWriterTool.name()
181  << "] FAILED !");
182  return StatusCode::FAILURE;
183  }
184 
185  // now we configure the tools
186  StringProperty prop( "TruthParticles", m_truthParticlesName.value() );
187  if ( m_mcAodWriterTool->setProperty( prop ).isFailure() ) {
188  ATH_MSG_ERROR("Could not set property [" << prop.name() << "] for tool ["
189  << m_mcAodWriterTool.type() << "/"
190  //<< m_mcAodWriterTool.name()
191  << "] !!");
192  return StatusCode::FAILURE;
193  }
194  return StatusCode::SUCCESS;
195 }

◆ 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_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_mcAodWriterTool

McAodTool_t SpclMcValidationTool::m_mcAodWriterTool
protected

Tool to write the TruthParticleContainer into a dedicated file.

Definition at line 99 of file SpclMcValidationTool.h.

◆ m_mcEventsName

StringProperty SpclMcValidationTool::m_mcEventsName
protected

Location of the reference McEventCollection.

Definition at line 89 of file SpclMcValidationTool.h.

◆ m_nAnalysedEvents

unsigned int TruthParticleValidationBaseTool::m_nAnalysedEvents
protectedinherited

Counter of analysed events.

Definition at line 75 of file TruthParticleValidationBaseTool.h.

◆ m_truthParticlesName

StringProperty SpclMcValidationTool::m_truthParticlesName
protected

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

Definition at line 93 of file SpclMcValidationTool.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
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SpclMcValidationTool::executeTool
virtual StatusCode executeTool()
Main method to perform the validation.
Definition: SpclMcValidationTool.cxx:82
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
TruthParticleValidationBaseTool::TruthParticleValidationBaseTool
TruthParticleValidationBaseTool()
Default constructor:
TruthParticleValidationBaseTool::finalizeTool
virtual StatusCode finalizeTool()
Definition: TruthParticleValidationBaseTool.h:94
TruthParticle
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticle.h:58
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
SpclMcValidationTool::m_mcAodWriterTool
McAodTool_t m_mcAodWriterTool
Tool to write the TruthParticleContainer into a dedicated file.
Definition: SpclMcValidationTool.h:99
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
TruthParticleContainer
Definition: PhysicsAnalysis/TruthParticleID/McParticleEvent/McParticleEvent/TruthParticleContainer.h:42
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
SpclMcValidationTool::setupMcAodWriterTool
StatusCode setupMcAodWriterTool()
Request pointers to the IIOMcAodTool to be able to write out TruthParticleContainer for further compa...
Definition: SpclMcValidationTool.cxx:175
mc
Definition: mc.PG_single_nu_valid.py:1
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TruthParticleValidationBaseTool::executeTool
virtual StatusCode executeTool()=0
Main method to perform the validation.
HepMC::barcode_to_particle
GenParticle * barcode_to_particle(const GenEvent *e, int id)
Definition: GenEvent.h:506
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
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
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
SpclMcValidationTool::m_mcEventsName
StringProperty m_mcEventsName
Location of the reference McEventCollection.
Definition: SpclMcValidationTool.h:89
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
a
TList * a
Definition: liststreamerinfos.cxx:10
h
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:616
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
SpclMcValidationTool::McAodTool_t
ToolHandle< IIOMcAodTool > McAodTool_t
Definition: SpclMcValidationTool.h:95
TruthParticleValidationBaseTool::m_nAnalysedEvents
unsigned int m_nAnalysedEvents
Counter of analysed events.
Definition: TruthParticleValidationBaseTool.h:75
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
SpclMcValidationTool::m_truthParticlesName
StringProperty m_truthParticlesName
Location of the 'to-be-validated' TruthParticleContainer.
Definition: SpclMcValidationTool.h:93
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528