9#include "GaudiKernel/IRndmGenSvc.h"
10#include "GaudiKernel/RndmGenerators.h"
11#include "GaudiKernel/DataSvc.h"
12#include "GaudiKernel/SmartDataPtr.h"
41#include "CLHEP/Units/SystemOfUnits.h"
42#include "CLHEP/Matrix/Vector.h"
43#include "CLHEP/Random/RandFlat.h"
44#include "CLHEP/Random/RandLandau.h"
45#include "CLHEP/Random/RandGaussZiggurat.h"
48#include "GaudiKernel/ITHistSvc.h"
56 m_eLossUpdator(
"iFatras::McEnergyLossUpdator/FatrasEnergyLossUpdator"),
58 m_msUpdator(
"Trk::MultipleScatteringUpdator/AtlasMultipleScatteringUpdator"),
125 declareProperty(
"EnergyLoss" ,
m_eLoss);
127 declareProperty(
"MultipleScattering" ,
m_ms);
128 declareProperty(
"MultipleScatteringUpdator" ,
m_msUpdator);
134 declareProperty(
"BremProcessCode" ,
m_processCode,
"MCTruth Physics Process Code");
136 declareProperty(
"HadronicInteraction" ,
m_hadInt);
154 declareProperty(
"RandomNumberService" ,
m_rndGenSvc ,
"Random number generator");
155 declareProperty(
"RandomStreamName" ,
m_randomEngineName ,
"Name of the random number stream");
158 declareProperty(
"ParticleBroker" ,
m_particleBroker ,
"ISF Particle Broker Svc");
159 declareProperty(
"TruthRecordSvc" ,
m_truthRecordSvc ,
"ISF Particle Truth Svc");
176 return StatusCode::FAILURE;
184 return StatusCode::FAILURE;
195 return StatusCode::FAILURE;
205 return StatusCode::FAILURE;
213 return StatusCode::FAILURE;
223 return StatusCode::FAILURE;
231 return StatusCode::FAILURE;
256 return StatusCode::FAILURE;
263 return StatusCode::FAILURE;
267 return StatusCode::FAILURE;
276 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
278 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !" );
298 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
301 ATH_MSG_INFO(
"TTree for MaterialEffects validation booked." );
322 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
325 ATH_MSG_INFO(
"TTree for Bremsstrahlung validation booked." );
346 ATH_MSG_ERROR(
"initialize() Could not register the validation Tree -> Switching ValidationMode Off !" );
349 ATH_MSG_INFO(
"TTree for Energy deposition validation booked." );
356 return StatusCode::SUCCESS;
363 ATH_MSG_INFO(
" ---------- Statistics output -------------------------- " );
368 return StatusCode::SUCCESS;
371std::unique_ptr<Trk::TrackParameters>
385 double traversedMatFraction = 0.;
412 return updateInLay(parent,parm,traversedMatFraction,timeLim, pathLim,dir, particle);
415std::unique_ptr<Trk::TrackParameters>
428 ATH_MSG_WARNING(
"Trk::TrackParameters parm is null -- will not proceed. Returning nullptr.");
432 std::unique_ptr<Trk::TrackParameters> currPar = inParm->
uniqueClone();
437 ATH_MSG_WARNING(
"Something went wrong -- m_matProp is missing but Trk::TrackParameters is not null! Returning nullptr.");
440 double pathCorrection =
441 m_layer->surfaceRepresentation().normal().dot(currPar->momentum()) != 0
442 ? std::abs(
m_layer->surfaceRepresentation().pathCorrection(currPar->position(), dir * (currPar->momentum())))
447 ATH_MSG_WARNING(
"BendingCorrection not implemented!! (McMaterialEffectsUpdator.cxx)");
453 std::string volumeName = enclosingVolume ? enclosingVolume->
volumeName() :
"Unknown";
454 double layerR =
m_layer->surfaceRepresentation().bounds().r();
455 double layerZ =
m_layer->surfaceRepresentation().center().z();
457 ATH_MSG_VERBOSE(
" -> path/X0 on layer [r/z] = [ " << layerR <<
" / " << layerZ <<
" ] :"
458 << pathCorrection*
m_matProp->thicknessInX0() );
475 dInL0 = extMatProp ? (1-matFraction)*pathCorrection*extMatProp->
thicknessInL0() :
480 double dX0 = (1.-matFraction)*pathCorrection*
m_matProp->thicknessInX0();
546 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from non-interacting ISFParticle "<< *regisp);
559 dInL0 *= x0rem > 0 ? x0rem / dX0 : 1.;
563 }
else if (pathLim.
x0Max > 0 && extMatProp && pathLim.
process > 100 &&
566 dX0 *= l0rem > 0 ? l0rem / dInL0 : 1.;
575 double p = currPar->momentum().mag();
579 AmgVector(5) updatedParameters(currPar->parameters());
580 std::unique_ptr<Trk::TrackParameters> updated =
nullptr;
584 double matTot = (1 - matFraction) * pathCorrection *
m_matProp->thicknessInX0();
586 radiate(isp, updatedParameters, currPar->position(), edir, timeLim, dX0, matFraction, matTot, dir, particle);
588 updated = currPar->associatedSurface().createUniqueTrackParameters(updatedParameters[0],
589 updatedParameters[1],
590 updatedParameters[2],
591 updatedParameters[3],
592 updatedParameters[4],
595 currPar = std::move(updated);
604 matFraction += dX0 / pathCorrection /
m_matProp->thicknessInX0();
607 if (isp->
charge() != 0 && dX0 > 0.) {
609 ionize(*currPar, updatedParameters, dX0, dir, particle);
622 updated = currPar->associatedSurface().createUniqueTrackParameters(updatedParameters[0],
623 updatedParameters[1],
624 updatedParameters[2],
625 updatedParameters[3],
626 updatedParameters[4],
628 currPar = std::move(updated);
638 if (iStatus == 1 || iStatus == 2) {
646 isp, timeLim.
time, currPar->position(), currPar->momentum(), &extMatProp->
material(), particle);
649 isp, timeLim.
time, currPar->position(), currPar->momentum(),
nullptr, particle);
660 for (
unsigned ic = 0; ic < childs.size(); ic++) {
661 double mom = childs[ic]->momentum().mag();
668 auto cparm = std::make_unique<Trk::CurvilinearParameters>(childs[ic]->position(), childs[ic]->momentum(), childs[ic]->
charge());
675 double ci =
m_layer->surfaceRepresentation().normal().dot(currPar->momentum().unit());
676 double co =
m_layer->surfaceRepresentation().normal().dot(childs[ic]->momentum().
unit());
677 double remMat = ci * co < 0 ? (1 - matFraction) : matFraction;
680 std::unique_ptr<Trk::TrackParameters> uPar =
681 updateInLay(childs[ic], cparm.get(), remMat, timeLim, pLim, dir, pHypothesis);
684 << uPar->position());
686 if (!childs.empty()) {
752 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from non-interacting ISFParticle "<< *regisp);
776 double E = sqrt(p*p+m*m);
785 double Ionization = 0.;
788 double I = 16.e-6 * std::pow(
m_matProp->averageZ(),0.9);
791 double kaz = 0.5*30.7075*
m_matProp->zOverAtimesRho();
796 Ionization = -kaz*(2.*log(2.*me/
I)+3.*log(gamma) - 1.95);
799 double eta2 = beta*gamma; eta2 *= eta2;
803 double eplasma = 28.816e-6 * sqrt(1000.*
m_matProp->zOverAtimesRho());
804 delta = 2.*log(eplasma/
I) + log(eta2) - 1.;
807 double tMax = 2.*eta2*me/(1.+2.*gamma*mfrac+mfrac*mfrac);
810 Ionization = -kaz*(log(2.*me*eta2*tMax/(
I*
I)) - 2.*(beta*beta) - delta);
813 double energyLoss = Ionization*dInX0*
m_matProp->x0();
814 double newP = sqrt(fmax(0.,(E+energyLoss)*(E+energyLoss)-m*m));
825 Trk::TimeLimit timeLim,
double pathLim,
double& matFraction,
double matTot,
841 double z =
pow(eps,
pow(rndx,exp(1.1)));
847 double dx = -log(
z)*0.65;
850 if ( path+dx > pathLim ) {
852 if (rndp > (pathLim-path)/dx){
859 matFraction += dx*rndp/matTot;
863 matFraction += dx/matTot;
900 double deltaP = (1-
z)*p;
915std::unique_ptr<Trk::TrackParameters>
920 double pathCorrection,
931 double E = sqrt(p*p+m*m);
944 ATH_MSG_VERBOSE(
" [+] Hadronic interaction killed initial hadron ... stop "
945 "simulation, tackle childs.");
954 AmgVector(5) updatedParameters(parm.parameters());
961 double energyLoss = sampledEnergyLoss.
deltaE();
963 if (E + energyLoss < m) {
965 " [+] particle momentum fell under momentum cut - stop simulation");
969 newP = sqrt((E + energyLoss) * (E + energyLoss) - m * m);
987 double deltaP = newP - p;
1001 ATH_MSG_VERBOSE(
" [+] particle momentum fell under momentum cut - stop simulation" );
1013 if (
m_ms && matprop.
x0()>0 ){
1029 (parm.covariance()) ? std::optional<AmgSymMatrix(5)>(*parm.covariance())
1034 updatedParameters[1],
1035 updatedParameters[2],
1036 updatedParameters[3],
1037 updatedParameters[4],
1041std::unique_ptr<Trk::TrackParameters>
1052 ATH_MSG_WARNING(
" [ ---- ] Only implemented for muons yet. No parameterisation for other particles." );
1057 AmgVector(5) updatedParameters(parm->parameters());
1060 double pathCorrection = 1.;
1065 double E = sqrt(p*p+m*m);
1097 double simulatedEnergyLoss = -1.*(energyLossMPV+energyLossSigma*CLHEP::RandLandau::shoot(
m_randomEngine));
1101 ATH_MSG_VERBOSE(
" [+] try to record deposited energy (if mapped with a calo sample) " );
1102 const EventContext& ctx = Gaudi::Hive::currentContext();
1104 if (pTrackingGeometry) {
1115 Trk::LayerIndexSampleMap::const_iterator layerIndexCaloSample = lism->find(associatedLayer->
layerIndex());
1117 if (layerIndexCaloSample != lism->end()){
1138 double newP = sqrt((E+simulatedEnergyLoss)*(E+simulatedEnergyLoss)-m*m);
1148 updatedParameters[1],
1149 updatedParameters[2],
1150 updatedParameters[3],
1151 updatedParameters[4],
1158 double E = sqrt(p*p+m*m);
1163 double sigmaMSproj = 13.6/beta/p*sqrt(dInX0)*(1.+0.038*log(dInX0));
1170 double sigmaMSproj)
const
1204 CLHEP::Hep3Vector parsMomHep( pars.momentum().x(), pars.momentum().y(), pars.momentum().z() );
1205 CLHEP::Hep3Vector newDirectionHep( parsMomHep.unit().x(), parsMomHep.unit().y(), parsMomHep.unit().z());
1206 double x = -newDirectionHep.y();
1207 double y = newDirectionHep.x();
1210 if (newDirectionHep.z()*newDirectionHep.z() > 0.999999) {
1215 CLHEP::Hep3Vector deflector(
x,
y,
z);
1217 newDirectionHep.rotate(thetaMs, deflector);
1219 newDirectionHep.rotate(psi, parsMomHep);
1221 parameters[
Trk::phi] = newDirectionHep.phi();
1222 parameters[
Trk::theta] = newDirectionHep.theta();
1260 double E = sqrt(pElectron*pElectron + m*m);
1275 double u = -log(r2*r3)/
a;
1303 double th = particleDir.theta()-
theta;
1304 double ph = particleDir.phi();
1305 if ( th<0.) { th *=-1; ph +=
M_PI; }
1306 CLHEP::Hep3Vector newDirectionHep( sin(th)*cos(ph),sin(th)*sin(ph),cos(th) );
1307 CLHEP::Hep3Vector particleDirHep( particleDir.x(), particleDir.y(), particleDir.z() );
1308 newDirectionHep.rotate(psi,particleDirHep);
1309 Amg::Vector3D newDirection( newDirectionHep.x(), newDirectionHep.y(), newDirectionHep.z() );
1313 particleDir = (particleDir*pElectron- gammaE*newDirection).
unit();
1321 gammaE*newDirection,
1335 if (parent->getUserInformation()) validInfo->
setGeneration(parent->getUserInformation()->generation()+1);
1345 parent->nextGeoID(),
1354 if (!parent->getTruthBinding()) {
1355 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from parent ISFParticle "<< *parent);
1357 for (
auto *childParticle : children) {
1358 if (!childParticle->getTruthBinding()) {
1359 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
1375 ATH_MSG_VERBOSE(
" [ brem ] Filling bremsstrahlung validation TTree ..." );
1416 double E = sqrt(pElectron*pElectron + m*m);
1431 double u = -log(r2*r3)/
a;
1439 CLHEP::Hep3Vector particleDirHep( particleDir.x(), particleDir.y(), particleDir.z() );
1440 CLHEP::Hep3Vector newDirectionHep( particleDirHep );
1441 double x = -newDirectionHep.y();
1442 double y = newDirectionHep.x();
1445 if (newDirectionHep.z()*newDirectionHep.z() > 0.999999)
1448 CLHEP::Hep3Vector deflectorHep(
x,
y,
z);
1450 newDirectionHep.rotate(
theta, deflectorHep);
1452 newDirectionHep.rotate(psi,particleDirHep);
1455 Amg::Vector3D newDirection( newDirectionHep.x(), newDirectionHep.y(), newDirectionHep.z() );
1456 particleDir = (particleDir*pElectron- gammaE*newDirection).
unit();
1462 gammaE*newDirection,
1477 if (parent->getUserInformation()) validInfo->
setGeneration(parent->getUserInformation()->generation()+1);
1487 parent->nextGeoID(),
1496 if (!parent->getTruthBinding()) {
1497 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from parent ISFParticle "<< *parent);
1499 for (
auto *childParticle : children) {
1500 if (!childParticle->getTruthBinding()) {
1501 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
1508 m_validationTool->saveISFVertexInfo(3,vertex,*parent,pElectron*particleDir,nMom,children);
1517 double ci =
m_layer->surfaceRepresentation().normal().dot(particleDir);
1518 double co =
m_layer->surfaceRepresentation().normal().dot(newDirection);
1520 double remMat = ci*co <0 ? (1-matFraction) : matFraction;
1524 double pathCorrection =
m_layer->surfaceRepresentation().normal().dot(bremPhoton->
momentum()) !=0 ?
1527 double mTot =
m_matProp->thicknessInX0()*pathCorrection*(1.-remMat);
1529 if (mTot < pLim.
x0Max) {
1536 auto cparm = std::make_unique<Trk::CurvilinearParameters>(bremPhoton->
position(),bremPhoton->
momentum(),bremPhoton->
charge());
1537 std::unique_ptr<Trk::TrackParameters> uPar =
updateInLay(bremPhoton,cparm.get(),remMat,timeLim, pLim, dir,
Trk::photon);
1538 if (uPar) {
ATH_MSG_VERBOSE(
"Check this: parameters should be dummy here (brem.photon) " <<
","<<uPar->position() ); }
1544 ATH_MSG_VERBOSE(
" [ brem ] Filling bremsstrahlung validation TTree ..." );
1579std::unique_ptr<Trk::TrackParameters>
1598 double p = momentum.mag();
1609 parent->nextGeoID(),
1616 for (
unsigned int i=0; i<childVector.size(); i++) {
1621 if (parent->getUserInformation()) validInfo->
setGeneration(parent->getUserInformation()->generation()+1);
1623 childVector[i]->setUserInformation(validInfo);
1626 childVector[i]->setNextGeoID( parent->nextGeoID() );
1645 double fmin = mass/p;
1681 parent->nextGeoID(),
1690 if (!parent->getTruthBinding()) {
1691 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from parent ISFParticle "<< *parent);
1693 for (
auto *childParticle : children) {
1694 if (!childParticle->getTruthBinding()) {
1695 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
1703 if (parent->getUserInformation()) validInfo1->
setGeneration(parent->getUserInformation()->generation()+1);
1705 children[0]->setUserInformation(validInfo1);
1708 if (parent->getUserInformation()) validInfo2->
setGeneration(parent->getUserInformation()->generation()+1);
1710 children[1]->setUserInformation(validInfo2);
1730 auto parm = std::make_unique<Trk::NeutralCurvilinearParameters>(position,momentum,parent->charge());
1734 if (!cStat)
ATH_MSG_WARNING(
"Conversion failed, killing photon anyway ");
1744 auto parm = std::make_unique<Trk::CurvilinearParameters>(position,momentum,parent->charge());
1746 bool recHad =
m_hadIntProcessor->doHadronicInteraction(time, position, momentum, extMatProp, particle,
true);
1768 if (
process==0 )
return childVector;
1780 double fmin = mass/p;
1816 if (parent->getUserInformation()) validInfo1->
setGeneration(parent->getUserInformation()->generation()+1);
1818 children[0]->setUserInformation(validInfo1);
1821 if (parent->getUserInformation()) validInfo2->
setGeneration(parent->getUserInformation()->generation()+1);
1823 children[1]->setUserInformation(validInfo2);
1830 parent->nextGeoID(),
1846 if (!parent->getTruthBinding()) {
1847 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from parent ISFParticle "<< *parent);
1849 for (
auto *childParticle : children) {
1850 if (!childParticle->getTruthBinding()) {
1851 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
1867 for (
unsigned int i=0; i<childVector.size(); i++) {
1870 if (parent->getUserInformation()) validInfo->
setGeneration(parent->getUserInformation()->generation()+1);
1872 childVector[i]->setUserInformation(validInfo);
1881 for (
auto *childParticle : childVector) {
1882 if (!childParticle->getTruthBinding()) {
1883 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
1893 extMatProp? &extMatProp->
material() :
nullptr, particle) );
1901 for (
unsigned int i=0; i<childVector.size(); i++) {
1904 if (parent->getUserInformation()) validInfo->
setGeneration(parent->getUserInformation()->generation()+1);
1906 childVector[i]->setUserInformation(validInfo);
1914 parent->nextGeoID(),
1930 for (
auto *childParticle : childVector) {
1931 if (!childParticle->getTruthBinding()) {
1932 ATH_MSG_ERROR(
"Could not retrieve TruthBinding from child ISFParticle "<< *childParticle);
1946 "Could not retrieve TrackingGeometry from Conditions Store.");
1949 return handle.
cptr();
1955 ATH_MSG_FATAL(
"Could not retrieve TrackingGeometry from DetectorStore.");
Scalar deltaPhi(const MatrixBase< Derived > &vec) const
Scalar phi() const
phi method
Scalar theta() const
theta method
const PlainObject unit() const
This is a plugin that makes Eigen look like CLHEP & defines some convenience methods.
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_WARNING(x)
double charge(const T &p)
#define AmgSymMatrix(dim)
ATLAS-specific HepMC functions.
constexpr int pow(int base, int exp) noexcept
a link optimized in size for a GenParticle in a McEventCollection
The generic ISF particle definition,.
const TruthBinding * getTruthBinding() const
pointer to the simulation truth - optional, can be 0
double charge() const
charge of the particle
const HepMcParticleLink * getParticleLink() const
HepMcParticleLink accessors.
void setUserInformation(ParticleUserInformation *userInfo)
const ParticleUserInformation * getUserInformation() const
get/set ParticleUserInformation
const Amg::Vector3D & momentum() const
The current momentum vector of the ISFParticle.
double timeStamp() const
Timestamp 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
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...
void updateParentAfterIncidentProperties()
Update the id and particleLink properties of the parentAfterIncident (to be called after registerTrut...
static ParticleClipboard & getInstance()
get the singleton instance
const ISF::ISFParticle * getParticle() const
get the particle from the clipboard
Each ISFParticle carries a pointer to this class.
const MaterialPathInfo * materialLimit() const
void setMaterialLimit(int process, float x0lim, float x0coll)
void setGeneration(int gen)
void setProcess(int proc)
const_pointer_type cptr()
This class describes energy loss material effects in the ATLAS tracking EDM.
double sigmaDeltaE() const
returns the symmatric error
double deltaE() const
returns the
int value() const
layerIndex expressed in an integer
This virtual base class encapsulates the logics to build pre/post/full update material for Layer stru...
virtual const MaterialProperties * fullMaterial(const Amg::Vector3D &gp) const =0
Return method for full material description of the Layer.
Base Class for a Detector Layer in the Tracking realm.
const LayerIndex & layerIndex() const
get the layerIndex
double thicknessInX0() const
returns the actually traversed material .
represents the full description of deflection and e-loss of a track in material.
const EnergyLoss * energyLoss() const
returns the energy loss object.
const ScatteringAngles * scatteringAngles() const
returns the MCS-angles object.
Material with information about thickness of material.
float thicknessInX0() const
Return the radiationlength fraction.
float thicknessInL0() const
Return the nuclear interaction length fraction.
const Material & material() const
Return the stored Material.
float x0() const
Return the radiation length.
A common object to be contained by.
const Amg::Vector3D & momentum() const
Access method for the momentum.
const Amg::Vector3D & position() const
Access method for the position.
double charge() const
Returns the charge.
virtual const Surface & associatedSurface() const override=0
Access to the Surface associated to the Parameters.
std::unique_ptr< ParametersBase< DIM, T > > uniqueClone() const
clone method for polymorphic deep copy returning unique_ptr; it is not overriden, but uses the existi...
Abstract Base Class for tracking surfaces.
const TrkDetElementBase * associatedDetectorElement() const
return associated Detector Element
virtual ChargedTrackParametersUniquePtr createUniqueTrackParameters(double l1, double l2, double phi, double theat, double qop, std::optional< AmgSymMatrix(5)> cov=std::nullopt) const =0
Use the Surface as a ParametersBase constructor, from local parameters - charged.
The TrackingGeometry class is the owner of the constructed TrackingVolumes.
const TrackingVolume * lowestTrackingVolume(const Amg::Vector3D &gp) const
return the lowest tracking Volume
Full Volume description used in Tracking, it inherits from Volume to get the geometrical structure,...
const Layer * associatedLayer(const Amg::Vector3D &gp) const
Return the associated Layer.
const std::string & volumeName() const
Returns the VolumeName - for debug reason, might be depreciated later.
Exception to be thrown when TrackingGeometry not found.
std::string m_validationTreeDescription
validation tree description - second argument in TTree
std::string m_bremValidationTreeDescription
validation tree description
float m_deltaP
nutple variable : energy loss
double m_minimumBremPhotonMomentum
Minimum momentum for brem photons.
std::string m_edValidationTreeName
validation tree name - to be acessed by this from root
ToolHandle< IHadronicInteractionProcessor > m_hadIntProcessor
float m_bremPointZ
ntuple variable : brem point z coordinate
virtual ~McMaterialEffectsUpdator()
Destructor.
void radiate(const ISF::ISFParticle *parent, AmgVector(5) &updatedParameters, const Amg::Vector3D &pos, Amg::Vector3D &dir, Trk::TimeLimit time, double dX0, double &matFraction, double matTot, Trk::PropDirection pdir, Trk::ParticleHypothesis particle) const
ServiceHandle< Trk::ITrackingGeometrySvc > m_trackingGeometrySvc
ToolHandle to the TrackingGeometrySvc.
float m_bremPointY
ntuple variable : brem point y coordinate
float m_thetaMStheta
ntuple variable : ms in theta
McMaterialEffectsUpdator(const std::string &, const std::string &, const IInterface *)
AlgTool constructor for McMaterialEffectsUpdator.
const Trk::Layer * m_layer
cache layer properties
double m_minimumMomentum
Minimum momentum cut.
float m_edLayerIntersectR
ntuple variable : energy deposit r coordinate
float m_edLayerSample
ntuple variable : layer sample
ISF::ISFParticleVector interactLay(const ISF::ISFParticle *isp, double time, const Trk::TrackParameters &parm, Trk::ParticleHypothesis particle, int process, const Trk::MaterialProperties *extMatProp=0) const
bool m_parametricScattering
describe deflection parametric/do real deflection
void recordBremPhotonLay(const ISF::ISFParticle *parent, Trk::TimeLimit time, double pElectron, double gammaE, const Amg::Vector3D &vertex, Amg::Vector3D &particleDir, double matFraction, Trk::PropDirection dir, Trk::ParticleHypothesis particle) const
the helper function for a brem photon record
int m_processCode
MCTruth process code for TruthIncidents created by this tool.
ToolHandle< iFatras::IProcessSamplingTool > m_samplingTool
MCTruth process sampling.
float m_edLayerIntersectY
ntuple variable : energy deposit y coordinate
std::string m_layerIndexCaloSampleMapName
name to record it
const Trk::LayerIndexSampleMap * layerIndexSampleMap() const
return the TrackingGeometry used
const ISF::ISFParticle * m_isp
cache incoming particle
Trk::PdgToParticleHypothesis m_pdgToParticleHypothesis
std::unique_ptr< Trk::TrackParameters > interact(double time, const Amg::Vector3D &position, const Amg::Vector3D &momentum, Trk::ParticleHypothesis particle, int process, const Trk::Material *extMatProp=0) const
float m_bremPhotonEnergy
ntuple variable : brem photon energy
std::string m_bremValidationTreeFolder
stream/folder to for the TTree to be written out
double msSigma(double dInX0, double p, Trk::ParticleHypothesis particle) const
handle the Energy loss
CLHEP::HepRandomEngine * m_randomEngine
Random engine.
bool m_uniformHertzDipoleAngle
use the relativistic hertz dipole for brem photon radiation
void ionize(const Trk::TrackParameters &parm, AmgVector(5) &updatedPar, double dInX0, Trk::PropDirection pdir, Trk::ParticleHypothesis particle) const
StatusCode finalize()
AlgTool finalize method.
float m_deltaPsigma
ntuple variable : stragling on energy loss
bool m_use_msUpdator
switch between MSUpdator and local parametrization
std::string m_edValidationTreeDescription
validation tree description - second argument in TTree
ToolHandle< IParticleDecayHelper > m_particleDecayer
Particle Decay.
bool m_hadInt
hadronic interaction setting
std::string m_validationTreeName
validation tree name - to be acessed by this from root
TTree * m_validationTree
Root Validation Tree.
ToolHandle< IPhysicsValidationTool > m_validationTool
virtual const Trk::TrackingGeometry * trackingGeometry(const EventContext &ctx) const
TTree * m_edValidationTree
Root Validation Tree.
const Trk::LayerIndexSampleMap * m_layerIndexCaloSampleMap
the map for the calo-layer index map
std::string m_edValidationTreeFolder
stream/folder to for the TTree to be written out
float m_edLayerEnergyDeposit
ntuple variable : energy despoit - value
float m_bremPhotonAngle
ntuple variable : brem photon angle
ServiceHandle< ISF::IParticleBroker > m_particleBroker
ToolHandle< Trk::IEnergyLossUpdator > m_eLossUpdator
float m_edLayerIntersectZ
ntuple variable : energy deposit z coordinate
float m_tInX0
nutple variable : t/X0
float m_thetaMSproj
ntuple variable : projected ms
std::unique_ptr< Trk::TrackParameters > updateInLay(const ISF::ISFParticle *isp, const Trk::TrackParameters *parm, double &matFraction, Trk::TimeLimit &time, Trk::PathLimit &path, Trk::PropDirection dir=Trk::alongMomentum, Trk::ParticleHypothesis particle=Trk::pion) const
TTree * m_bremValidationTree
Root Validation Tree.
StatusCode initialize()
AlgTool initailize method.
float m_edLayerIntersectX
ntuple variable : energy deposit x coordinate
std::string m_trackingGeometryName
Name of the TrackingGeometry as given in Detector Store.
double m_oneOverThree
useful for the angle calculation of the brem photon
bool m_ms
IMultipleScatteringUpdator.
float m_thetaMSphi
ntuple variable : ms in phi
std::atomic< unsigned int > m_recordedBremPhotons
for statistics output
float m_bremMotherEnergy
ntuple variable : brem mother energy
std::string m_bremValidationTreeName
validation tree name - to be acessed by this from root
void recordBremPhoton(double time, double pElectron, double gammaE, const Amg::Vector3D &vertex, Amg::Vector3D &particleDir, Trk::ParticleHypothesis particle) const
the helper function for a brem photon record
std::string m_randomEngineName
Name of the random number stream.
bool m_eLoss
IEnergyLossUpdator.
std::unique_ptr< Trk::TrackParameters > update(const Trk::TrackParameters *parm, const Trk::Layer &sf, Trk::TimeLimit &time, Trk::PathLimit &path, Trk::GeometrySignature geoID, Trk::PropDirection dir=Trk::alongMomentum, Trk::ParticleHypothesis particle=Trk::pion) const
Updator interface (full update for a layer): A unique_ptr to Trk::TrackParameters is returned it coul...
int m_currentSample
for the calo energy recording
bool m_bendingCorrection
Switch to use bending correction.
ServiceHandle< ISF::ITruthSvc > m_truthRecordSvc
ServiceHandle< IAtRndmGenSvc > m_rndGenSvc
Random Generator service.
std::string m_validationTreeFolder
stream/folder to for the TTree to be written out
float m_bremPointX
ntuple variable : brem point x coordinate
bool m_referenceMaterial
Switch to use reference material.
double m_projectionFactor
projection factor for the non-parametric scattering
int m_layerIndex
ntuple variable : layer index of material effects update
const Trk::MaterialProperties * m_matProp
SG::ReadCondHandleKey< Trk::TrackingGeometry > m_trackingGeometryReadKey
ToolHandle< iFatras::IPhotonConversionTool > m_conversionTool
IPhotonConversionTool.
bool m_recordEnergyDeposition
for deposition methods
void multipleScatteringUpdate(const Trk::TrackParameters &parm, AmgVector(5) ¶meters, double sigmaMSproj) const
the private multiple Scattering update method, thetaMs is the projected random number
ToolHandle< Trk::IMultipleScatteringUpdator > m_msUpdator
float m_bremPointR
ntuple variable : brem point r distance
const std::string process
Eigen::Matrix< double, 3, 1 > Vector3D
constexpr int UNDEFINED_ID
constexpr int SIM_STATUS_THRESHOLD
Constant definiting the status threshold for simulated particles, eg. can be used to separate generat...
std::vector< ISF::ISFParticle * > ISFParticleVector
ISFParticle vector.
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
PropDirection
PropDirection, enum for direction of the propagation.
ParticleHypothesis
Enumeration for Particle hypothesis respecting the interaction with material.
MaterialUpdateMode
This is a steering enum to force the material update it can be: (1) addNoise (-1) removeNoise Second ...
CurvilinearParametersT< NeutralParametersDim, Neutral, PlaneSurface > NeutralCurvilinearParameters
ParametersBase< TrackParametersDim, Charged > TrackParameters
std::map< Trk::LayerIndex, int > LayerIndexSampleMap
void updateMat(float dX0, float Z, float dL0)
collected material update