ATLAS Offline Software
Public Member Functions | Private Member Functions | Private Attributes | List of all members
ISF::ParticleBrokerDynamicOnReadIn Class Reference

#include <ParticleBrokerDynamicOnReadIn.h>

Inheritance diagram for ISF::ParticleBrokerDynamicOnReadIn:
Collaboration diagram for ISF::ParticleBrokerDynamicOnReadIn:

Public Member Functions

 ParticleBrokerDynamicOnReadIn (const std::string &name, ISvcLocator *pSvcLocator)
 Constructor. More...
 
virtual ~ParticleBrokerDynamicOnReadIn ()
 Destructor. More...
 
StatusCode initialize ()
 Athena algorithm's interface methods. More...
 
StatusCode initializeEvent (ISFParticleContainer &&simParticles)
 Initialize the particle broker. More...
 
virtual StatusCode finalizeEvent ()
 Finalize the event in the broker service. More...
 
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 (usually the particle which ISF handed over to the simulator) More...
 
virtual const ISFParticleVectorpopVector (size_t maxVectorSize)
 Get vectors of ISF particles from the broker. More...
 
virtual size_t numParticles () const
 Get the current stack size. More...
 
StatusCode dump () const
 Return the particle stack (not implemented) More...
 
StatusCode registerSimSelector (SimSelectorToolArray &simSelectorTools, AtlasDetDescr::AtlasRegion geoID)
 Register an array of SimulationSelectors. More...
 

Private Member Functions

 ParticleBrokerDynamicOnReadIn ()
 Default constructor. More...
 
StatusCode registerPosValTree (const char *treeName, const char *treeDescr, TTree *&tree)
 setup the ROOT TTrees for THistSvc in validation mode More...
 
void fillPosValTree (TTree *tree, const ISFParticle &particle)
 fill the TTree with the (x,y,z) coordinates of the given ISFParticle More...
 
void updateAllSelectors (const ISFParticle &particle)
 update all unfrozen simSelectors with the given particle More...
 
void selectAndStore (ISFParticle *p)
 go through the chain of SimulationSelectors and let the first one which selects the particle decide which simulation the particle will be assigned to More...
 
ISF::SimSvcID identifySimID (const ISF::ISFParticle *p)
 go through the chain of SimulationSelectors and return the SimulatoID of the first SimulationSelector that selects the particle More...
 

Private Attributes

PublicToolHandle< IEntryLayerToolm_entryLayerTool {this, "EntryLayerTool", "iGeant4::EntryLayerTool/ISF_EntryLayerTool"}
 AthenaTool responsible for writing Calo/Muon Entry/Exit Layer collection. More...
 
PublicToolHandle< IParticleOrderingToolm_orderingTool {this, "ParticleOrderingTool", ""}
 AthenaTool responsible for proritizing the particles and determine their simulation order. More...
 
ServiceHandle< IGeoIDSvcm_geoIDSvc {this, "GeoIDSvc", ""}
 the geo identifier service used to route the particle into the right SimulationSelector chain More...
 
IGeoIDSvcm_geoIDSvcQuick {}
 minimize Gaudi overhead More...
 
BooleanProperty m_forceGeoIDSvc {this, "AlwaysUseGeoIDSvc", false}
 always use GeoIDSvc to determine GeoID of given particles More...
 
BooleanProperty m_validateGeoID {this, "ValidateGeoIDs", false}
 always use GeoIDSvc to check correctness of GeoIDs already assigned to particles More...
 
ISFParticleOrderedQueue m_particles
 the particle container storing all particles which need to be simulated More...
 
ISFParticleVector m_popParticles
 the vector of particles returned for simulation (via popVector() ) More...
 
SimSelectorArray m_simSelector [AtlasDetDescr::fNumAtlasRegions]
 the simulation selectors per geoID (the actual routing chain) More...
 
SimSelectorSet m_simSelectorSet
 used to remove multiple uses of the same selector More...
 
std::string m_screenOutputPrefix {"isf >> "}
 Screen output refinement. More...
 
std::string m_screenEmptyPrefix {""}
 
BooleanProperty m_doSelectorCPUMon {this, "SimSelectorCPUMonitoring", false}
 Benchmarking. More...
 
PMonUtils::CustomBenchmarkm_benchPDGCode {}
 
PMonUtils::CustomBenchmarkm_benchGeoID {}
 
BooleanProperty m_validationOutput {this, "ValidationOutput", false, "If turned on, write out a ROOT tree."}
 validation mode: create ROOT Tree with additional information More...
 
ServiceHandle< ITHistSvc > m_thistSvc {this, "THistService", "THistSvc"}
 the histogram service More...
 
StringProperty m_validationStream {this, "ValidationStreamName", "ParticleBroker"}
 validation THist stream name More...
 
TTree * m_t_pushPosition {}
 the actual validation histograms and ROOT trees More...
 
TTree * m_t_entryLayerPos [ISF::fNumAtlasEntryLayers]
 
int m_val_pdg {0}
 memory containing the entries for the ROOT tree More...
 
float m_val_p {0.f}
 
float m_val_x {0.f}
 
float m_val_y {0.f}
 
float m_val_z {0.f}
 

