ATLAS Offline Software
Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
G4AtlasAlg Class Reference

Primary Athena algorithm for ATLAS simulation. More...

#include <G4AtlasAlg.h>

Inheritance diagram for G4AtlasAlg:
Collaboration diagram for G4AtlasAlg:

Public Member Functions

 G4AtlasAlg (const std::string &name, ISvcLocator *pSvcLocator)
 Standard algorithm constructor. More...
 
virtual ~G4AtlasAlg ()
 Virtual destructor. More...
 
bool isClonable () const override
 this Alg is Clonable (for AthenaMT) More...
 
StatusCode initialize ATLAS_NOT_THREAD_SAFE () override
 Initialize the algorithm. More...
 
StatusCode finalize () override
 Finalize the algorithm and invoke G4 run termination. More...
 
StatusCode execute () override
 Simulate one Athena event. More...
 
void initializeG4 ()
 Poorly named possibly unused method which sets some verbosities. More...
 
void initializeOnce ()
 G4 initialization called only by the first alg instance. More...
 
void finalizeOnce ()
 G4 finalization called only by the first alg instance. More...
 
virtual StatusCode sysInitialize () override
 Override sysInitialize. More...
 
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies. More...
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

void commandLog (int returnCode, const std::string &commandString) const
 This command prints a message about a G4Command depending on its returnCode. More...
 
void releaseGeoModel ()
 Releases the GeoModel geometry from memory once it has been used to build the G4 geometry and is no-longer required. More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

PublicToolHandleArray< G4UA::IUserActionToolm_actionTools {this, "UserActionTools", {}, "User action tools to be added to the G4 Action service."}
 
Gaudi::Property< std::string > m_simplifiedGeoPath {this, "SimplifiedGeoPath", "", "Path to the simplified geometry file used to transport particles"}
 
DataObjIDColl m_extendedExtraObjects
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 
Configurable Properties
Gaudi::Property< bool > m_killAbortedEvents {this, "KillAbortedEvents", false, ""}
 
Gaudi::Property< bool > m_flagAbortedEvents {this, "FlagAbortedEvents", false, ""}
 
SG::ReadHandleKey< McEventCollectionm_inputTruthCollectionKey {this, "InputTruthCollection", "BeamTruthEvent", "Input hard scatter collection"}
 input hard scatter collection More...
 
SG::WriteHandleKey< McEventCollectionm_outputTruthCollectionKey {this, "OutputTruthCollection", "TruthEvent", "Output hard scatter truth collection"}
 output hard scatter truth collection More...
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "EventInfo", "EventInfo", "EventInfo key"}
 
ServiceHandle< ISF::ITruthSvcm_truthRecordSvc {this, "TruthRecordService", "ISF_TruthRecordSvc", ""}
 Central Truth Service. More...
 
ServiceHandle< ISF::IGeoIDSvcm_geoIDSvc {this, "GeoIDSvc", "ISF_GeoIDSvc", ""}
 Geo ID Service. More...
 
std::map< std::string, std::string > m_verbosities
 Verbosity settings for Geant4. More...
 
Configurable Properties (common with TransportTool)
Gaudi::Property< std::string > m_libList {this, "Dll", "", ""}
 
Gaudi::Property< std::string > m_physList {this, "Physics", "", ""}
 
Gaudi::Property< std::string > m_fieldMap {this, "FieldMap", "", ""}
 
Gaudi::Property< std::string > m_rndmGen {this, "RandomGenerator", "athena", ""}
 
Gaudi::Property< bool > m_releaseGeoModel {this, "ReleaseGeoModel", true, ""}
 
Gaudi::Property< bool > m_recordFlux {this, "RecordFlux", false, ""}
 
Gaudi::Property< bool > m_quietMode {this, "QuietMode", false, ""}
 
Gaudi::Property< std::vector< std::string > > m_g4commands {this, "G4Commands", {}, "Commands to send to the G4UI"}
 Commands to send to the G4 UI. More...
 
Gaudi::Property< bool > m_useMT {this,"MultiThreading", false, "Multi-threading specific settings"}
 Activate multi-threading configuration. More...
 
Gaudi::Property< bool > m_activateParallelGeometries {this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}
 
BooleanProperty m_useShadowEvent {this, "UseShadowEvent", false, "New approach to selecting particles for simulation" }
 
ServiceHandle< IAthRNGSvcm_rndmGenSvc {this, "AtRndmGenSvc", "AthRNGSvc", ""}
 Random number service. More...
 
Gaudi::Property< std::string > m_randomStreamName {this, "RandomStreamName", "Geant4", ""}
 Random Stream Name. More...
 
ServiceHandle< IUserLimitsSvcm_userLimitsSvc {this, "UserLimitsSvc", "UserLimitsSvc", ""}
 
ServiceHandle< G4UA::IUserActionSvcm_userActionSvc {this, "UserActionSvc", "G4UA::UserActionSvc", ""}
 User Action Service. More...
 
ServiceHandle< IDetectorGeometrySvcm_detGeoSvc {this, "DetGeoSvc", "DetectorGeometrySvc", ""}
 Detector Geometry Service (builds G4 Geometry) More...
 
ServiceHandle< Simulation::IZeroLifetimePatcherm_qspatcher {this, "QuasiStablePatcher", "", "Quasi-Stable Particle Simulation Patcher"}
 Quasi-Stable Particle Simulation Patcher. More...
 
