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 (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. 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 EventContext &ctx, 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

ServiceHandle< IChronoStatSvc > m_chrono {this, "ChronoStatService", "ChronoStatSvc"}
 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 98 of file BaseSimulatorTool.h.

98  {
99  if (m_chrono) return m_chrono->chronoStart( tag);
100  return nullptr;
101  }

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

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

95  { 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 67 of file BaseSimulatorTool.h.

68  { 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 ( 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 }

◆ 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::ParticleKillerSimTool, iGeant4::G4TransportTool, and iGeant4::G4LegacyTransportTool.

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  }

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

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.

◆ 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::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:90
ISF::ISFParticle
Definition: ISFParticle.h:42
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
ISF::BaseSimulatorTool::m_chrono
ServiceHandle< IChronoStatSvc > m_chrono
The timing service for general usage.
Definition: BaseSimulatorTool.h:115
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:221
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:63
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:57
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
ISF::BaseSimulatorTool::simulate
virtual StatusCode simulate(const EventContext &, ISFParticle &, ISFParticleContainer &, McEventCollection *) override
Definition: BaseSimulatorTool.h:71
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24