ATLAS Offline Software
Loading...
Searching...
No Matches
ParticleBrokerDynamicOnReadIn.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ISF_SERVICES_PARTICLEBROKERDYNAMICONREADIN_H
6#define ISF_SERVICES_PARTICLEBROKERDYNAMICONREADIN_H 1
7
8// STL includes
9#include <string>
10#include <set>
11
12// FrameWork includes
13#include "GaudiKernel/ToolHandle.h"
14#include "GaudiKernel/ServiceHandle.h"
16#include "GaudiKernel/ITHistSvc.h"
17
18// ISF includes
27
28// AtlasDetDescr
30
31// forward declarations
32namespace PMonUtils {
33 class CustomBenchmark;
34}
35// ROOT forward declarations
36class TTree;
37
38namespace ISF {
39
41
42 typedef std::vector<ISimulationSelector*> SimSelectorArray;
43 typedef std::set<ISimulationSelector*> SimSelectorSet;
44
53 class ATLAS_NOT_THREAD_SAFE ParticleBrokerDynamicOnReadIn : public extends<AthService, IParticleBroker> {
54 public:
55
56 //** Constructor with parameters */
57 ParticleBrokerDynamicOnReadIn( const std::string& name, ISvcLocator* pSvcLocator );
58
61
63 StatusCode initialize();
64
66 StatusCode initializeEvent(ISFParticleContainer&& simParticles);
67
69 virtual StatusCode finalizeEvent();
70
74 virtual void push( ISFParticle *particle, const ISFParticle *ancestor);
75
77 virtual const ISFParticleVector& popVector(size_t maxVectorSize);
78
80 virtual size_t numParticles() const;
81
83 //const ParticleContainer& particleStack() const;
84
85 /* Dump the stack to the screen */
86 StatusCode dump() const;
87
89 StatusCode registerSimSelector(SimSelectorToolArray &simSelectorTools, AtlasDetDescr::AtlasRegion geoID);
90
91 private:
94
96 StatusCode registerPosValTree( const char *treeName,
97 const char *treeDescr,
98 TTree *&tree );
99
101 void fillPosValTree( TTree *tree, const ISFParticle &particle);
102
104 void updateAllSelectors(const ISFParticle &particle);
105
108 void selectAndStore( ISFParticle* p);
109
113
115 PublicToolHandle<IEntryLayerTool> m_entryLayerTool{this, "EntryLayerTool", "iGeant4::EntryLayerTool/ISF_EntryLayerTool"};
116
118 PublicToolHandle<IParticleOrderingTool> m_orderingTool{this, "ParticleOrderingTool", ""};
119
124
126 BooleanProperty m_forceGeoIDSvc{this, "AlwaysUseGeoIDSvc", false};
127
129 BooleanProperty m_validateGeoID{this, "ValidateGeoIDs", false};
130
133
136
140
142 std::string m_screenOutputPrefix{"isf >> "};
143 std::string m_screenEmptyPrefix{""};
144
146 BooleanProperty m_doSelectorCPUMon{this, "SimSelectorCPUMonitoring", false};
149
151 BooleanProperty m_validationOutput{this, "ValidationOutput", false, "If turned on, write out a ROOT tree."};
152 ServiceHandle<ITHistSvc> m_thistSvc{this, "THistService", "THistSvc"};
153 StringProperty m_validationStream{this, "ValidationStreamName", "ParticleBroker"};
158 int m_val_pdg{0};
159 float m_val_p{0.f};
160 float m_val_x{0.f};
161 float m_val_y{0.f};
162 float m_val_z{0.f};
163 };
164
166 inline size_t ParticleBrokerDynamicOnReadIn::numParticles() const { return m_particles.size(); }
167
169 /* inline const ParticleContainer& ParticleBrokerDynamicOnReadIn::particleStack() const
170 {
171 // @TODO:
172 //ATH_MSG_WARNING("TODO: the ParticleBrokerDynamicOnReadIn::particleStack() method only returns the active part of the partilce stack");
173 return m_activeStack;
174 } */
175
176}
177
178#endif //> !ISF_SERVICES_PARTICLEBROKERDYNAMICONREADIN_H
#define ATLAS_NOT_THREAD_SAFE
getNoisyStrip() Find noisy strips from hitmaps and write out into xml/db formats
The interface to chose between the sub geometry services, realized as an AlgTool since it does not ha...
Definition IGeoIDSvc.h:41
The generic ISF particle definition,.
Definition ISFParticle.h:42
virtual StatusCode finalizeEvent()
Finalize the event in the broker service.
void selectAndStore(ISFParticle *p)
go through the chain of SimulationSelectors and let the first one which selects the particle decide w...
StatusCode registerPosValTree(const char *treeName, const char *treeDescr, TTree *&tree)
setup the ROOT TTrees for THistSvc in validation mode
SimSelectorArray m_simSelector[AtlasDetDescr::fNumAtlasRegions]
the simulation selectors per geoID (the actual routing chain)
int m_val_pdg
memory containing the entries for the ROOT tree
PublicToolHandle< IEntryLayerTool > m_entryLayerTool
AthenaTool responsible for writing Calo/Muon Entry/Exit Layer collection.
void updateAllSelectors(const ISFParticle &particle)
update all unfrozen simSelectors with the given particle
BooleanProperty m_validationOutput
validation mode: create ROOT Tree with additional information
ISF::SimSvcID identifySimID(const ISF::ISFParticle *p)
go through the chain of SimulationSelectors and return the SimulatoID of the first SimulationSelector...
std::string m_screenOutputPrefix
Screen output refinement.
SimSelectorSet m_simSelectorSet
used to remove multiple uses of the same selector
ISFParticleVector m_popParticles
the vector of particles returned for simulation (via popVector() )
TTree * m_t_entryLayerPos[ISF::fNumAtlasEntryLayers]
TTree * m_t_pushPosition
the actual validation histograms and ROOT trees
virtual void push(ISFParticle *particle, const ISFParticle *ancestor)
add a new particle to the stack and inherit ISF properties from the given ancestor ISF particel (usua...
ParticleBrokerDynamicOnReadIn(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
StatusCode initializeEvent(ISFParticleContainer &&simParticles)
Initialize the particle broker.
ParticleBrokerDynamicOnReadIn()
Default constructor.
virtual const ISFParticleVector & popVector(size_t maxVectorSize)
Get vectors of ISF particles from the broker.
BooleanProperty m_forceGeoIDSvc
always use GeoIDSvc to determine GeoID of given particles
ServiceHandle< ITHistSvc > m_thistSvc
the histogram service
BooleanProperty m_validateGeoID
always use GeoIDSvc to check correctness of GeoIDs already assigned to particles
StatusCode registerSimSelector(SimSelectorToolArray &simSelectorTools, AtlasDetDescr::AtlasRegion geoID)
Register an array of SimulationSelectors.
PublicToolHandle< IParticleOrderingTool > m_orderingTool
AthenaTool responsible for proritizing the particles and determine their simulation order.
virtual size_t numParticles() const
Get the current stack size.
ServiceHandle< IGeoIDSvc > m_geoIDSvc
the geo identifier service used to route the particle into the right SimulationSelector chain
void fillPosValTree(TTree *tree, const ISFParticle &particle)
fill the TTree with the (x,y,z) coordinates of the given ISFParticle
ISFParticleOrderedQueue m_particles
the particle container storing all particles which need to be simulated
IGeoIDSvc * m_geoIDSvcQuick
minimize Gaudi overhead
StringProperty m_validationStream
validation THist stream name
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
Definition AtlasRegion.h:21
ISFParticleOrderedQueue.
ToolHandleArray< ISimulationSelector > SimSelectorToolArray
typedef for better readable code
std::priority_queue< ISF::ISFParticle *, ISF::ISFParticleVector, ISF::ISFParticleOrdering > ISFParticleOrderedQueue
the actual particle priority_queue
@ fNumAtlasEntryLayers
Definition EntryLayer.h:41
uint8_t SimSvcID
Simulation service ID datatype.
Definition SimSvcID.h:28
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
std::vector< ISimulationSelector * > SimSelectorArray
std::set< ISimulationSelector * > SimSelectorSet
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
-event-from-file
void initialize()
TChain * tree