ToolHandle< ISF::IGenEventFilterm_truthPreselectionTool {this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"}
 
ServiceHandle< ISF::IInputConverterm_inputConverter {this, "InputConverter", "ISF_InputConverter", ""}
 Service to convert ISF_Particles into a G4Event. More...
 
ServiceHandle< IPhysicsListSvcm_physListSvc {this, "PhysicsListSvc", "PhysicsListSvc", ""}
 Physics List Tool. More...
 
PublicToolHandle< ISensitiveDetectorMasterToolm_senDetTool {this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}
 Sensitive Detector Master Tool. More...
 
PublicToolHandle< IFastSimulationMasterToolm_fastSimTool {this, "FastSimMasterTool", "FastSimulationMasterTool", ""}
 Fast Simulation Master Tool. More...
 

Detailed Description

Primary Athena algorithm for ATLAS simulation.

During initialization, this class sets up several things, including:

During the event loop, it handles processing of the event by invoking the (worker) run manager.

Definition at line 52 of file G4AtlasAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ G4AtlasAlg()

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

Standard algorithm constructor.

Definition at line 57 of file G4AtlasAlg.cxx.

58  : AthAlgorithm(name, pSvcLocator)
59 {
60  // Verbosities
61  declareProperty("Verbosities", m_verbosities);
62 }

◆ ~G4AtlasAlg()

virtual G4AtlasAlg::~G4AtlasAlg ( )
inlinevirtual

Virtual destructor.

Definition at line 61 of file G4AtlasAlg.h.

61 { };

Member Function Documentation

◆ ATLAS_NOT_THREAD_SAFE()

StatusCode initialize G4AtlasAlg::ATLAS_NOT_THREAD_SAFE ( )
override

Initialize the algorithm.

Here we setup several things for simulation, including:

  • force intialization of the UserActionSvc
  • apply custom G4 UI commands (like custom physics list)
  • configure the particle generator and random generator svc

◆ commandLog()

void G4AtlasAlg::commandLog ( int  returnCode,
const std::string &  commandString 
) const
private

This command prints a message about a G4Command depending on its returnCode.

Definition at line 483 of file G4AtlasAlg.cxx.

484 {
485  switch(returnCode) {
486  case 0: { ATH_MSG_DEBUG("G4 Command: " << commandString << " - Command Succeeded"); } break;
487  case 100: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Command Not Found!"); } break;
488  case 200: {
489  auto* stateManager = G4StateManager::GetStateManager();
490  ATH_MSG_DEBUG("G4 Command: " << commandString << " - Illegal Application State (" <<
491  stateManager->GetStateString(stateManager->GetCurrentState()) << ")!");
492  } break;
493  case 300: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Parameter Out of Range!"); } break;
494  case 400: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Parameter Unreadable!"); } break;
495  case 500: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Parameter Out of Candidates!"); } break;
496  case 600: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Alias Not Found!"); } break;
497  default: { ATH_MSG_ERROR("G4 Command: " << commandString << " - Unknown Status!"); } break;
498  }
499 
500 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ execute()

StatusCode G4AtlasAlg::execute ( )
override

Simulate one Athena event.

Definition at line 312 of file G4AtlasAlg.cxx.

313 {
314  static std::atomic<unsigned int> n_Event=0;
315  ATH_MSG_DEBUG("++++++++++++ G4AtlasAlg execute ++++++++++++");
316 
317 #ifdef G4MULTITHREADED
318  // In some rare cases, TBB may create more physical worker threads than
319  // were requested via the pool size. This can happen at any time.
320  // In that case, those extra threads will not have had the thread-local
321  // initialization done, leading to a crash. Try to detect that and do
322  // the initialization now if needed.
323  if (G4TransportationManager::GetTransportationManager()->GetNavigatorForTracking()->GetWorldVolume() == nullptr)
324  {
325  ToolHandle<IThreadInitTool> ti ("G4ThreadInitTool", nullptr);
326  ATH_CHECK( ti.retrieve() );
327  ti->initThread();
328  }
329 #endif
330 
331  n_Event += 1;
332 
333  if (n_Event<=10 || (n_Event%100) == 0) {
334  ATH_MSG_ALWAYS("G4AtlasAlg: Event num. " << n_Event << " start processing");
335  }
336 
337  // Release GeoModel Geometry if necessary
338  if (m_releaseGeoModel) {
339  try {
340  std::call_once(releaseGeoModelOnceFlag, &G4AtlasAlg::releaseGeoModel, this);
341  }
342  catch(const std::exception& e) {
343  ATH_MSG_ERROR("Failure in G4AtlasAlg::releaseGeoModel: " << e.what());
344  return StatusCode::FAILURE;
345  }
346  }
347 
348  const EventContext& ctx = Gaudi::Hive::currentContext();
349  // Set the RNG to use for this event. We need to reset it for MT jobs
350  // because of the mismatch between Gaudi slot-local and G4 thread-local RNG.
351  ATHRNG::RNGWrapper* rngWrapper = m_rndmGenSvc->getEngine(this, m_randomStreamName);
352  rngWrapper->setSeed( m_randomStreamName, ctx);
353  G4Random::setTheEngine(*rngWrapper);
354 
355  ATH_MSG_DEBUG("Calling SimulateG4Event");
356 
357  ATH_CHECK(m_senDetTool->BeginOfAthenaEvent());
358  ATH_CHECK(m_fastSimTool->BeginOfAthenaEvent());
359 
361  if (!inputTruthCollection.isValid()) {
362  ATH_MSG_FATAL("Unable to read input GenEvent collection " << inputTruthCollection.name() << " in store " << inputTruthCollection.store());
363  return StatusCode::FAILURE;
364  }
365  ATH_MSG_DEBUG("Found input GenEvent collection " << inputTruthCollection.name() << " in store " << inputTruthCollection.store());
366  // create the output Truth collection
368  std::unique_ptr<McEventCollection> shadowTruth{};
369  if (m_useShadowEvent) {
370  outputTruthCollection = std::make_unique<McEventCollection>();
371  // copy input Evgen collection to shadow Truth collection
372  shadowTruth = std::make_unique<McEventCollection>(*inputTruthCollection);
373  for (HepMC::GenEvent* currentGenEvent : *shadowTruth ) {
374  // Apply QS patch if required
375  if ( not m_qspatcher.empty() ) {
376  ATH_CHECK(m_qspatcher->applyWorkaround(*currentGenEvent));
377  }
378  // Copy GenEvent and remove daughters of quasi-stable particles to be simulated
379  std::unique_ptr<HepMC::GenEvent> outputEvent = m_truthPreselectionTool->filterGenEvent(*currentGenEvent);
380  outputTruthCollection->push_back(outputEvent.release());
381  }
382  }
383  else {
384  // copy input Evgen collection to output Truth collection
385  outputTruthCollection = std::make_unique<McEventCollection>(*inputTruthCollection);
386  // empty shadow Truth collection
387  shadowTruth = std::make_unique<McEventCollection>();
388  // Apply QS patch if required
389  if ( not m_qspatcher.empty() ) {
390  for (HepMC::GenEvent* currentGenEvent : *outputTruthCollection ) {
391  ATH_CHECK(m_qspatcher->applyWorkaround(*currentGenEvent));
392  }
393  }
394  }
395 
396  ATH_MSG_DEBUG("Recorded output GenEvent collection " << outputTruthCollection.name() << " in store " << outputTruthCollection.store());
397 
398  const int largestGeneratedParticleBC = (outputTruthCollection->empty()) ? HepMC::UNDEFINED_ID
399  : HepMC::maxGeneratedParticleBarcode(outputTruthCollection->at(0)); // TODO make this more robust
400  const int largestGeneratedVertexBC = (outputTruthCollection->empty()) ? HepMC::UNDEFINED_ID
401  : HepMC::maxGeneratedVertexBarcode(outputTruthCollection->at(0)); // TODO make this more robust
402  // tell TruthService we're starting a new event
403  ATH_CHECK( m_truthRecordSvc->initializeTruthCollection(largestGeneratedParticleBC, largestGeneratedVertexBC) );
404 
405  G4Event *inputEvent{};
406  ATH_CHECK( m_inputConverter->convertHepMCToG4Event(ctx, *outputTruthCollection, inputEvent, *shadowTruth) );
407 
408  bool abort = false;
409  // Worker run manager
410  // Custom class has custom method call: ProcessEvent.
411  // So, grab custom singleton class directly, rather than base.
412  // Maybe that should be changed! Then we can use a base pointer.
413  if(m_useMT) {
414 #ifdef G4MULTITHREADED
415  auto* workerRM = G4AtlasWorkerRunManager::GetG4AtlasWorkerRunManager();
416  abort = workerRM->ProcessEvent(inputEvent);
417 #else
418  ATH_MSG_ERROR("Trying to use multi-threading in non-MT build!");
419  return StatusCode::FAILURE;
420 #endif
421  }
422  else {
423  auto* workerRM ATLAS_THREAD_SAFE = // single-threaded case
424  G4AtlasRunManager::GetG4AtlasRunManager();
425  abort = workerRM->ProcessEvent(inputEvent);
426  }
427  if (abort) {
428  ATH_MSG_WARNING("Event was aborted !! ");
429  ATH_MSG_WARNING("Simulation will now go on to the next event ");
430  if (m_killAbortedEvents) {
431  ATH_MSG_WARNING("setFilterPassed is now False");
432  setFilterPassed(false);
433  }
434  if (m_flagAbortedEvents) {
436  if (!eventInfo.isValid()) {
437  ATH_MSG_FATAL( "Failed to retrieve xAOD::EventInfo while trying to update the error state!" );
438  return StatusCode::FAILURE;
439  }
440  else {
441  eventInfo->updateErrorState(xAOD::EventInfo::Core,xAOD::EventInfo::Error);
442  ATH_MSG_WARNING( "Set error state in xAOD::EventInfo!" );
443  }
444  }
445  }
446 
447  // Register all of the collections if there are any new-style SDs
448  ATH_CHECK(m_senDetTool->EndOfAthenaEvent());
449  ATH_CHECK(m_fastSimTool->EndOfAthenaEvent());
450 
451  ATH_CHECK( m_truthRecordSvc->releaseEvent() );
452 
453  // Remove QS patch if required
454  if(!m_qspatcher.empty()) {
455  for (HepMC::GenEvent* currentGenEvent : *outputTruthCollection ) {
456  ATH_CHECK(m_qspatcher->removeWorkaround(*currentGenEvent));
457  }
458  }
459 
460  return StatusCode::SUCCESS;
461 }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 50 of file AthAlgorithm.cxx.

51 {
52  // If we didn't find any symlinks to add, just return the collection
53  // from the base class. Otherwise, return the extended collection.
54  if (!m_extendedExtraObjects.empty()) {
56  }
57  return Algorithm::extraOutputDeps();
58 }

◆ finalize()

StatusCode G4AtlasAlg::finalize ( )
override

Finalize the algorithm and invoke G4 run termination.

Definition at line 285 of file G4AtlasAlg.cxx.

286 {
287  ATH_MSG_DEBUG(std::endl<<std::endl<<std::endl);
288  ATH_MSG_DEBUG("++++++++++++ G4AtlasAlg finalized ++++++++++++" <<std::endl<<std::endl);
289 
290  // One time finalization
291  try {
292  std::call_once(finalizeOnceFlag, &G4AtlasAlg::finalizeOnce, this);
293  }
294  catch(const std::exception& e) {
295  ATH_MSG_ERROR("Failure in G4AtlasAlg::finalizeOnce: " << e.what());
296  return StatusCode::FAILURE;
297  }
298 
299  return StatusCode::SUCCESS;
300 }

◆ finalizeOnce()

void G4AtlasAlg::finalizeOnce ( )

G4 finalization called only by the first alg instance.

This is done (for now) because we get multiple alg instances in hive.

Definition at line 303 of file G4AtlasAlg.cxx.

304 {
305  ATH_MSG_DEBUG("\t terminating the current G4 run");
306  auto runMgr = G4RunManager::GetRunManager();
307  runMgr->RunTermination();
308 }

◆ initializeG4()

void G4AtlasAlg::initializeG4 ( )

Poorly named possibly unused method which sets some verbosities.

Definition at line 252 of file G4AtlasAlg.cxx.

253 {
254  if (m_verbosities.size()>0) {
255  G4TransportationManager *tm = G4TransportationManager::GetTransportationManager();
256  G4RunManagerKernel *rmk = G4RunManagerKernel::GetRunManagerKernel();
257  G4EventManager *em = G4EventManager::GetEventManager();
258 
259  auto itr = m_verbosities.end();
260  if ((itr = m_verbosities.find("Navigator")) != m_verbosities.end()) {
261  tm->GetNavigatorForTracking()->SetVerboseLevel( atof(itr->second.data()) );
262  }
263  if ((itr = m_verbosities.find("Propagator")) != m_verbosities.end()) {
264  tm->GetPropagatorInField()->SetVerboseLevel( atof(itr->second.data()) );
265  }
266  if ((itr = m_verbosities.find("Tracking")) != m_verbosities.end()) {
267  rmk->GetTrackingManager()->SetVerboseLevel( atof(itr->second.data()) );
268  }
269  if ((itr = m_verbosities.find("Stepping")) != m_verbosities.end()) {
270  rmk->GetTrackingManager()->GetSteppingManager()->
271  SetVerboseLevel( atof(itr->second.data()) );
272  }
273  if ((itr = m_verbosities.find("Stacking")) != m_verbosities.end()) {
274  rmk->GetStackManager()->SetVerboseLevel( atof(itr->second.data()) );
275  }
276  if ((itr = m_verbosities.find("Event")) != m_verbosities.end()) {
277  em->SetVerboseLevel( atof(itr->second.data()) );
278  }
279  } // End of the setting of verbosities
280 
281 }

◆ initializeOnce()

void G4AtlasAlg::initializeOnce ( )

G4 initialization called only by the first alg instance.

This is done (for now) because we get multiple alg instances in hive.

Definition at line 133 of file G4AtlasAlg.cxx.

134 {
135  // Assign physics list
136  if(m_physListSvc.retrieve().isFailure()) {
137  throw std::runtime_error("Could not initialize ATLAS PhysicsListSvc!");
138  }
139  for (const auto& action_tool : m_actionTools) {
140  if (m_userActionSvc->addActionTool(action_tool).isFailure()) {
141  throw std::runtime_error("Failed to add action tool "+action_tool.name());
142  }
143  }
144 
145  // Create the (master) run manager
146  if(m_useMT) {
147 #ifdef G4MULTITHREADED
148  auto* runMgr ATLAS_THREAD_SAFE = // protected by std::call_once above
149  G4AtlasMTRunManager::GetG4AtlasMTRunManager();
150  m_physListSvc->SetPhysicsList();
151  runMgr->SetDetGeoSvc( m_detGeoSvc.typeAndName() );
152  runMgr->SetFastSimMasterTool(m_fastSimTool.typeAndName() );
153  runMgr->SetPhysListSvc( m_physListSvc.typeAndName() );
154  runMgr->SetQuietMode( m_quietMode );
155  // Worker Thread initialization used to create worker run manager on demand.
156  std::unique_ptr<G4AtlasUserWorkerThreadInitialization> workerInit =
157  std::make_unique<G4AtlasUserWorkerThreadInitialization>();
158  workerInit->SetDetGeoSvc( m_detGeoSvc.typeAndName() );
159  workerInit->SetFastSimMasterTool( m_fastSimTool.typeAndName() );
160  workerInit->SetQuietMode( m_quietMode );
161  runMgr->SetUserInitialization( workerInit.release() );
162  std::unique_ptr<G4AtlasActionInitialization> actionInitialization =
163  std::make_unique<G4AtlasActionInitialization>(m_userActionSvc.get());
164  runMgr->SetUserInitialization(actionInitialization.release());
165 #else
166  throw std::runtime_error("Trying to use multi-threading in non-MT build!");
167 #endif
168  }
169  // Single-threaded run manager
170  else {
171  auto* runMgr ATLAS_THREAD_SAFE = // safe because single-threaded
172  G4AtlasRunManager::GetG4AtlasRunManager();
173  m_physListSvc->SetPhysicsList();
174  runMgr->SetRecordFlux( m_recordFlux, std::make_unique<G4AtlasFluxRecorder>() );
175  runMgr->SetLogLevel( int(msg().level()) ); // Synch log levels
176  runMgr->SetDetGeoSvc( m_detGeoSvc.typeAndName() );
177  runMgr->SetFastSimMasterTool(m_fastSimTool.typeAndName() );
178  runMgr->SetPhysListSvc(m_physListSvc.typeAndName() );
179  runMgr->SetQuietMode( m_quietMode );
180  std::unique_ptr<G4AtlasActionInitialization> actionInitialization =
181  std::make_unique<G4AtlasActionInitialization>(m_userActionSvc.get());
182  runMgr->SetUserInitialization(actionInitialization.release());
183  }
184 
185  // G4 user interface commands
186  G4UImanager *ui = G4UImanager::GetUIpointer();
187 
188  // Load custom libraries
189  if (!m_libList.empty()) {
190  ATH_MSG_INFO("G4AtlasAlg specific libraries requested ");
191  std::string temp="/load "+m_libList;
192  ui->ApplyCommand(temp);
193  }
194  // Load custom physics
195  if (!m_physList.empty()) {
196  ATH_MSG_INFO("requesting a specific physics list "<< m_physList);
197  std::string temp="/Physics/GetPhysicsList "+m_physList;
198  ui->ApplyCommand(temp);
199  }
200  // Load custom magnetic field
201  if (!m_fieldMap.empty()) {
202  ATH_MSG_INFO("requesting a specific field map "<< m_fieldMap);
203  ATH_MSG_INFO("the field is initialized straight away");
204  std::string temp="/MagneticField/Select "+m_fieldMap;
205  ui->ApplyCommand(temp);
206  ui->ApplyCommand("/MagneticField/Initialize");
207  }
208 
209  // Send UI commands
210  ATH_MSG_DEBUG("G4 Command: Trying at the end of initializeOnce()");
211  for (const auto& g4command : m_g4commands) {
212  int returnCode = ui->ApplyCommand( g4command );
213  commandLog(returnCode, g4command);
214  }
215 
216  // Code from G4AtlasSvc
217  auto* rm = G4RunManager::GetRunManager();
218  if(!rm) {
219  throw std::runtime_error("Run manager retrieval has failed");
220  }
221  rm->Initialize(); // Initialization differs slightly in multi-threading.
222  // TODO: add more details about why this is here.
223  if(!m_useMT && rm->ConfirmBeamOnCondition()) {
224  rm->RunInitialization();
225  }
226 
227  ATH_MSG_INFO( "retireving the Detector Geometry Service" );
228  if(m_detGeoSvc.retrieve().isFailure()) {
229  throw std::runtime_error("Could not initialize ATLAS DetectorGeometrySvc!");
230  }
231 
232  if(m_userLimitsSvc.retrieve().isFailure()) {
233  throw std::runtime_error("Could not initialize ATLAS UserLimitsSvc!");
234  }
235 
237  G4VModularPhysicsList* thePhysicsList=dynamic_cast<G4VModularPhysicsList*>(m_physListSvc->GetPhysicsList());
238  if (!thePhysicsList) {
239  throw std::runtime_error("Failed dynamic_cast!! this is not a G4VModularPhysicsList!");
240  }
241 #if G4VERSION_NUMBER >= 1010
242  std::vector<std::string>& parallelWorldNames=m_detGeoSvc->GetParallelWorldNames();
243  for (auto& it: parallelWorldNames) {
244  thePhysicsList->RegisterPhysics(new G4ParallelWorldPhysics(it,true));
245  }
246 #endif
247  }
248 
249  return;
250 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

bool G4AtlasAlg::isClonable ( ) const
inlineoverride

this Alg is Clonable (for AthenaMT)

Definition at line 64 of file G4AtlasAlg.h.

64 { return true; }

◆ msg() [1/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< Algorithm >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< Algorithm >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ releaseGeoModel()

void G4AtlasAlg::releaseGeoModel ( )
private

Releases the GeoModel geometry from memory once it has been used to build the G4 geometry and is no-longer required.

Definition at line 465 of file G4AtlasAlg.cxx.

466 {
467  SmartIF<IGeoModelSvc> geoModel{Gaudi::svcLocator()->service("GeoModelSvc")};
468  if (!geoModel) {
469  ATH_MSG_WARNING( " ----> Unable to retrieve GeoModelSvc" );
470  }
471  else {
472  if (geoModel->clear().isFailure()) {
473  ATH_MSG_WARNING( " ----> GeoModelSvc::clear() failed" );
474  }
475  else {
476  ATH_MSG_INFO( " ----> GeoModelSvc::clear() succeeded " );
477  }
478  }
479  m_releaseGeoModel=false; // Don't do that again...
480  return;
481 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< Algorithm > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ sysInitialize()

StatusCode AthAlgorithm::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, PyAthena::Alg, and AthHistogramAlgorithm.

Definition at line 66 of file AthAlgorithm.cxx.

66  {
68 
69  if (sc.isFailure()) {
70  return sc;
71  }
72  ServiceHandle<ICondSvc> cs("CondSvc",name());
73  for (auto h : outputHandles()) {
74  if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75  // do this inside the loop so we don't create the CondSvc until needed
76  if ( cs.retrieve().isFailure() ) {
77  ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78  return StatusCode::SUCCESS;
79  }
80  if (cs->regHandle(this,*h).isFailure()) {
81  sc = StatusCode::FAILURE;
82  ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83  << " with CondSvc");
84  }
85  }
86  }
87  return sc;
88 }

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

Member Data Documentation

◆ m_actionTools

PublicToolHandleArray<G4UA::IUserActionTool> G4AtlasAlg::m_actionTools {this, "UserActionTools", {}, "User action tools to be added to the G4 Action service."}
private

Definition at line 157 of file G4AtlasAlg.h.

◆ m_activateParallelGeometries

Gaudi::Property<bool> G4AtlasAlg::m_activateParallelGeometries {this, "ActivateParallelWorlds", false, "Toggle on/off the G4 parallel geometry system"}
private

Definition at line 130 of file G4AtlasAlg.h.

◆ m_detGeoSvc

ServiceHandle<IDetectorGeometrySvc> G4AtlasAlg::m_detGeoSvc {this, "DetGeoSvc", "DetectorGeometrySvc", ""}
private

Detector Geometry Service (builds G4 Geometry)

Definition at line 141 of file G4AtlasAlg.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> G4AtlasAlg::m_eventInfoKey {this, "EventInfo", "EventInfo", "EventInfo key"}
private

Definition at line 106 of file G4AtlasAlg.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_fastSimTool

PublicToolHandle<IFastSimulationMasterTool> G4AtlasAlg::m_fastSimTool {this, "FastSimMasterTool", "FastSimulationMasterTool", ""}
private

Fast Simulation Master Tool.

Definition at line 155 of file G4AtlasAlg.h.

◆ m_fieldMap

Gaudi::Property<std::string> G4AtlasAlg::m_fieldMap {this, "FieldMap", "", ""}
private

Definition at line 121 of file G4AtlasAlg.h.

◆ m_flagAbortedEvents

Gaudi::Property<bool> G4AtlasAlg::m_flagAbortedEvents {this, "FlagAbortedEvents", false, ""}
private

Definition at line 103 of file G4AtlasAlg.h.

◆ m_g4commands

Gaudi::Property<std::vector<std::string> > G4AtlasAlg::m_g4commands {this, "G4Commands", {}, "Commands to send to the G4UI"}
private

Commands to send to the G4 UI.

Definition at line 127 of file G4AtlasAlg.h.

◆ m_geoIDSvc

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

Geo ID Service.

Definition at line 111 of file G4AtlasAlg.h.

◆ m_inputConverter

ServiceHandle<ISF::IInputConverter> G4AtlasAlg::m_inputConverter {this, "InputConverter", "ISF_InputConverter", ""}
private

Service to convert ISF_Particles into a G4Event.

Definition at line 149 of file G4AtlasAlg.h.

◆ m_inputTruthCollectionKey

SG::ReadHandleKey<McEventCollection> G4AtlasAlg::m_inputTruthCollectionKey {this, "InputTruthCollection", "BeamTruthEvent", "Input hard scatter collection"}
private

input hard scatter collection

Definition at line 104 of file G4AtlasAlg.h.

◆ m_killAbortedEvents

Gaudi::Property<bool> G4AtlasAlg::m_killAbortedEvents {this, "KillAbortedEvents", false, ""}
private

Definition at line 102 of file G4AtlasAlg.h.

◆ m_libList

Gaudi::Property<std::string> G4AtlasAlg::m_libList {this, "Dll", "", ""}
private

Definition at line 119 of file G4AtlasAlg.h.

◆ m_outputTruthCollectionKey

SG::WriteHandleKey<McEventCollection> G4AtlasAlg::m_outputTruthCollectionKey {this, "OutputTruthCollection", "TruthEvent", "Output hard scatter truth collection"}
private

output hard scatter truth collection

Definition at line 105 of file G4AtlasAlg.h.

◆ m_physList

Gaudi::Property<std::string> G4AtlasAlg::m_physList {this, "Physics", "", ""}
private

Definition at line 120 of file G4AtlasAlg.h.

◆ m_physListSvc

ServiceHandle<IPhysicsListSvc> G4AtlasAlg::m_physListSvc {this, "PhysicsListSvc", "PhysicsListSvc", ""}
private

Physics List Tool.

Definition at line 151 of file G4AtlasAlg.h.

◆ m_qspatcher

ServiceHandle<Simulation::IZeroLifetimePatcher> G4AtlasAlg::m_qspatcher {this, "QuasiStablePatcher", "", "Quasi-Stable Particle Simulation Patcher"}
private

Quasi-Stable Particle Simulation Patcher.

Definition at line 144 of file G4AtlasAlg.h.

◆ m_quietMode

Gaudi::Property<bool> G4AtlasAlg::m_quietMode {this, "QuietMode", false, ""}
private

Definition at line 125 of file G4AtlasAlg.h.

◆ m_randomStreamName

Gaudi::Property<std::string> G4AtlasAlg::m_randomStreamName {this, "RandomStreamName", "Geant4", ""}
private

Random Stream Name.

Definition at line 135 of file G4AtlasAlg.h.

◆ m_recordFlux

Gaudi::Property<bool> G4AtlasAlg::m_recordFlux {this, "RecordFlux", false, ""}
private

Definition at line 124 of file G4AtlasAlg.h.

◆ m_releaseGeoModel

Gaudi::Property<bool> G4AtlasAlg::m_releaseGeoModel {this, "ReleaseGeoModel", true, ""}
private

Definition at line 123 of file G4AtlasAlg.h.

◆ m_rndmGen

Gaudi::Property<std::string> G4AtlasAlg::m_rndmGen {this, "RandomGenerator", "athena", ""}
private

Definition at line 122 of file G4AtlasAlg.h.

◆ m_rndmGenSvc

ServiceHandle<IAthRNGSvc> G4AtlasAlg::m_rndmGenSvc {this, "AtRndmGenSvc", "AthRNGSvc", ""}
private

Random number service.

Definition at line 133 of file G4AtlasAlg.h.

◆ m_senDetTool

PublicToolHandle<ISensitiveDetectorMasterTool> G4AtlasAlg::m_senDetTool {this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}
private

Sensitive Detector Master Tool.

Definition at line 153 of file G4AtlasAlg.h.

◆ m_simplifiedGeoPath

Gaudi::Property<std::string> G4AtlasAlg::m_simplifiedGeoPath {this, "SimplifiedGeoPath", "", "Path to the simplified geometry file used to transport particles"}
private

Definition at line 159 of file G4AtlasAlg.h.

◆ m_truthPreselectionTool

ToolHandle<ISF::IGenEventFilter> G4AtlasAlg::m_truthPreselectionTool {this, "TruthPreselectionTool", "", "Tool for filtering out quasi-stable particle daughters"}
private

Definition at line 146 of file G4AtlasAlg.h.

◆ m_truthRecordSvc

ServiceHandle<ISF::ITruthSvc> G4AtlasAlg::m_truthRecordSvc {this, "TruthRecordService", "ISF_TruthRecordSvc", ""}
private

Central Truth Service.

Definition at line 109 of file G4AtlasAlg.h.

◆ m_useMT

Gaudi::Property<bool> G4AtlasAlg::m_useMT {this,"MultiThreading", false, "Multi-threading specific settings"}
private

Activate multi-threading configuration.

Definition at line 129 of file G4AtlasAlg.h.

◆ m_userActionSvc

ServiceHandle<G4UA::IUserActionSvc> G4AtlasAlg::m_userActionSvc {this, "UserActionSvc", "G4UA::UserActionSvc", ""}
private

User Action Service.

Definition at line 139 of file G4AtlasAlg.h.

◆ m_userLimitsSvc

ServiceHandle<IUserLimitsSvc> G4AtlasAlg::m_userLimitsSvc {this, "UserLimitsSvc", "UserLimitsSvc", ""}
private

Definition at line 137 of file G4AtlasAlg.h.

◆ m_useShadowEvent

BooleanProperty G4AtlasAlg::m_useShadowEvent {this, "UseShadowEvent", false, "New approach to selecting particles for simulation" }
private

Definition at line 131 of file G4AtlasAlg.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_verbosities

std::map<std::string,std::string> G4AtlasAlg::m_verbosities
private

Verbosity settings for Geant4.

Definition at line 114 of file G4AtlasAlg.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
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
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
G4AtlasAlg::m_flagAbortedEvents
Gaudi::Property< bool > m_flagAbortedEvents
Definition: G4AtlasAlg.h:103
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
G4AtlasAlg::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
Definition: G4AtlasAlg.h:106
SG::ReadHandle< McEventCollection >
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
G4AtlasAlg::m_senDetTool
PublicToolHandle< ISensitiveDetectorMasterTool > m_senDetTool
Sensitive Detector Master Tool.
Definition: G4AtlasAlg.h:153
G4AtlasAlg::m_fieldMap
Gaudi::Property< std::string > m_fieldMap
Definition: G4AtlasAlg.h:121
skel.it
it
Definition: skel.GENtoEVGEN.py:396
HepMC::maxGeneratedVertexBarcode
int maxGeneratedVertexBarcode(const HepMC::GenEvent *genEvent)
Get the maximal absolute value of barcode of vertex present in the event. Returns a negative number.
Definition: MagicNumbers.h:432
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
G4AtlasAlg::m_recordFlux
Gaudi::Property< bool > m_recordFlux
Definition: G4AtlasAlg.h:124
G4AtlasAlg::m_detGeoSvc
ServiceHandle< IDetectorGeometrySvc > m_detGeoSvc
Detector Geometry Service (builds G4 Geometry)
Definition: G4AtlasAlg.h:141
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
G4AtlasAlg::m_releaseGeoModel
Gaudi::Property< bool > m_releaseGeoModel
Definition: G4AtlasAlg.h:123
G4AtlasAlg::m_physListSvc
ServiceHandle< IPhysicsListSvc > m_physListSvc
Physics List Tool.
Definition: G4AtlasAlg.h:151
G4AtlasAlg::m_randomStreamName
Gaudi::Property< std::string > m_randomStreamName
Random Stream Name.
Definition: G4AtlasAlg.h:135
G4AtlasAlg::commandLog
void commandLog(int returnCode, const std::string &commandString) const
This command prints a message about a G4Command depending on its returnCode.
Definition: G4AtlasAlg.cxx:483
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
python.iconfTool.models.loaders.level
level
Definition: loaders.py:20
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
xAOD::EventInfo_v1::Error
@ Error
The sub-detector issued an error.
Definition: EventInfo_v1.h:349
G4AtlasAlg::m_userLimitsSvc
ServiceHandle< IUserLimitsSvc > m_userLimitsSvc
Definition: G4AtlasAlg.h:137
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:27
G4AtlasAlg::m_truthPreselectionTool
ToolHandle< ISF::IGenEventFilter > m_truthPreselectionTool
Definition: G4AtlasAlg.h:146
G4AtlasAlg::m_inputTruthCollectionKey
SG::ReadHandleKey< McEventCollection > m_inputTruthCollectionKey
input hard scatter collection
Definition: G4AtlasAlg.h:104
G4AtlasAlg::m_inputConverter
ServiceHandle< ISF::IInputConverter > m_inputConverter
Service to convert ISF_Particles into a G4Event.
Definition: G4AtlasAlg.h:149
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
AthAlgorithm::sysInitialize
virtual StatusCode sysInitialize() override
Override sysInitialize.
Definition: AthAlgorithm.cxx:66
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
AthCommonDataStore< AthCommonMsg< Algorithm > >::outputHandles
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
G4AtlasAlg::m_fastSimTool
PublicToolHandle< IFastSimulationMasterTool > m_fastSimTool
Fast Simulation Master Tool.
Definition: G4AtlasAlg.h:155
G4AtlasAlg::finalizeOnce
void finalizeOnce()
G4 finalization called only by the first alg instance.
Definition: G4AtlasAlg.cxx:303
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
G4AtlasAlg::m_useShadowEvent
BooleanProperty m_useShadowEvent
Definition: G4AtlasAlg.h:131
calibdata.exception
exception
Definition: calibdata.py:496
ATH_MSG_ALWAYS
#define ATH_MSG_ALWAYS(x)
Definition: AthMsgStreamMacros.h:35
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthCommonDataStore< AthCommonMsg< Algorithm > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
CxxUtils::atof
double atof(std::string_view str)
Converts a string into a double / float.
Definition: Control/CxxUtils/Root/StringUtils.cxx:91
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
G4AtlasAlg::m_g4commands
Gaudi::Property< std::vector< std::string > > m_g4commands
Commands to send to the G4 UI.
Definition: G4AtlasAlg.h:127
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ATHRNG::RNGWrapper
A wrapper class for event-slot-local random engines.
Definition: RNGWrapper.h:56
G4AtlasAlg::releaseGeoModel
void releaseGeoModel()
Releases the GeoModel geometry from memory once it has been used to build the G4 geometry and is no-l...
Definition: G4AtlasAlg.cxx:465
G4AtlasAlg::m_physList
Gaudi::Property< std::string > m_physList
Definition: G4AtlasAlg.h:120
SG::WriteHandle< McEventCollection >
G4AtlasAlg::m_useMT
Gaudi::Property< bool > m_useMT
Activate multi-threading configuration.
Definition: G4AtlasAlg.h:129
AthAlgorithm::m_extendedExtraObjects
DataObjIDColl m_extendedExtraObjects
Definition: AthAlgorithm.h:79
a
TList * a
Definition: liststreamerinfos.cxx:10
G4AtlasAlg::m_truthRecordSvc
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
Central Truth Service.
Definition: G4AtlasAlg.h:109
G4AtlasAlg::m_actionTools
PublicToolHandleArray< G4UA::IUserActionTool > m_actionTools
Definition: G4AtlasAlg.h:157
h
HepMC::maxGeneratedParticleBarcode
int maxGeneratedParticleBarcode(const HepMC::GenEvent *genEvent)
Get the maximal value of barcode of particle present in the event.
Definition: MagicNumbers.h:415
G4AtlasAlg::m_quietMode
Gaudi::Property< bool > m_quietMode
Definition: G4AtlasAlg.h:125
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
G4AtlasAlg::m_verbosities
std::map< std::string, std::string > m_verbosities
Verbosity settings for Geant4.
Definition: G4AtlasAlg.h:114
AthCommonMsg< Algorithm >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
G4AtlasAlg::m_userActionSvc
ServiceHandle< G4UA::IUserActionSvc > m_userActionSvc
User Action Service.
Definition: G4AtlasAlg.h:139
G4AtlasAlg::m_qspatcher
ServiceHandle< Simulation::IZeroLifetimePatcher > m_qspatcher
Quasi-Stable Particle Simulation Patcher.
Definition: G4AtlasAlg.h:144
AthAlgorithm::AthAlgorithm
AthAlgorithm()
Default constructor:
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
G4AtlasAlg::m_killAbortedEvents
Gaudi::Property< bool > m_killAbortedEvents
Definition: G4AtlasAlg.h:102
ATLAS_THREAD_SAFE
#define ATLAS_THREAD_SAFE
Definition: checker_macros.h:211
LHEF::Writer
Pythia8::Writer Writer
Definition: Prophecy4fMerger.cxx:12
G4AtlasAlg::m_rndmGenSvc
ServiceHandle< IAthRNGSvc > m_rndmGenSvc
Random number service.
Definition: G4AtlasAlg.h:133
G4AtlasAlg::m_libList
Gaudi::Property< std::string > m_libList
Definition: G4AtlasAlg.h:119
G4AtlasAlg::m_outputTruthCollectionKey
SG::WriteHandleKey< McEventCollection > m_outputTruthCollectionKey
output hard scatter truth collection
Definition: G4AtlasAlg.h:105
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
xAOD::EventInfo_v1::Core
@ Core
Core flags describing the event.
Definition: EventInfo_v1.h:339
fitman.k
k
Definition: fitman.py:528
G4AtlasAlg::m_activateParallelGeometries
Gaudi::Property< bool > m_activateParallelGeometries
Definition: G4AtlasAlg.h:130
ServiceHandle< ICondSvc >