ATLAS Offline Software
Loading...
Searching...
No Matches
ISF::FatrasSimTool Class Reference

#include <FatrasSimTool.h>

Inheritance diagram for ISF::FatrasSimTool:
Collaboration diagram for ISF::FatrasSimTool:

Public Member Functions

 FatrasSimTool (const std::string &type, const std::string &name, const IInterface *parent)
 ~FatrasSimTool ()
virtual StatusCode initialize () override
virtual StatusCode simulate (const EventContext &ctx, ISFParticle &isp, ISFParticleContainer &, McEventCollection *) override
virtual StatusCode setupEvent (const EventContext &) override
 Setup Event chain - in case of a begin-of event action is needed.
virtual StatusCode releaseEvent (const EventContext &) override
 Release Event chain - in case of an end-of event action is needed.
virtual ISF::SimulationFlavor simFlavor () const override
virtual StatusCode sysInitialize () override
 Gaudi sysInitialize() methods.
virtual StatusCode setupEventST () override
 Setup Event chain - in case of a begin-of event action is needed (called by ISimulationSvc)
virtual StatusCode simulateVector (const EventContext &ctx, const ISFParticleVector &particles, ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *) override
 Simulation call for vectors of particles.
virtual StatusCode releaseEventST () override
 Release Event chain - in case of an end-of event action is needed (called by ISimulationSvc)
const ChronoEntity * chronoStart (const IChronoSvc::ChronoTag &tag)
 wrapper call to start chrono with given tag
const ChronoEntity * chronoStop (const IChronoSvc::ChronoTag &tag)
 wrapper call to stop chrono with given tag

Protected Attributes

ServiceHandle< IChronoStatSvc > m_chrono {this, "ChronoStatService", "ChronoStatSvc"}
 The timing service for general usage.

Private Attributes

PublicToolHandle< ISF::IParticleProcessorm_IDsimulationTool {this, "IDSimulationTool", "", ""}
 Track Creation & transport.
bool m_useExtrapolator {true}
 Boolean used to run with the old extrapolator setup.
PublicToolHandle< ISF::IParticleProcessorm_simulationTool {this, "SimulationTool", "", ""}
 Pointer to the transport AlgTool.
PublicToolHandle< ISF::IParticleFilterm_particleFilter {this, "ParticleFilter", "", ""}
 the particle filter concerning kinematic cuts, etc.

Detailed Description

Definition at line 22 of file FatrasSimTool.h.

Constructor & Destructor Documentation

◆ FatrasSimTool()

ISF::FatrasSimTool::FatrasSimTool ( const std::string & type,
const std::string & name,
const IInterface * parent )

Definition at line 7 of file FatrasSimTool.cxx.

8 : BaseSimulatorTool(type, name, parent)
9{
10 declareProperty("UseSimulationTool", m_useExtrapolator);
11}
BaseSimulatorTool()
Default constructor.
bool m_useExtrapolator
Boolean used to run with the old extrapolator setup.

◆ ~FatrasSimTool()

ISF::FatrasSimTool::~FatrasSimTool ( )

Definition at line 13 of file FatrasSimTool.cxx.

13 {
14
15}

Member Function Documentation

◆ chronoStart()

const ChronoEntity * ISF::BaseSimulatorTool::chronoStart ( const IChronoSvc::ChronoTag & tag)
inlineinherited

wrapper call to start chrono with given tag

Definition at line 98 of file BaseSimulatorTool.h.

98 {
99 if (m_chrono) return m_chrono->chronoStart( tag);
100 return nullptr;
101 }
ServiceHandle< IChronoStatSvc > m_chrono
The timing service for general usage.

◆ chronoStop()

const ChronoEntity * ISF::BaseSimulatorTool::chronoStop ( const IChronoSvc::ChronoTag & tag)
inlineinherited

wrapper call to stop chrono with given tag

Definition at line 104 of file BaseSimulatorTool.h.