Detailed Description

ISF particle broker responsible to flag particles with their corresponding simulator. On detector boundaries, simulators hand back all particles that pass them via the push() method.

Author
Andreas.Salzburger -at- cern.ch , Elmar.Ritsch -at- cern.ch

Definition at line 53 of file ParticleBrokerDynamicOnReadIn.h.

Constructor & Destructor Documentation

◆ ParticleBrokerDynamicOnReadIn() [1/2]

ISF::ParticleBrokerDynamicOnReadIn::ParticleBrokerDynamicOnReadIn ( const std::string &  name,
ISvcLocator *  pSvcLocator 
)

Constructor.

Definition at line 30 of file ParticleBrokerDynamicOnReadIn.cxx.

30  :
31  base_class(name,svc),
32  m_particles(),
34  m_simSelector(),
37 {
38 }

◆ ~ParticleBrokerDynamicOnReadIn()

ISF::ParticleBrokerDynamicOnReadIn::~ParticleBrokerDynamicOnReadIn ( )
virtual

Destructor.

Definition at line 41 of file ParticleBrokerDynamicOnReadIn.cxx.

42 {}

◆ ParticleBrokerDynamicOnReadIn() [2/2]

ISF::ParticleBrokerDynamicOnReadIn::ParticleBrokerDynamicOnReadIn ( )
private

Default constructor.

Member Function Documentation

◆ dump()

StatusCode ISF::ParticleBrokerDynamicOnReadIn::dump ( ) const

Return the particle stack (not implemented)

Definition at line 418 of file ParticleBrokerDynamicOnReadIn.cxx.

419 {
420  ATH_MSG_INFO( m_screenOutputPrefix << "==== ISF Particle Stack Dump ====");
421  ATH_MSG_INFO( m_screenOutputPrefix << " 'active' particles -> ready to be simulated");
422  ATH_MSG_INFO( m_screenOutputPrefix << " 'onHold' particles -> no sim Selector decision yet, waiting in routing chain");
423  ATH_MSG_INFO( m_screenOutputPrefix << " --- ");
424  ATH_MSG_INFO( m_screenOutputPrefix << " Number of 'active' particles: " << m_particles.size());
425  for ( int geoID = AtlasDetDescr::fFirstAtlasRegion; geoID < AtlasDetDescr::fNumAtlasRegions; ++geoID) {
426  ATH_MSG_INFO( m_screenOutputPrefix << " --- SimGeoID=" << geoID
427  << " (" << AtlasDetDescr::AtlasRegionHelper::getName(geoID) << ") ---");
428  ATH_MSG_INFO( m_screenOutputPrefix << " Routing Chain has length "
429  << m_simSelector[geoID].size() );
430  }
431  ATH_MSG_INFO( m_screenOutputPrefix << "=================================");
432 
433  return StatusCode::SUCCESS;
434 }

◆ fillPosValTree()

void ISF::ParticleBrokerDynamicOnReadIn::fillPosValTree ( TTree *  tree,
const ISFParticle particle 
)
private

fill the TTree with the (x,y,z) coordinates of the given ISFParticle

fill the TTree with the given (x,y,z) values

Definition at line 142 of file ParticleBrokerDynamicOnReadIn.cxx.

143  {
144  // the particle position
145  const Amg::Vector3D &pos = p.position();
146  // fill the member variables
147  m_val_x = pos.x();
148  m_val_y = pos.y();
149  m_val_z = pos.z();
150  m_val_p = p.momentum().mag();
151  m_val_pdg = p.pdgCode();
152  // fill the ROOT TTree
153  tree->Fill();
154 
155  return;
156 }

◆ finalizeEvent()

StatusCode ISF::ParticleBrokerDynamicOnReadIn::finalizeEvent ( )
virtual

Finalize the event in the broker service.

Finalize the event in the stackSvc.

Definition at line 299 of file ParticleBrokerDynamicOnReadIn.cxx.

299  {
300 
301  // go throught all SimSelectors and call the endEvent() on them
302  SimSelectorSet::iterator fSimSelIter = m_simSelectorSet.begin();
303  SimSelectorSet::iterator fSimSelIterEnd = m_simSelectorSet.end();
304  for ( ; fSimSelIter != fSimSelIterEnd; ++fSimSelIter )
305  (*fSimSelIter)->endEvent();
306 
307  return StatusCode::SUCCESS;
308 }

◆ identifySimID()

ISF::SimSvcID ISF::ParticleBrokerDynamicOnReadIn::identifySimID ( const ISF::ISFParticle p)
private

go through the chain of SimulationSelectors and return the SimulatoID of the first SimulationSelector that selects the particle

Definition at line 208 of file ParticleBrokerDynamicOnReadIn.cxx.

