31#include "CaloDetDescr/CaloDetDescrElement.h"
37#include "CLHEP/Units/SystemOfUnits.h"
79 return StatusCode::SUCCESS;
90 const EventContext& ctx = Gaudi::Hive::currentContext();
112 std::string chronoName=this->name()+
"_"+ tool.name();
117 ATH_MSG_DEBUG(
"Chrono stop : delta " <<
m_chrono->chronoDelta (chronoName,IChronoStatSvc::USER) * CLHEP::microsecond / CLHEP::second <<
" second " );
123 return StatusCode::FAILURE;
127 return StatusCode::SUCCESS;
132 ATH_MSG_VERBOSE(
"FastCaloSimV2Tool " << name() <<
" releaseEvent() " );
141 return StatusCode::SUCCESS;
143 return StatusCode::FAILURE;
149 const EventContext& ctx = Gaudi::Hive::currentContext();
159 return StatusCode::SUCCESS;
167 ATH_MSG_VERBOSE(
"NEW PARTICLE! FastCaloSimV2Tool called with ISFParticle: " << isfp);
175 if(isfp.
ekin() < 10) {
176 ATH_MSG_VERBOSE(
"Skipping particle with Ekin: " << isfp.
ekin() <<
" MeV. Below the 10 MeV threshold.");
177 return StatusCode::SUCCESS;
181 truth.SetPtEtaPhiM(particle_direction.perp(), particle_direction.eta(), particle_direction.phi(), isfp.
mass());
190 ATH_MSG_VERBOSE(
"Found anti-proton/neutron, setting Ekin offset in TFCSTruthState.");
196 ATH_MSG_DEBUG(
" particle: " << isfp.
pdgCode() <<
" Ekin: " << isfp.
ekin() <<
" position eta: " << particle_position.eta() <<
" direction eta: " << particle_direction.eta() <<
" position phi: " << particle_position.phi() <<
" direction phi: " << particle_direction.phi());
199 if(extrapol.IDCaloBoundary_eta() != -999){
200 CLHEP::HepRandomEngine *rndmEngine = rngWrapper->
getEngine(ctx);
204 simulstate.
setAuxInfo<
int>(
"EventNr"_FCShash, ctx.evt() );
214 for(
const auto& iter : simulstate.
cells()) {
225 if (someSecondaries && !someSecondaries->empty()) {
238 for (
auto *secondary : *someSecondaries) {
239 if (secondary->getTruthBinding()) {
240 secondaries.push_back(secondary);
243 ATH_MSG_WARNING(
"Secondary particle created by PunchThroughTool not written out to truth.\n Parent (" << isfp <<
")\n Secondary (" << *secondary <<
")");
247 delete someSecondaries;
252 else ATH_MSG_DEBUG(
"Skipping simulation as extrapolation to ID-Calo boundary failed.");
255 return StatusCode::SUCCESS;
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
This class provides an interface to generate or decode an identifier for the upper levels of the dete...
Definition of CaloDetDescrManager.
A wrapper class for event-slot-local random engines.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Data object for each calorimeter readout cell.
void addEnergy(float energy)
add energy
The generic ISF particle definition,.
double ekin() const
Kinetic energy.
const Amg::Vector3D & momentum() const
The current momentum vector of the ISFParticle.
const Amg::Vector3D & position() const
The current position of the ISFParticle.
int pdgCode() const
PDG value.
double mass() const
mass of the particle
AtlasDetDescr::AtlasRegion nextGeoID() const
next geoID the particle will be simulated in
Interface class for all truth incidents handled by the ISF.
void updateChildParticleProperties()
Update the id and particleLink properties of the child particles (to be called after registerTruthInc...
This defines the McEventCollection, which is really just an ObjectVector of McEvent objectsFile: Gene...
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
void setAuxInfo(std::uint32_t index, const T &val)
void set_vertex(const TLorentzVector &val)
void set_Ekin_off(double val)
const std::string process
Eigen::Matrix< double, 3, 1 > Vector3D
std::list< ISF::ISFParticle * > ISFParticleContainer
generic ISFParticle container (not necessarily a std::list!)
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts