ATLAS Offline Software
Classes | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
ISF::ActsFatrasSimTool Class Reference

#include <ActsFatrasSimTool.h>

Inheritance diagram for ISF::ActsFatrasSimTool:
Collaboration diagram for ISF::ActsFatrasSimTool:

Classes

struct  HitSurfaceSelector
 Simple struct to select surfaces where hits should be generated. More...
 
struct  SingleParticleSimulation
 Single particle simulation with fixed propagator, interactions, and decay. More...
 

Public Types

using Generator = std::ranlux48
 
using Navigator = Acts::Navigator
 
using ChargedStepper = Acts::EigenStepper< Acts::EigenStepperDefaultExtension >
 
using ChargedPropagator = Acts::Propagator< ChargedStepper, Navigator >
 
using NeutralStepper = Acts::StraightLineStepper
 
using NeutralPropagator = Acts::Propagator< NeutralStepper, Navigator >
 
using ChargedSelector = ActsFatras::ChargedSelector
 
using ChargedInteractions = ActsFatras::StandardChargedElectroMagneticInteractions
 
using ChargedSimulation = SingleParticleSimulation< ChargedPropagator, ChargedInteractions, HitSurfaceSelector, ActsFatras::NoDecay >
 
using NeutralSelector = ActsFatras::NeutralSelector
 
using NeutralInteractions = ActsFatras::InteractionList<>
 
using NeutralSimulation = SingleParticleSimulation< NeutralPropagator, NeutralInteractions, ActsFatras::NoSurface, ActsFatras::NoDecay >
 
using Simulation = ActsFatras::Simulation< ChargedSelector, ChargedSimulation, NeutralSelector, NeutralSimulation >
 

Public Member Functions

 ActsFatrasSimTool (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ActsFatrasSimTool ()
 
virtual StatusCode initialize () override
 
virtual StatusCode simulate (const EventContext &ctx, ISFParticle &isp, ISFParticleContainer &, McEventCollection *) override
 
virtual StatusCode simulateVector (const EventContext &ctx, const ISFParticleVector &particles, ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *shadowTruth=nullptr) override
 Simulation call for vectors of particles. More...
 
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 Acts::MagneticFieldContext getMagneticFieldContext (const EventContext &) const
 
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 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 Member Functions

template<class T >
StatusCode retrieveTool (ToolHandle< T > &thandle)
 
int getATLASProcessCode (ActsFatras::ProcessType actspt)
 

Private Attributes

ServiceHandle< IAthRNGSvcm_rngSvc {this, "RNGService", "AthRNGSvc"}
 
ATHRNG::RNGWrapper *m_randomEngine ATLAS_THREAD_SAFE {}
 
Gaudi::Property< std::string > m_randomEngineName
 
ToolHandle< IActsTrackingGeometryToolm_trackingGeometryTool
 
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
 
SG::ReadCondHandleKey< AtlasFieldCacheCondObjm_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
 
std::shared_ptr< const Acts::Logger > m_logger {nullptr}
 
PublicToolHandle< ISF::IParticleFilterm_particleFilter
 
ServiceHandle< ISF::ITruthSvcm_truthRecordSvc {this, "TruthRecordService", "ISF_TruthRecordSvc", ""}
 
ToolHandle< ActsFatrasWriteHandlerm_ActsFatrasWriteHandler
 
Gaudi::Property< double > m_interact_minPt
 
Gaudi::Property< bool > m_meanEnergyLoss {this, "MeanEnergyLoss", true, "Toggle between mean and mode evaluation of energy loss"}
 
Gaudi::Property< bool > m_includeGgradient {this, "IncludeGgradient", true, "Boolean flag for inclusion of d(dEds)d(q/p) into energy loss"}
 
Gaudi::Property< double > m_momentumCutOff {this, "MomentumCutOff", 0., "Cut-off value for the momentum in SI units"}
 
Gaudi::Property< double > m_maxStep
 
Gaudi::Property< double > m_maxRungeKuttaStepTrials
 
Gaudi::Property< double > m_maxStepSize
 
Gaudi::Property< double > m_pathLimit
 
Gaudi::Property< bool > m_loopProtection
 
Gaudi::Property< double > m_loopFraction
 
Gaudi::Property< double > m_tolerance
 
Gaudi::Property< double > m_stepSizeCutOff
 
Gaudi::Property< std::map< int, int > > m_processTypeMap
 

Detailed Description

Definition at line 68 of file ActsFatrasSimTool.h.

Member Typedef Documentation

◆ ChargedInteractions

using ISF::ActsFatrasSimTool::ChargedInteractions = ActsFatras::StandardChargedElectroMagneticInteractions

Definition at line 186 of file ActsFatrasSimTool.h.

◆ ChargedPropagator

Definition at line 177 of file ActsFatrasSimTool.h.

◆ ChargedSelector

using ISF::ActsFatrasSimTool::ChargedSelector = ActsFatras::ChargedSelector

Definition at line 185 of file ActsFatrasSimTool.h.

◆ ChargedSimulation

Definition at line 188 of file ActsFatrasSimTool.h.

◆ ChargedStepper

using ISF::ActsFatrasSimTool::ChargedStepper = Acts::EigenStepper<Acts::EigenStepperDefaultExtension>

Definition at line 176 of file ActsFatrasSimTool.h.

◆ Generator

using ISF::ActsFatrasSimTool::Generator = std::ranlux48

Definition at line 172 of file ActsFatrasSimTool.h.

◆ Navigator

using ISF::ActsFatrasSimTool::Navigator = Acts::Navigator

Definition at line 174 of file ActsFatrasSimTool.h.

◆ NeutralInteractions

using ISF::ActsFatrasSimTool::NeutralInteractions = ActsFatras::InteractionList<>

Definition at line 193 of file ActsFatrasSimTool.h.

◆ NeutralPropagator

Definition at line 180 of file ActsFatrasSimTool.h.

◆ NeutralSelector

using ISF::ActsFatrasSimTool::NeutralSelector = ActsFatras::NeutralSelector

Definition at line 192 of file ActsFatrasSimTool.h.

◆ NeutralSimulation

Definition at line 194 of file ActsFatrasSimTool.h.

◆ NeutralStepper

using ISF::ActsFatrasSimTool::NeutralStepper = Acts::StraightLineStepper

Definition at line 179 of file ActsFatrasSimTool.h.

◆ Simulation

Definition at line 198 of file ActsFatrasSimTool.h.

Constructor & Destructor Documentation

◆ ActsFatrasSimTool()

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

Definition at line 17 of file ActsFatrasSimTool.cxx.

◆ ~ActsFatrasSimTool()

ISF::ActsFatrasSimTool::~ActsFatrasSimTool ( )
virtual

Definition at line 22 of file ActsFatrasSimTool.cxx.

22 {}

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  }