104 {
105 if (m_chrono) return m_chrono->chronoStop( tag);
106 return nullptr;
107 }

◆ initialize()

StatusCode ISF::FatrasSimTool::initialize ( )
overridevirtual

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 17 of file FatrasSimTool.cxx.

17 {
18
20
21 // retrieve simulation tool
22 ATH_CHECK( m_IDsimulationTool.retrieve() );
23
24 // retrieve simulation tool
25 if ( m_useExtrapolator ) {
26 ATH_CHECK( m_simulationTool.retrieve() );
27 }
28 else {
29 m_simulationTool.disable();
30 ATH_MSG_INFO ( "Using only Extrapolation Engine Tools...");
31 }
32
33 // retrieve particle filter
34 if ( !m_particleFilter.empty() ) {
35 ATH_CHECK( m_particleFilter.retrieve() );
36 }
37 return StatusCode::SUCCESS;
38}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_INFO(x)
virtual StatusCode initialize() override
PublicToolHandle< ISF::IParticleProcessor > m_simulationTool
Pointer to the transport AlgTool.
PublicToolHandle< ISF::IParticleProcessor > m_IDsimulationTool
Track Creation & transport.
PublicToolHandle< ISF::IParticleFilter > m_particleFilter
the particle filter concerning kinematic cuts, etc.

◆ releaseEvent()

virtual StatusCode ISF::FatrasSimTool::releaseEvent ( const EventContext & )
inlineoverridevirtual

Release Event chain - in case of an end-of event action is needed.

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 34 of file FatrasSimTool.h.

34{ return StatusCode::SUCCESS; };

◆ releaseEventST()

virtual StatusCode ISF::BaseSimulatorTool::releaseEventST ( )
inlineoverridevirtualinherited

Release Event chain - in case of an end-of event action is needed (called by ISimulationSvc)

Reimplemented in ISF::BaseSimulatorG4Tool, and ISF::FastCaloSimV2Tool.

Definition at line 94 of file BaseSimulatorTool.h.

95 { return releaseEvent(Gaudi::Hive::currentContext()); }
virtual StatusCode releaseEvent(const EventContext &) override
Release Event chain - in case of an end-of event action is needed.

◆ setupEvent()

virtual StatusCode ISF::FatrasSimTool::setupEvent ( const EventContext & )
inlineoverridevirtual

Setup Event chain - in case of a begin-of event action is needed.

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 32 of file FatrasSimTool.h.

32{ return StatusCode::SUCCESS; };

◆ setupEventST()

virtual StatusCode ISF::BaseSimulatorTool::setupEventST ( )
inlineoverridevirtualinherited

Setup Event chain - in case of a begin-of event action is needed (called by ISimulationSvc)

Reimplemented in ISF::BaseSimulatorG4Tool, and ISF::FastCaloSimV2Tool.

Definition at line 67 of file BaseSimulatorTool.h.

68 { return setupEvent(Gaudi::Hive::currentContext()); }
virtual StatusCode setupEvent(const EventContext &) override
Setup Event chain - in case of a begin-of event action is needed.

◆ simFlavor()

virtual ISF::SimulationFlavor ISF::FatrasSimTool::simFlavor ( ) const
inlineoverridevirtual

Definition at line 36 of file FatrasSimTool.h.

36{ return ISF::Fatras; };

◆ simulate()

StatusCode ISF::FatrasSimTool::simulate ( const EventContext & ctx,
ISFParticle & isp,
ISFParticleContainer & secondaries,
McEventCollection *  )
overridevirtual

Process Particle from particle broker

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 40 of file FatrasSimTool.cxx.

