ATLAS Offline Software
Public Member Functions | Protected Attributes | Private Attributes | List of all members
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 (ISFParticle &isp, ISFParticleContainer &, McEventCollection *) override
 
virtual StatusCode setupEvent (const EventContext &) override
 Setup Event chain - in case of a begin-of event action is needed. More...
 
virtual StatusCode releaseEvent (const EventContext &) override
 Release Event chain - in case of an end-of event action is needed. More...
 
virtual ISF::SimulationFlavor simFlavor () const override
 
virtual StatusCode sysInitialize () override
 Gaudi sysInitialize() methods. More...
 
virtual StatusCode setupEventST () override
 Setup Event chain - in case of a begin-of event action is needed (called by ISimulationSvc) More...
 
virtual StatusCode simulateVector (const ISFParticleVector &particles, ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *) override
 Simulation call for vectors of particles. More...
 
virtual StatusCode releaseEventST () override
 Release Event chain - in case of an end-of event action is needed (called by ISimulationSvc) 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...
 

Protected Attributes

std::string m_chronoSvcName {"ChronoStatSvc"}
 Name of the timing service - can be set by declareProperty() More...
 
IChronoStatSvc * m_chrono {}
 The timing service for general usage. More...
 

Private Attributes

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

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.

9 {
10  declareProperty("UseSimulationTool", m_useExtrapolator);
11 }

◆ ~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 100 of file BaseSimulatorTool.h.

100  {
101  if (m_chrono) return m_chrono->chronoStart( tag);
102  return nullptr;
103  }

◆ chronoStop()

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

wrapper call to stop chrono with given tag

Definition at line 106 of file BaseSimulatorTool.h.

106  {
107  if (m_chrono) return m_chrono->chronoStop( tag);
108  return nullptr;
109  }

◆ 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 }

◆ 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::FastCaloSimV2Tool.

Definition at line 96 of file BaseSimulatorTool.h.

97  { return releaseEvent(Gaudi::Hive::currentContext()); }

◆ 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::FastCaloSimV2Tool.

Definition at line 69 of file BaseSimulatorTool.h.

70  { return setupEvent(Gaudi::Hive::currentContext()); }

◆ 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 ( 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 }

◆ simulateVector()

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

Simulation call for vectors of particles.

Reimplemented in ISF::ActsFatrasSimTool, ISF::ParticleKillerSimTool, iGeant4::G4TransportTool, and iGeant4::G4LegacyTransportTool.

Definition at line 77 of file BaseSimulatorTool.h.

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

◆ sysInitialize()

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

Gaudi sysInitialize() methods.

Definition at line 51 of file BaseSimulatorTool.h.

52  {
54  ATH_CHECK( serviceLocator()->service(m_chronoSvcName, m_chrono ) );
55  return StatusCode::SUCCESS;
56  }

Member Data Documentation

◆ m_chrono

IChronoStatSvc* ISF::BaseSimulatorTool::m_chrono {}
protectedinherited

The timing service for general usage.

Definition at line 120 of file BaseSimulatorTool.h.

◆ m_chronoSvcName

std::string ISF::BaseSimulatorTool::m_chronoSvcName {"ChronoStatSvc"}
protectedinherited

Name of the timing service - can be set by declareProperty()

Definition at line 117 of file BaseSimulatorTool.h.

◆ 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.

◆ 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.

◆ 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.

◆ 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.


The documentation for this class was generated from the following files:
ISF::BaseSimulatorTool::m_chronoSvcName
std::string m_chronoSvcName
Name of the timing service - can be set by declareProperty()
Definition: BaseSimulatorTool.h:117
ISF::FatrasSimTool::m_particleFilter
PublicToolHandle< ISF::IParticleFilter > m_particleFilter
the particle filter concerning kinematic cuts, etc.
Definition: FatrasSimTool.h:44
AtlasDetDescr::fAtlasForward
@ fAtlasForward
Definition: AtlasRegion.h:34
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
ISF::FatrasSimTool::m_simulationTool
PublicToolHandle< ISF::IParticleProcessor > m_simulationTool
Pointer to the transport AlgTool.
Definition: FatrasSimTool.h:43
ISF::BaseSimulatorTool::releaseEvent
virtual StatusCode releaseEvent(const EventContext &) override
Release Event chain - in case of an end-of event action is needed.
Definition: BaseSimulatorTool.h:92
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::BaseSimulatorTool::m_chrono
IChronoStatSvc * m_chrono
The timing service for general usage.
Definition: BaseSimulatorTool.h:120
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::FatrasSimTool::m_IDsimulationTool
PublicToolHandle< ISF::IParticleProcessor > m_IDsimulationTool
Track Creation & transport.
Definition: FatrasSimTool.h:41
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ISF::BaseSimulatorTool::BaseSimulatorTool
BaseSimulatorTool()
Default constructor.
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
AtlasDetDescr::fAtlasID
@ fAtlasID
Definition: AtlasRegion.h:33
AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize
virtual StatusCode sysInitialize() override
Perform system initialization for an algorithm.
ISF::BaseSimulatorTool::setupEvent
virtual StatusCode setupEvent(const EventContext &) override
Setup Event chain - in case of a begin-of event action is needed.
Definition: BaseSimulatorTool.h:65
ISF::Fatras
@ Fatras
Definition: SimulationFlavor.h:22
ISF::FatrasSimTool::m_useExtrapolator
bool m_useExtrapolator
Boolean used to run with the old extrapolator setup.
Definition: FatrasSimTool.h:42
ISF::BaseSimulatorTool::initialize
virtual StatusCode initialize() override
Definition: BaseSimulatorTool.h:59
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
ISF::BaseSimulatorTool::simulate
virtual StatusCode simulate(ISFParticle &, ISFParticleContainer &, McEventCollection *) override
Definition: BaseSimulatorTool.h:73