208  {
209  // implicit assumption that the geoID is set properly at this point (it is a private method)!
210  AtlasDetDescr::AtlasRegion geoID = p->nextGeoID();
211 
212  // iterators used to loop over all simulation Selectors
213  SimSelectorArray::iterator selectorIt = m_simSelector[geoID].begin();
214  SimSelectorArray::iterator selectorItEnd = m_simSelector[geoID].end();
215 
216  // will store whether the particle was selected by a simulation filter
217  bool selected = false;
218 
219  // block defines scope for Benchmarks
220  // -> benchmarks will be stared/stopped automatically via the CustomBenchmarkGuard
221  // constructor and destructor, respectively
222  {
223  // prepare the pdgCode for the benchmark
224  unsigned int pdgCode = ISFBenchmarkHelper::getBenchReadyPdgCode( *p);
225 
226  // setup sim svc benchmarks
227  PMonUtils::CustomBenchmarkGuard benchPDG ( m_benchPDGCode, pdgCode );
228  PMonUtils::CustomBenchmarkGuard benchGeoID( m_benchGeoID , geoID );
229 
230  // go through the chain of selectors and find the first
231  // selector which selects out the particle
232  for ( ; !selected && (selectorIt != selectorItEnd) ; ++selectorIt) {
233  // check if the current selector selects it
234  selected = (*selectorIt)->selfSelect( *p);
235  }
236 
237  } // stop benchmarks
238 
239  // determine the simulator ID
240  ISF::SimSvcID simID = selected ? (*--selectorIt)->simSvcID() : ISF::SimSvcID(ISF::fUndefinedSimID);
241 
242  return simID;
243 }

◆ initialize()

StatusCode ISF::ParticleBrokerDynamicOnReadIn::initialize ( )

Athena algorithm's interface methods.

framework methods

Definition at line 46 of file ParticleBrokerDynamicOnReadIn.cxx.

47 {
48  ATH_MSG_DEBUG("initialize() ...");
49 
50  // retrieve the entry layer tool
51  ATH_CHECK ( m_entryLayerTool.retrieve() );
52 
53  // retrieve the particle ing tool if given
54  ATH_CHECK ( m_orderingTool.retrieve( DisableTool{m_orderingTool.empty()} ) );
55 
56  // retrieve the geo identification decision tool
57  ATH_CHECK ( m_geoIDSvc.retrieve() );
58  // store a quick-access-pointer (removes GaudiOverhead)
59  m_geoIDSvcQuick = &(*m_geoIDSvc);
60 
61  // setup CPU Benchmarks
62  if (m_doSelectorCPUMon) {
63  if (!m_benchPDGCode) {
65  }
66  if (!m_benchGeoID) {
68  }
69  }
70 
71  // setup for validation mode
72  if ( m_validationOutput) {
73  // retrieve the histogram service
74  ATH_CHECK ( m_thistSvc.retrieve() );
75  ATH_CHECK( registerPosValTree( "push_position",
76  "push() particle positions",
78  ATH_CHECK( registerPosValTree( "caloEntry_pos",
79  "CaloEntryLayer positions",
81  ATH_CHECK( registerPosValTree( "muonEntry_pos",
82  "MuonEntryLayer positions",
84  ATH_CHECK( registerPosValTree( "muonExit_pos",
85  "MuonExitLayer positions",
87  }
88 
89  // initialization was successful
90  return StatusCode::SUCCESS;
91 }

◆ initializeEvent()

StatusCode ISF::ParticleBrokerDynamicOnReadIn::initializeEvent ( ISFParticleContainer &&  simParticles)

Initialize the particle broker.

Initialize the stackSvc and the truthSvc.

Definition at line 247 of file ParticleBrokerDynamicOnReadIn.cxx.

248 {
249  ATH_MSG_DEBUG( m_screenOutputPrefix << "Initializing particle stack");
250 
251  // fill set of simulation selectors once per job
252  // -> the std::set allows us to address each selector only once
253  // (the same selector might appear in multiple geoIDs)
254  if ( !m_simSelectorSet.size() ) {
255  for ( int curGeoID = AtlasDetDescr::fFirstAtlasRegion; curGeoID < AtlasDetDescr::fNumAtlasRegions; ++curGeoID) {
256  // fill the set with the selectors from the current geoID
257  m_simSelectorSet.insert( m_simSelector[curGeoID].begin(), m_simSelector[curGeoID].end() );
258  }
259 
260  ATH_MSG_DEBUG("Number of unique SimulationSelctors registered: "
261  << m_simSelectorSet.size() );
262  }
263 
264  // call beginEvent() for all selectors registerd to the ParticleBroker:
265  for ( const auto& simSelector : m_simSelectorSet ) {
266  simSelector->beginEvent();
267  }
268 
269  m_entryLayerTool->setupEvent();
270  // update the routing chain selectors with the particles in the initial stack
271  for ( auto& particlePointer : simParticles ) {
272  auto& particle = *particlePointer;
273 
274  // identify the geoID of the particle
276  // the geoID at this point better makes sense :)
277  assertAtlasRegion( particle.nextGeoID() );
278 
279  // update all registered selectors (in all geoIDs) with this particle
281 
282  m_entryLayerTool->registerParticle(particle);
283  }
284 
285  size_t order = simParticles.size(); // FIXME: ugly hack to keep bit-wise identical output with prior FullG4 implementation :(
286 
287  for ( auto& particlePtr: simParticles ) {
288  // FIXME: ugly hack to keep bit-wise identical output with prior FullG4 implementation :(
289  if (!m_orderingTool.isEnabled() ) { particlePtr->setOrder(order--); }
290 
291  selectAndStore(particlePtr);
292  }
293 
294  return StatusCode::SUCCESS;
295 }

◆ numParticles()

size_t ISF::ParticleBrokerDynamicOnReadIn::numParticles ( ) const
inlinevirtual

Get the current stack size.

Definition at line 166 of file ParticleBrokerDynamicOnReadIn.h.

166 { return m_particles.size(); }

◆ popVector()

const ISF::ISFParticleVector & ISF::ParticleBrokerDynamicOnReadIn::popVector ( size_t  maxVectorSize)
virtual

Get vectors of ISF particles from the broker.

Definition at line 376 of file ParticleBrokerDynamicOnReadIn.cxx.

377 {
378  // delete particles from previous return vector and empty the vector
379  ISF::ISFParticleVector::const_iterator partIt = m_popParticles.begin();
380  ISF::ISFParticleVector::const_iterator partEnd = m_popParticles.end();
381  for ( ; partIt != partEnd; ++partIt) {
382  ISF::ISFParticle *curPart = (*partIt);
383  delete curPart;
384  }
385  m_popParticles.clear();
386 
387  // if there are particles in the queue
388  if ( m_particles.size() ) {
389 
390  SimSvcID returnID = m_particles.top()->nextSimID();
391  ISFParticleOrderedQueue tempQueue;
392  // loop as long as we have particles in the m_particles queue
393  do {
394  // get the next particle from the ordered queue
395  ISFParticle *curParticle = m_particles.top();
396  SimSvcID curID = curParticle->nextSimID();
397 
398  // if this particle has a different SimID, or the maximum size of the return vector is reached
399  // -> don't add any more particles to the m_popParticles std::vector
400  if ( curID != returnID || m_popParticles.size() >= maxVectorSize ) {
401  tempQueue.push(m_particles.top()); //break;
402  }
403  else {
404  // add this particle to the, later returned, m_popParticles std::vector
405  m_popParticles.push_back( curParticle );
406  }
407  // remove this particle from the ordered queue
408  m_particles.pop();
409  } while ( m_particles.size() ) ;
410  m_particles = std::move(tempQueue);
411  }
412  // return the popParticles vector
413  return m_popParticles;
414 }

◆ push()

void ISF::ParticleBrokerDynamicOnReadIn::push ( ISFParticle particle,
const ISFParticle ancestor 
)
virtual

add a new particle to the stack and inherit ISF properties from the given ancestor ISF particel (usually the particle which ISF handed over to the simulator)

add a new particle to the stack and link it to its parent

Definition at line 312 of file ParticleBrokerDynamicOnReadIn.cxx.

312  {
313  // this call does not make much sense with no given particle
314  assert(particlePtr);
315 
316  ISFParticle &particle = *particlePtr;
317 
318  if (parentPtr) {
319  //Let's make sure that the new ISFParticle has a valid TruthBinding and HepMcParticleLink
320  //(could happen that the new particles are not saved by the TruthSvc for instance)
321  //or attach pointers to the parent otherwise
322  if (!particlePtr->getTruthBinding()) {
323  ATH_MSG_WARNING("The provided new ISFParticle had no TruthBinding ! Copying over the one from the parent ISFParticle.");
324  particle.setTruthBinding(new TruthBinding(*parentPtr->getTruthBinding()));
325  }
326  }
327 
328  // get the particle's next geoID
329  AtlasDetDescr::AtlasRegion geoID = particle.nextGeoID();
330 
331  // if GeoID not set (e.g. ISF::fUndefinedGeoID) or a flag is set to always use the GeoIDSvc
332  // -> let the geoIDSvc find the next geoID
333  if ( m_forceGeoIDSvc || !validAtlasRegion(geoID) ) {
335  }
336  // inform the entry layer tool about this particle
337  ISF::EntryLayer layer = m_entryLayerTool->registerParticle( particle );
338 
339  // ---> if validation mode: fill the corresponding entry layer ROOT tree
340  if ( m_validationOutput ) {
341  // fill the push() position TTree
343  // in case particle was added to an entry layer, add it to the corresponding TTree
344  if ( validEntryLayer(layer) ) {
346  }
347  }
348  // <--- end validation output
349 
350  // validation mode: check whether the particle position corresponds to the GeoID given
351  // by the particle itself
352  if ( m_validateGeoID) {
354  if ( (geoID!=AtlasDetDescr::fUndefinedAtlasRegion) && (geoID!=identifiedGeoID) ) {
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);
357  ATH_MSG_WARNING(" Particle: " << particle);
358  }
359  }
360 
361  // only process particles with well defined geoID
362  if ( !validAtlasRegion( geoID) ) {
363  ATH_MSG_ERROR( m_screenOutputPrefix << "Trying to push particle onto the stack with unknown geoID=" << geoID
364  << ". Dropping this particle.");
365  delete particlePtr;
366  return;
367  }
368 
369  // (*) let the Selectors select the particle
370  // - if a Selector selects a particle -> it is pushed onto the active stack
371  // - if it is not selected -> particle is dropped (deleted)
372  selectAndStore( particlePtr );
373 }

◆ registerPosValTree()

StatusCode ISF::ParticleBrokerDynamicOnReadIn::registerPosValTree ( const char *  treeName,
const char *  treeDescr,
TTree *&  tree 
)
private

setup the ROOT TTrees for THistSvc in validation mode

Definition at line 123 of file ParticleBrokerDynamicOnReadIn.cxx.

125  {
126  // Create the prefix of histogram names for the THistSvc
127  std::string prefix = "/" + m_validationStream + "/";
128 
129  tree = new TTree( treeName, treeDescr );
130  tree->Branch("x" , &m_val_x , "x/F");
131  tree->Branch("y" , &m_val_y , "y/F");
132  tree->Branch("z" , &m_val_z , "z/F");
133  tree->Branch("p" , &m_val_p , "p/F");
134  tree->Branch("pdg", &m_val_pdg, "pdg/I");
135 
136  // register the Tree to the THistSvc and return it's StatusCode
137  return (m_thistSvc->regTree( prefix+treeName, tree) );
138 }

◆ registerSimSelector()

StatusCode ISF::ParticleBrokerDynamicOnReadIn::registerSimSelector ( SimSelectorToolArray simSelectorTools,
AtlasDetDescr::AtlasRegion  geoID 
)

Register an array of SimulationSelectors.

Definition at line 95 of file ParticleBrokerDynamicOnReadIn.cxx.

96 {
97  // (1.) retrieve all SimulationSelector tools in the array
98  if ( simSelectorTools.retrieve().isFailure() ) {
99  ATH_MSG_FATAL( m_screenOutputPrefix << "Could not retrieve SimulatorSelector Tool Array. Abort.");
100  return StatusCode::FAILURE;
101  }
102 
103  // reserve memory in STL vector
104  m_simSelector[geoID].reserve ( simSelectorTools.size());
105 
106  // (2.) loop over SimulationSelector tool array and store
107  // its contents in m_simSelector[]
108  SimSelectorToolArray::iterator fSimSelIter = simSelectorTools.begin();
109  SimSelectorToolArray::iterator fSimSelIterEnd = simSelectorTools.end();
110  for ( ; fSimSelIter != fSimSelIterEnd; ++fSimSelIter ) {
111  ISimulationSelector *curSelector = &**fSimSelIter;
112  // initialize the SimulationSelector
113  curSelector->initializeSelector();
114  // register current SimulationSelector to the m_simSelector vector
115  m_simSelector[geoID].push_back( curSelector);
116  }
117 
118  return StatusCode::SUCCESS;
119 }

◆ selectAndStore()

void ISF::ParticleBrokerDynamicOnReadIn::selectAndStore ( ISF::ISFParticle p)
private

go through the chain of SimulationSelectors and let the first one which selects the particle decide which simulation the particle will be assigned to

Definition at line 169 of file ParticleBrokerDynamicOnReadIn.cxx.

170 {
171  // consult the routing chain to find the simulator ID corresponding to this
172  // particle
173  SimSvcID selectedSimID = identifySimID( p);
174 
175  // in case a simulator was determined for this particle
176  // -> register this simulator to the particle
177  // -> push particle onto container
178  if ( selectedSimID != ISF::fUndefinedSimID) {
179  ATH_MSG_VERBOSE( m_screenOutputPrefix << "Assigning " << *p
180  << " to simulator with ID=" << selectedSimID << ".");
181  // register the SimulatorID to the particle
182  p->setNextSimID( selectedSimID);
183 
184  if ( m_orderingTool.isEnabled() ) { m_orderingTool->setOrder(*p); }
185 
186  // store particle locally
187  m_particles.push(p);
188 
189  // no simulator could be found
190  // -> drop particle
191  } else {
192  AtlasDetDescr::AtlasRegion geoID = p->nextGeoID();
193  // different error message for empty simulation Selector chain:
194  if ( !m_simSelector[geoID].size()) {
195  ATH_MSG_INFO( m_screenOutputPrefix << "No SimulationSelectors registered for GeoID="
196  << AtlasDetDescr::AtlasRegionHelper::getName(geoID) << ". Will not assign this particle to any simulator, dropping it.");
197  }
198  else {
199  ATH_MSG_INFO( m_screenOutputPrefix << "Current particle not selected by any SimulationSelector with GeoID="
200  << AtlasDetDescr::AtlasRegionHelper::getName(geoID) << ". Will not assign this particle to any simulator, dropping it.");
201  }
202  delete p;
203  }
204 }

◆ updateAllSelectors()

void ISF::ParticleBrokerDynamicOnReadIn::updateAllSelectors ( const ISFParticle particle)
private

update all unfrozen simSelectors with the given particle

update all SimulationSelectors in the routing chain with the given particle

Definition at line 160 of file ParticleBrokerDynamicOnReadIn.cxx.

160  {
161  for ( const auto& simSelector : m_simSelectorSet ) {
162  simSelector->update(particle);
163  }
164 }

Member Data Documentation

◆ m_benchGeoID

PMonUtils::CustomBenchmark* ISF::ParticleBrokerDynamicOnReadIn::m_benchGeoID {}
private

Definition at line 148 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_benchPDGCode

PMonUtils::CustomBenchmark* ISF::ParticleBrokerDynamicOnReadIn::m_benchPDGCode {}
private

Definition at line 147 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_doSelectorCPUMon

BooleanProperty ISF::ParticleBrokerDynamicOnReadIn::m_doSelectorCPUMon {this, "SimSelectorCPUMonitoring", false}
private

Benchmarking.

whether we use PMonUtils or not

Definition at line 146 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_entryLayerTool

PublicToolHandle<IEntryLayerTool> ISF::ParticleBrokerDynamicOnReadIn::m_entryLayerTool {this, "EntryLayerTool", "iGeant4::EntryLayerTool/ISF_EntryLayerTool"}
private

AthenaTool responsible for writing Calo/Muon Entry/Exit Layer collection.

Definition at line 115 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_forceGeoIDSvc

BooleanProperty ISF::ParticleBrokerDynamicOnReadIn::m_forceGeoIDSvc {this, "AlwaysUseGeoIDSvc", false}
private

always use GeoIDSvc to determine GeoID of given particles

Definition at line 126 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_geoIDSvc

ServiceHandle<IGeoIDSvc> ISF::ParticleBrokerDynamicOnReadIn::m_geoIDSvc {this, "GeoIDSvc", ""}
private

the geo identifier service used to route the particle into the right SimulationSelector chain

Definition at line 122 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_geoIDSvcQuick

IGeoIDSvc* ISF::ParticleBrokerDynamicOnReadIn::m_geoIDSvcQuick {}
private

minimize Gaudi overhead

Definition at line 123 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_orderingTool

PublicToolHandle<IParticleOrderingTool> ISF::ParticleBrokerDynamicOnReadIn::m_orderingTool {this, "ParticleOrderingTool", ""}
private

AthenaTool responsible for proritizing the particles and determine their simulation order.

Definition at line 118 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_particles

ISFParticleOrderedQueue ISF::ParticleBrokerDynamicOnReadIn::m_particles
private

the particle container storing all particles which need to be simulated

Definition at line 132 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_popParticles

ISFParticleVector ISF::ParticleBrokerDynamicOnReadIn::m_popParticles
private

the vector of particles returned for simulation (via popVector() )

Definition at line 135 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_screenEmptyPrefix

std::string ISF::ParticleBrokerDynamicOnReadIn::m_screenEmptyPrefix {""}
private

Definition at line 143 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_screenOutputPrefix

std::string ISF::ParticleBrokerDynamicOnReadIn::m_screenOutputPrefix {"isf >> "}
private

Screen output refinement.

Definition at line 142 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_simSelector

SimSelectorArray ISF::ParticleBrokerDynamicOnReadIn::m_simSelector[AtlasDetDescr::fNumAtlasRegions]
private

the simulation selectors per geoID (the actual routing chain)

selectors per geoID

Definition at line 138 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_simSelectorSet

SimSelectorSet ISF::ParticleBrokerDynamicOnReadIn::m_simSelectorSet
private

used to remove multiple uses of the same selector

Definition at line 139 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_t_entryLayerPos

TTree* ISF::ParticleBrokerDynamicOnReadIn::m_t_entryLayerPos[ISF::fNumAtlasEntryLayers]
private

Definition at line 156 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_t_pushPosition

TTree* ISF::ParticleBrokerDynamicOnReadIn::m_t_pushPosition {}
private

the actual validation histograms and ROOT trees

Definition at line 155 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_thistSvc

ServiceHandle<ITHistSvc> ISF::ParticleBrokerDynamicOnReadIn::m_thistSvc {this, "THistService", "THistSvc"}
private

the histogram service

Definition at line 152 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_val_p

float ISF::ParticleBrokerDynamicOnReadIn::m_val_p {0.f}
private

Definition at line 159 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_val_pdg

int ISF::ParticleBrokerDynamicOnReadIn::m_val_pdg {0}
private

memory containing the entries for the ROOT tree

Definition at line 158 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_val_x

float ISF::ParticleBrokerDynamicOnReadIn::m_val_x {0.f}
private

Definition at line 160 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_val_y

float ISF::ParticleBrokerDynamicOnReadIn::m_val_y {0.f}
private

Definition at line 161 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_val_z

float ISF::ParticleBrokerDynamicOnReadIn::m_val_z {0.f}
private

Definition at line 162 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_validateGeoID

BooleanProperty ISF::ParticleBrokerDynamicOnReadIn::m_validateGeoID {this, "ValidateGeoIDs", false}
private

always use GeoIDSvc to check correctness of GeoIDs already assigned to particles

Definition at line 129 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_validationOutput

BooleanProperty ISF::ParticleBrokerDynamicOnReadIn::m_validationOutput {this, "ValidationOutput", false, "If turned on, write out a ROOT tree."}
private

validation mode: create ROOT Tree with additional information

turn validation mode on/off

Definition at line 151 of file ParticleBrokerDynamicOnReadIn.h.

◆ m_validationStream

StringProperty ISF::ParticleBrokerDynamicOnReadIn::m_validationStream {this, "ValidationStreamName", "ParticleBroker"}
private

validation THist stream name

Definition at line 153 of file ParticleBrokerDynamicOnReadIn.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ISF::ParticleBrokerDynamicOnReadIn::m_validationOutput
BooleanProperty m_validationOutput
validation mode: create ROOT Tree with additional information
Definition: ParticleBrokerDynamicOnReadIn.h:151
AtlasDetDescr::fNumAtlasRegions
@ fNumAtlasRegions
Definition: AtlasRegion.h:39
ISF::ParticleBrokerDynamicOnReadIn::m_val_y
float m_val_y
Definition: ParticleBrokerDynamicOnReadIn.h:161
ISF::ParticleBrokerDynamicOnReadIn::m_thistSvc
ServiceHandle< ITHistSvc > m_thistSvc
the histogram service
Definition: ParticleBrokerDynamicOnReadIn.h:152
ISF::fAtlasMuonEntry
@ fAtlasMuonEntry
Definition: EntryLayer.h:38
ISF::ParticleBrokerDynamicOnReadIn::m_simSelectorSet
SimSelectorSet m_simSelectorSet
used to remove multiple uses of the same selector
Definition: ParticleBrokerDynamicOnReadIn.h:139
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
ISF::fMaxBenchmarkPDGCode
@ fMaxBenchmarkPDGCode
Definition: ISFBenchmarkHelper.h:32
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ISF::fAtlasMuonExit
@ fAtlasMuonExit
Definition: EntryLayer.h:39
ISF::ParticleBrokerDynamicOnReadIn::m_val_x
float m_val_x
Definition: ParticleBrokerDynamicOnReadIn.h:160
ISF::ParticleBrokerDynamicOnReadIn::m_doSelectorCPUMon
BooleanProperty m_doSelectorCPUMon
Benchmarking.
Definition: ParticleBrokerDynamicOnReadIn.h:146
AtlasDetDescr::AtlasRegion
AtlasRegion
Definition: AtlasRegion.h:27
ISF::ParticleBrokerDynamicOnReadIn::m_benchPDGCode
PMonUtils::CustomBenchmark * m_benchPDGCode
Definition: ParticleBrokerDynamicOnReadIn.h:147
tree
TChain * tree
Definition: tile_monitor.h:30
ISF::IGeoIDSvc::identifyAndRegNextGeoID
AtlasDetDescr::AtlasRegion identifyAndRegNextGeoID(ISFParticle &sp) const
Find the AtlasRegion that the particle will enter with its next infinitesimal step along the given di...
Definition: IGeoIDSvc.h:106
ISF::ParticleBrokerDynamicOnReadIn::registerPosValTree
StatusCode registerPosValTree(const char *treeName, const char *treeDescr, TTree *&tree)
setup the ROOT TTrees for THistSvc in validation mode
Definition: ParticleBrokerDynamicOnReadIn.cxx:123
ISF::ISFParticleOrderedQueue
std::priority_queue< ISF::ISFParticle *, ISF::ISFParticleVector, ISF::ISFParticleOrdering > ISFParticleOrderedQueue
the actual particle priority_queue
Definition: ISFParticleOrderedQueue.h:28
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
ISF::ISFParticle
Definition: ISFParticle.h:42
AtlasDetDescr::fUndefinedAtlasRegion
@ fUndefinedAtlasRegion
Definition: AtlasRegion.h:29
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::ParticleBrokerDynamicOnReadIn::m_val_z
float m_val_z
Definition: ParticleBrokerDynamicOnReadIn.h:162
AtlasDetDescr::AtlasRegionHelper::getName
static const char * getName(int region)
Definition: AtlasRegionHelper.cxx:13
ISF::ParticleBrokerDynamicOnReadIn::m_geoIDSvcQuick
IGeoIDSvc * m_geoIDSvcQuick
minimize Gaudi overhead
Definition: ParticleBrokerDynamicOnReadIn.h:123
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
ISF::ParticleBrokerDynamicOnReadIn::m_validationStream
StringProperty m_validationStream
validation THist stream name
Definition: ParticleBrokerDynamicOnReadIn.h:153
ISF::ParticleBrokerDynamicOnReadIn::m_t_entryLayerPos
TTree * m_t_entryLayerPos[ISF::fNumAtlasEntryLayers]
Definition: ParticleBrokerDynamicOnReadIn.h:156
ISF::ParticleBrokerDynamicOnReadIn::m_popParticles
ISFParticleVector m_popParticles
the vector of particles returned for simulation (via popVector() )
Definition: ParticleBrokerDynamicOnReadIn.h:135
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
ISF::ParticleBrokerDynamicOnReadIn::m_benchGeoID
PMonUtils::CustomBenchmark * m_benchGeoID
Definition: ParticleBrokerDynamicOnReadIn.h:148
ISF::ParticleBrokerDynamicOnReadIn::fillPosValTree
void fillPosValTree(TTree *tree, const ISFParticle &particle)
fill the TTree with the (x,y,z) coordinates of the given ISFParticle
Definition: ParticleBrokerDynamicOnReadIn.cxx:142
validEntryLayer
#define validEntryLayer(layer)
Definition: EntryLayer.h:15
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::ParticleBrokerDynamicOnReadIn::m_t_pushPosition
TTree * m_t_pushPosition
the actual validation histograms and ROOT trees
Definition: ParticleBrokerDynamicOnReadIn.h:155
ISF::ParticleBrokerDynamicOnReadIn::m_geoIDSvc
ServiceHandle< IGeoIDSvc > m_geoIDSvc
the geo identifier service used to route the particle into the right SimulationSelector chain
Definition: ParticleBrokerDynamicOnReadIn.h:122
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
mc.order
order
Configure Herwig7.
Definition: mc.Herwig7_Dijet.py:12
TRT::Hit::layer
@ layer
Definition: HitInfo.h:79
ISF::ParticleBrokerDynamicOnReadIn::identifySimID
ISF::SimSvcID identifySimID(const ISF::ISFParticle *p)
go through the chain of SimulationSelectors and return the SimulatoID of the first SimulationSelector...
Definition: ParticleBrokerDynamicOnReadIn.cxx:208
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
dumpFileToPlots.treeName
string treeName
Definition: dumpFileToPlots.py:20
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ISF::ParticleBrokerDynamicOnReadIn::m_particles
ISFParticleOrderedQueue m_particles
the particle container storing all particles which need to be simulated
Definition: ParticleBrokerDynamicOnReadIn.h:132
ISF::ParticleBrokerDynamicOnReadIn::m_entryLayerTool
PublicToolHandle< IEntryLayerTool > m_entryLayerTool
AthenaTool responsible for writing Calo/Muon Entry/Exit Layer collection.
Definition: ParticleBrokerDynamicOnReadIn.h:115
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
PMonUtils::CustomBenchmarkGuard
Definition: CustomBenchmark.h:118
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ISF::IGeoIDSvc::identifyNextGeoID
virtual AtlasDetDescr::AtlasRegion identifyNextGeoID(const Amg::Vector3D &pos, const Amg::Vector3D &dir) const =0
Find the AtlasRegion that the particle will enter with its next infinitesimal step along the given di...
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ISF::ParticleBrokerDynamicOnReadIn::selectAndStore
void selectAndStore(ISFParticle *p)
go through the chain of SimulationSelectors and let the first one which selects the particle decide w...
Definition: ParticleBrokerDynamicOnReadIn.cxx:169
ISF::EntryLayer
EntryLayer
Definition: EntryLayer.h:31
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ISF::ParticleBrokerDynamicOnReadIn::m_val_p
float m_val_p
Definition: ParticleBrokerDynamicOnReadIn.h:159
ISF::ParticleBrokerDynamicOnReadIn::m_val_pdg
int m_val_pdg
memory containing the entries for the ROOT tree
Definition: ParticleBrokerDynamicOnReadIn.h:158
ISF::SimSvcID
uint8_t SimSvcID
Simulation service ID datatype.
Definition: SimSvcID.h:28
assertAtlasRegion
#define assertAtlasRegion(region)
Definition: AtlasRegion.h:16
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
ISF::fAtlasCaloEntry
@ fAtlasCaloEntry
Definition: EntryLayer.h:37
ISF::ParticleBrokerDynamicOnReadIn::m_forceGeoIDSvc
BooleanProperty m_forceGeoIDSvc
always use GeoIDSvc to determine GeoID of given particles
Definition: ParticleBrokerDynamicOnReadIn.h:126
ISF::ParticleBrokerDynamicOnReadIn::m_simSelector
SimSelectorArray m_simSelector[AtlasDetDescr::fNumAtlasRegions]
the simulation selectors per geoID (the actual routing chain)
Definition: ParticleBrokerDynamicOnReadIn.h:138
ISF::ParticleBrokerDynamicOnReadIn::m_orderingTool
PublicToolHandle< IParticleOrderingTool > m_orderingTool
AthenaTool responsible for proritizing the particles and determine their simulation order.
Definition: ParticleBrokerDynamicOnReadIn.h:118
ISF::ParticleBrokerDynamicOnReadIn::m_validateGeoID
BooleanProperty m_validateGeoID
always use GeoIDSvc to check correctness of GeoIDs already assigned to particles
Definition: ParticleBrokerDynamicOnReadIn.h:129
ISF::ParticleBrokerDynamicOnReadIn::m_screenOutputPrefix
std::string m_screenOutputPrefix
Screen output refinement.
Definition: ParticleBrokerDynamicOnReadIn.h:142
validAtlasRegion
#define validAtlasRegion(region)
Definition: AtlasRegion.h:15
ISF::ISFBenchmarkHelper::getBenchReadyPdgCode
static unsigned int getBenchReadyPdgCode(const ISFParticle &p)
get PMonUtils::CustomBenchmarkGuard ready PDGCode of the given ISFParticle -> returns abs(pdgCode) if...
Definition: ISFBenchmarkHelper.h:53
ISF::fUndefinedSimID
@ fUndefinedSimID
Definition: SimSvcID.h:32
ISF::ParticleBrokerDynamicOnReadIn::updateAllSelectors
void updateAllSelectors(const ISFParticle &particle)
update all unfrozen simSelectors with the given particle
Definition: ParticleBrokerDynamicOnReadIn.cxx:160
AtlasDetDescr::fFirstAtlasRegion
@ fFirstAtlasRegion
Definition: AtlasRegion.h:31
PMonUtils::CustomBenchmark
Definition: CustomBenchmark.h:30