ATLAS Offline Software
ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // class header
6 #include "TransportTool.h"
7 
8 //package includes
14 #include "ISFFluxRecorder.h"
15 
17 
18 // ISF classes
19 #include "ISF_Event/ISFParticle.h"
21 
22 // Athena classes
24 #include "GaudiKernel/IThreadInitTool.h"
25 
28 
29 // HepMC classes
30 #include "AtlasHepMC/GenParticle.h"
31 
32 // Geant4 classes
33 #include "G4LorentzVector.hh"
34 #include "G4PrimaryVertex.hh"
35 #include "G4PrimaryParticle.hh"
36 #include "G4Trajectory.hh"
37 #include "G4Geantino.hh"
38 #include "G4ChargedGeantino.hh"
39 #include "G4ParticleTable.hh"
40 #include "G4StateManager.hh"
41 #include "G4TransportationManager.hh"
42 #include "G4UImanager.hh"
43 #include "G4ScoringManager.hh"
44 #include "G4Timer.hh"
45 #include "G4SDManager.hh"
46 #include "G4VUserPhysicsList.hh"
47 #include "G4VModularPhysicsList.hh"
48 #include "G4ParallelWorldPhysics.hh"
49 
51 
52 // call_once mutexes
53 #include <mutex>
54 static std::once_flag initializeOnceFlag;
55 static std::once_flag finalizeOnceFlag;
56 
57 //________________________________________________________________________
59  const std::string& name,
60  const IInterface* parent )
61  : ISF::BaseSimulatorTool(type, name, parent)
62 {
63  //declareProperty("KillAllNeutrinos", m_KillAllNeutrinos=true);
64  //declareProperty("KillLowEPhotons", m_KillLowEPhotons=-1.);
65 }
66 
67 //________________________________________________________________________
69 {
70  ATH_MSG_VERBOSE("initialize");
71 
73 
74  // create G4Timers if enabled
75  if (m_doTiming) {
76  m_runTimer = new G4Timer();
77  m_eventTimer = new G4Timer();
78  m_runTimer->Start();
79  }
80 
81  // Create the scoring manager if requested
82  if (m_recordFlux) G4ScoringManager::GetScoringManager();
83 
84  // One-time initialization
85  try {
86  std::call_once(initializeOnceFlag, &iGeant4::G4TransportTool::initializeOnce, this);
87  }
88  catch(const std::exception& e) {
89  ATH_MSG_ERROR("Failure in iGeant4::G4TransportTool::initializeOnce: " << e.what());
90  return StatusCode::FAILURE;
91  }
92 
93  ATH_CHECK( m_rndmGenSvc.retrieve() );
94  ATH_CHECK( m_userActionSvc.retrieve() );
95 
96  ATH_CHECK(m_senDetTool.retrieve());
97  ATH_CHECK(m_fastSimTool.retrieve());
98 
99  ATH_CHECK(m_inputConverter.retrieve());
100 
101  return StatusCode::SUCCESS;
102 }
103 
104 //________________________________________________________________________
105 void iGeant4::G4TransportTool::initializeOnce ATLAS_NOT_THREAD_SAFE ()
106 {
107  // get G4AtlasRunManager
108  ATH_MSG_DEBUG("initialize G4AtlasRunManager");
109 
110  if(m_physListSvc.retrieve().isFailure()) {
111  throw std::runtime_error("Could not initialize ATLAS PhysicsListSvc!");
112  }
113 
114  // Create the (master) run manager
115  if(m_useMT) {
116 #ifdef G4MULTITHREADED
117  auto* runMgr = G4AtlasMTRunManager::GetG4AtlasMTRunManager();
118  m_physListSvc->SetPhysicsList();
119  runMgr->SetDetGeoSvc( m_detGeoSvc.typeAndName() );
120  runMgr->SetFastSimMasterTool(m_fastSimTool.typeAndName() );
121  runMgr->SetPhysListSvc( m_physListSvc.typeAndName() );
122  // Worker Thread initialization used to create worker run manager on demand.
123  std::unique_ptr<G4AtlasUserWorkerThreadInitialization> workerInit =
124  std::make_unique<G4AtlasUserWorkerThreadInitialization>();
125  workerInit->SetDetGeoSvc( m_detGeoSvc.typeAndName() );
126  workerInit->SetFastSimMasterTool( m_fastSimTool.typeAndName() );
127  runMgr->SetUserInitialization( workerInit.release() );
128  std::unique_ptr<G4AtlasActionInitialization> actionInitialization =
129  std::make_unique<G4AtlasActionInitialization>(&*m_userActionSvc);
130  runMgr->SetUserInitialization(actionInitialization.release());
131 #else
132  throw std::runtime_error("Trying to use multi-threading in non-MT build!");
133 #endif
134  }
135  // Single-threaded run manager
136  else {
137  auto* runMgr = G4AtlasRunManager::GetG4AtlasRunManager();
138  m_physListSvc->SetPhysicsList();
139  runMgr->SetRecordFlux( m_recordFlux, std::make_unique<ISFFluxRecorder>() );
140  runMgr->SetLogLevel( int(msg().level()) ); // Synch log levels
141  runMgr->SetDetGeoSvc( m_detGeoSvc.typeAndName() );
142  runMgr->SetFastSimMasterTool(m_fastSimTool.typeAndName() );
143  runMgr->SetPhysListSvc(m_physListSvc.typeAndName() );
144  std::unique_ptr<G4AtlasActionInitialization> actionInitialization =
145  std::make_unique<G4AtlasActionInitialization>(&*m_userActionSvc);
146  runMgr->SetUserInitialization(actionInitialization.release());
147  }
148 
149  G4UImanager *ui = G4UImanager::GetUIpointer();
150 
151  if (!m_libList.empty()) {
152  ATH_MSG_INFO("G4AtlasAlg specific libraries requested ") ;
153  std::string temp="/load "+m_libList;
154  ui->ApplyCommand(temp);
155  }
156 
157  if (!m_physList.empty()) {
158  ATH_MSG_INFO("requesting a specific physics list "<< m_physList) ;
159  std::string temp="/Physics/GetPhysicsList "+m_physList;
160  ui->ApplyCommand(temp);
161  }
162 
163  if (!m_fieldMap.empty()) {
164  ATH_MSG_INFO("requesting a specific field map "<< m_fieldMap) ;
165  ATH_MSG_INFO("the field is initialized straight away") ;
166  std::string temp="/MagneticField/Select "+m_fieldMap;
167  ui->ApplyCommand(temp);
168  ui->ApplyCommand("/MagneticField/Initialize");
169  }
170 
171  // Send UI commands
172  ATH_MSG_DEBUG("G4 Command: Trying at the end of initializeOnce()");
173  for (const auto& g4command : m_g4commands) {
174  int returnCode = ui->ApplyCommand( g4command );
175  commandLog(returnCode, g4command);
176  }
177 
178  // Code from G4AtlasSvc
179  auto* rm = G4RunManager::GetRunManager();
180  if(!rm) {
181  throw std::runtime_error("Run manager retrieval has failed");
182  }
183  rm->Initialize(); // Initialization differs slightly in multi-threading.
184  // TODO: add more details about why this is here.
185  if(!m_useMT && rm->ConfirmBeamOnCondition()) {
186  rm->RunInitialization();
187  }
188 
189  ATH_MSG_INFO( "retireving the Detector Geometry Service" );
190  if(m_detGeoSvc.retrieve().isFailure()) {
191  throw std::runtime_error("Could not initialize ATLAS DetectorGeometrySvc!");
192  }
193 
194  if(m_userLimitsSvc.retrieve().isFailure()) {
195  throw std::runtime_error("Could not initialize ATLAS UserLimitsSvc!");
196  }
197 
198  if (m_activateParallelGeometries) {
199  G4VModularPhysicsList* thePhysicsList=dynamic_cast<G4VModularPhysicsList*>(m_physListSvc->GetPhysicsList());
200  if (!thePhysicsList) {
201  throw std::runtime_error("Failed dynamic_cast!! this is not a G4VModularPhysicsList!");
202  }
203 #if G4VERSION_NUMBER >= 1010
204  std::vector<std::string>& parallelWorldNames=m_detGeoSvc->GetParallelWorldNames();
205  for (auto& it: parallelWorldNames) {
206  thePhysicsList->RegisterPhysics(new G4ParallelWorldPhysics(it,true));
207  }
208 #endif
209  }
210 
211  return;
212 }
213 
214 //________________________________________________________________________
216 {
217  ATH_MSG_VERBOSE("++++++++++++ ISF G4 G4TransportTool finalized ++++++++++++");
218 
219  // One time finalization
220  try {
221  std::call_once(finalizeOnceFlag, &iGeant4::G4TransportTool::finalizeOnce, this);
222  }
223  catch(const std::exception& e) {
224  ATH_MSG_ERROR("Failure in iGeant4::G4TransportTool::finalizeOnce: " << e.what());
225  return StatusCode::FAILURE;
226  }
227 
228  if (m_doTiming) {
229  m_runTimer->Stop();
230  const float numEntriesFloat(m_nrOfEntries);
231  const float runTime=m_runTimer->GetUserElapsed()+m_runTimer->GetSystemElapsed();
232  const float avgTimePerEvent=(m_nrOfEntries>1) ? m_accumulatedEventTime/(numEntriesFloat-1.f) : runTime;
233  const float avgTimeSqPerEvent=(m_nrOfEntries>1) ? m_accumulatedEventTimeSq/(numEntriesFloat-1.f) : runTime*runTime;
234  const float sigma=(m_nrOfEntries>2) ? std::sqrt(std::abs(avgTimeSqPerEvent - avgTimePerEvent*avgTimePerEvent)/(numEntriesFloat-2.f)) : 0;
235  ATH_MSG_INFO("*****************************************"<<endmsg<<
236  "** **"<<endmsg<<
237  " End of run - time spent is "<<std::setprecision(4) <<
238  runTime<<endmsg<<
239  " Average time per event was "<<std::setprecision(4) <<
240  avgTimePerEvent <<" +- "<< std::setprecision(4) << sigma<<endmsg<<
241  "** **"<<endmsg<<
242  "*****************************************");
243  }
244 
245  return StatusCode::SUCCESS;
246 }
247 
248 //________________________________________________________________________
250 {
251  ATH_MSG_DEBUG("\t terminating the current G4 run");
252  auto runMgr = G4RunManager::GetRunManager();
253  runMgr->RunTermination();
254  return;
255 }
256 
257 //________________________________________________________________________
259 
260  // give a screen output that you entered Geant4SimSvc
261  ATH_MSG_VERBOSE( "Particle " << isp << " received for simulation." );
262 
264  // wrap the given ISFParticle into a STL vector of ISFParticles with length 1
265  // (minimizing code duplication)
266  const ISF::ISFParticleVector ispVector(1, &isp);
267  StatusCode success = this->simulateVector(ispVector, secondaries, mcEventCollection);
268  ATH_MSG_VERBOSE( "Simulation done" );
269 
270  // Geant4 call done
271  return success;
272 }
273 
274 //________________________________________________________________________
276 
277  ATH_MSG_DEBUG (name() << ".simulateVector(...) : Received a vector of " << particles.size() << " particles for simulation.");
279  G4Event* inputEvent{};
280  if (shadowTruth && !shadowTruth->empty()) {
281  inputEvent = m_inputConverter->ISF_to_G4Event(particles, genEvent(mcEventCollection), shadowTruth->back());
282  }
283  else{
284  inputEvent = m_inputConverter->ISF_to_G4Event(particles, genEvent(mcEventCollection));
285  }
286  if (!inputEvent) {
287  ATH_MSG_ERROR("ISF Event conversion failed ");
288  return StatusCode::FAILURE;
289  }
290 
291  ATH_MSG_DEBUG("Calling ISF_Geant4 ProcessEvent");
292  bool abort = false;
293  // Worker run manager
294  // Custom class has custom method call: ProcessEvent.
295  // So, grab custom singleton class directly, rather than base.
296  // Maybe that should be changed! Then we can use a base pointer.
297  if(m_useMT) {
298 #ifdef G4MULTITHREADED
299  auto* workerRM = G4AtlasWorkerRunManager::GetG4AtlasWorkerRunManager();
300  abort = workerRM->ProcessEvent(inputEvent);
301 #else
302  ATH_MSG_ERROR("Trying to use multi-threading in non-MT build!");
303  return StatusCode::FAILURE;
304 #endif
305  }
306  else {
307  auto* workerRM ATLAS_THREAD_SAFE = G4AtlasRunManager::GetG4AtlasRunManager(); // non-MT case
308  abort = workerRM->ProcessEvent(inputEvent);
309  }
310  if (abort) {
311  ATH_MSG_WARNING("Event was aborted !! ");
312  //ATH_MSG_WARNING("Simulation will now go on to the next event ");
313  //ATH_MSG_WARNING("setFilterPassed is now False");
314  //setFilterPassed(false);
315  return StatusCode::FAILURE;
316  }
317 
318  // Get user actions that return secondaries
319  auto actionsFound = m_secondaryActions.find( std::this_thread::get_id() );
320  if ( actionsFound == m_secondaryActions.end() ) {
321  // Get all UAs
322  std::vector< G4UserSteppingAction* > allActions;
323  StatusCode sc = m_userActionSvc->getSecondaryActions( allActions );
324  if ( !sc.isSuccess() ) {
325  ATH_MSG_ERROR( "Failed to retrieve secondaries from UASvc" );
326  return sc;
327  }
328 
329  // Find the UAs that can return secondaries
330  for ( G4UserSteppingAction* action : allActions ) {
331  passbackAction_t* castAction = dynamic_cast< passbackAction_t* >( action );
332  if ( castAction ) {
333  m_secondaryActions[ std::this_thread::get_id() ].push_back( castAction );
334  }
335  }
336 
337  actionsFound = m_secondaryActions.find( std::this_thread::get_id() );
338  }
339 
340  // Retrieve secondaries from user actions
341  for ( auto* action : actionsFound->second ) {
342  for ( auto& parent : particles ) {
343 
344  ISF::ISFParticleContainer someSecondaries = action->ReturnSecondaries( parent );
345 
346  secondaries.splice( begin(secondaries), std::move(someSecondaries) );
347  }
348  }
349 
350  // const DataHandle <TrackRecordCollection> tracks;
351 
352  // StatusCode sc = evtStore()->retrieve(tracks,m_trackCollName);
353 
354  // if (sc.isFailure()) {
355  // ATH_MSG_WARNING(" Cannot retrieve TrackRecordCollection " << m_trackCollName);
356  // }
357 
358  // not implemented yet... need to get particle stack from Geant4 and convert to ISFParticle
359  ATH_MSG_VERBOSE( "Simulation done" );
360 
361  // Geant4 call done
362  return StatusCode::SUCCESS;
363 }
364 
365 //________________________________________________________________________
367 {
368  ATH_MSG_DEBUG ( "setup Event" );
369 
370 #ifdef G4MULTITHREADED
371  // In some rare cases, TBB may create more physical worker threads than
372  // were requested via the pool size. This can happen at any time.
373  // In that case, those extra threads will not have had the thread-local
374  // initialization done, leading to a crash. Try to detect that and do
375  // the initialization now if needed.
376  if (m_useMT && G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume() == nullptr)
377  {
378  ToolHandle<IThreadInitTool> ti ("G4ThreadInitTool", nullptr);
379  ATH_CHECK( ti.retrieve() );
380  ti->initThread();
381  }
382 #endif
383 
384  // Set the RNG to use for this event. We need to reset it for MT jobs
385  // because of the mismatch between Gaudi slot-local and G4 thread-local RNG.
386  ATHRNG::RNGWrapper* rngWrapper = m_rndmGenSvc->getEngine(this, m_randomStreamName);
387  rngWrapper->setSeed( m_randomStreamName, ctx );
388  G4Random::setTheEngine(rngWrapper->getEngine(ctx));
389 
390  ATH_CHECK(m_senDetTool->BeginOfAthenaEvent());
391 
392  m_nrOfEntries++;
393  if (m_doTiming) m_eventTimer->Start();
394 
395  // make sure SD collections are properly initialized in every Athena event
396  G4SDManager::GetSDMpointer()->PrepareNewEvent();
397 
398  return StatusCode::SUCCESS;
399 }
400 
401 //________________________________________________________________________
403 {
404  ATH_MSG_DEBUG ( "release Event" );
407  /* todo: ELLI: the following is copied in from the PyG4AtlasAlg:
408  -> this somehow needs to be moved into C++
409  and put into releaseEvent() ( or setupEvent() ?)
410 
411  from ISF_Geant4Example import AtlasG4Eng
412  from ISF_Geant4Example.ISF_SimFlags import simFlags
413  if self.doFirstEventG4SeedsCheck :
414  if simFlags.SeedsG4.statusOn:
415  rnd = AtlasG4Eng.G4Eng.menu_G4RandomNrMenu()
416  rnd.set_Seed(simFlags.SeedsG4.get_Value())
417  self.doFirstEventG4SeedsCheck = False
418  if self.RndG4Menu.SaveStatus:
419  self.RndG4Menu.Menu.saveStatus('G4Seeds.txt')
420  */
421 
422  // print per-event timing info if enabled
423  if (m_doTiming) {
424  m_eventTimer->Stop();
425 
426  const double eventTime=m_eventTimer->GetUserElapsed()+m_eventTimer->GetSystemElapsed();
427  if (m_nrOfEntries>1) {
428  m_accumulatedEventTime +=eventTime;
429  m_accumulatedEventTimeSq+=eventTime*eventTime;
430  }
431 
432  const float numEntriesFloat(m_nrOfEntries);
433  const float avgTimePerEvent=(m_nrOfEntries>1) ? m_accumulatedEventTime/(numEntriesFloat-1.f) : eventTime;
434  const float avgTimeSqPerEvent=(m_nrOfEntries>1) ? m_accumulatedEventTimeSq/(numEntriesFloat-1.f) : eventTime*eventTime;
435  const float sigma=(m_nrOfEntries>2) ? std::sqrt(std::abs(avgTimeSqPerEvent - avgTimePerEvent*avgTimePerEvent)/(numEntriesFloat-2.f)) : 0;
436  ATH_MSG_INFO("\t Run:Event "<<ctx.eventID().run_number()<<":"<<ctx.eventID().event_number() << "\t ("<<m_nrOfEntries<<"th event for this worker) took " << std::setprecision(4) <<
437  eventTime << " s. New average " << std::setprecision(4) <<
438  avgTimePerEvent<<" +- "<<std::setprecision(4) << sigma);
439  }
440 
441  ATH_CHECK(m_senDetTool->EndOfAthenaEvent());
442  ATH_CHECK(m_fastSimTool->EndOfAthenaEvent());
443 
444  return StatusCode::SUCCESS;
445 }
446 
447 //________________________________________________________________________
448 HepMC::GenEvent* iGeant4::G4TransportTool::genEvent(McEventCollection* mcEventCollection) const
449 {
450 
451  if(!mcEventCollection) {
452  // retrieve McEventCollection from storegate
453  if (evtStore()->contains<McEventCollection>(m_mcEventCollectionName)) {
454  if (evtStore()->retrieve( mcEventCollection, m_mcEventCollectionName).isFailure()) {
455  ATH_MSG_ERROR( "Unable to retrieve McEventCollection with name=" << m_mcEventCollectionName
456  << ".");
457  return nullptr;
458  }
459  else {
460  ATH_MSG_WARNING( "Fallback. Sucessfully retrieved McEventCollection with name=" << m_mcEventCollectionName);
461  }
462  }
463  else { return nullptr; }
464  }
465  // collect last GenEvent from McEventCollection
466  return mcEventCollection->back();
467 }
468 
469 //________________________________________________________________________
470 void iGeant4::G4TransportTool::commandLog(int returnCode, const std::string& commandString) const
471 {
472  switch(returnCode) {
473  case 0: { ATH_MSG_DEBUG("G4 Command: " << commandString << " - Command Succeeded"); } break;
474  case 100: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Command Not Found!"); } break;
475  case 200: {
476  auto* stateManager = G4StateManager::GetStateManager();
477  ATH_MSG_DEBUG("G4 Command: " << commandString << " - Illegal Application State (" <<
478  stateManager->GetStateString(stateManager->GetCurrentState()) << ")!");
479  } break;
480  case 300: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Parameter Out of Range!"); } break;
481  case 400: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Parameter Unreadable!"); } break;
482  case 500: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Parameter Out of Candidates!"); } break;
483  case 600: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Alias Not Found!"); } break;
484  default: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Unknown Status!"); } break;
485  }
486 
487 }
488 
ISF::ISFParticleContainer
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
Definition: ISFParticleContainer.h:23
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
ATHRNG::RNGWrapper::setSeed
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition: RNGWrapper.h:169
iGeant4::G4TransportTool::G4TransportTool
G4TransportTool(const std::string &, const std::string &, const IInterface *)
Constructor.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:58
python.CaloRecoConfig.f
f
Definition: CaloRecoConfig.py:127
G4UA::iGeant4::TrackProcessorUserActionBase
Definition: TrackProcessorUserActionBase.h:33
pdg_comparison.sigma
sigma
Definition: pdg_comparison.py:324
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
G4AtlasMTRunManager.h
G4AtlasActionInitialization.h
ISFFluxRecorder.h
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
iGeant4::G4TransportTool::setupEvent
virtual StatusCode setupEvent(const EventContext &) override
Setup Event chain - in case of a begin-of event action is needed.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:366
ISF::ISFParticle
Definition: ISFParticle.h:42
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
G4AtlasUserWorkerThreadInitialization.h
GenParticle.h
iGeant4::G4TransportTool::simulate
virtual StatusCode simulate(ISF::ISFParticle &isp, ISF::ISFParticleContainer &secondaries, McEventCollection *mcEventCollection) override
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:258
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
ISFParticleContainer.h
iGeant4::G4TransportTool::genEvent
HepMC::GenEvent * genEvent(McEventCollection *mcEventCollection) const
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:448
G4AtlasRunManager.h
iGeant4::G4TransportTool::simulateVector
virtual StatusCode simulateVector(const ISF::ISFParticleVector &particles, ISF::ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *shadowTruth=nullptr) override
Simulation call for vectors of particles.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:275
ISFParticle.h
iGeant4::G4TransportTool::finalize
virtual StatusCode finalize() override final
AlgTool finalize method.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:215
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
McEventCollection.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
G4AtlasWorkerRunManager.h
ISF::ISFParticleVector
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Definition: ISFParticleContainer.h:26
calibdata.exception
exception
Definition: calibdata.py:496
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATLAS_NOT_THREAD_SAFE
void iGeant4::G4TransportTool::initializeOnce ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:105
AtlasRegionHelper.h
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
DataVector::back
const T * back() const
Access the last element in the collection as an rvalue.
iGeant4::G4TransportTool::releaseEvent
virtual StatusCode releaseEvent(const EventContext &) override
Release Event chain - in case of an end-of event action is needed.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:402
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
ATHRNG::RNGWrapper::getEngine
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition: RNGWrapper.h:134
RNGWrapper.h
iGeant4::G4TransportTool::commandLog
void commandLog(int returnCode, const std::string &commandString) const
This command prints a message about a G4Command depending on its returnCode.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:470
ISF::BaseSimulatorTool::initialize
virtual StatusCode initialize() override
Definition: BaseSimulatorTool.h:59
iGeant4::G4TransportTool::finalizeOnce
void finalizeOnce()
G4 finalization called only by the first tool instance.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:249
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
AtlasG4EventUserInfo.h
ISF
ISFParticleOrderedQueue.
Definition: PrimaryParticleInformation.h:13
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.action
action
Definition: CaloScaleNoiseConfig.py:77
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
PrimaryParticleInformation.h
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
iGeant4::G4TransportTool::initialize
virtual StatusCode initialize() override final
AlgTool initialize method.
Definition: ISF_Geant4/ISF_Geant4Tools/src/TransportTool.cxx:68
CI_EMPFlowData22test.returnCode
returnCode
Definition: CI_EMPFlowData22test.py:16
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
TransportTool.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
DataVector::empty
bool empty() const noexcept
Returns true if the collection is empty.