ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
iFatras::McEnergyLossUpdator Class Reference

#include <McEnergyLossUpdator.h>

Inheritance diagram for iFatras::McEnergyLossUpdator:
Collaboration diagram for iFatras::McEnergyLossUpdator:

Public Member Functions

 McEnergyLossUpdator (const std::string &, const std::string &, const IInterface *)
 Constructor with AlgTool parameters. More...
 
virtual ~McEnergyLossUpdator ()=default
 Destructor. More...
 
virtual StatusCode initialize () override
 AlgTool initialise method. More...
 
virtual double dEdX (const Trk::MaterialProperties &materialProperties, double momentum, Trk::ParticleHypothesis particleHypothesis=Trk::pion) const override
 IEnergyLossUpdator public method to compute dEdX. More...
 
virtual Trk::EnergyLoss energyLoss (const Trk::MaterialProperties &materialProperties, double momentum, double pathCorrection, Trk::PropDirection direction=Trk::alongMomentum, Trk::ParticleHypothesis particleHypothesis=Trk::pion, bool usePDGformula=false) const override
 IEnergyLossUpdator public method to compute the mean and variance of the energy loss. More...
 
virtual Trk::EnergyLoss updateEnergyLoss (Trk::EnergyLoss &, double, double, double, double, int &) const override
 Dummy methodes imposed by public interface - cleanup. More...
 
virtual void getX0ElossScales (int, double, double, double &, double &) const override
 Routine to calculate X0 and Eloss scale factors for the Calorimeter and Muon System. More...
 

Private Attributes

PublicToolHandle< IEnergyLossUpdator > m_energyLossUpdator {this, "EnergyLossUpdator", "Trk::EnergyLossUpdator/AtlasEnergyLossUpdator"}
 Dummy methods end here. More...
 
IntegerProperty m_energyLossDistribution {this, "EnergyLossDistribution", 3}
 include energy loss straggling or not ( 0 == none, 1 == gauss, 2 == landau) More...
 
ServiceHandle< IAtRndmGenSvcm_rndGenSvc {this, "RandomNumberService", "AtDSFMTGenSvc"}
 Random Generator service - not thread-safe. More...
 
CLHEP::HepRandomEngine * m_randomEngine {}
 Random engine
More...
 
StringProperty m_randomEngineName {this, "RandomStreamName", "FatrasRnd"}
 Name of the random number stream. More...
 
BooleanProperty m_usePDGformula {this, "UsePDG_EnergyLossFormula", false}
 

Detailed Description

Updator for a eloss of a track on a Trk::Layer, it extends the IEnergyLossUpdtor interface

Author
Tom.A.nosp@m.tkin.nosp@m.son@c.nosp@m.ern..nosp@m.ch, Andre.nosp@m.as.S.nosp@m.alzbu.nosp@m.rger.nosp@m.@cern.nosp@m..ch

Definition at line 35 of file McEnergyLossUpdator.h.

Constructor & Destructor Documentation

◆ McEnergyLossUpdator()

iFatras::McEnergyLossUpdator::McEnergyLossUpdator ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Constructor with AlgTool parameters.

Definition at line 18 of file McEnergyLossUpdator.cxx.

19  :
20  base_class( type, name, parent )
21 {
22 }

◆ ~McEnergyLossUpdator()

virtual iFatras::McEnergyLossUpdator::~McEnergyLossUpdator ( )
virtualdefault

Destructor.

Member Function Documentation

◆ dEdX()

double iFatras::McEnergyLossUpdator::dEdX ( const Trk::MaterialProperties materialProperties,
double  momentum,
Trk::ParticleHypothesis  particleHypothesis = Trk::pion 
) const
overridevirtual

IEnergyLossUpdator public method to compute dEdX.

Definition at line 46 of file McEnergyLossUpdator.cxx.

49 {
50  // simply forward the dEdX from the standard energy loss updator
51  return m_energyLossUpdator->dEdX( materialProperties, momentum, particleHypothesis );
52 }

◆ energyLoss()

Trk::EnergyLoss iFatras::McEnergyLossUpdator::energyLoss ( const Trk::MaterialProperties materialProperties,
double  momentum,
double  pathCorrection,
Trk::PropDirection  direction = Trk::alongMomentum,
Trk::ParticleHypothesis  particleHypothesis = Trk::pion,
bool  usePDGformula = false 
) const
overridevirtual

IEnergyLossUpdator public method to compute the mean and variance of the energy loss.

Definition at line 55 of file McEnergyLossUpdator.cxx.

62 {
63 
64 
65  // get the number of the material effects distribution
66  Trk::EnergyLoss sampledEloss =
67  m_energyLossUpdator->energyLoss(materialProperties,
68  momentum,
69  pathCorrection,
70  direction,
71  particleHypothesis,
73 
74 
75  // smear according to preselected distribution
76  switch (m_energyLossDistribution) {
77  // no straggling
78  case 0 : { } break;
79  // gaussian smearing
80  case 1 : {
81  float deIoni = sampledEloss.sigmaIoni() * CLHEP::RandGaussZiggurat::shoot(m_randomEngine);
82  float deRad = sampledEloss.sigmaRad() * CLHEP::RandGaussZiggurat::shoot(m_randomEngine);
83  sampledEloss.update(deIoni,0.,deRad,0.,false);
84  } break;
85  case 2 : {
86  float deIoni = -sampledEloss.sigmaIoni() * CLHEP::RandLandau::shoot(m_randomEngine); // TODO :check sign
87  sampledEloss.update(deIoni,0.,0.,0.,false);
88  } break;
89  // landau smearing
90  default : {
91  float deIoni = -sampledEloss.sigmaIoni() * CLHEP::RandLandau::shoot(m_randomEngine); // TODO :check sign
92  float deRad = -sampledEloss.sigmaRad() * CLHEP::RandLandau::shoot(m_randomEngine); // TODO :check sign
93  sampledEloss.update(deIoni,0.,deRad,0.,false);
94  } break;
95  }
96 
97  // protection due to straggling - maximum energy loss is E-m
98  double m = Trk::ParticleMasses::mass[particleHypothesis];
99  double E = sqrt(momentum*momentum+m*m);
100 
101  if (sampledEloss.deltaE()+E<m ) { // particle stopping - rest energy
102  float dRad_rest = m-E-sampledEloss.deltaE();
103  sampledEloss.update(0.,0.,dRad_rest,0.,false);
104  }
105 
106  return sampledEloss;
107 }

◆ getX0ElossScales()

virtual void iFatras::McEnergyLossUpdator::getX0ElossScales ( int  ,
double  ,
double  ,
double &  ,
double &   
) const
inlineoverridevirtual

Routine to calculate X0 and Eloss scale factors for the Calorimeter and Muon System.

Definition at line 71 of file McEnergyLossUpdator.h.

71 {}

◆ initialize()

StatusCode iFatras::McEnergyLossUpdator::initialize ( )
overridevirtual

AlgTool initialise method.

Definition at line 25 of file McEnergyLossUpdator.cxx.

26 {
27  ATH_MSG_VERBOSE( "initialize()" );
28 
29  // Retrieve the energy loss updator tool
30  ATH_CHECK ( m_energyLossUpdator.retrieve() );
31 
32  // get the random generator serice
33  ATH_CHECK ( m_rndGenSvc.retrieve() );
34 
35  //Get own engine with own seeds:
37  if (!m_randomEngine) {
38  ATH_MSG_FATAL( "Could not get random engine '" << m_randomEngineName << "'" );
39  return StatusCode::FAILURE;
40  }
41 
42  return StatusCode::SUCCESS;
43 }

◆ updateEnergyLoss()

virtual Trk::EnergyLoss iFatras::McEnergyLossUpdator::updateEnergyLoss ( Trk::EnergyLoss ,
double  ,
double  ,
double  ,
double  ,
int &   
) const
inlineoverridevirtual

Dummy methodes imposed by public interface - cleanup.

Method to recalculate Eloss values for the fit setting an elossFlag using as an input the detailed Eloss information Calorimeter energy, error momentum and momentum error

Definition at line 67 of file McEnergyLossUpdator.h.

67 { return {}; }

Member Data Documentation

◆ m_energyLossDistribution

IntegerProperty iFatras::McEnergyLossUpdator::m_energyLossDistribution {this, "EnergyLossDistribution", 3}
private

include energy loss straggling or not ( 0 == none, 1 == gauss, 2 == landau)

Definition at line 77 of file McEnergyLossUpdator.h.

◆ m_energyLossUpdator

PublicToolHandle<IEnergyLossUpdator> iFatras::McEnergyLossUpdator::m_energyLossUpdator {this, "EnergyLossUpdator", "Trk::EnergyLossUpdator/AtlasEnergyLossUpdator"}
private

Dummy methods end here.

ToolHandle to the energy loss updator

Definition at line 76 of file McEnergyLossUpdator.h.

◆ m_randomEngine

CLHEP::HepRandomEngine* iFatras::McEnergyLossUpdator::m_randomEngine {}
private

Random engine

Definition at line 82 of file McEnergyLossUpdator.h.

◆ m_randomEngineName

StringProperty iFatras::McEnergyLossUpdator::m_randomEngineName {this, "RandomStreamName", "FatrasRnd"}
private

Name of the random number stream.

Definition at line 83 of file McEnergyLossUpdator.h.

◆ m_rndGenSvc

ServiceHandle<IAtRndmGenSvc> iFatras::McEnergyLossUpdator::m_rndGenSvc {this, "RandomNumberService", "AtDSFMTGenSvc"}
private

Random Generator service - not thread-safe.

Definition at line 80 of file McEnergyLossUpdator.h.

◆ m_usePDGformula

BooleanProperty iFatras::McEnergyLossUpdator::m_usePDGformula {this, "UsePDG_EnergyLossFormula", false}
private

Definition at line 84 of file McEnergyLossUpdator.h.


The documentation for this class was generated from the following files:
Trk::EnergyLoss::update
void update(double ioni, double sigi, double rad, double sigr, bool mpv=false)
iFatras::McEnergyLossUpdator::m_energyLossDistribution
IntegerProperty m_energyLossDistribution
include energy loss straggling or not ( 0 == none, 1 == gauss, 2 == landau)
Definition: McEnergyLossUpdator.h:77
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
Trk::EnergyLoss::sigmaRad
double sigmaRad() const
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
iFatras::McEnergyLossUpdator::m_rndGenSvc
ServiceHandle< IAtRndmGenSvc > m_rndGenSvc
Random Generator service - not thread-safe.
Definition: McEnergyLossUpdator.h:80
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
Trk::EnergyLoss::deltaE
double deltaE() const
returns the
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
iFatras::McEnergyLossUpdator::m_usePDGformula
BooleanProperty m_usePDGformula
Definition: McEnergyLossUpdator.h:84
Trk::ParticleMasses::mass
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
VP1PartSpect::E
@ E
Definition: VP1PartSpectFlags.h:21
Trk::EnergyLoss
This class describes energy loss material effects in the ATLAS tracking EDM.
Definition: EnergyLoss.h:34
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
iFatras::McEnergyLossUpdator::m_randomEngine
CLHEP::HepRandomEngine * m_randomEngine
Random engine
Definition: McEnergyLossUpdator.h:82
iFatras::McEnergyLossUpdator::m_energyLossUpdator
PublicToolHandle< IEnergyLossUpdator > m_energyLossUpdator
Dummy methods end here.
Definition: McEnergyLossUpdator.h:76
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
iFatras::McEnergyLossUpdator::m_randomEngineName
StringProperty m_randomEngineName
Name of the random number stream.
Definition: McEnergyLossUpdator.h:83
Trk::EnergyLoss::sigmaIoni
double sigmaIoni() const