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

#include <TruthClosureCheck.h>

Inheritance diagram for TruthClosureCheck:
Collaboration diagram for TruthClosureCheck:

Public Member Functions

virtual StatusCode initialize () override final
virtual StatusCode execute (const EventContext &ctx) const override final
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual unsigned int cardinality () const override
 Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
virtual void setFilterPassed (bool state, const EventContext &ctx) const
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 {this, "OriginalMcEventCollection" , "BeamTruthEvent"}
SG::ReadHandleKey< McEventCollectionm_resetMcEventCollection {this, "ResetMcEventCollection" , "NewTruthEvent"}
Gaudi::Property< bool > m_compareMomenta {this, "CompareMomenta", true}
double m_momentaLimit {0.000000000001}
Gaudi::Property< bool > m_postSimulation {this, "PostSimulation", false}
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
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< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Member Function Documentation

◆ cardinality()

unsigned int AthCommonReentrantAlgorithm< Gaudi::Algorithm >::cardinality ( ) const
overridevirtualinherited

Cardinality (Maximum number of clones that can exist) special value 0 means that algorithm is reentrant.

Override this to return 0 for reentrant algorithms.

Definition at line 75 of file AthCommonReentrantAlgorithm.cxx.

64{
65 return 0;
66}

◆ compareGenParticle()

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

Definition at line 317 of file TruthClosureCheck.cxx.

319{
320 bool pass{true};
321 if (HepMC::barcode(origParticle) != HepMC::barcode(resetParticle)) { // FIXME barcode-based
322 ATH_MSG_ERROR ("particle barcode differs! Original: "<<HepMC::barcode(origParticle)<<", Reset: "<<HepMC::barcode(resetParticle));
323 pass &= false;
324 }
325 if (origParticle.status() != resetParticle.status()) {
326 ATH_MSG_ERROR ("particle status differs! Original: "<<origParticle.status()<<", Reset: "<<resetParticle.status());
327 pass &= false;
328 }
329 if (origParticle.pdg_id() != resetParticle.pdg_id()) {
330 ATH_MSG_ERROR ("particle pdg_id differs! Original: "<<origParticle.pdg_id()<<", Reset: "<<resetParticle.pdg_id());
331 pass &= false;
332 }
333 if (compareMomenta(origParticle.momentum(), resetParticle.momentum()).isFailure()) {
334 const HepMC::FourVector& oM = origParticle.momentum();
335 const HepMC::FourVector& rM = resetParticle.momentum();
336 ATH_MSG_DEBUG("particle momentum differs! Original: ("<<oM.x()<<","<<oM.y()<<","<<oM.z()<<","<<oM.t()<<"), Reset: ("<<rM.x()<<","<<rM.y()<<","<<rM.z()<<","<<rM.t()<<")");
337 pass &= false;
338 }
339 if(!pass) { return StatusCode::FAILURE; }
340 return StatusCode::SUCCESS;
341}
#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 192 of file TruthClosureCheck.cxx.

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

262{
263 bool pass{true};
264 if (m_compareMomenta) {
265 if (m_momentaLimit<std::abs(origMomenta.px()-resetMomenta.px())) {
266 pass &= false;
267 }
268 if (m_momentaLimit<std::abs(origMomenta.py()-resetMomenta.py())) {
269 pass &= false;
270 }
271 if (m_momentaLimit<std::abs(origMomenta.pz()-resetMomenta.pz())) {
272 pass &= false;
273 }
274 if (m_momentaLimit<std::abs(origMomenta.e()-resetMomenta.e())) {
275 pass &= false;
276 }
277 if(origMomenta != resetMomenta) {
278 ATH_MSG_ERROR ("Exact momenta agreement check failed.");
279 pass &= false;
280 }
281 }
282 if(!pass) { return StatusCode::FAILURE; }
283 return StatusCode::SUCCESS;
284}
Gaudi::Property< bool > m_compareMomenta

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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< Gaudi::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 ( const EventContext & ctx) const
finaloverridevirtual

Definition at line 425 of file TruthClosureCheck.cxx.

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

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::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 & AthCommonReentrantAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 94 of file AthCommonReentrantAlgorithm.cxx.

90{
91 // If we didn't find any symlinks to add, just return the collection
92 // from the base class. Otherwise, return the extended collection.
93 if (!m_extendedExtraObjects.empty()) {
95 }
97}
An algorithm that can be simultaneously executed in multiple threads.

◆ filterPassed()

virtual bool AthCommonReentrantAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Definition at line 96 of file AthCommonReentrantAlgorithm.h.

96 {
97 return execState( ctx ).filterPassed();
98 }
virtual bool filterPassed(const EventContext &ctx) const

◆ initialize()

StatusCode TruthClosureCheck::initialize ( )
finaloverridevirtual

Definition at line 23 of file TruthClosureCheck.cxx.

23 {
24 //----------------------------------------------------
25
28 return StatusCode::SUCCESS;
29
30}
#define ATH_CHECK
Evaluate an expression and check for errors.

◆ inputHandles()

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

◆ isClonable()

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::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< Gaudi::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 88 of file TruthClosureCheck.cxx.

90{
91 ATH_MSG_INFO("----------------------------------");
92 ATH_MSG_INFO("Original Vertex:");
93 ATH_MSG_INFO( origVertex );
94 ATH_MSG_INFO("Particles In:");
95 HepMC::GenVertex::particles_in_const_iterator originalPartInIter(origVertex.particles_in_const_begin());
96 const HepMC::GenVertex::particles_in_const_iterator endOfOriginalListOfParticlesIn(origVertex.particles_in_const_end());
97 while( originalPartInIter!=endOfOriginalListOfParticlesIn ) {
98 ATH_MSG_INFO( **originalPartInIter );
99 ++originalPartInIter;
100 }
101 ATH_MSG_INFO("Particles Out:");
102 HepMC::GenVertex::particles_out_const_iterator originalPartOutIter(origVertex.particles_out_const_begin());
103 const HepMC::GenVertex::particles_out_const_iterator endOfOriginalListOfParticlesOut(origVertex.particles_out_const_end());
104 while( originalPartOutIter!=endOfOriginalListOfParticlesOut) {
105 ATH_MSG_INFO( **originalPartOutIter );
106 ++originalPartOutIter;
107 }
108 ATH_MSG_INFO("----------------------------------");
109 ATH_MSG_INFO("Reset Vertex:");
110 ATH_MSG_INFO( resetVertex );
111 ATH_MSG_INFO("Particles In:");
112 HepMC::GenVertex::particles_in_const_iterator resetPartInIter(resetVertex.particles_in_const_begin());
113 const HepMC::GenVertex::particles_in_const_iterator endOfResetListOfParticlesIn(resetVertex.particles_in_const_end());
114 while( resetPartInIter!=endOfResetListOfParticlesIn ) {
115 ATH_MSG_INFO( **resetPartInIter );
116 ++resetPartInIter;
117 }
118 ATH_MSG_INFO("Particles Out:");
119 HepMC::GenVertex::particles_out_const_iterator resetPartOutIter(resetVertex.particles_out_const_begin());
120 const HepMC::GenVertex::particles_out_const_iterator endOfResetListOfParticlesOut(resetVertex.particles_out_const_end());
121 while( resetPartOutIter!=endOfResetListOfParticlesOut) {
122 ATH_MSG_INFO( **resetPartOutIter );
123 ++resetPartOutIter;
124 }
125 ATH_MSG_INFO("----------------------------------");
126 return;
127}

◆ 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< Gaudi::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< Gaudi::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 33 of file TruthClosureCheck.cxx.

33 {
34 //Sanity check
35 bool resetProblem(false);
36 for (const auto& particle: event) {
37 if (MC::isStable(particle)) {
38 if (!particle->production_vertex()) {
39 ATH_MSG_ERROR("Stable particle without a production vertex!! " << particle);
40 resetProblem = true;
41 }
42 if (!m_postSimulation && particle->end_vertex()) {
43 ATH_MSG_ERROR("Stable particle with an end vertex!! " << particle);
44 resetProblem = true;
45 }
46 }
47 else if (MC::isDecayed(particle)) {
48 if (!particle->production_vertex()) {
49 ATH_MSG_ERROR("Decayed particle without a production vertex!! " << particle);
50 resetProblem = true;
51 }
52 if (!particle->end_vertex()) {
53 ATH_MSG_ERROR("Decayed particle without an end vertex!! " << particle);
54 resetProblem = true;
55 }
56 }
57 }
58 if (resetProblem) {
59 return StatusCode::FAILURE;
60 }
61
62 return StatusCode::SUCCESS;
63}
Gaudi::Property< bool > m_postSimulation
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

◆ setFilterPassed()

virtual void AthCommonReentrantAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Definition at line 100 of file AthCommonReentrantAlgorithm.h.

100 {
102 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const

◆ sysExecute()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Definition at line 85 of file AthCommonReentrantAlgorithm.cxx.

77{
78 return BaseAlg::sysExecute (ctx);
79}

◆ sysInitialize()

StatusCode AthCommonReentrantAlgorithm< Gaudi::Algorithm >::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< Gaudi::Algorithm > >.

Reimplemented in HypoBase, and InputMakerBase.

Definition at line 61 of file AthCommonReentrantAlgorithm.cxx.

107 {
109
110 if (sc.isFailure()) {
111 return sc;
112 }
113
114 ServiceHandle<ICondSvc> cs("CondSvc",name());
115 for (auto h : outputHandles()) {
116 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
117 // do this inside the loop so we don't create the CondSvc until needed
118 if ( cs.retrieve().isFailure() ) {
119 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
120 return StatusCode::SUCCESS;
121 }
122 if (cs->regHandle(this,*h).isFailure()) {
124 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
125 << " with CondSvc");
126 }
127 }
128 }
129 return sc;
130}
#define ATH_MSG_WARNING(x)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::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 }

Member Data Documentation

◆ m_compareMomenta

Gaudi::Property<bool> TruthClosureCheck::m_compareMomenta {this, "CompareMomenta", true}
private

Definition at line 44 of file TruthClosureCheck.h.

44{this, "CompareMomenta", true};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::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< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonReentrantAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 114 of file AthCommonReentrantAlgorithm.h.

◆ m_momentaLimit

double TruthClosureCheck::m_momentaLimit {0.000000000001}
private

Definition at line 45 of file TruthClosureCheck.h.

45{0.000000000001};

◆ m_originalMcEventCollection

SG::ReadHandleKey<McEventCollection> TruthClosureCheck::m_originalMcEventCollection {this, "OriginalMcEventCollection" , "BeamTruthEvent"}
private

Definition at line 42 of file TruthClosureCheck.h.

42{this, "OriginalMcEventCollection" , "BeamTruthEvent"};

◆ m_postSimulation

Gaudi::Property<bool> TruthClosureCheck::m_postSimulation {this, "PostSimulation", false}
private

Definition at line 46 of file TruthClosureCheck.h.

46{this, "PostSimulation", false};

◆ m_resetMcEventCollection

SG::ReadHandleKey<McEventCollection> TruthClosureCheck::m_resetMcEventCollection {this, "ResetMcEventCollection" , "NewTruthEvent"}
private

Definition at line 43 of file TruthClosureCheck.h.

43{this, "ResetMcEventCollection" , "NewTruthEvent"};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


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