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::ConstGenVertexPtr &origVertex, const HepMC::ConstGenVertexPtr &resetVertex) const
StatusCode compareGenParticle (const HepMC::ConstGenParticlePtr &origParticle, const HepMC::ConstGenParticlePtr &resetParticle) const
void printGenVertex (const HepMC::ConstGenVertexPtr &origVertex, const HepMC::ConstGenVertexPtr &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.

62{
63 return 0;
64}

◆ compareGenParticle()

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

Definition at line 174 of file TruthClosureCheck.cxx.

176{
177 if (!origParticle && !resetParticle) return StatusCode::SUCCESS;
178 if (!origParticle || !resetParticle) return StatusCode::FAILURE;
179
180 bool pass{true};
181 if (HepMC::barcode(origParticle) != HepMC::barcode(resetParticle)) { // FIXME barcode-based
182 ATH_MSG_ERROR ("particle barcode differs! Original: "<<HepMC::barcode(origParticle)<<", Reset: "<<HepMC::barcode(resetParticle));
183 pass &= false;
184 }
185 if (origParticle->status() != resetParticle->status()) {
186 ATH_MSG_ERROR ("particle status differs! Original: "<<origParticle->status()<<", Reset: "<<resetParticle->status());
187 pass &= false;
188 }
189 if (origParticle->pdg_id() != resetParticle->pdg_id()) {
190 ATH_MSG_ERROR ("particle pdg_id differs! Original: "<<origParticle->pdg_id()<<", Reset: "<<resetParticle->pdg_id());
191 pass &= false;
192 }
193 if (compareMomenta(origParticle->momentum(), resetParticle->momentum()).isFailure()) {
194 const HepMC::FourVector& oM = origParticle->momentum();
195 const HepMC::FourVector& rM = resetParticle->momentum();
196 ATH_MSG_DEBUG("particle momentum differs! Original: ("<<oM.x()<<","<<oM.y()<<","<<oM.z()<<","<<oM.t()<<"), Reset: ("<<rM.x()<<","<<rM.y()<<","<<rM.z()<<","<<rM.t()<<")");
197 pass &= false;
198 }
199 if(!pass) { return StatusCode::FAILURE; }
200 return StatusCode::SUCCESS;
201}
#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:15
HepMC3::FourVector FourVector

◆ compareGenVertex()

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

Definition at line 86 of file TruthClosureCheck.cxx.

88{
89 if (!origVertex && !resetVertex) return StatusCode::SUCCESS;
90 if (!origVertex || !resetVertex) return StatusCode::FAILURE;
91 bool pass{true};
92
93 if (HepMC::barcode(origVertex) != HepMC::barcode(resetVertex)) { // FIXME barcode-based
94 ATH_MSG_ERROR ("vertex barcode differs! Original: "<<HepMC::barcode(origVertex)<<", Reset: "<<HepMC::barcode(resetVertex));
95 pass = false;
96 }
97 if (origVertex->position() != resetVertex->position()) {
98 const HepMC::FourVector& oP = origVertex->position();
99 const HepMC::FourVector& rP = resetVertex->position();
100 ATH_MSG_ERROR("vertex position differs! Original: ("<<oP.x()<<","<<oP.y()<<","<<oP.z()<<","<<oP.t()<<"), Reset: ("<<rP.x()<<","<<rP.y()<<","<<rP.z()<<","<<rP.t()<<")");
101 pass = false;
102 }
103 if (origVertex->particles_in().size() != resetVertex->particles_in().size() ) {
104 ATH_MSG_ERROR ("particles_in_size differs! Original: "<<origVertex->particles_in().size()<<", Reset: "<<resetVertex->particles_in().size());
105 pass = false;
106 }
107 if (origVertex->particles_out().size() != resetVertex->particles_out().size() ) {
108 ATH_MSG_ERROR ("particles_out_size differs! Original: "<<origVertex->particles_out().size()<<", Reset: "<<resetVertex->particles_out().size());
109 pass = false;
110 }
111 std::vector<HepMC::ConstGenParticlePtr> OriginalListOfParticlesIn = origVertex->particles_in();
112 std::vector<HepMC::ConstGenParticlePtr> ResetListOfParticlesIn = resetVertex->particles_in();
113 for ( std::vector<HepMC::ConstGenParticlePtr>::iterator originalPartInIter(OriginalListOfParticlesIn.begin()),resetPartInIter(ResetListOfParticlesIn.begin());
114 originalPartInIter != OriginalListOfParticlesIn.end() && resetPartInIter != ResetListOfParticlesIn.end();
115 ++originalPartInIter, ++resetPartInIter
116 ) {
117 if (compareGenParticle(*originalPartInIter,*resetPartInIter).isFailure()) {
118 ATH_MSG_ERROR ( "input particle properties differ!" );
119 pass &= false;
120 }
121 ATH_MSG_VERBOSE ( "particles match!" );
122 }
123
124
125 std::vector<HepMC::ConstGenParticlePtr> OriginalListOfParticlesOut = origVertex->particles_out();
126 std::vector<HepMC::ConstGenParticlePtr> ResetListOfParticlesOut = resetVertex->particles_out();
127 //AV: please remember that the best quantities to compare particles are physical quantities.
128 std::sort(OriginalListOfParticlesOut.begin(), OriginalListOfParticlesOut.end(), [](auto& a, auto& b) -> bool{return a->momentum().pz() > b->momentum().pz(); });
129 std::sort(ResetListOfParticlesOut.begin(), ResetListOfParticlesOut.end(), [](auto& a, auto& b) -> bool{return a->momentum().pz() > b->momentum().pz(); });
130
131 for ( std::vector<HepMC::ConstGenParticlePtr>::iterator originalPartOutIter(OriginalListOfParticlesOut.begin()), resetPartOutIter(ResetListOfParticlesOut.begin());
132 originalPartOutIter != OriginalListOfParticlesOut.end() && resetPartOutIter != ResetListOfParticlesOut.end();
133 ++originalPartOutIter, ++resetPartOutIter
134 ) {
135 if (compareGenParticle(*originalPartOutIter,*resetPartOutIter).isFailure()) {
136 ATH_MSG_ERROR ( "output particle properties differ!" );
137 pass &= false;
138 }
139 ATH_MSG_VERBOSE ( "particles match!" );
140 }
141 if(!pass) { return StatusCode::FAILURE; }
142 return StatusCode::SUCCESS;
143}
#define ATH_MSG_VERBOSE(x)
static Double_t a
StatusCode compareGenParticle(const HepMC::ConstGenParticlePtr &origParticle, const HepMC::ConstGenParticlePtr &resetParticle) const
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.

◆ compareMomenta()

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

Definition at line 148 of file TruthClosureCheck.cxx.

150{
151 bool pass{true};
152 if (m_compareMomenta) {
153 if (m_momentaLimit<std::abs(origMomenta.px()-resetMomenta.px())) {
154 pass &= false;
155 }
156 if (m_momentaLimit<std::abs(origMomenta.py()-resetMomenta.py())) {
157 pass &= false;
158 }
159 if (m_momentaLimit<std::abs(origMomenta.pz()-resetMomenta.pz())) {
160 pass &= false;
161 }
162 if (m_momentaLimit<std::abs(origMomenta.e()-resetMomenta.e())) {
163 pass &= false;
164 }
165 if(origMomenta != resetMomenta) {
166 ATH_MSG_ERROR ("Exact momenta agreement check failed.");
167 pass &= false;
168 }
169 }
170 if(!pass) { return StatusCode::FAILURE; }
171 return StatusCode::SUCCESS;
172}
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 205 of file TruthClosureCheck.cxx.

205 {
206 //-------------------------------------------------
207
208 ATH_MSG_DEBUG( " execute..... " );
209 SG::ReadHandle<McEventCollection> originalMcEventCollection(m_originalMcEventCollection, ctx);
210 if (!originalMcEventCollection.isValid()) {
211 ATH_MSG_ERROR("Could not find original McEventCollection called " << originalMcEventCollection.name() << " in store " << originalMcEventCollection.store() << ".");
212 return StatusCode::FAILURE;
213 }
214 const HepMC::GenEvent& originalEvent(**(originalMcEventCollection->begin()));
215
216 if (sanityCheck(originalEvent).isFailure()) {
217 ATH_MSG_FATAL("Problems in original GenEvent - bailing out.");
218 return StatusCode::FAILURE;
219 }
220
221 SG::ReadHandle<McEventCollection> resetMcEventCollection(m_resetMcEventCollection,ctx);
222 if (!resetMcEventCollection.isValid()) {
223 ATH_MSG_ERROR("Could not find reset McEventCollection called " << resetMcEventCollection.name() << " in store " << resetMcEventCollection.store() << ".");
224 return StatusCode::FAILURE;
225 }
226 const HepMC::GenEvent& resetEvent(**(resetMcEventCollection->begin()));
227
228 if (sanityCheck(resetEvent).isFailure()) {
229 ATH_MSG_FATAL("Problems in reset GenEvent - bailing out.");
230 return StatusCode::FAILURE;
231 }
232
233 if (originalEvent.event_number() != resetEvent.event_number() ) {
234 ATH_MSG_ERROR ("event_number differs! Original: "<<originalEvent.event_number()<<", Reset: "<<resetEvent.event_number());
235 }
236
237 if (HepMC::signal_process_id(originalEvent) != HepMC::signal_process_id(resetEvent) ) {
238 ATH_MSG_ERROR ("signal_process_id differs! Original: "<<HepMC::signal_process_id(originalEvent)<<", Reset: "<<HepMC::signal_process_id(resetEvent));
239 }
241 std::vector<HepMC::ConstGenParticlePtr> OriginalBeams = originalEvent.beams();
242 std::vector<HepMC::ConstGenParticlePtr> ResetBeams = resetEvent.beams();
243
244 for ( std::vector<HepMC::ConstGenParticlePtr>::iterator originalBeamIter(OriginalBeams.begin()), resetBeamIter(ResetBeams.begin());
245 originalBeamIter != OriginalBeams.end() && resetBeamIter != ResetBeams.end();
246 ++originalBeamIter, ++resetBeamIter
247 ) {
248 if (compareGenParticle(*originalBeamIter,*resetBeamIter).isFailure()) {
249 ATH_MSG_ERROR ( "Beam particle properties differ!" );
250 }
252 if (originalEvent.particles().size() != resetEvent.particles().size() ) {
253 ATH_MSG_ERROR ("particles_size differs! Original: "<<originalEvent.particles().size()<<", Reset: "<<resetEvent.particles().size());
254 }
255
256 if (originalEvent.vertices().size() != resetEvent.vertices().size() ) {
257 ATH_MSG_ERROR ("vertices_size differs! Original: "<<originalEvent.vertices().size()<<", Reset: "<<resetEvent.vertices().size());
258 }
259 }
260
261 //loop over vertices in Background GenEvent
262 std::vector<HepMC::ConstGenVertexPtr> OriginalListOfVertices = originalEvent.vertices();
263 std::vector<HepMC::ConstGenVertexPtr> ResetListOfVertices = resetEvent.vertices();
264
265 for( std::vector<HepMC::ConstGenVertexPtr>::iterator origVertexIter(OriginalListOfVertices.begin()),resetVertexIter(ResetListOfVertices.begin());
266 origVertexIter != OriginalListOfVertices.end() && resetVertexIter != ResetListOfVertices.end();
267 ++origVertexIter, ++resetVertexIter
268 ) {
269 if (compareGenVertex(*origVertexIter,*resetVertexIter).isFailure()) {
270 ATH_MSG_ERROR ( "vertices differ!" );
271 printGenVertex(*origVertexIter,*resetVertexIter);
272 }
273 }
274 ATH_MSG_INFO( "Completed Truth reset closure check ..... " );
275
276 return StatusCode::SUCCESS;
277
278}
#define ATH_MSG_FATAL(x)
#define ATH_MSG_INFO(x)
StatusCode compareGenVertex(const HepMC::ConstGenVertexPtr &origVertex, const HepMC::ConstGenVertexPtr &resetVertex) const
SG::ReadHandleKey< McEventCollection > m_originalMcEventCollection
void printGenVertex(const HepMC::ConstGenVertexPtr &origVertex, const HepMC::ConstGenVertexPtr &resetVertex) const
StatusCode sanityCheck(const HepMC::GenEvent &event) const
SG::ReadHandleKey< McEventCollection > m_resetMcEventCollection
int signal_process_id(const GenEvent &evt)
Definition GenEvent.h:572
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39

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

88{
89 // If we didn't find any symlinks to add, just return the collection
90 // from the base class. Otherwise, return the extended collection.
91 if (!m_extendedExtraObjects.empty()) {
93 }
95}
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::ConstGenVertexPtr & origVertex,
const HepMC::ConstGenVertexPtr & resetVertex ) const
private

Definition at line 65 of file TruthClosureCheck.cxx.

67{
68 ATH_MSG_INFO("----------------------------------");
69 ATH_MSG_INFO("Original Vertex:");
70 ATH_MSG_INFO( origVertex );
71 ATH_MSG_INFO("Particles In:");
72 for (const auto& originalPartIn: origVertex->particles_in()) ATH_MSG_INFO( originalPartIn );
73 ATH_MSG_INFO("Particles Out:");
74 for (const auto& originalPartOut: origVertex->particles_out()) ATH_MSG_INFO( originalPartOut );
75 ATH_MSG_INFO("----------------------------------");
76 ATH_MSG_INFO("Reset Vertex:");
77 ATH_MSG_INFO( resetVertex );
78 ATH_MSG_INFO("Particles In:");
79 for (const auto& resetPartIn: resetVertex->particles_in()) ATH_MSG_INFO( resetPartIn );
80 ATH_MSG_INFO("Particles Out:");
81 for (const auto& resetPartOut: resetVertex->particles_out()) ATH_MSG_INFO( resetPartOut );
82 ATH_MSG_INFO("----------------------------------");
83 return;
84}

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

75{
76 return BaseAlg::sysExecute (ctx);
77}

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

105 {
107
108 if (sc.isFailure()) {
109 return sc;
110 }
111
112 ServiceHandle<ICondSvc> cs("CondSvc",name());
113 for (auto h : outputHandles()) {
114 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
115 // do this inside the loop so we don't create the CondSvc until needed
116 if ( cs.retrieve().isFailure() ) {
117 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
118 return StatusCode::SUCCESS;
119 }
120 if (cs->regHandle(this,*h).isFailure()) {
122 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
123 << " with CondSvc");
124 }
125 }
126 }
127 return sc;
128}
#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 35 of file TruthClosureCheck.h.

35{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 36 of file TruthClosureCheck.h.

36{0.000000000001};

◆ m_originalMcEventCollection

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

Definition at line 33 of file TruthClosureCheck.h.

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

◆ m_postSimulation

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

Definition at line 37 of file TruthClosureCheck.h.

37{this, "PostSimulation", false};

◆ m_resetMcEventCollection

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

Definition at line 34 of file TruthClosureCheck.h.

34{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: