ATLAS Offline Software
Loading...
Searching...
No Matches
Trk::EnergyLossUpdator Class Referencefinal

The mean Energy loss per unit length of a particle is calculated as. More...

#include <EnergyLossUpdator.h>

Inheritance diagram for Trk::EnergyLossUpdator:
Collaboration diagram for Trk::EnergyLossUpdator:

Public Member Functions

 EnergyLossUpdator (const std::string &, const std::string &, const IInterface *)
 AlgTool like constructor.
virtual ~EnergyLossUpdator ()=default
 Virtual destructor.
virtual double dEdX (const MaterialProperties &mat, double p, ParticleHypothesis particle=pion) const override final
 dEdX calculation when providing MaterialProperties, a momentum, a pathlength, and a ParicleHypothesis:
virtual EnergyLoss energyLoss (const MaterialProperties &mat, double p, double pathcorrection, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion, bool useMPV=false) const override final
 deltaE calculation using dEdX and integrating along pathlength, assuming constant dEdX during for the path.
virtual EnergyLoss updateEnergyLoss (EnergyLoss &eLoss, double caloEnergy, double caloEnergyError, double pCaloEntry, double momentumError, int &elossFlag) const override final
 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.
virtual void getX0ElossScales (int icalo, double eta, double phi, double &X0Scale, double &ElossScale) const override final
 Routine to calculate X0 and Eloss scale factors for the Calorimeter and Muon System.
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
 DeclareInterfaceID (IEnergyLossUpdator, 1, 0)
 Creates the InterfaceID and interfaceID() method.
virtual void validationAction () const
 Validation Action: Can be implemented optionally, outside access to internal validation steps.

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

double varianceDeltaQoverP (const MaterialProperties &, double p, double pathcorrection, PropDirection direction=alongMomentum, ParticleHypothesis particleHypothesis=electron) const
 Method to return the variance of the change in q/p for the Bethe-Heitler parameterisation.
Trk::EnergyLoss ionizationEnergyLoss (const MaterialProperties &mat, double p, double pathcorrection, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion) const
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

BooleanProperty m_detailedEloss
BooleanProperty m_optimalRadiation
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

The mean Energy loss per unit length of a particle is calculated as.

\( (dE/dx) = (dE/dX)_{io} + (dE/dX)_{rad} \)

Formulas used:

  • For the ionization : Bethe-Bloch for minimum ionizing particles (modified for electrons)

\( (dE/dX)_{io,mip} = K \cdot \frac{Z}{A} \frac{1/\beta^2} \cdot [\frac{1}{2}] \cdot \ln \frac{2 m_e c^2 \beta^2 \gamma^2 T_max}{I^2} - \beta^2] \), (1)

respectively

@f$ (dE/dX)_{io,e}  = \frac{1/2} \cdot K \cdot \frac{Z}{A}
[2\ln\frac{2m_e c^2}{I} + 3 \ln{\gamma} - 1.95] @f$ (2)

Alternatively, the most probable value instead of the mean value can be

taken (steared by boolean in the method signature), taken from (4)

 @f$ \_{L}\Delta_p = \xi \left[ln\frac{2mc^2\beta^2\gamma^2}{I} +

ln\frac{\xi}{I} - 0.8 + 4.447 \right] \( with \) \xi = Z N_a \frac{k}{\beta^2}\codt t \( The with of both distributions is given as the (crude) approximation, that the full width at half maximum of the landau distribution is : \) 4 \xi \( For the transformation into a parameterized sigma the factor \) 2\cdot\sqrt{2.\cdot ln(2.) } \( can be used Sigma can be multiplied by a form factor (given through job options) - <b>For radiation corrections: </b> The Bethe-Heitler parameterisation is in terms of \) Z = \frac{E_f}{E_i} \( (2) With this parameterisation the expected energy loss \) \langle Z \rangle = e^{-t} \( (2) where \) t = \frac{x}{X_0} \( or the fraction of a radiation length of material traversed by the particle. This formula can be transposed in terms of \) \Delta (E) \(. The transposition however depends on the direction of propagation. For forwards propagation we get: \) \langle \Delta (E) \rangle = E_i ( 1 - \langle Z \rangle ) \( (2) For the propagation against momentum we get: \) \langle \Delta (E) \rangle = E_i ( \frac{1}{\langle Z \rangle} - 1 ) \( (2) The variance of Z is also defined (2): \) Var(Z) = e^{-t ln(3) / ln(2)} - e^{-2t} \( Transposing this one dervies the following relations for 1. Forwards propagation \) Var ( \Delta \frac{q}{p} ) = \frac{Var(Z)}{\langle Z \rangle ^2 p^2} \( 2. Backwards propagation \) Var ( \Delta \frac{q}{p} ) = \frac{Var(Z)}{p^2} \( Where p is the global momentum. Bethe-Heitler formula \) (dE/dX)_{rad} = \frac{E_{initial}}{X_o}\cdot (\frac{m}{m_e})^2

Definition at line 113 of file EnergyLossUpdator.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ EnergyLossUpdator()

Trk::EnergyLossUpdator::EnergyLossUpdator ( const std::string & t,
const std::string & n,
const IInterface * p )

AlgTool like constructor.

Definition at line 22 of file EnergyLossUpdator.cxx.

25 : AthAlgTool(t, n, p)
26{
27 declareInterface<Trk::IEnergyLossUpdator>(this);
28}
AthAlgTool()
Default constructor:

◆ ~EnergyLossUpdator()

virtual Trk::EnergyLossUpdator::~EnergyLossUpdator ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ DeclareInterfaceID()

Trk::IEnergyLossUpdator::DeclareInterfaceID ( IEnergyLossUpdator ,
1 ,
0  )
inherited

Creates the InterfaceID and interfaceID() method.

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ dEdX()

double Trk::EnergyLossUpdator::dEdX ( const MaterialProperties & mat,
double p,
ParticleHypothesis particle = pion ) const
finaloverridevirtual

dEdX calculation when providing MaterialProperties, a momentum, a pathlength, and a ParicleHypothesis:

Units: [MeV/mm]

Implements Trk::IEnergyLossUpdator.

Definition at line 32 of file EnergyLossUpdator.cxx.

35{
36 if (particle == Trk::undefined || particle == Trk::nonInteracting) {
37 return 0.;
38 }
39
40 // preparation of kinetic constants
42 double E = std::sqrt(p * p + m * m);
43 double beta = p / E;
44 double gamma = E / m;
45
46 // add ionization and radiation
47 double dEdX =
48 Trk::MaterialInteraction::dEdXBetheBloch(mat, beta, gamma, particle) +
50
51 // add e+e- pair production and photonuclear effect for muons at energies
52 // above 8 GeV
53 if ((particle == Trk::muon) && (E > 8000.)) {
54 if (E < 1.e6) {
55 dEdX += -0.5345 / mat.x0() + 6.803e-5 * E / mat.x0() +
56 2.278e-11 * E * E / mat.x0() -
57 9.899e-18 * E * E * E / mat.x0(); // E below 1 TeV
58 } else {
59 dEdX += -2.986 / mat.x0() + 9.253e-5 * E / mat.x0(); // E above 1 TeV
60 }
61 }
62 return dEdX;
63}
virtual double dEdX(const MaterialProperties &mat, double p, ParticleHypothesis particle=pion) const override final
dEdX calculation when providing MaterialProperties, a momentum, a pathlength, and a ParicleHypothesis...
constexpr double mass[PARTICLEHYPOTHESES]
the array of masses
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
static double dEdXBetheHeitler(const Trk::MaterialProperties &mat, double initialE, Trk::ParticleHypothesis particle)
static double dEdXBetheBloch(const Trk::MaterialProperties &mat, double beta, double gamma, Trk::ParticleHypothesis particle)
dE/dl ionization energy loss per path unit

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ energyLoss()

Trk::EnergyLoss Trk::EnergyLossUpdator::energyLoss ( const MaterialProperties & mat,
double p,
double pathcorrection,
PropDirection dir = alongMomentum,
ParticleHypothesis particle = pion,
bool useMPV = false ) const
finaloverridevirtual

deltaE calculation using dEdX and integrating along pathlength, assuming constant dEdX during for the path.

The sign depends on the given propagation direction