◆ getATLASProcessCode()

int ISF::ActsFatrasSimTool::getATLASProcessCode ( ActsFatras::ProcessType  actspt)
inlineprivate

Definition at line 291 of file ActsFatrasSimTool.h.

291 {return m_processTypeMap[static_cast<uint32_t>(actspt)];};

◆ getMagneticFieldContext()

Acts::MagneticFieldContext ISF::ActsFatrasSimTool::getMagneticFieldContext ( const EventContext &  ctx) const
virtual

Definition at line 222 of file ActsFatrasSimTool.cxx.

222  {
224  if (!readHandle.isValid()) {
225  ATH_MSG_ERROR(name() + ": Failed to retrieve magnetic field condition data " + m_fieldCacheCondObjInputKey.key() + ".");
226  }
227  else ATH_MSG_DEBUG(name() << "retrieved magnetic field condition data "<< m_fieldCacheCondObjInputKey.key());
228  const AtlasFieldCacheCondObj* fieldCondObj{*readHandle};
229 
230  return Acts::MagneticFieldContext(fieldCondObj);
231 }

◆ initialize()

StatusCode ISF::ActsFatrasSimTool::initialize ( )
overridevirtual

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 24 of file ActsFatrasSimTool.cxx.

24  {
26  ATH_MSG_INFO("ISF::ActsFatrasSimTool update with ACTS 37.0.0");
27  // Retrieve particle filter
28  if (!m_particleFilter.empty()) ATH_CHECK(m_particleFilter.retrieve());
29 
30  // setup logger
31  m_logger = makeActsAthenaLogger(this, std::string("ActsFatras"),std::string("ActsFatrasSimTool"));
32 
33  // retrive tracking geo tool
35  m_trackingGeometry = m_trackingGeometryTool->trackingGeometry();
36 
37  //retrive Magnetfield tool
38  ATH_MSG_VERBOSE("Using ATLAS magnetic field service");
40 
41  // Random number service
42  if (m_rngSvc.retrieve().isFailure()) {
43  ATH_MSG_FATAL("Could not retrieve " << m_rngSvc);
44  return StatusCode::FAILURE;
45  }
46  // Get own engine with own seeds
47  m_randomEngine = m_rngSvc->getEngine(this, m_randomEngineName.value());
48  if (!m_randomEngine) {
49  ATH_MSG_FATAL("Could not get random engine '" << m_randomEngineName.value() << "'");
50  return StatusCode::FAILURE;
51  }
52 
53  // ISF truth service
54  ATH_CHECK (m_truthRecordSvc.retrieve());
55  ATH_MSG_DEBUG( "- Using ISF TruthRecordSvc : " << m_truthRecordSvc.typeAndName() );
56  return StatusCode::SUCCESS;
57 }

◆ releaseEvent()

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

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

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 217 of file ActsFatrasSimTool.h.

217  {
218  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()); }

◆ retrieveTool()

template<class T >
StatusCode ISF::ActsFatrasSimTool::retrieveTool ( ToolHandle< T > &  thandle)
inlineprivate

Definition at line 228 of file ActsFatrasSimTool.h.

228  {
229  if (!thandle.empty() && thandle.retrieve().isFailure()) {
230  ATH_MSG_FATAL("Cannot retrieve " << thandle << ". Abort.");
231  return StatusCode::FAILURE;
232  } else ATH_MSG_DEBUG("Successfully retrieved " << thandle);
233  return StatusCode::SUCCESS;
234  }

◆ setupEvent()

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

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

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 215 of file ActsFatrasSimTool.h.

215  {
216  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::ActsFatrasSimTool::simFlavor ( ) const
inlineoverridevirtual

Definition at line 219 of file ActsFatrasSimTool.h.

219  {
220  return ISF::Fatras; };

◆ simulate()

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

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 59 of file ActsFatrasSimTool.cxx.

61  {
62  ATH_MSG_VERBOSE("Particle " << isp << " received for simulation.");
63  // Check if particle passes filter, if there is one
64  if (!m_particleFilter.empty() && !m_particleFilter->passFilter(isp)) {
65  ATH_MSG_VERBOSE("ISFParticle " << isp << " does not pass selection. Ignoring.");
66  return StatusCode::SUCCESS;
67  }
68  // Process ParticleState from particle stack
69  // Wrap the input ISFParticle in an STL vector with size of 1
70  const ISF::ISFParticleVector ispVector(1, &isp);
71  ATH_CHECK(m_truthRecordSvc->initializeTruthCollection());
72  ATH_CHECK(this->simulateVector(ctx, ispVector, secondaries, mcEventCollection));
73  ATH_MSG_VERBOSE("Simulation done");
74  return StatusCode::SUCCESS;
75 }

◆ simulateVector()

StatusCode ISF::ActsFatrasSimTool::simulateVector ( const EventContext &  ctx,
const ISFParticleVector particles,
ISFParticleContainer secondaries,
McEventCollection mcEventCollection,
McEventCollection = nullptr 
)
overridevirtual

Simulation call for vectors of particles.

Reimplemented from ISF::BaseSimulatorTool.

Definition at line 77 of file ActsFatrasSimTool.cxx.

81  {
82 
83  m_randomEngine->setSeed(m_randomEngineName, ctx);
84  CLHEP::HepRandomEngine* randomEngine = m_randomEngine->getEngine(ctx);
85  Generator generator(CLHEP::RandFlat::shoot(randomEngine->flat()));
86  ATH_MSG_VERBOSE(name() << " RNG seed " << CLHEP::RandFlat::shoot(randomEngine->flat()));
87  ATH_MSG_VERBOSE(name() << " received vector of size "
88  << particles.size() << " particles for simulation.");
89 
90  // construct the ACTS simulator
91  Acts::Navigator navigator( Acts::Navigator::Config{ m_trackingGeometry }, m_logger);
92  auto bField = std::make_shared<ATLASMagneticFieldWrapper>();
93  auto chargedStepper = ChargedStepper(std::move(bField));
94  auto neutralStepper = NeutralStepper();
95  auto chargedPropagator = ChargedPropagator(chargedStepper, navigator, m_logger->clone(Acts::Logging::Level::FATAL));
96  auto neutralPropagator = NeutralPropagator(neutralStepper, navigator, m_logger->clone(Acts::Logging::Level::FATAL));
97  ChargedSimulation simulatorCharged(std::move(chargedPropagator), m_logger->clone());
98  NeutralSimulation simulatorNeutral(std::move(neutralPropagator), m_logger->clone());
99  Simulation simulator=Simulation(std::move(simulatorCharged),std::move(simulatorNeutral));
100  ATH_MSG_VERBOSE(name() << " Min pT for interaction " << m_interact_minPt * Acts::UnitConstants::MeV << " GeV");
101  // Acts propagater options
102  simulator.charged.maxStepSize = m_maxStepSize;
103  simulator.charged.maxStep = m_maxStep;
104  simulator.charged.pathLimit = m_pathLimit;
105  simulator.charged.maxRungeKuttaStepTrials = m_maxRungeKuttaStepTrials;
106  simulator.charged.loopProtection = m_loopProtection;
107  simulator.charged.loopFraction = m_loopFraction;
108  simulator.charged.targetTolerance = m_tolerance;
109  simulator.charged.stepSizeCutOff = m_stepSizeCutOff;
110  // Create interaction list
111  simulator.charged.interactions = ActsFatras::makeStandardChargedElectroMagneticInteractions(m_interact_minPt * Acts::UnitConstants::MeV);
112  // get Geo and Mag map
113  ATH_MSG_VERBOSE(name() << " Getting per event Geo and Mag map");
114  Acts::MagneticFieldContext mctx = getMagneticFieldContext(ctx);
115  const ActsGeometryContext& gctx = m_trackingGeometryTool->getNominalGeometryContext();
116  auto anygctx = gctx.context();
117  // Loop over ISFParticleVector and process each separately
118  ATH_MSG_VERBOSE(name() << " Processing particles in ISFParticleVector.");
119  // For sihit creation
120  SiHitCollection pixelSiHits;
121  SiHitCollection sctSiHits;
122  for (const auto isfp : particles) {
123  // ====ACTSFatras Simulation====
124  // //
125  // input/output particle and hits containers
126  // Convert to ActsFatras::Particle
127  // ISF: Energy, mass, and momentum are in MeV, position in mm
128  // Acts: Energy, mass, and momentum are in GeV, position in mm
129  std::vector<ActsFatras::Particle> input = std::vector<ActsFatras::Particle>{
130  ActsFatras::Particle(ActsFatras::Barcode().setVertexPrimary(0).setParticle(
131  HepMC::barcode(isfp)), static_cast<Acts::PdgParticle>(isfp->pdgCode()),
132  isfp->charge(),isfp->mass() * Acts::UnitConstants::MeV)
133  .setDirection(Acts::makeDirectionFromPhiEta(
134  isfp->momentum().phi(), isfp->momentum().eta()))
135  .setAbsoluteMomentum(isfp->momentum().mag() * Acts::UnitConstants::MeV)
136  .setPosition4(isfp->position().x(), isfp->position().y(),
137  isfp->position().z(), isfp->timeStamp())};
138  std::vector<ActsFatras::Particle> simulatedInitial;
139  std::vector<ActsFatras::Particle> simulatedFinal;
140  std::vector<ActsFatras::Hit> hits;
141  ATH_MSG_DEBUG(name() << " Convert ISF::Particle " << isfp->barcode() << " to ActsFatras::Particle " << input[0].particleId().value());
142  ATH_MSG_DEBUG(name() << " Propagating ActsFatras::Particle vertex|particle|generation|subparticle, " << input[0]);
143  // simulate
144  auto result=simulator.simulate(anygctx, mctx, generator, input, simulatedInitial, simulatedFinal, hits);
145  auto simulatedFailure=result.value();
146  if (simulatedFailure.size()>0){
147  for (const auto& simfail : simulatedFailure){
148  auto errCode = Acts::make_error_code(Acts::PropagatorError(simfail.error.value()));
149  ATH_MSG_WARNING(name() << " Particle id " <<simfail.particle.particleId()<< ": fail to be simulated during Propagation: " << errCode.message());
150  ATH_MSG_WARNING(name() << " Particle vertex|particle|generation|subparticle"<<simfail.particle << " starts from position" << Acts::toString(simfail.particle.position()) << " and direction " << Acts::toString(simfail.particle.direction()));
151  return StatusCode::SUCCESS;
152  }
153  }
154 
155  ATH_MSG_DEBUG(name() << " initial particle " << simulatedInitial[0]);
156  ATH_MSG_DEBUG(name() << " ActsFatras simulator hits: " << hits.size());
157  int i = 0;
158  for (const auto& hit : hits) {
159  ATH_MSG_DEBUG(name() << " hit pos: " << hit.position() );
160  ++i;
161  if (i>5) break;
162  }
163  ATH_MSG_DEBUG(name() << " No. of particles after ActsFatras simulator: " << simulatedFinal.size());
164  if (simulatedFinal.size()>1){
165  ATH_MSG_DEBUG(name() << " start procesing secondaries");
166  // convert final particles to ISF::particle
167  auto isAlive = ISF::fPrimarySurvives;
168  // int generation = simulatedFinal[-1].particleId().generation();
169  int n = 1;
170  for (std::vector<ActsFatras::Particle>::iterator itr=simulatedFinal.begin()+1;itr!=simulatedFinal.end();++itr){
171  ATH_MSG_DEBUG(name() << " secondaries particle " <<n<<"/"<< simulatedFinal.size()-1<<": "<< *itr);
172  ++n;
173  const auto pos = Amg::Vector3D(itr->position()[Acts::ePos0],itr->position()[Acts::ePos1],itr->position()[Acts::ePos2]);
174  const auto mom = Amg::Vector3D(itr->fourMomentum()[Acts::eMom0] / Acts::UnitConstants::MeV,itr->fourMomentum()[Acts::eMom1] / Acts::UnitConstants::MeV,itr->fourMomentum()[Acts::eMom2] / Acts::UnitConstants::MeV);
175  double mass = itr->mass() / Acts::UnitConstants::MeV;
176  double charge = itr->charge();
177  int pdgid = itr->pdg();
178  double properTime = itr->properTime();
179  const int status = 1 + HepMC::SIM_STATUS_THRESHOLD;
180  const int id = HepMC::UNDEFINED_ID;
181  ATH_MSG_DEBUG(name() << " secondaries particle process code " << itr->process());
182  auto secisfp = new ISF::ISFParticle (pos,mom,mass,charge,pdgid,status,properTime,*isfp,id);
183  auto vecsecisfp = std::make_unique<ISF::ISFParticleVector>();
184  vecsecisfp->push_back(secisfp);
185  ATH_MSG_DEBUG(name() << " vecsecisfp barcode|p: " << (*vecsecisfp)[0]->barcode() <<"|"<< (*vecsecisfp)[0]->momentum().mag());
186  if(!itr->isAlive()) isAlive = ISF::fKillsPrimary;
187  ISF::ISFTruthIncident truth(*isfp,
188  *vecsecisfp,
189  getATLASProcessCode(itr->process()),
190  isfp->nextGeoID(), // inherits from the parent
191  isAlive
192  );
193  ATH_MSG_DEBUG(name() << " Truth incident physicsProcessCode()" << truth.physicsProcessCode());
194  m_truthRecordSvc->registerTruthIncident(truth, true);
195  truth.updateChildParticleProperties();
196  ATH_MSG_DEBUG(name() << " Create secondariy ISF::Particle " << secisfp->barcode());
197  if (secisfp->getTruthBinding()) {
198  ATH_MSG_DEBUG(name() << " Save secondariy " << *secisfp);
199  secondaries.push_back(secisfp);
200  }
201  else {
202  ATH_MSG_WARNING("Secondary particle not written out to truth.\n Parent (" << isfp << ")\n Secondary (" << *secisfp <<")");
203  }
204  }
205  }//end of secondaries
206  ATH_MSG_VERBOSE(name() << " No. of secondaries: " << secondaries.size());
207  ATH_MSG_DEBUG(name() << " End of particle " << isfp->barcode());
208  m_ActsFatrasWriteHandler->createHits(*isfp, m_trackingGeometry,hits,pixelSiHits,sctSiHits);
209 
210  std::vector<ActsFatras::Particle>().swap(input);
211  std::vector<ActsFatras::Particle>().swap(simulatedInitial);
212  std::vector<ActsFatras::Particle>().swap(simulatedFinal);
213  std::vector<ActsFatras::Hit>().swap(hits);
214  } // end of isfp loop
215  std::vector<SiHitCollection> hitcolls;
216  hitcolls.push_back(pixelSiHits);
217  hitcolls.push_back(sctSiHits);
218  ATH_CHECK(m_ActsFatrasWriteHandler->WriteHits(hitcolls,ctx));
219  return StatusCode::SUCCESS;
220 }

◆ 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

◆ ATLAS_THREAD_SAFE

ATHRNG::RNGWrapper* m_randomEngine ISF::ActsFatrasSimTool::ATLAS_THREAD_SAFE {}
private

Definition at line 238 of file ActsFatrasSimTool.h.

◆ m_ActsFatrasWriteHandler

ToolHandle<ActsFatrasWriteHandler> ISF::ActsFatrasSimTool::m_ActsFatrasWriteHandler
private
Initial value:
{
this, "ActsFatrasWriteHandler", "ActsFatrasWriteHandler"}

Definition at line 260 of file ActsFatrasSimTool.h.

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

SG::ReadCondHandleKey<AtlasFieldCacheCondObj> ISF::ActsFatrasSimTool::m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"}
private

Definition at line 248 of file ActsFatrasSimTool.h.

◆ m_includeGgradient

Gaudi::Property<bool> ISF::ActsFatrasSimTool::m_includeGgradient {this, "IncludeGgradient", true, "Boolean flag for inclusion of d(dEds)d(q/p) into energy loss"}
private

Definition at line 268 of file ActsFatrasSimTool.h.

◆ m_interact_minPt

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_interact_minPt
private
Initial value:
{this, "Interact_MinPt", 50.0,
"Min pT of the interactions (MeV)"}

Definition at line 263 of file ActsFatrasSimTool.h.

◆ m_logger

std::shared_ptr<const Acts::Logger> ISF::ActsFatrasSimTool::m_logger {nullptr}
private

Definition at line 251 of file ActsFatrasSimTool.h.

◆ m_loopFraction

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_loopFraction
private
Initial value:
{this, "LoopFraction", 0.5,
"Allowed loop fraction, 1 is a full loop"}

Definition at line 281 of file ActsFatrasSimTool.h.

◆ m_loopProtection

Gaudi::Property<bool> ISF::ActsFatrasSimTool::m_loopProtection
private
Initial value:
{this, "LoopProtection", true,
"Loop protection, it adapts the pathLimit"}

Definition at line 279 of file ActsFatrasSimTool.h.

◆ m_maxRungeKuttaStepTrials

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_maxRungeKuttaStepTrials
private
Initial value:
{this, "MaxRungeKuttaStepTrials", 10000,
"Maximum number of Runge-Kutta steps for the stepper step call"}

Definition at line 273 of file ActsFatrasSimTool.h.

◆ m_maxStep

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_maxStep
private
Initial value:
{this, "MaxSteps", 1000,
"Max number of steps"}

Definition at line 271 of file ActsFatrasSimTool.h.

◆ m_maxStepSize

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_maxStepSize
private
Initial value:
{this, "MaxStepSize", 3.0,
"Max step size (converted to Acts::UnitConstants::m)"}

Definition at line 275 of file ActsFatrasSimTool.h.

◆ m_meanEnergyLoss

Gaudi::Property<bool> ISF::ActsFatrasSimTool::m_meanEnergyLoss {this, "MeanEnergyLoss", true, "Toggle between mean and mode evaluation of energy loss"}
private

Definition at line 267 of file ActsFatrasSimTool.h.

◆ m_momentumCutOff

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_momentumCutOff {this, "MomentumCutOff", 0., "Cut-off value for the momentum in SI units"}
private

Definition at line 269 of file ActsFatrasSimTool.h.

◆ m_particleFilter

PublicToolHandle<ISF::IParticleFilter> ISF::ActsFatrasSimTool::m_particleFilter
private
Initial value:
{
this, "ParticleFilter", "", "Particle filter kinematic cuts, etc."}

Definition at line 254 of file ActsFatrasSimTool.h.

◆ m_pathLimit

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_pathLimit
private
Initial value:
{this, "PathLimit", 100.0,
"Track path limit (converted to Acts::UnitConstants::cm)"}

Definition at line 277 of file ActsFatrasSimTool.h.

◆ m_processTypeMap

Gaudi::Property<std::map<int,int> > ISF::ActsFatrasSimTool::m_processTypeMap
private
Initial value:
{this, "ProcessTypeMap",
{{0,0}, {1,201}, {2,14}, {3,3}, {4,121}}, "proessType map <ActsFatras,G4>"}

Definition at line 288 of file ActsFatrasSimTool.h.

◆ m_randomEngineName

Gaudi::Property<std::string> ISF::ActsFatrasSimTool::m_randomEngineName
private
Initial value:
{this, "RandomEngineName",
"RandomEngineName", "Name of random number stream"}

Definition at line 239 of file ActsFatrasSimTool.h.

◆ m_rngSvc

ServiceHandle<IAthRNGSvc> ISF::ActsFatrasSimTool::m_rngSvc {this, "RNGService", "AthRNGSvc"}
private

Definition at line 237 of file ActsFatrasSimTool.h.

◆ m_stepSizeCutOff

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_stepSizeCutOff
private
Initial value:
{this, "StepSizeCutOff", 0.,
"Cut-off value for the step size"}

Definition at line 285 of file ActsFatrasSimTool.h.

◆ m_tolerance

Gaudi::Property<double> ISF::ActsFatrasSimTool::m_tolerance
private
Initial value:
{this, "Tolerance", 0.0001,
"Tolerance for the error of the integration"}

Definition at line 283 of file ActsFatrasSimTool.h.

◆ m_trackingGeometry

std::shared_ptr<const Acts::TrackingGeometry> ISF::ActsFatrasSimTool::m_trackingGeometry
private

Definition at line 245 of file ActsFatrasSimTool.h.

◆ m_trackingGeometryTool

ToolHandle<IActsTrackingGeometryTool> ISF::ActsFatrasSimTool::m_trackingGeometryTool
private
Initial value:
{
this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}

Definition at line 243 of file ActsFatrasSimTool.h.

◆ m_truthRecordSvc

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

Definition at line 257 of file ActsFatrasSimTool.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
ISF::ActsFatrasSimTool::ChargedPropagator
Acts::Propagator< ChargedStepper, Navigator > ChargedPropagator
Definition: ActsFatrasSimTool.h:177
ISF::ActsFatrasSimTool::m_interact_minPt
Gaudi::Property< double > m_interact_minPt
Definition: ActsFatrasSimTool.h:263
ISF::ActsFatrasSimTool::Generator
std::ranlux48 Generator
Definition: ActsFatrasSimTool.h:172
ISF::ActsFatrasSimTool::m_rngSvc
ServiceHandle< IAthRNGSvc > m_rngSvc
Definition: ActsFatrasSimTool.h:237
ISF::ActsFatrasSimTool::m_trackingGeometry
std::shared_ptr< const Acts::TrackingGeometry > m_trackingGeometry
Definition: ActsFatrasSimTool.h:245
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
TRTCalib_Extractor.hits
hits
Definition: TRTCalib_Extractor.py:35
get_generator_info.result
result
Definition: get_generator_info.py:21
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
AtlasFieldCacheCondObj
Definition: AtlasFieldCacheCondObj.h:19
ISF::ActsFatrasSimTool::NeutralPropagator
Acts::Propagator< NeutralStepper, Navigator > NeutralPropagator
Definition: ActsFatrasSimTool.h:180
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ISF::ActsFatrasSimTool::ChargedStepper
Acts::EigenStepper< Acts::EigenStepperDefaultExtension > ChargedStepper
Definition: ActsFatrasSimTool.h:176
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
ActsTrk::detail::Navigator
Acts::Navigator Navigator
Definition: Tracking/Acts/ActsTrackReconstruction/src/detail/Definitions.h:31
ISF::ActsFatrasSimTool::m_pathLimit
Gaudi::Property< double > m_pathLimit
Definition: ActsFatrasSimTool.h:277
python.SystemOfUnits.MeV
int MeV
Definition: SystemOfUnits.py:154
AtlasHitsVector
Definition: AtlasHitsVector.h:33
ISF::ISFParticle
Definition: ISFParticle.h:42
ISF::ActsFatrasSimTool::NeutralSimulation
SingleParticleSimulation< NeutralPropagator, NeutralInteractions, ActsFatras::NoSurface, ActsFatras::NoDecay > NeutralSimulation
Definition: ActsFatrasSimTool.h:196
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAOD::Particle
Particle_v1 Particle
Define the latest version of the particle class.
Definition: Event/xAOD/xAODParticleEvent/xAODParticleEvent/Particle.h:17
ISF::ActsFatrasSimTool::m_loopFraction
Gaudi::Property< double > m_loopFraction
Definition: ActsFatrasSimTool.h:281
ISF::ActsFatrasSimTool::m_loopProtection
Gaudi::Property< bool > m_loopProtection
Definition: ActsFatrasSimTool.h:279
makeActsAthenaLogger
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Definition: Tracking/Acts/ActsInterop/src/Logger.cxx:64
ActsGeometryContext::context
Acts::GeometryContext context() const
Definition: ActsGeometryContext.h:45
ISF::ActsFatrasSimTool::m_maxStepSize
Gaudi::Property< double > m_maxStepSize
Definition: ActsFatrasSimTool.h:275
ParticleGun_EoverP_Config.mom
mom
Definition: ParticleGun_EoverP_Config.py:63
Amg::toString
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
Definition: GeoPrimitivesToStringConverter.h:40
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ISF::ActsFatrasSimTool::ChargedSimulation
SingleParticleSimulation< ChargedPropagator, ChargedInteractions, HitSurfaceSelector, ActsFatras::NoDecay > ChargedSimulation
Definition: ActsFatrasSimTool.h:190
ISF::ActsFatrasSimTool::simulateVector
virtual StatusCode simulateVector(const EventContext &ctx, const ISFParticleVector &particles, ISFParticleContainer &secondaries, McEventCollection *mcEventCollection, McEventCollection *shadowTruth=nullptr) override
Simulation call for vectors of particles.
Definition: ActsFatrasSimTool.cxx:77
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
ISF::ISFTruthIncident
Definition: ISFTruthIncident.h:35
lumiFormat.i
int i
Definition: lumiFormat.py:85
beamspotman.n
n
Definition: beamspotman.py:731
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ISF::BaseSimulatorTool::m_chrono
ServiceHandle< IChronoStatSvc > m_chrono
The timing service for general usage.
Definition: BaseSimulatorTool.h:115
HepMC::barcode
int barcode(const T *p)
Definition: Barcode.h:16
PlotPulseshapeFromCool.input
input
Definition: PlotPulseshapeFromCool.py:106
ISF::ISFParticleVector
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
Definition: ISFParticleContainer.h:26
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ISF::ActsFatrasSimTool::NeutralStepper
Acts::StraightLineStepper NeutralStepper
Definition: ActsFatrasSimTool.h:179
ISF::BaseSimulatorTool::BaseSimulatorTool
BaseSimulatorTool()
Default constructor.
ActsGeometryContext
Include the GeoPrimitives which need to be put first.
Definition: ActsGeometryContext.h:27
ISF::ActsFatrasSimTool::m_ActsFatrasWriteHandler
ToolHandle< ActsFatrasWriteHandler > m_ActsFatrasWriteHandler
Definition: ActsFatrasSimTool.h:260
HepMC::UNDEFINED_ID
constexpr int UNDEFINED_ID
Definition: MagicNumbers.h:55
HepMC::SIM_STATUS_THRESHOLD
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
Definition: MagicNumbers.h:45
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
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
charge
double charge(const T &p)
Definition: AtlasPID.h:538
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
ISF::Fatras
@ Fatras
Definition: SimulationFlavor.h:22
ISF::ActsFatrasSimTool::getMagneticFieldContext
virtual Acts::MagneticFieldContext getMagneticFieldContext(const EventContext &) const
Definition: ActsFatrasSimTool.cxx:222
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
ISF::ActsFatrasSimTool::m_processTypeMap
Gaudi::Property< std::map< int, int > > m_processTypeMap
Definition: ActsFatrasSimTool.h:288
ISF::BaseSimulatorTool::initialize
virtual StatusCode initialize() override
Definition: BaseSimulatorTool.h:57
mc.generator
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
Definition: mc.MGH7_FxFx_H71-DEFAULT_test.py:18
ISF::ActsFatrasSimTool::m_logger
std::shared_ptr< const Acts::Logger > m_logger
Definition: ActsFatrasSimTool.h:251
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
ISF::ActsFatrasSimTool::m_maxStep
Gaudi::Property< double > m_maxStep
Definition: ActsFatrasSimTool.h:271
Simulation
Definition: BeamEffectsAlg.cxx:21
ISF::ActsFatrasSimTool::m_maxRungeKuttaStepTrials
Gaudi::Property< double > m_maxRungeKuttaStepTrials
Definition: ActsFatrasSimTool.h:273
ISF::ActsFatrasSimTool::m_stepSizeCutOff
Gaudi::Property< double > m_stepSizeCutOff
Definition: ActsFatrasSimTool.h:285
merge.status
status
Definition: merge.py:17
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
ISF::ActsFatrasSimTool::m_trackingGeometryTool
ToolHandle< IActsTrackingGeometryTool > m_trackingGeometryTool
Definition: ActsFatrasSimTool.h:243
ISF::fPrimarySurvives
@ fPrimarySurvives
Definition: ISFTruthIncident.h:24
mag
Scalar mag() const
mag method
Definition: AmgMatrixBasePlugin.h:26
ISF::ActsFatrasSimTool::m_fieldCacheCondObjInputKey
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > m_fieldCacheCondObjInputKey
Definition: ActsFatrasSimTool.h:248
ISF::ActsFatrasSimTool::Simulation
ActsFatras::Simulation< ChargedSelector, ChargedSimulation, NeutralSelector, NeutralSimulation > Simulation
Definition: ActsFatrasSimTool.h:199
ISF::ActsFatrasSimTool::m_particleFilter
PublicToolHandle< ISF::IParticleFilter > m_particleFilter
Definition: ActsFatrasSimTool.h:254
ISF::ActsFatrasSimTool::getATLASProcessCode
int getATLASProcessCode(ActsFatras::ProcessType actspt)
Definition: ActsFatrasSimTool.h:291
ISF::fKillsPrimary
@ fKillsPrimary
Definition: ISFTruthIncident.h:25
ISF::ActsFatrasSimTool::m_randomEngineName
Gaudi::Property< std::string > m_randomEngineName
Definition: ActsFatrasSimTool.h:239
ISF::ActsFatrasSimTool::m_truthRecordSvc
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
Definition: ActsFatrasSimTool.h:257
ISF::ActsFatrasSimTool::m_tolerance
Gaudi::Property< double > m_tolerance
Definition: ActsFatrasSimTool.h:283