 |
ATLAS Offline Software
|
#include <ActsFatrasSimTool.h>
|
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< ActsFatras::PhotonConversion > |
|
using | NeutralSimulation = SingleParticleSimulation< NeutralPropagator, NeutralInteractions, ActsFatras::NoSurface, ActsFatras::NoDecay > |
|
using | Simulation = ActsFatras::Simulation< ChargedSelector, ChargedSimulation, NeutralSelector, NeutralSimulation > |
|
|
SiHitCollection | m_pixelSiHits |
|
SiHitCollection | m_sctSiHits |
|
ServiceHandle< IAthRNGSvc > | m_rngSvc {this, "RNGService", "AthRNGSvc"} |
|
ATHRNG::RNGWrapper *m_randomEngine | ATLAS_THREAD_SAFE {} |
|
Gaudi::Property< std::string > | m_randomEngineName |
|
PublicToolHandle< ActsTrk::ITrackingGeometryTool > | m_trackingGeometryTool |
|
std::shared_ptr< const Acts::TrackingGeometry > | m_trackingGeometry |
|
SG::ReadCondHandleKey< AtlasFieldCacheCondObj > | m_fieldCacheCondObjInputKey {this, "AtlasFieldCacheCondObj", "fieldCondObj", "Name of the Magnetic Field conditions object key"} |
|
std::shared_ptr< const Acts::Logger > | m_logger {nullptr} |
|
PublicToolHandle< ISF::IParticleFilter > | m_particleFilter |
|
ServiceHandle< ISF::ITruthSvc > | m_truthRecordSvc {this, "TruthRecordService", "ISF_TruthRecordSvc", ""} |
|
ToolHandle< ActsFatrasWriteHandler > | m_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 |
|
Definition at line 70 of file ActsFatrasSimTool.h.
◆ ChargedInteractions
◆ ChargedPropagator
◆ ChargedSelector
◆ ChargedSimulation
◆ ChargedStepper
◆ Generator
◆ Navigator
◆ NeutralInteractions
◆ NeutralPropagator
◆ NeutralSelector
◆ NeutralSimulation
◆ NeutralStepper
◆ Simulation
◆ ActsFatrasSimTool()
ISF::ActsFatrasSimTool::ActsFatrasSimTool |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
parent |
|
) |
| |
◆ ~ActsFatrasSimTool()
ISF::ActsFatrasSimTool::~ActsFatrasSimTool |
( |
| ) |
|
|
virtual |
◆ chronoStart()
const ChronoEntity* ISF::BaseSimulatorTool::chronoStart |
( |
const IChronoSvc::ChronoTag & |
tag | ) |
|
|
inlineinherited |
◆ chronoStop()
const ChronoEntity* ISF::BaseSimulatorTool::chronoStop |
( |
const IChronoSvc::ChronoTag & |
tag | ) |
|
|
inlineinherited |
◆ getATLASProcessCode()
int ISF::ActsFatrasSimTool::getATLASProcessCode |
( |
ActsFatras::ProcessType |
actspt | ) |
|
|
inlineprivate |
◆ getMagneticFieldContext()
Acts::MagneticFieldContext ISF::ActsFatrasSimTool::getMagneticFieldContext |
( |
const EventContext & |
ctx | ) |
const |
|
virtual |
Definition at line 234 of file ActsFatrasSimTool.cxx.
236 if (!readHandle.isValid()) {
242 return Acts::MagneticFieldContext(fieldCondObj);
◆ initialize()
StatusCode ISF::ActsFatrasSimTool::initialize |
( |
| ) |
|
|
overridevirtual |
Reimplemented from ISF::BaseSimulatorTool.
Definition at line 25 of file ActsFatrasSimTool.cxx.
27 ATH_MSG_INFO(
"ISF::ActsFatrasSimTool update with ACTS version: v"
28 << Acts::VersionMajor <<
"." << Acts::VersionMinor <<
"."
29 << Acts::VersionPatch <<
" [" << Acts::CommitHash <<
"]");
45 if (
m_rngSvc.retrieve().isFailure()) {
47 return StatusCode::FAILURE;
51 if (!m_randomEngine) {
53 return StatusCode::FAILURE;
59 return StatusCode::SUCCESS;
◆ releaseEvent()
virtual StatusCode ISF::ActsFatrasSimTool::releaseEvent |
( |
const EventContext & |
| ) |
|
|
inlineoverridevirtual |
◆ releaseEventST()
virtual StatusCode ISF::BaseSimulatorTool::releaseEventST |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ retrieveTool()
template<class T >
StatusCode ISF::ActsFatrasSimTool::retrieveTool |
( |
ToolHandle< T > & |
thandle | ) |
|
|
inlineprivate |
Definition at line 241 of file ActsFatrasSimTool.h.
242 if (!thandle.empty() && thandle.retrieve().isFailure()) {
244 return StatusCode::FAILURE;
246 return StatusCode::SUCCESS;
◆ setupEvent()
virtual StatusCode ISF::ActsFatrasSimTool::setupEvent |
( |
const EventContext & |
| ) |
|
|
inlineoverridevirtual |
◆ setupEventST()
virtual StatusCode ISF::BaseSimulatorTool::setupEventST |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ simFlavor()
◆ simulate()
◆ simulateVector()
Simulation call for vectors of particles.
Reimplemented from ISF::BaseSimulatorTool.
Definition at line 79 of file ActsFatrasSimTool.cxx.
86 CLHEP::HepRandomEngine* randomEngine = m_randomEngine->getEngine(ctx);
90 <<
particles.size() <<
" particles for simulation.");
94 auto bField = std::make_shared<ATLASMagneticFieldWrapper>();
131 ATH_MSG_DEBUG(
name() <<
" Convert ISF::Particle(mass) " << isfp->id()<<
"|" << isfp<<
"(" << isfp->mass() <<
")");
132 std::vector<ActsFatras::Particle>
input = std::vector<ActsFatras::Particle>{
133 ActsFatras::Particle(ActsFatras::Barcode().setVertexPrimary(0).setParticle(isfp->id()),
static_cast<Acts::PdgParticle
>(isfp->pdgCode()),
135 .setDirection(Acts::makeDirectionFromPhiEta(isfp->momentum().phi(), isfp->momentum().eta()))
138 ATH_MSG_DEBUG(
name() <<
" Propagating ActsFatras::Particle vertex|particle|generation|subparticle, " << input[0]);
139 std::vector<ActsFatras::Particle> simulatedInitial;
140 std::vector<ActsFatras::Particle> simulatedFinal;
141 std::vector<ActsFatras::Hit>
hits;
143 auto result=simulator.simulate(anygctx, mctx,
generator, input, simulatedInitial, simulatedFinal,
hits);
144 auto simulatedFailure=
result.value();
145 if (simulatedFailure.size()>0){
146 for (
const auto& simfail : simulatedFailure){
147 auto errCode = Acts::make_error_code(Acts::PropagatorError(simfail.error.value()));
148 ATH_MSG_WARNING(
name() <<
" Particle id " <<simfail.particle.particleId()<<
": fail to be simulated during Propagation: " << errCode.message());
149 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()));
150 return StatusCode::SUCCESS;
157 for (
const auto& hit :
hits) {
162 ATH_MSG_DEBUG(
name() <<
" No. of particles after ActsFatras simulator: " << simulatedFinal.size());
163 if (!simulatedFinal.empty()){
165 auto itr = simulatedFinal.begin();
167 std::vector<ActsFatras::Hit> particle_hits;
168 std::copy(
hits.begin(),
hits.begin()+itr->numberOfHits(), std::back_inserter(particle_hits));
171 auto isKilled = !itr->isAlive();
172 int maxGeneration = (simulatedFinal.back()).particleId().generation();
174 for (
int gen = 0;
gen <= maxGeneration; ++
gen){
176 auto vecsecisfp = std::make_unique<ISF::ISFParticleVector>();
177 while (
static_cast<int>(itr->particleId().generation()) ==
gen){
179 if(itr->isSecondary()){
184 double charge = itr->charge();
185 int pdgid = itr->pdg();
191 ATH_MSG_DEBUG(
name() <<
" secondaries particle (ISF): " << *secisfp <<
" time "<<secisfp->timeStamp());
192 vecsecisfp->push_back(secisfp);
199 if (!vecsecisfp->empty()) {
206 ATH_MSG_DEBUG(
name() <<
" Truth incident parentPt2(MinPt2) " << truth.parentPt2() <<
" (100 MeV)");
207 ATH_MSG_DEBUG(
name() <<
" Truth incident ChildPt2(MinPt2) " << truth.childrenPt2Pass(300) <<
" (300 MeV)");
209 truth.updateParentAfterIncidentProperties();
210 truth.updateChildParticleProperties();
211 for (
auto *secisfp : *vecsecisfp){
212 if (secisfp->getTruthBinding()) {
213 secondaries.push_back(secisfp);
216 ATH_MSG_WARNING(
"Secondary particle not written out to truth.\n Parent (" << isfp <<
")\n Secondary (" << *secisfp <<
")");
226 std::vector<ActsFatras::Particle>().swap(input);
227 std::vector<ActsFatras::Particle>().swap(simulatedInitial);
228 std::vector<ActsFatras::Particle>().swap(simulatedFinal);
229 std::vector<ActsFatras::Hit>().swap(
hits);
231 return StatusCode::SUCCESS;
◆ sysInitialize()
virtual StatusCode ISF::BaseSimulatorTool::sysInitialize |
( |
| ) |
|
|
inlineoverridevirtualinherited |
◆ ATLAS_THREAD_SAFE
◆ m_ActsFatrasWriteHandler
Initial value:{
this, "ActsFatrasWriteHandler", "ActsFatrasWriteHandler"}
Definition at line 273 of file ActsFatrasSimTool.h.
◆ m_chrono
ServiceHandle<IChronoStatSvc> ISF::BaseSimulatorTool::m_chrono {this, "ChronoStatService", "ChronoStatSvc"} |
|
protectedinherited |
◆ m_fieldCacheCondObjInputKey
◆ 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 |
◆ 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 276 of file ActsFatrasSimTool.h.
◆ m_logger
std::shared_ptr<const Acts::Logger> ISF::ActsFatrasSimTool::m_logger {nullptr} |
|
private |
◆ 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 294 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 292 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 286 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 284 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 288 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 |
◆ m_momentumCutOff
Gaudi::Property<double> ISF::ActsFatrasSimTool::m_momentumCutOff {this, "MomentumCutOff", 0., "Cut-off value for the momentum in SI units"} |
|
private |
◆ m_particleFilter
Initial value:{
this, "ParticleFilter", "", "Particle filter kinematic cuts, etc."}
Definition at line 267 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 290 of file ActsFatrasSimTool.h.
◆ m_pixelSiHits
◆ 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 301 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 252 of file ActsFatrasSimTool.h.
◆ m_rngSvc
◆ m_sctSiHits
◆ 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 298 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 296 of file ActsFatrasSimTool.h.
◆ m_trackingGeometry
std::shared_ptr<const Acts::TrackingGeometry> ISF::ActsFatrasSimTool::m_trackingGeometry |
|
private |
◆ m_trackingGeometryTool
Initial value:{
this, "TrackingGeometryTool", "ActsTrackingGeometryTool"}
Definition at line 256 of file ActsFatrasSimTool.h.
◆ m_truthRecordSvc
The documentation for this class was generated from the following files:
Acts::Navigator Navigator
Acts::Vector4 convertPosToActs(const Amg::Vector3D &athenaPos, const double athenaTime=0.)
Converts a position vector & time from Athena units into Acts units.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
constexpr double timeToAthena(const double actsT)
Converts a time unit from Acts to Athena units.
Particle_v1 Particle
Define the latest version of the particle class.
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
Acts::GeometryContext context() const
std::string toString(const Translation3D &translation, int precision=4)
GeoPrimitvesToStringConverter.
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
std::pair< Amg::Vector3D, double > convertPosFromActs(const Acts::Vector4 &actsPos)
Converts an Acts 4-vector into a pair of an Athena spatial vector and the passed time.
std::pair< Amg::Vector3D, double > convertMomFromActs(const Acts::Vector4 &actsMom)
Converts an Acts four-momentum vector into an pair of an Athena three-momentum and the paritcle's ene...
Include the GeoPrimitives which need to be put first.
constexpr int UNDEFINED_ID
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
virtual StatusCode sysInitialize() override
Perform system initialization for an algorithm.
double charge(const T &p)
StatusCode initialize(bool used=true)
generator
Configure Herwig7 These are the commands corresponding to what would go into the regular Herwig infil...
#define ATH_MSG_WARNING(x)