40 {
41
42 // give a screen output that you entered FatrasSimSvc
43 ATH_MSG_VERBOSE( "Particle " << isp << " received for simulation." );
44
45 // now decide what to do with the particle
46 if (!m_particleFilter.empty() && !m_particleFilter->passFilter(isp)){
47 ATH_MSG_VERBOSE( "ISFParticle " << isp << " does not pass selection. Ignore.");
48 return StatusCode::SUCCESS;
49 }
51 ISF::ISFParticle* newIsp = (isp.nextGeoID()==AtlasDetDescr::fAtlasID || isp.nextGeoID()==AtlasDetDescr::fAtlasForward) ? m_IDsimulationTool->process(isp) : m_simulationTool->process(isp);
52 ATH_MSG_VERBOSE( "Simulation created : " << ( newIsp ? "" : "no") << " new particle");
53
54 if (newIsp) {
55 // new particle into the stack
56 secondaries.push_back(newIsp);
57 }
58
59 // Fatras call done
60 return StatusCode::SUCCESS;
61}
#define ATH_MSG_VERBOSE(x)

◆ simulateVector()

virtual StatusCode ISF::BaseSimulatorTool::simulateVector ( const EventContext & ctx,
const ISFParticleVector & particles,
ISFParticleContainer & secondaries,
McEventCollection * mcEventCollection,
McEventCollection *  )
inlineoverridevirtualinherited

Simulation call for vectors of particles.

Reimplemented in ISF::ActsFatrasSimTool, ISF::BaseSimulatorG4Tool, and ISF::ParticleKillerSimTool.

Definition at line 75 of file BaseSimulatorTool.h.

76 {
77 // this implementation is a wrapper in case the simulator does
78 // implement particle-vector input
79
80 // simulate each particle individually
81 for (auto* cisp : particles) {
82 ATH_MSG_VERBOSE( "Starting simulation of particle: " << (*cisp) );
83 ATH_CHECK(this->simulate(ctx, *cisp, secondaries, mcEventCollection));
84 }
85 return StatusCode::SUCCESS;
86
87 }
virtual StatusCode simulate(const EventContext &, ISFParticle &, ISFParticleContainer &, McEventCollection *) override

◆ sysInitialize()

virtual StatusCode ISF::BaseSimulatorTool::sysInitialize ( )
inlineoverridevirtualinherited

Gaudi sysInitialize() methods.

Definition at line 49 of file BaseSimulatorTool.h.

50 {
52 ATH_CHECK( m_chrono.retrieve() );
53 return StatusCode::SUCCESS;
54 }
virtual StatusCode sysInitialize() override

Member Data Documentation

◆ m_chrono

ServiceHandle<IChronoStatSvc> ISF::BaseSimulatorTool::m_chrono {this, "ChronoStatService", "ChronoStatSvc"}
protectedinherited

The timing service for general usage.

Definition at line 115 of file BaseSimulatorTool.h.

115{this, "ChronoStatService", "ChronoStatSvc"};

◆ m_IDsimulationTool

PublicToolHandle<ISF::IParticleProcessor> ISF::FatrasSimTool::m_IDsimulationTool {this, "IDSimulationTool", "", ""}
private

Track Creation & transport.

Pointer to the transport AlgTool

Definition at line 41 of file FatrasSimTool.h.

41{this, "IDSimulationTool", "", ""};

◆ m_particleFilter

PublicToolHandle<ISF::IParticleFilter> ISF::FatrasSimTool::m_particleFilter {this, "ParticleFilter", "", ""}
private

the particle filter concerning kinematic cuts, etc.

Definition at line 44 of file FatrasSimTool.h.

44{this, "ParticleFilter", "", ""};

◆ m_simulationTool

PublicToolHandle<ISF::IParticleProcessor> ISF::FatrasSimTool::m_simulationTool {this, "SimulationTool", "", ""}
private

Pointer to the transport AlgTool.

Definition at line 43 of file FatrasSimTool.h.

43{this, "SimulationTool", "", ""};

◆ m_useExtrapolator

bool ISF::FatrasSimTool::m_useExtrapolator {true}
private

Boolean used to run with the old extrapolator setup.

Definition at line 42 of file FatrasSimTool.h.

42{true};

The documentation for this class was generated from the following files: