ATLAS Offline Software
Loading...
Searching...
No Matches
TruthSvc.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ISF_SERVICES_TRUTHSVC_H
6#define ISF_SERVICES_TRUTHSVC_H 1
7
8// STL includes
9#include <string>
10
11// FrameWork includes
12#include "GaudiKernel/ToolHandle.h"
13#include "GaudiKernel/ServiceHandle.h"
15
16// ISF include
20
21// DetectorDescription
23
24// Barcode
26
27// McEventCollection
29
30// forward declarations
31class StoreGateSvc;
32
35
36namespace ISFTesting {
37 class TruthSvc_test;
38}
39
40namespace ISF {
41
50 class TruthSvc final : public extends<AthService, ITruthSvc> {
51
52 // allow test to access private data
53 friend ISFTesting::TruthSvc_test;
54
55 public:
56
57 //** Constructor with parameters */
58 TruthSvc( const std::string& name, ISvcLocator* pSvcLocator );
59
61 virtual ~TruthSvc() = default;
62
64 StatusCode initialize() override;
66 StatusCode finalize() override;
67
69 void registerTruthIncident( ITruthIncident& truthincident, bool saveAllChildren=false) const override;
70
72 StatusCode initializeTruthCollection(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override;
73
75 StatusCode releaseEvent() override;
76
77 private:
79 void recordIncidentToMCTruth( ITruthIncident& truthincident, bool passWholeVertex) const;
82
83 ServiceHandle<Barcode::IBarcodeSvc> m_barcodeSvc{this, "BarcodeSvc", "BarcodeSvc", ""};
84
86 ToolHandleArray<ITruthStrategy> m_truthStrategies{this, "TruthStrategies", {}, ""};
90
92 Gaudi::Property<bool> m_skipIfNoChildren{this, "SkipIfNoChildren", true, ""};
93 Gaudi::Property<bool> m_skipIfNoParentId{this, "SkipIfNoParentId", true, ""};
94 Gaudi::Property<bool> m_ignoreUndefinedBarcodes{this, "IgnoreUndefinedBarcodes", false, ""};
95
96 Gaudi::Property<bool> m_passWholeVertex{this, "PassWholeVertices", true, ""};
97
98 Gaudi::Property<std::vector<unsigned int> > m_forceEndVtxRegionsVec{this, "ForceEndVtxInRegions", {}, ""};
99 // to write end-vtx
100 std::array<bool, AtlasDetDescr::fNumAtlasRegions> m_forceEndVtx{};
101 // all parent particles if they die
102
103 Gaudi::Property<bool> m_quasiStableParticlesIncluded{this, "QuasiStableParticlesIncluded", false, ""};
104 Gaudi::Property<bool> m_quasiStableParticleOverwrite{this, "QuasiStableParticleOverwrite", true, ""};
105
106 };
107}
108
109
110#endif //> !ISF_SERVICES_TRUTHSVC_H
ISF interface class for TruthIncidents.
StatusCode initializeTruthCollection(int largestGeneratedParticleBC=0, int largestGeneratedVertexBC=0) override
Initialize the Truth Svc at the beginning of each event.
Definition TruthSvc.cxx:113
Gaudi::Property< bool > m_passWholeVertex
Definition TruthSvc.h:96
ServiceHandle< Barcode::IBarcodeSvc > m_barcodeSvc
The Barcode service.
Definition TruthSvc.h:83
void registerTruthIncident(ITruthIncident &truthincident, bool saveAllChildren=false) const override
Register a truth incident.
Definition TruthSvc.cxx:125
unsigned short m_numStrategies[AtlasDetDescr::fNumAtlasRegions]
Definition TruthSvc.h:89
virtual ~TruthSvc()=default
Destructor.
HepMC::GenVertexPtr createGenVertexFromTruthIncident(ITruthIncident &truthincident) const
Record and end vertex to the MC Truth for the parent particle.
Definition TruthSvc.cxx:300
Gaudi::Property< std::vector< unsigned int > > m_forceEndVtxRegionsVec
property containing AtlasRegions for which
Definition TruthSvc.h:98
StatusCode finalize() override
Athena algorithm's interface method finalize()
Definition TruthSvc.cxx:105
StatusCode releaseEvent() override
Finalize the Truth Svc at the end of each event.
Definition TruthSvc.cxx:119
TruthSvc(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition TruthSvc.cxx:49
Gaudi::Property< bool > m_quasiStableParticleOverwrite
should the job be overwriting QS particles
Definition TruthSvc.h:104
void recordIncidentToMCTruth(ITruthIncident &truthincident, bool passWholeVertex) const
Record the given truth incident to the MC Truth.
Definition TruthSvc.cxx:199
Gaudi::Property< bool > m_quasiStableParticlesIncluded
does this job simulate quasi-stable particles.
Definition TruthSvc.h:103
Gaudi::Property< bool > m_skipIfNoChildren
MCTruth steering.
Definition TruthSvc.h:92
ITruthStrategy ** m_geoStrategies[AtlasDetDescr::fNumAtlasRegions]
for faster access: using an internal pointer to the actual ITruthStrategy instances
Definition TruthSvc.h:88
ToolHandleArray< ITruthStrategy > m_truthStrategies
the truth strategies applied (as AthenaToolHandle Array)
Definition TruthSvc.h:86
Gaudi::Property< bool > m_ignoreUndefinedBarcodes
do/don't abort if retrieve an undefined barcode
Definition TruthSvc.h:94
std::array< bool, AtlasDetDescr::fNumAtlasRegions > m_forceEndVtx
attach end vertex to
Definition TruthSvc.h:100
StatusCode initialize() override
Athena algorithm's interface method initialize()
Definition TruthSvc.cxx:57
Gaudi::Property< bool > m_skipIfNoParentId
do not record if parentId == HepMC::UNDEFINED_ID
Definition TruthSvc.h:93
The Athena Transient Store API.
HepMC::GenVertex * GenVertexPtr
Definition GenVertex.h:59
Core Athena algorithm for the Integrated Simulation Framework.
ISFParticleOrderedQueue.