ATLAS Offline Software
Loading...
Searching...
No Matches
TruthClosureCheck Class Reference

#include <TruthClosureCheck.h>

Inheritance diagram for TruthClosureCheck:
Collaboration diagram for TruthClosureCheck:

Public Member Functions

 TruthClosureCheck (const std::string &name, ISvcLocator *pSvcLocator)
 ~TruthClosureCheck ()=default
virtual StatusCode initialize () override final
virtual StatusCode execute () override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

StatusCode sanityCheck (const HepMC::GenEvent &event) const
StatusCode compareGenVertex (const HepMC::GenVertex &origVertex, const HepMC::GenVertex &resetVertex) const
StatusCode compareGenParticle (const HepMC::GenParticle &origParticle, const HepMC::GenParticle &resetParticle) const
void printGenVertex (const HepMC::GenVertex &origVertex, const HepMC::GenVertex &resetVertex) const
StatusCode compareMomenta (const HepMC::FourVector &origMomenta, const HepMC::FourVector &resetMomenta) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

SG::ReadHandleKey< McEventCollectionm_originalMcEventCollection
SG::ReadHandleKey< McEventCollectionm_resetMcEventCollection
bool m_compareMomenta {true}
double m_momentaLimit {0.000000000001}
bool m_postSimulation {false}
DataObjIDColl m_extendedExtraObjects
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 15 of file TruthClosureCheck.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TruthClosureCheck()

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

Definition at line 22 of file TruthClosureCheck.cxx.

22 :
23 AthAlgorithm(name, pSvcLocator)
24{
25 declareProperty("OriginalMcEventCollection" , m_originalMcEventCollection = "BeamTruthEvent");
26 declareProperty("ResetMcEventCollection" , m_resetMcEventCollection = "NewTruthEvent");
27 declareProperty("CompareMomenta", m_compareMomenta);
28 declareProperty("PostSimulation", m_postSimulation);
29}
AthAlgorithm()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::ReadHandleKey< McEventCollection > m_originalMcEventCollection
SG::ReadHandleKey< McEventCollection > m_resetMcEventCollection

◆ ~TruthClosureCheck()

TruthClosureCheck::~TruthClosureCheck ( )
default

Member Function Documentation

◆ compareGenParticle()

StatusCode TruthClosureCheck::compareGenParticle ( const HepMC::GenParticle & origParticle,
const HepMC::GenParticle & resetParticle ) const
private

Definition at line 327 of file TruthClosureCheck.cxx.

329{
330 bool pass{true};
331 if (HepMC::barcode(origParticle) != HepMC::barcode(resetParticle)) { // FIXME barcode-based
332 ATH_MSG_ERROR ("particle barcode differs! Original: "<<HepMC::barcode(origParticle)<<", Reset: "<<HepMC::barcode(resetParticle));
333 pass &= false;
334 }
335 if (origParticle.status() != resetParticle.status()) {
336 ATH_MSG_ERROR ("particle status differs! Original: "<<origParticle.status()<<", Reset: "<<resetParticle.status());
337 pass &= false;
338 }
339 if (origParticle.pdg_id() != resetParticle.pdg_id()) {
340 ATH_MSG_ERROR ("particle pdg_id differs! Original: "<<origParticle.pdg_id()<<", Reset: "<<resetParticle.pdg_id());
341 pass &= false;
342 }
343 if (compareMomenta(origParticle.momentum(), resetParticle.momentum()).isFailure()) {
344 const HepMC::FourVector& oM = origParticle.momentum();
345 const HepMC::FourVector& rM = resetParticle.momentum();
346 ATH_MSG_DEBUG("particle momentum differs! Original: ("<<oM.x()<<","<<oM.y()<<","<<oM.z()<<","<<oM.t()<<"), Reset: ("<<rM.x()<<","<<rM.y()<<","<<rM.z()<<","<<rM.t()<<")");
347 pass &= false;
348 }
349 if(!pass) { return StatusCode::FAILURE; }
350 return StatusCode::SUCCESS;
351}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_DEBUG(x)
StatusCode compareMomenta(const HepMC::FourVector &origMomenta, const HepMC::FourVector &resetMomenta) const
int barcode(const T *p)
Definition Barcode.h:16

◆ compareGenVertex()

StatusCode TruthClosureCheck::compareGenVertex ( const HepMC::GenVertex & origVertex,
const HepMC::GenVertex & resetVertex ) const
private

Definition at line 202 of file TruthClosureCheck.cxx.

204{
205 bool pass{true};
206
207 if (HepMC::barcode(origVertex) != HepMC::barcode(resetVertex)) { // FIXME HepMC::barcode
208 ATH_MSG_ERROR ("vertex barcode differs! Original: " << HepMC::barcode(origVertex) << ", Reset: " << HepMC::barcode(resetVertex));
209 pass = false;
210 }
211 if (origVertex.position() != resetVertex.position()) {
212 const HepMC::FourVector& oP = origVertex.position();
213 const HepMC::FourVector& rP = resetVertex.position();
214 ATH_MSG_ERROR("vertex position differs! Original: ("<<oP.x()<<","<<oP.y()<<","<<oP.z()<<","<<oP.t()<<"), Reset: ("<<rP.x()<<","<<rP.y()<<","<<rP.z()<<","<<rP.t()<<")");
215 pass = false;
216 }
217 if (origVertex.particles_in_size() != resetVertex.particles_in_size() ) {
218 ATH_MSG_ERROR ("particles_in_size differs! Original: "<<origVertex.particles_in_size()<<", Reset: "<<resetVertex.particles_in_size());
219 pass = false;
220 }
221 if (origVertex.particles_out_size() != resetVertex.particles_out_size() ) {
222 ATH_MSG_ERROR ("particles_out_size differs! Original: "<<origVertex.particles_out_size()<<", Reset: "<<resetVertex.particles_out_size());
223 pass = false;
224 }
225 HepMC::GenVertex::particles_in_const_iterator originalPartInIter(origVertex.particles_in_const_begin());
226 const HepMC::GenVertex::particles_in_const_iterator endOfOriginalListOfParticlesIn(origVertex.particles_in_const_end());
227 HepMC::GenVertex::particles_in_const_iterator resetPartInIter(resetVertex.particles_in_const_begin());
228 const HepMC::GenVertex::particles_in_const_iterator endOfResetListOfParticlesIn(resetVertex.particles_in_const_end());
229 while( originalPartInIter!=endOfOriginalListOfParticlesIn &&
230 resetPartInIter!=endOfResetListOfParticlesIn ) {
231 if (compareGenParticle(**originalPartInIter,**resetPartInIter).isFailure()) {
232 ATH_MSG_ERROR ( "input particle properties differ!" );
233 pass &= false;
234 }
235 ATH_MSG_VERBOSE ( "particles match!" );
236 ++resetPartInIter;
237 ++originalPartInIter;
238 }
239
240 HepMC::GenVertex::particles_out_const_iterator originalPartOutIter(origVertex.particles_out_const_begin());
241 const HepMC::GenVertex::particles_out_const_iterator endOfOriginalListOfParticlesOut(origVertex.particles_out_const_end());
242 // ordering of particles may differ in each case - sigh..
243 const HepMC::GenVertex::particles_out_const_iterator endOfResetListOfParticlesOut(resetVertex.particles_out_const_end());
244 while( originalPartOutIter!=endOfOriginalListOfParticlesOut) {
245 const int barcodeOrig{HepMC::barcode(*originalPartOutIter)}; // FIXME barcode-based
246 HepMC::GenVertex::particles_out_const_iterator resetPartOutIter(resetVertex.particles_out_const_begin());
247 HepMC::GenVertex::particles_in_const_iterator matchingResetParticleIter{endOfResetListOfParticlesOut};
248 while(resetPartOutIter!=endOfResetListOfParticlesOut) {
249 if ( barcodeOrig == HepMC::barcode(*resetPartOutIter) ) {
250 matchingResetParticleIter = resetPartOutIter;
251 break;
252 }
253 ++resetPartOutIter;
254 }
255 if (matchingResetParticleIter==endOfResetListOfParticlesOut ||
256 compareGenParticle(**originalPartOutIter,**matchingResetParticleIter).isFailure()) {
257 ATH_MSG_ERROR ( "output particle properties differ!" );
258 pass &= false;
259 }
260 ATH_MSG_VERBOSE ( "particles match!" );
261 ++originalPartOutIter;
262 }
263
264 if(!pass) { return StatusCode::FAILURE; }
265 return StatusCode::SUCCESS;
266}
#define ATH_MSG_VERBOSE(x)
StatusCode compareGenParticle(const HepMC::GenParticle &origParticle, const HepMC::GenParticle &resetParticle) const

◆ compareMomenta()

StatusCode TruthClosureCheck::compareMomenta ( const HepMC::FourVector & origMomenta,
const HepMC::FourVector & resetMomenta ) const
private

Definition at line 270 of file TruthClosureCheck.cxx.

272{
273 bool pass{true};
274 if (m_compareMomenta) {
275 if (m_momentaLimit<std::abs(origMomenta.px()-resetMomenta.px())) {
276 pass &= false;
277 }
278 if (m_momentaLimit<std::abs(origMomenta.py()-resetMomenta.py())) {
279 pass &= false;
280 }
281 if (m_momentaLimit<std::abs(origMomenta.pz()-resetMomenta.pz())) {
282 pass &= false;
283 }
284 if (m_momentaLimit<std::abs(origMomenta.e()-resetMomenta.e())) {
285 pass &= false;
286 }
287 if(origMomenta != resetMomenta) {
288 ATH_MSG_ERROR ("Exact momenta agreement check failed.");
289 pass &= false;
290 }
291 }
292 if(!pass) { return StatusCode::FAILURE; }
293 return StatusCode::SUCCESS;
294}

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode TruthClosureCheck::execute ( )
finaloverridevirtual

Definition at line 435 of file TruthClosureCheck.cxx.

435 {
436 //-------------------------------------------------
437
438 ATH_MSG_DEBUG( " execute..... " );
439 SG::ReadHandle<McEventCollection> originalMcEventCollection(m_originalMcEventCollection);
440 if (!originalMcEventCollection.isValid()) {
441 ATH_MSG_ERROR("Could not find original McEventCollection called " << originalMcEventCollection.name() << " in store " << originalMcEventCollection.store() << ".");
442 return StatusCode::FAILURE;
443 }
444 const HepMC::GenEvent& originalEvent(**(originalMcEventCollection->begin()));
445
446 if (sanityCheck(originalEvent).isFailure()) {
447 ATH_MSG_FATAL("Problems in original GenEvent - bailing out.");
448 return StatusCode::FAILURE;
449 }
450
451 SG::ReadHandle<McEventCollection> resetMcEventCollection(m_resetMcEventCollection);
452 if (!resetMcEventCollection.isValid()) {
453 ATH_MSG_ERROR("Could not find reset McEventCollection called " << resetMcEventCollection.name() << " in store " << resetMcEventCollection.store() << ".");
454 return StatusCode::FAILURE;
455 }
456 const HepMC::GenEvent& resetEvent(**(resetMcEventCollection->begin()));
457
458 if (sanityCheck(resetEvent).isFailure()) {
459 ATH_MSG_FATAL("Problems in reset GenEvent - bailing out.");
460 return StatusCode::FAILURE;
461 }
462
463 if (originalEvent.event_number() != resetEvent.event_number() ) {
464 ATH_MSG_ERROR ("event_number differs! Original: "<<originalEvent.event_number()<<", Reset: "<<resetEvent.event_number());
465 }
466
467 if (originalEvent.signal_process_id() != resetEvent.signal_process_id() ) {
468 ATH_MSG_ERROR ("signal_process_id differs! Original: "<<originalEvent.signal_process_id()<<", Reset: "<<resetEvent.signal_process_id());
469 }
470
471 if (originalEvent.valid_beam_particles() != resetEvent.valid_beam_particles() ) {
472 ATH_MSG_ERROR ("valid_beam_particles differs! Original: "<<originalEvent.valid_beam_particles()<<", Reset: "<<resetEvent.valid_beam_particles());
473 }
474 else if (originalEvent.valid_beam_particles() && resetEvent.valid_beam_particles()) {
475 std::pair<HepMC::GenParticle*,HepMC::GenParticle*> originalBP = originalEvent.beam_particles();
476 std::pair<HepMC::GenParticle*,HepMC::GenParticle*> resetBP = resetEvent.beam_particles();
477 if ( ( !originalBP.first && resetBP.first ) ||
478 ( originalBP.first && !resetBP.first ) ||
479 ( originalBP.first && resetBP.first && compareGenParticle(*(originalBP.first), *(resetBP.first)).isFailure() ) ) {
480 ATH_MSG_ERROR ( "First beam particle does not match" );
481 }
482 if ( ( !originalBP.second && resetBP.second ) ||
483 ( originalBP.second && !resetBP.second ) ||
484 ( originalBP.second && resetBP.second && compareGenParticle(*(originalBP.second), *(resetBP.second)).isFailure() ) ) {
485 ATH_MSG_ERROR ( "Second beam particle does not match" );
486 }
487
488 if (originalEvent.particles_size() != resetEvent.particles_size() ) {
489 ATH_MSG_ERROR ("particles_size differs! Original: "<<originalEvent.particles_size()<<", Reset: "<<resetEvent.particles_size());
490 }
491
492 if (originalEvent.vertices_size() != resetEvent.vertices_size() ) {
493 ATH_MSG_ERROR ("vertices_size differs! Original: "<<originalEvent.vertices_size()<<", Reset: "<<resetEvent.vertices_size());
494 }
495 }
496
497 //loop over vertices in Background GenEvent
498 HepMC::GenEvent::vertex_const_iterator origVertexIter(originalEvent.vertices_begin());
499 const HepMC::GenEvent::vertex_const_iterator endOfOriginalListOfVertices(originalEvent.vertices_end());
500 HepMC::GenEvent::vertex_const_iterator resetVertexIter(resetEvent.vertices_begin());
501 const HepMC::GenEvent::vertex_const_iterator endOfResetListOfVertices(resetEvent.vertices_end());
502 while( origVertexIter!=endOfOriginalListOfVertices &&
503 resetVertexIter!=endOfResetListOfVertices) {
504 if (compareGenVertex(**origVertexIter,**resetVertexIter).isFailure()) {
505 ATH_MSG_ERROR ( "vertices differ!" );
506 printGenVertex(**origVertexIter,**resetVertexIter);
507 }
508 ++origVertexIter;
509 ++resetVertexIter;
510 }
511 ATH_MSG_INFO( "Completed Truth reset closure check ..... " );
512
513 return StatusCode::SUCCESS;
514
515}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
StatusCode compareGenVertex(const HepMC::GenVertex &origVertex, const HepMC::GenVertex &resetVertex) const
StatusCode sanityCheck(const HepMC::GenEvent &event) const
void printGenVertex(const HepMC::GenVertex &origVertex, const HepMC::GenVertex &resetVertex) const

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ initialize()

StatusCode TruthClosureCheck::initialize ( )
finaloverridevirtual

Definition at line 33 of file TruthClosureCheck.cxx.

33 {
34 //----------------------------------------------------
35
38 return StatusCode::SUCCESS;
39
40}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Algorithm > >::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()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Algorithm >::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< Algorithm > >::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.

◆ printGenVertex()

void TruthClosureCheck::printGenVertex ( const HepMC::GenVertex & origVertex,
const HepMC::GenVertex & resetVertex ) const
private

Definition at line 98 of file TruthClosureCheck.cxx.

100{
101 ATH_MSG_INFO("----------------------------------");
102 ATH_MSG_INFO("Original Vertex:");
103 ATH_MSG_INFO( origVertex );
104 ATH_MSG_INFO("Particles In:");
105 HepMC::GenVertex::particles_in_const_iterator originalPartInIter(origVertex.particles_in_const_begin());
106 const HepMC::GenVertex::particles_in_const_iterator endOfOriginalListOfParticlesIn(origVertex.particles_in_const_end());
107 while( originalPartInIter!=endOfOriginalListOfParticlesIn ) {
108 ATH_MSG_INFO( **originalPartInIter );
109 ++originalPartInIter;
110 }
111 ATH_MSG_INFO("Particles Out:");
112 HepMC::GenVertex::particles_out_const_iterator originalPartOutIter(origVertex.particles_out_const_begin());
113 const HepMC::GenVertex::particles_out_const_iterator endOfOriginalListOfParticlesOut(origVertex.particles_out_const_end());
114 while( originalPartOutIter!=endOfOriginalListOfParticlesOut) {
115 ATH_MSG_INFO( **originalPartOutIter );
116 ++originalPartOutIter;
117 }
118 ATH_MSG_INFO("----------------------------------");
119 ATH_MSG_INFO("Reset Vertex:");
120 ATH_MSG_INFO( resetVertex );
121 ATH_MSG_INFO("Particles In:");
122 HepMC::GenVertex::particles_in_const_iterator resetPartInIter(resetVertex.particles_in_const_begin());
123 const HepMC::GenVertex::particles_in_const_iterator endOfResetListOfParticlesIn(resetVertex.particles_in_const_end());
124 while( resetPartInIter!=endOfResetListOfParticlesIn ) {
125 ATH_MSG_INFO( **resetPartInIter );
126 ++resetPartInIter;
127 }
128 ATH_MSG_INFO("Particles Out:");
129 HepMC::GenVertex::particles_out_const_iterator resetPartOutIter(resetVertex.particles_out_const_begin());
130 const HepMC::GenVertex::particles_out_const_iterator endOfResetListOfParticlesOut(resetVertex.particles_out_const_end());
131 while( resetPartOutIter!=endOfResetListOfParticlesOut) {
132 ATH_MSG_INFO( **resetPartOutIter );
133 ++resetPartOutIter;
134 }
135 ATH_MSG_INFO("----------------------------------");
136 return;
137}

◆ 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< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

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

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sanityCheck()

StatusCode TruthClosureCheck::sanityCheck ( const HepMC::GenEvent & event) const
private

Definition at line 43 of file TruthClosureCheck.cxx.

43 {
44 //Sanity check
45 bool resetProblem(false);
46 for (const auto& particle: event) {
47 if (MC::isStable(particle)) {
48 if (!particle->production_vertex()) {
49 ATH_MSG_ERROR("Stable particle without a production vertex!! " << particle);
50 resetProblem = true;
51 }
52 if (!m_postSimulation && particle->end_vertex()) {
53 ATH_MSG_ERROR("Stable particle with an end vertex!! " << particle);
54 resetProblem = true;
55 }
56 }
57 else if (MC::isDecayed(particle)) {
58 if (!particle->production_vertex()) {
59 ATH_MSG_ERROR("Decayed particle without a production vertex!! " << particle);
60 resetProblem = true;
61 }
62 if (!particle->end_vertex()) {
63 ATH_MSG_ERROR("Decayed particle without an end vertex!! " << particle);
64 resetProblem = true;
65 }
66 }
67 }
68 if (resetProblem) {
69 return StatusCode::FAILURE;
70 }
71
72 return StatusCode::SUCCESS;
73}
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isDecayed(const T &p)
Identify if the particle decayed.
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
#define ATH_MSG_WARNING(x)
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::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< Algorithm > >::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_compareMomenta

bool TruthClosureCheck::m_compareMomenta {true}
private

Definition at line 45 of file TruthClosureCheck.h.

45{true};

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_momentaLimit

double TruthClosureCheck::m_momentaLimit {0.000000000001}
private

Definition at line 46 of file TruthClosureCheck.h.

46{0.000000000001};

◆ m_originalMcEventCollection

SG::ReadHandleKey<McEventCollection> TruthClosureCheck::m_originalMcEventCollection
private

Definition at line 43 of file TruthClosureCheck.h.

◆ m_postSimulation

bool TruthClosureCheck::m_postSimulation {false}
private

Definition at line 47 of file TruthClosureCheck.h.

47{false};

◆ m_resetMcEventCollection

SG::ReadHandleKey<McEventCollection> TruthClosureCheck::m_resetMcEventCollection
private

Definition at line 44 of file TruthClosureCheck.h.

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: