76 "push() particle positions",
79 "CaloEntryLayer positions",
82 "MuonEntryLayer positions",
85 "MuonExitLayer positions",
90 return StatusCode::SUCCESS;
98 if ( simSelectorTools.retrieve().isFailure() ) {
100 return StatusCode::FAILURE;
108 SimSelectorToolArray::iterator fSimSelIter = simSelectorTools.begin();
109 SimSelectorToolArray::iterator fSimSelIterEnd = simSelectorTools.end();
110 for ( ; fSimSelIter != fSimSelIterEnd; ++fSimSelIter ) {
118 return StatusCode::SUCCESS;
124 const char *treeDescr,
129 tree =
new TTree( treeName, treeDescr );
162 simSelector->update(particle);
180 <<
" to simulator with ID=" << selectedSimID <<
".");
182 p->setNextSimID( selectedSimID);
213 SimSelectorArray::iterator selectorIt =
m_simSelector[geoID].begin();
214 SimSelectorArray::iterator selectorItEnd =
m_simSelector[geoID].end();
217 bool selected =
false;
232 for ( ; !selected && (selectorIt != selectorItEnd) ; ++selectorIt) {
234 selected = (*selectorIt)->selfSelect( *p);
260 ATH_MSG_DEBUG(
"Number of unique SimulationSelctors registered: "
266 simSelector->beginEvent();
271 for (
auto& particlePointer : simParticles ) {
272 auto& particle = *particlePointer;
285 size_t order = simParticles.size();
287 for (
auto& particlePtr: simParticles ) {
289 if (!
m_orderingTool.isEnabled() ) { particlePtr->setOrder(order--); }
294 return StatusCode::SUCCESS;
304 for ( ; fSimSelIter != fSimSelIterEnd; ++fSimSelIter )
305 (*fSimSelIter)->endEvent();
307 return StatusCode::SUCCESS;
323 ATH_MSG_WARNING(
"The provided new ISFParticle had no TruthBinding ! Copying over the one from the parent ISFParticle.");
355 ATH_MSG_WARNING(
"Validating GeoID: GeoIDSvc resolves a particle's position to a different GeoID than stored in the particle:");
356 ATH_MSG_WARNING(
" assigned=" << geoID <<
" GeoIDSvc=" << identifiedGeoID);
364 <<
". Dropping this particle.");
379 ISF::ISFParticleVector::const_iterator partIt =
m_popParticles.begin();
380 ISF::ISFParticleVector::const_iterator partEnd =
m_popParticles.end();
381 for ( ; partIt != partEnd; ++partIt) {
400 if ( curID != returnID ||
m_popParticles.size() >= maxVectorSize ) {
433 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
bool validAtlasRegion(AtlasDetDescr::AtlasRegion region)
Check a given AtlasRegion for its validity.
#define validEntryLayer(layer)
static const char * getName(int region)
static unsigned int getBenchReadyPdgCode(const ISFParticle &p)
get PMonUtils::CustomBenchmarkGuard ready PDGCode of the given ISFParticle -> returns abs(pdgCode) if...
The generic ISF particle definition,.
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
SimSvcID nextSimID() const
the next simulation service the particle will be sent to
virtual void initializeSelector()=0
initialize Selector
PMonUtils::CustomBenchmark * m_benchPDGCode
StatusCode dump() const
Return the particle stack (not implemented)
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...
virtual ~ParticleBrokerDynamicOnReadIn()
Destructor.
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...
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
PMonUtils::CustomBenchmark * m_benchGeoID
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.
StatusCode initialize()
Athena algorithm's interface methods.
PublicToolHandle< IParticleOrderingTool > m_orderingTool
AthenaTool responsible for proritizing the particles and determine their simulation order.
BooleanProperty m_doSelectorCPUMon
Benchmarking.
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
Eigen::Matrix< double, 3, 1 > Vector3D
AtlasRegion
A simple enum of ATLAS regions and sub-detectors.
ToolHandleArray< ISimulationSelector > SimSelectorToolArray
typedef for better readable code
std::priority_queue< ISF::ISFParticle *, ISF::ISFParticleVector, ISF::ISFParticleOrdering > ISFParticleOrderedQueue
the actual particle priority_queue
EntryLayer
Identifiers for the TrackRecordCollections on the boundaries between CaloEntry: Inner Detector - Calo...
uint8_t SimSvcID
Simulation service ID datatype.
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.