 |
ATLAS Offline Software
|
#include <G4LegacyTransportTool.h>
|
| | G4LegacyTransportTool (const std::string &, const std::string &, const IInterface *) |
| | Constructor. More...
|
| |
| virtual | ~G4LegacyTransportTool ()=default |
| | Destructor. More...
|
| |
| virtual StatusCode | initialize () override final |
| | AlgTool initialize method. More...
|
| |
| void initializeOnce | ATLAS_NOT_THREAD_SAFE () |
| | G4 initialization called only by the first tool instance. More...
|
| |
| virtual StatusCode | finalize () override final |
| | AlgTool finalize method. More...
|
| |
| void | finalizeOnce () |
| | G4 finalization called only by the first tool instance. More...
|
| |
| virtual StatusCode | simulate (const EventContext &ctx, ISF::ISFParticle &isp, ISF::ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, std::shared_ptr< HitCollectionMap >) override |
| | Simulation call for individual particles. More...
|
| |
| virtual StatusCode | simulateVector (const EventContext &ctx, const ISF::ISFParticleVector &particles, ISF::ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, std::shared_ptr< HitCollectionMap > hitCollections, McEventCollection *shadowTruth=nullptr) override |
| | Simulation call for vectors of particles. More...
|
| |
| virtual StatusCode | setupEvent (const EventContext &, HitCollectionMap &) override |
| | Create data containers for an event. More...
|
| |
| virtual StatusCode | releaseEvent (const EventContext &, HitCollectionMap &) override |
| | Finalise data containers for an event. More...
|
| |
| virtual ISF::SimulationFlavor | simFlavor () const override |
| |
| virtual StatusCode | simulate (const EventContext &, ISFParticle &, ISFParticleContainer &, McEventCollection *) |
| | Simulation call for individual particles. More...
|
| |
| virtual StatusCode | simulateVector (const EventContext &, const ISFParticleVector &, ISFParticleContainer &, McEventCollection *, McEventCollection *) |
| | Simulation call for vectors of particles. More...
|
| |
| virtual StatusCode | setupEvent (const EventContext &) |
| | Create data containers for an event. More...
|
| |
| virtual StatusCode | setupEventST (HitCollectionMap &hitCollections) |
| | Create data containers for an event (called by ISimulationSvc) More...
|
| |
| virtual StatusCode | setupEventST () |
| | Create data containers for an event (called by ISimulationSvc) More...
|
| |
| virtual StatusCode | releaseEvent (const EventContext &) |
| | Finalise data containers for an event. More...
|
| |
| virtual StatusCode | releaseEventST (HitCollectionMap &hitCollections) |
| | Finalise data containers for an event (called by ISimulationSvc) More...
|
| |
| virtual StatusCode | releaseEventST () |
| | Finalise data containers for an event (called by ISimulationSvc) More...
|
| |
| | BaseSimulatorTool (const std::string &type, const std::string &name, const IInterface *parent) |
| | Standard BaseSimulatorTool constructor. More...
|
| |
| virtual StatusCode | sysInitialize () override |
| | Gaudi sysInitialize() methods. More...
|
| |
| const ChronoEntity * | chronoStart (const IChronoSvc::ChronoTag &tag) |
| | wrapper call to start chrono with given tag More...
|
| |
| const ChronoEntity * | chronoStop (const IChronoSvc::ChronoTag &tag) |
| | wrapper call to stop chrono with given tag More...
|
| |
|
|
| Gaudi::Property< bool > | m_doTiming {this, "PrintTimingInfo", true, ""} |
| |
| float | m_accumulatedEventTime {0.} |
| |
| float | m_accumulatedEventTimeSq {0.} |
| |
| unsigned int | m_nrOfEntries {0} |
| |
| G4Timer * | m_runTimer {nullptr} |
| |
| G4Timer * | m_eventTimer {nullptr} |
| |
| SG::SlotSpecificObj< Slot > m_slots | ATLAS_THREAD_SAFE |
| |
| Gaudi::Property< std::string > | m_mcEventCollectionName |
| |
| PublicToolHandle< ISF::IG4RunManagerHelper > | m_g4RunManagerHelper |
| | Helper Tool to provide G4RunManager. More...
|
| |
| G4AtlasRunManager * | m_pRunMgr {} |
| |
| 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< 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 |
| | Commands to send to the G4 UI. More...
|
| |
| Gaudi::Property< bool > | m_useMT |
| | Activate multi-threading configuration. More...
|
| |
| Gaudi::Property< bool > | m_activateParallelGeometries |
| |
| ServiceHandle< IAthRNGSvc > | m_rndmGenSvc |
| |
| Gaudi::Property< std::string > | m_randomStreamName |
| | Random Stream Name. More...
|
| |
| ServiceHandle< IUserLimitsSvc > | m_userLimitsSvc |
| |
| ServiceHandle< G4UA::IUserActionSvc > | m_userActionSvc |
| | user action service More...
|
| |
| PublicToolHandle< IDetectorConstructionTool > | m_detConstruction {this, "DetectorConstruction", "", "Tool handle of the DetectorConstruction"} |
| |
| ServiceHandle< ISF::IInputConverter > | m_inputConverter |
| | Service to convert ISF_Particles into a G4Event. More...
|
| |
| ServiceHandle< IPhysicsListSvc > | m_physListSvc |
| | Physics List Service. More...
|
| |
| PublicToolHandle< ISensitiveDetectorMasterTool > | m_senDetTool |
| | Sensitive Detector Master Tool. More...
|
| |
| PublicToolHandle< IFastSimulationMasterTool > | m_fastSimTool |
| | Fast Simulation Master Tool. More...
|
| |
| PublicToolHandleArray< IPhysicsInitializationTool > | m_physicsInitializationTools {this, "PhysicsInitializationTools", {}, "Physics initialization happening after Geant4 initialization"} |
| |
Geant4 AlgTool to create a ISFParticle at a volume entry/exit
- Author
- Robert Harrington
Definition at line 60 of file G4LegacyTransportTool.h.
◆ G4LegacyTransportTool()
| iGeant4::G4LegacyTransportTool::G4LegacyTransportTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~G4LegacyTransportTool()
| virtual iGeant4::G4LegacyTransportTool::~G4LegacyTransportTool |
( |
| ) |
|
|
virtualdefault |
◆ ATLAS_NOT_THREAD_SAFE()
| void initializeOnce iGeant4::G4LegacyTransportTool::ATLAS_NOT_THREAD_SAFE |
( |
| ) |
|
G4 initialization called only by the first tool instance.
This is done (for now) because we get multiple tool instances in hive.
◆ BaseSimulatorTool()
| ISF::BaseSimulatorTool::BaseSimulatorTool |
|
inlineinherited |
◆ chronoStart()
| const ChronoEntity* ISF::BaseSimulatorTool::chronoStart |
( |
const IChronoSvc::ChronoTag & |
tag | ) |
|
|
inlineinherited |
◆ chronoStop()
| const ChronoEntity* ISF::BaseSimulatorTool::chronoStop |
( |
const IChronoSvc::ChronoTag & |
tag | ) |
|
|
inlineinherited |
◆ commandLog()
| void iGeant4::G4LegacyTransportTool::commandLog |
( |
int |
returnCode, |
|
|
const std::string & |
commandString |
|
) |
| const |
|
private |
This command prints a message about a G4Command depending on its returnCode.
Definition at line 420 of file G4LegacyTransportTool.cxx.
423 case 0: {
ATH_MSG_DEBUG(
"G4 Command: " << commandString <<
" - Command Succeeded"); }
break;
424 case 100: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Command Not Found!"); }
break;
426 auto* stateManager = G4StateManager::GetStateManager();
427 ATH_MSG_DEBUG(
"G4 Command: " << commandString <<
" - Illegal Application State (" <<
428 stateManager->GetStateString(stateManager->GetCurrentState()) <<
")!");
430 case 300: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Out of Range!"); }
break;
431 case 400: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Unreadable!"); }
break;
432 case 500: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Parameter Out of Candidates!"); }
break;
433 case 600: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Alias Not Found!"); }
break;
434 default: {
ATH_MSG_ERROR(
"G4 Command: " << commandString <<
" - Unknown Status!"); }
break;
◆ finalize()
| StatusCode iGeant4::G4LegacyTransportTool::finalize |
( |
| ) |
|
|
finaloverridevirtual |
AlgTool finalize method.
Definition at line 202 of file G4LegacyTransportTool.cxx.
204 ATH_MSG_VERBOSE(
"++++++++++++ ISF G4 G4LegacyTransportTool finalized ++++++++++++");
211 ATH_MSG_ERROR(
"Failure in iGeant4::G4LegacyTransportTool::finalizeOnce: " <<
e.what());
212 return StatusCode::FAILURE;
220 avgTimePerEvent*avgTimePerEvent)/
float(
m_nrOfEntries-2)) : 0;
223 " End of run - time spent is "<<std::setprecision(4) <<
225 " Average time per event was "<<std::setprecision(4) <<
226 avgTimePerEvent <<
" +- "<< std::setprecision(4) <<
sigma<<
endmsg<<
228 "*****************************************");
231 return StatusCode::SUCCESS;
◆ finalizeOnce()
| void iGeant4::G4LegacyTransportTool::finalizeOnce |
( |
| ) |
|
G4 finalization called only by the first tool instance.
This is done (for now) because we get multiple tool instances in hive.
Definition at line 235 of file G4LegacyTransportTool.cxx.
◆ genEvent()
| HepMC::GenEvent * iGeant4::G4LegacyTransportTool::genEvent |
( |
McEventCollection * |
mcEventCollection | ) |
const |
|
private |
◆ initialize()
| StatusCode iGeant4::G4LegacyTransportTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
AlgTool initialize method.
Reimplemented from ISF::BaseSimulatorTool.
Definition at line 65 of file G4LegacyTransportTool.cxx.
83 std::call_once(initializeOnceFlag, &iGeant4::G4LegacyTransportTool::initializeOnce,
this);
86 ATH_MSG_ERROR(
"Failure in iGeant4::G4LegacyTransportTool::initializeOnce: " <<
e.what());
87 return StatusCode::FAILURE;
98 return StatusCode::SUCCESS;
◆ releaseEvent() [1/2]
| virtual StatusCode ISF::BaseSimulatorG4Tool::releaseEvent |
( |
const EventContext & |
| ) |
|
|
inlinevirtualinherited |
◆ releaseEvent() [2/2]
Finalise data containers for an event.
- Todo:
- : strip hits of the tracks ...
Implements ISF::BaseSimulatorG4Tool.
Definition at line 352 of file G4LegacyTransportTool.cxx.
384 avgTimePerEvent*avgTimePerEvent)/
float(
m_nrOfEntries-2)) : 0.;
386 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) <<
387 eventTime <<
" s. New average " << std::setprecision(4) <<
388 avgTimePerEvent<<
" +- "<<std::setprecision(4) <<
sigma);
394 return StatusCode::SUCCESS;
◆ releaseEventST() [1/2]
| virtual StatusCode ISF::BaseSimulatorG4Tool::releaseEventST |
( |
| ) |
|
|
inlinevirtualinherited |
◆ releaseEventST() [2/2]
| virtual StatusCode ISF::BaseSimulatorG4Tool::releaseEventST |
( |
HitCollectionMap & |
hitCollections | ) |
|
|
inlinevirtualinherited |
Finalise data containers for an event (called by ISimulationSvc)
Definition at line 58 of file BaseSimulatorG4Tool.h.
59 return releaseEvent(Gaudi::Hive::currentContext(), hitCollections);
◆ setupEvent() [1/2]
| virtual StatusCode ISF::BaseSimulatorG4Tool::setupEvent |
( |
const EventContext & |
| ) |
|
|
inlinevirtualinherited |
◆ setupEvent() [2/2]
◆ setupEventST() [1/2]
| virtual StatusCode ISF::BaseSimulatorG4Tool::setupEventST |
( |
| ) |
|
|
inlinevirtualinherited |
◆ setupEventST() [2/2]
| virtual StatusCode ISF::BaseSimulatorG4Tool::setupEventST |
( |
HitCollectionMap & |
hitCollections | ) |
|
|
inlinevirtualinherited |
Create data containers for an event (called by ISimulationSvc)
Definition at line 49 of file BaseSimulatorG4Tool.h.
50 return setupEvent(Gaudi::Hive::currentContext(), hitCollections);
◆ simFlavor()
◆ simulate() [1/2]
◆ simulate() [2/2]
◆ simulateVector() [1/2]
◆ simulateVector() [2/2]
Simulation call for vectors of particles.
Process ParticleState from particle stack
Implements ISF::BaseSimulatorG4Tool.
Definition at line 266 of file G4LegacyTransportTool.cxx.
276 auto eventInfo = std::make_unique<AtlasG4EventUserInfo>();
277 eventInfo->SetHitCollectionMap(hitCollections);
279 auto inputEvent = std::make_unique<G4Event>(ctx.eventID().event_number());
280 inputEvent->SetUserInformation(eventInfo.release());
294 return StatusCode::FAILURE;
309 Slot& slot = *m_slots;
314 auto searchResult = slot.m_secondariesMap.find( cisp );
315 if ( searchResult == slot.m_secondariesMap.end() ) {
321 ATH_MSG_VERBOSE(
"Found secondaries: " << searchResult->second.size() );
322 secondaries.splice(
end(secondaries), std::move(searchResult->second) );
323 slot.m_secondariesMap.erase( searchResult );
327 return StatusCode::SUCCESS;
◆ sysInitialize()
| virtual StatusCode ISF::BaseSimulatorTool::sysInitialize |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ ATLAS_THREAD_SAFE
◆ m_accumulatedEventTime
| float iGeant4::G4LegacyTransportTool::m_accumulatedEventTime {0.} |
|
private |
◆ m_accumulatedEventTimeSq
| float iGeant4::G4LegacyTransportTool::m_accumulatedEventTimeSq {0.} |
|
private |
◆ m_activateParallelGeometries
| Gaudi::Property<bool> iGeant4::G4LegacyTransportTool::m_activateParallelGeometries |
|
private |
Initial value:{
this, "ActivateParallelWorlds", false,
"Toggle on/off the G4 parallel geometry system"}
Definition at line 160 of file G4LegacyTransportTool.h.
◆ m_chrono
| ServiceHandle<IChronoStatSvc> ISF::BaseSimulatorTool::m_chrono {this, "ChronoStatService", "ChronoStatSvc"} |
|
protectedinherited |
◆ m_detConstruction
| PublicToolHandle<IDetectorConstructionTool> iGeant4::G4LegacyTransportTool::m_detConstruction {this, "DetectorConstruction", "", "Tool handle of the DetectorConstruction"} |
|
private |
◆ m_doTiming
| Gaudi::Property<bool> iGeant4::G4LegacyTransportTool::m_doTiming {this, "PrintTimingInfo", true, ""} |
|
private |
◆ m_eventTimer
| G4Timer* iGeant4::G4LegacyTransportTool::m_eventTimer {nullptr} |
|
private |
◆ m_fastSimTool
◆ m_fieldMap
| Gaudi::Property<std::string> iGeant4::G4LegacyTransportTool::m_fieldMap {this, "FieldMap", "", ""} |
|
private |
◆ m_g4commands
| Gaudi::Property<std::vector<std::string> > iGeant4::G4LegacyTransportTool::m_g4commands |
|
private |
Initial value:{
this, "G4Commands", {}, "Commands to send to the G4UI"}
Commands to send to the G4 UI.
Definition at line 155 of file G4LegacyTransportTool.h.
◆ m_g4RunManagerHelper
Initial value:{
this, "G4RunManagerHelper",
"iGeant4::G4RunManagerHelper/G4RunManagerHelper", ""}
Helper Tool to provide G4RunManager.
Definition at line 143 of file G4LegacyTransportTool.h.
◆ m_inputConverter
Initial value:{
this, "InputConverter", "ISF_InputConverter", ""}
Service to convert ISF_Particles into a G4Event.
Definition at line 177 of file G4LegacyTransportTool.h.
◆ m_libList
| Gaudi::Property<std::string> iGeant4::G4LegacyTransportTool::m_libList {this, "Dll", "", ""} |
|
private |
◆ m_mcEventCollectionName
| Gaudi::Property<std::string> iGeant4::G4LegacyTransportTool::m_mcEventCollectionName |
|
private |
◆ m_nrOfEntries
| unsigned int iGeant4::G4LegacyTransportTool::m_nrOfEntries {0} |
|
private |
◆ m_physicsInitializationTools
| PublicToolHandleArray<IPhysicsInitializationTool> iGeant4::G4LegacyTransportTool::m_physicsInitializationTools {this, "PhysicsInitializationTools", {}, "Physics initialization happening after Geant4 initialization"} |
|
private |
◆ m_physList
| Gaudi::Property<std::string> iGeant4::G4LegacyTransportTool::m_physList {this, "Physics", "", ""} |
|
private |
◆ m_physListSvc
Initial value:{this, "PhysicsListSvc",
"PhysicsListSvc", ""}
Physics List Service.
Definition at line 180 of file G4LegacyTransportTool.h.
◆ m_pRunMgr
◆ m_quietMode
| Gaudi::Property<bool> iGeant4::G4LegacyTransportTool::m_quietMode {this, "QuietMode", false, ""} |
|
private |
◆ m_randomStreamName
| Gaudi::Property<std::string> iGeant4::G4LegacyTransportTool::m_randomStreamName |
|
private |
◆ m_recordFlux
| Gaudi::Property<bool> iGeant4::G4LegacyTransportTool::m_recordFlux {this, "RecordFlux", false, ""} |
|
private |
◆ m_releaseGeoModel
| Gaudi::Property<bool> iGeant4::G4LegacyTransportTool::m_releaseGeoModel {this, "ReleaseGeoModel", true, ""} |
|
private |
◆ m_rndmGenSvc
◆ m_runTimer
| G4Timer* iGeant4::G4LegacyTransportTool::m_runTimer {nullptr} |
|
private |
◆ m_senDetTool
Initial value:{
this, "SenDetMasterTool", "SensitiveDetectorMasterTool", ""}
Sensitive Detector Master Tool.
Definition at line 183 of file G4LegacyTransportTool.h.
◆ m_useMT
| Gaudi::Property<bool> iGeant4::G4LegacyTransportTool::m_useMT |
|
private |
Initial value:{this, "MultiThreading", false,
"Multi-threading specific settings"}
Activate multi-threading configuration.
Definition at line 158 of file G4LegacyTransportTool.h.
◆ m_userActionSvc
◆ m_userLimitsSvc
The documentation for this class was generated from the following files:
def retrieve(aClass, aKey=None)
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
void RunTermination() override final
G4 function called at end of run.
#define ATH_MSG_VERBOSE(x)
::StatusCode StatusCode
StatusCode definition for legacy code.
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
bool ProcessEvent(G4Event *event)
Does the work of simulating an ATLAS event.
const T * back() const
Access the last element in the collection as an rvalue.
A wrapper class for event-slot-local random engines.
virtual StatusCode sysInitialize() override
Perform system initialization for an algorithm.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
#define ATH_MSG_WARNING(x)