Units: [MeV]

mpv steers the most probable energy loss

Implements Trk::IEnergyLossUpdator.

Definition at line 67 of file EnergyLossUpdator.cxx.

73{
74 if (particle == Trk::undefined) {
76 "undefined ParticleHypothesis, energy loss calculation cancelled");
77 return {};
78 }
79
80 if (useMPV) {
81 return ionizationEnergyLoss(mat, p, pathcorrection, dir, particle);
82 }
83
84 double deltaE = 0.;
85 // preparation
86 double sign = (dir == Trk::oppositeMomentum) ? -1. : 1.;
87
88 double pathLength = pathcorrection * mat.thicknessInX0() * mat.x0();
89
90 double sigIoni = 0.;
91 double sigRad = 0.;
92 double kazL = 0.;
94 p, (mat.material()), particle, sigIoni, kazL);
96 p, (mat.material()), particle, sigRad);
97
98 meanIoni = sign * pathLength * meanIoni;
99 meanRad = sign * pathLength * meanRad;
100 sigIoni = pathLength * sigIoni;
101 sigRad = pathLength * sigRad;
102 kazL = pathLength * kazL;
103
104 //
105 // include pathlength dependence of Landau ionization
106 //
107 sigIoni = sigIoni - kazL * std::log(pathLength);
108
109 deltaE = meanIoni + meanRad;
110
111 double sigmaDeltaE = std::sqrt(sigIoni * sigIoni + sigRad * sigRad);
112 ATH_MSG_DEBUG(" Energy loss updator deltaE "
113 << deltaE << " meanIoni " << meanIoni << " meanRad " << meanRad
114 << " sigIoni " << sigIoni << " sigRad " << sigRad << " sign "
115 << sign << " pathLength " << pathLength);
116 return (!m_detailedEloss ? Trk::EnergyLoss(deltaE, sigmaDeltaE)
117 : Trk::EnergyLoss(deltaE, sigmaDeltaE, sigmaDeltaE,
118 sigmaDeltaE, meanIoni, sigIoni,
119 meanRad, sigRad, pathLength));
120}
#define ATH_MSG_WARNING(x)
#define ATH_MSG_DEBUG(x)
int sign(int a)
Trk::EnergyLoss ionizationEnergyLoss(const MaterialProperties &mat, double p, double pathcorrection, PropDirection dir=alongMomentum, ParticleHypothesis particle=pion) const
BooleanProperty m_detailedEloss
@ oppositeMomentum
static double dEdl_ionization(double p, const Material &mat, ParticleHypothesis particle, double &sigma, double &kazL)
dE/dl ionization energy loss per path unit
static double dEdl_radiation(double p, const Material &mat, ParticleHypothesis particle, double &sigma)
dE/dl radiation energy loss per path unit

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ getX0ElossScales()

void Trk::EnergyLossUpdator::getX0ElossScales ( int icalo,
double eta,
double phi,
double & X0Scale,
double & ElossScale ) const
finaloverridevirtual

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

Implements Trk::IEnergyLossUpdator.

Definition at line 310 of file EnergyLossUpdator.cxx.

315{
316 //
317 // for Calorimeter icalo = 1
318 // Muon System icalo = 0
319 // convention eta, phi is at Calorimeter Exit (or Muon Entry)
320 // eta and phi are from the position (not direction)
321 //
322 // input X0 and ElossScale = 1
323 // output updated X0Scale and ElossScale
324 //
325
326 double X0CaloGirder[4] = {
327 -1.02877e-01, -2.74322e-02, 8.12989e-02, 9.73551e-01
328 };
329
330 // R2012 to R2015 determined on ATLAS-R2-2015-03-01-00 to be used in rel 21
331 constexpr double X0CaloScale[60] = {
332 1.01685, 1.02092, 1.01875, 1.01812, 1.01791, 1.01345, 1.01354,
333 1.02145, 1.01645, 1.01585, 1.0172, 1.02262, 1.01464, 0.990931,
334 0.971953, 0.99845, 1.01433, 0.982143, 0.974015, 0.978742, 0.960029,
335 0.966766, 0.980199, 0.989586, 0.997144, 1.00169, 0.994166, 0.966332,
336 0.93671, 0.935656, 0.921994, 0.901489, 0.897799, 0.89638, 0.905629,
337 0.903374, 0.925922, 0.941203, 0.956273, 0.968618, 0.976883, 0.988349,
338 0.99855, 1.00212, 1.01456, 1.01541, 1.02532, 1.03238, 1.03688,
339 1.03783, 1.02078, 1.01529, 1.0156, 1.02212, 1.02226, 1.02406,
340 1.02188, 1.00661, 1.00661, 1.00661
341 };
342
343 // R2012 to R2015 determined on ATLAS-R2-2015-03-01-00 to be used in rel 21
344 constexpr double ElossCaloScale[30] = {
345 1.06921, 1.06828, 1.06734, 1.06092, 1.06638, 1.06335, 1.07421, 1.05885,
346 1.07351, 1.07435, 1.06902, 1.07704, 1.08782, 1.09844, 1.115, 1.07609,
347 1.08233, 1.08764, 1.08209, 1.08255, 1.08008, 1.07573, 1.077, 1.07271,
348 1.07343, 1.07769, 1.07794, 1.08377, 1.08377, 1.08377
349 };
350
351 //
352 constexpr double X0MuonScale[60] = {
353 -0.0320612, -0.0320612, -0.0320612, -0.0320612, -0.0693796, -0.0389677,
354 -0.0860891, -0.124606, -0.0882329, -0.100014, -0.0790912, -0.0745538,
355 -0.099088, -0.0933711, -0.0618782, -0.0619762, -0.0658361, -0.109704,
356 -0.129547, -0.143364, -0.0774768, -0.0739859, -0.0417835, -0.022119,
357 0.00308797, 0.0197657, -0.0137871, -0.036848, -0.0643794, -0.0514949,
358 -0.0317105, 0.016539, 0.0308435, -0.00056883, -0.00756813, -0.00760612,
359 -0.0234571, -0.0980915, -0.101175, -0.102354, -0.0920337, -0.100337,
360 -0.0887628, 0.0660931, 0.228999, 0.260675, 0.266301, 0.267907,
361 0.281668, 0.194433, 0.132954, 0.20707, 0.220466, 0.20936,
362 0.191441, 0.191441, 0.191441, 0.191441, 0.191441, 0.191441
363 };
364
365 int i60 = std::abs(eta) * 20.;
366
367 if (i60 < 0) {
368 i60 = 0;
369 }
370 if (i60 > 59) {
371 i60 = 59;
372 }
373
374 if (icalo == 1) {
375 //
376 // Girder parametrization
377 //
378 double x =
379 phi + 3.1416 - 3.1416 / 32. * int((3.1416 + phi) / (3.1416 / 32.));
380 double scale = 0.;
381 if (x > M_PI / 64.) {
382 x = M_PI / 32. - x;
383 }
384
385 if (x < 0.005) {
386 scale =
387 X0CaloGirder[0] * (1 - x / 0.005) + X0CaloGirder[1] + X0CaloGirder[3];
388 } else if (x < 0.017) {
389 scale = X0CaloGirder[1] + X0CaloGirder[3];
390 } else if (x < 0.028) {
391 scale = X0CaloGirder[2] + X0CaloGirder[3];
392 } else {
393 scale = X0CaloGirder[3];
394 }
395
396 if (std::abs(eta) > 1.3) {
397 scale = 1.;
398 }
399 //
400 // eta dependence of X0
401 //
402 scale *= X0CaloScale[i60];
403 X0Scale = scale;
404 //
405 // eta dependence of Eloss
406 //
407 int i30 = std::abs(eta) * 10.;
408 if (i30 < 0) {
409 i30 = 0;
410 }
411 if (i30 > 29) {
412 i30 = 29;
413 }
414
415 double nfactor = 0.987363 / 1.05471;
416
417 ElossScale = nfactor * ElossCaloScale[i30] * scale;
418 } else {
419 //
420 // Muon system
421 //
422 // eta dependence of X0
423 //
424 double scale = 1. + X0MuonScale[i60];
425 //
426 // Muon scale is now 1 with MuonTrackingGeometry and TrkDetDescrGeoModelCnv
427 // fixes
428 //
429 scale = 1.0;
430 X0Scale = scale;
431 ElossScale = 0.93 * scale;
432 }
433}
#define M_PI
Scalar eta() const
pseudorapidity method
@ x
Definition ParamDefs.h:55
@ phi
Definition ParamDefs.h:75

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ ionizationEnergyLoss()

Trk::EnergyLoss Trk::EnergyLossUpdator::ionizationEnergyLoss ( const MaterialProperties & mat,
double p,
double pathcorrection,
PropDirection dir = alongMomentum,
ParticleHypothesis particle = pion ) const
private

Definition at line 436 of file EnergyLossUpdator.cxx.

441{
442 // preparation
443 double sign = (dir == Trk::oppositeMomentum) ? -1. : 1.;
444 double pathLength = pathcorrection * mat.thicknessInX0() * mat.x0();
445
446 double sigIoni = 0.;
447 double kazL = 0.;
448
449 double meanIoni =
451 p, (mat.material()), particle, sigIoni, kazL, pathLength);
452
453 return (!m_detailedEloss
454 ? Trk::EnergyLoss(meanIoni, sigIoni)
455 : Trk::EnergyLoss(meanIoni,
456 sigIoni,
457 sigIoni,
458 sigIoni,
459 meanIoni,
460 sigIoni,
461 0.,
462 0.,
463 pathLength));
464}
static double dE_MPV_ionization(double p, const Trk::Material &mat, Trk::ParticleHypothesis particle, double &sigma, double &kazL, double path)
Most Propable dE ionization energly loss.

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateEnergyLoss()

Trk::EnergyLoss Trk::EnergyLossUpdator::updateEnergyLoss ( Trk::EnergyLoss & eLoss,
double caloEnergy,
double caloEnergyError,
double pCaloEntry,
double momentumError,
int & elossFlag ) const
finaloverridevirtual

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.

Implements Trk::IEnergyLossUpdator.

Definition at line 125 of file EnergyLossUpdator.cxx.

131{
132 //
133 // Input: the detailed EnergyLoss object in the Calorimeter that contains the
134 // different Eloss terms and their uncertainties; caloEnergy and error; and
135 // the muon momentumError (all in MeV)
136 //
137 // For use in the MuonSystem
138 // Input: caloEnergy = 0. caloEnergyError = 0. and pCaloEntry = pMuonEntry
139 // momentum at MuonEntry
140 //
141 // Output: an updated Energy loss values deltaE()
142 // that can be used in the track fit and corresponds to the Most
143 // Probable EnergyLoss value taking into account the ionization,
144 // radiation and smearing due to the errors including the
145 // momentumError (in MeV)
146 //
147 // elossFlag = false if Calorimeter Energy is NOT stored (and later
148 // fitted) on the Eloss object
149 // = true Calorimeter Energy is stored and will be fitted
150 //
151 // deltaE is used in the final fit
152 //
153
154 elossFlag = 0;
155
156 int isign = 1;
157 if (eLoss.deltaE() < 0) {
158 isign = -1;
159 }
160
161 double deltaE = eLoss.deltaE();
162 double sigmaDeltaE = eLoss.sigmaDeltaE();
163 // Detailed Eloss
164 double deltaE_ioni = eLoss.meanIoni();
165 double sigmaDeltaE_ioni = 0.45 * eLoss.sigmaIoni(); // sigma Landau
166 double deltaE_rad = eLoss.meanRad();
167 double sigmaDeltaE_rad =
168 eLoss.sigmaRad(); // rms and mean of steep exponential
169 double depth = eLoss.length();
170
171 // Eloss radiative protection
172
173 if (eLoss.meanRad() > 100000.) {
174 deltaE_rad = 100000.;
175 sigmaDeltaE_rad = eLoss.sigmaRad() * 100000. / eLoss.meanRad();
176 }
177
178 double sigmaPlusDeltaE = eLoss.sigmaPlusDeltaE();
179 double sigmaMinusDeltaE = eLoss.sigmaMinusDeltaE();
180
181 double MOP = deltaE_ioni - isign * 3.59524 * sigmaDeltaE_ioni;
182
183 //
184 // MOP shift due to ionization and radiation
185 //
186 double MOPshift =
187 isign * 50 * 10000. / pCaloEntry +
188 isign * 0.75 * std::sqrt(sigmaDeltaE_ioni * sigmaDeltaE_rad);
189 double MOPshiftNoRad = isign * 50 * 10000. / pCaloEntry;
190 //
191 // define sigmas for Landau convoluted with exponential
192 //
193 double fracErad = sigmaDeltaE_rad +
194 std::abs(deltaE_rad) * pCaloEntry / (800000. + pCaloEntry);
195 double sigmaL = sigmaDeltaE_ioni + 0.8 * fracErad / 3.59524;
196 // double sigmaLNoRad = sigmaDeltaE_ioni;
197 double sigmaMinus = 1.02 * sigmaDeltaE_ioni + 0.08 * sigmaDeltaE_rad;
198 double sigmaPlus = 4.65 * sigmaDeltaE_ioni + 1.16 * sigmaDeltaE_rad;
199 // double sigmaMinusNoRad = 1.02 * sigmaDeltaE_ioni;
200 // double sigmaPlusNoRad = 4.65 * sigmaDeltaE_ioni;
201 double xc = momentumError / (sigmaL > 0. ? sigmaL : 1.);
202 double correction =
203 (0.3849 * xc * xc + 7.76672e-03 * xc * xc * xc) /
204 (1 + 2.8631 * xc + 0.3849 * xc * xc + 7.76672e-03 * xc * xc * xc);
205
206 //
207 // Case where the measured Calorimeter energy is not available (e.g. low pT or
208 // not isolated)
209 //
210
211 if (caloEnergyError <= 0) {
212 //
213 // Shift of MOP due to momentum resolution
214 //
215 double MOPreso = isign * 3.59524 * sigmaL * correction;
216
217 deltaE = MOP + MOPshift + MOPreso;
218 sigmaMinusDeltaE = sigmaMinus;
219 sigmaPlusDeltaE = sigmaPlus;
220 sigmaDeltaE = std::sqrt(0.5 * sigmaMinusDeltaE * sigmaMinusDeltaE +
221 0.5 * sigmaPlusDeltaE * sigmaPlusDeltaE);
222 //
223 if (m_optimalRadiation && std::abs(deltaE) < caloEnergy &&
224 pCaloEntry > 100000) {
225 //
226 // Calorimeter measurement can be used as veto to say there was no
227 // significant radiation
228 //
229 // In that case the Eloss is taken as the ionization Eloss
230 // Use MOP after correction for landau tail (MOPshiftNoRad) and momentum
231 // resolution smearing (MOPreso)
232 //
233 sigmaL = sigmaDeltaE_ioni + 0.3 * fracErad / 3.59524;
234 xc = momentumError / (sigmaL > 0. ? sigmaL : 1.);
235 correction =
236 (0.3849 * xc * xc + 7.76672e-03 * xc * xc * xc) /
237 (1 + 2.8631 * xc + 0.3849 * xc * xc + 7.76672e-03 * xc * xc * xc);
238
239 MOPreso = isign * 3.59524 * sigmaL * correction;
240 deltaE = MOP + MOPshift + MOPreso;
241 sigmaMinusDeltaE = sigmaMinus;
242 sigmaPlusDeltaE = sigmaPlus;
243 sigmaDeltaE = std::sqrt(0.5 * sigmaMinusDeltaE * sigmaMinusDeltaE +
244 0.5 * sigmaPlusDeltaE * sigmaPlusDeltaE);
245 }
246 } else {
247 double sigmaPlusTot =
248 std::sqrt(sigmaPlus * sigmaPlus + caloEnergyError * caloEnergyError);
249 if (m_optimalRadiation) {
250 sigmaPlusTot =
251 std::sqrt(4.65 * sigmaDeltaE_ioni * 4.65 * sigmaDeltaE_ioni +
252 caloEnergyError * caloEnergyError);
253 }
254 double MOPtot = std::abs(MOP + MOPshift);
255 if (m_optimalRadiation) {
256 MOPtot = std::abs(MOP + MOPshiftNoRad);
257 }
258
259 if (caloEnergy > MOPtot + 2 * sigmaPlusTot) {
260 //
261 // Use measured Calorimeter energy
262 //
263 //
264 // take into account the tail in the Measured Eloss
265 //
266 double MOPreso = isign * 3.59524 * sigmaL * correction;
267 deltaE = isign * caloEnergy + MOPreso;
268 sigmaMinusDeltaE = caloEnergyError + 0.08 * sigmaDeltaE_rad;
269 sigmaPlusDeltaE = caloEnergyError + 1.16 * sigmaDeltaE_rad;
270 sigmaDeltaE = std::sqrt(0.5 * sigmaMinusDeltaE * sigmaMinusDeltaE +
271 0.5 * sigmaPlusDeltaE * sigmaPlusDeltaE);
272 elossFlag = 1;
273 } else {
274 // Use MOP after corrections
275
276 //
277 // Shift of MOP due to momentum resolution smearing
278 //
279 sigmaL = sigmaDeltaE_ioni + 0.3 * fracErad / 3.59524;
280 xc = momentumError / (sigmaL > 0. ? sigmaL : 1);
281 correction =
282 (0.3849 * xc * xc + 7.76672e-03 * xc * xc * xc) /
283 (1 + 2.8631 * xc + 0.3849 * xc * xc + 7.76672e-03 * xc * xc * xc);
284 double MOPreso = isign * 3.59524 * sigmaL * correction;
285 //
286 // Use MOP after correction for landau tail (MOPshiftNoRad) and radiation
287 // (MOPshift) and momentum resolution smearing (MOPreso)
288 //
289 deltaE = MOP + MOPshift + MOPreso;
290 sigmaMinusDeltaE = sigmaMinus;
291 sigmaPlusDeltaE = sigmaPlus;
292 sigmaDeltaE = std::sqrt(0.5 * sigmaMinusDeltaE * sigmaMinusDeltaE +
293 0.5 * sigmaPlusDeltaE * sigmaPlusDeltaE);
294 }
295 }
296
297 return {deltaE,
298 sigmaDeltaE,
299 sigmaMinusDeltaE,
300 sigmaPlusDeltaE,
301 deltaE_ioni,
302 sigmaDeltaE_ioni,
303 deltaE_rad,
304 sigmaDeltaE_rad,
305 depth};
306}
BooleanProperty m_optimalRadiation
double meanRad() const
double length() const
double sigmaPlusDeltaE() const
returns the positive side
double sigmaMinusDeltaE() const
returns the negative side
double sigmaIoni() const
double meanIoni() const
double sigmaDeltaE() const
returns the symmatric error
double sigmaRad() const
double deltaE() const
returns the
std::string depth
tag string for intendation
Definition fastadd.cxx:46
correction(mu, runmode, campaign, run=None)
Definition zlumi_mc_cf.py:4

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ validationAction()

virtual void Trk::IEnergyLossUpdator::validationAction ( ) const
inlinevirtualinherited

Validation Action: Can be implemented optionally, outside access to internal validation steps.

Definition at line 91 of file IEnergyLossUpdator.h.

91{}

◆ varianceDeltaQoverP()

double Trk::EnergyLossUpdator::varianceDeltaQoverP ( const MaterialProperties & ,
double p,
double pathcorrection,
PropDirection direction = alongMomentum,
ParticleHypothesis particleHypothesis = electron ) const
private

Method to return the variance of the change in q/p for the Bethe-Heitler parameterisation.

Member Data Documentation

◆ m_detailedEloss

BooleanProperty Trk::EnergyLossUpdator::m_detailedEloss
private
Initial value:
{this, "DetailedEloss", true,
"provide extended EnergyLoss info"}

Definition at line 187 of file EnergyLossUpdator.h.

187 {this, "DetailedEloss", true,
188 "provide extended EnergyLoss info"};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_optimalRadiation

BooleanProperty Trk::EnergyLossUpdator::m_optimalRadiation
private
Initial value:
{this, "OptimalRadiation", true,
"use calorimeter more optimal for radiation detection"}

Definition at line 189 of file EnergyLossUpdator.h.

189 {this, "OptimalRadiation", true,
190 "use calorimeter more optimal for radiation detection"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: