00001 #include "TrackingTools/MaterialEffects/interface/EnergyLossUpdator.h"
00002 #include "DataFormats/GeometrySurface/interface/MediumProperties.h"
00003
00004
00005
00006
00007
00008
00009 void EnergyLossUpdator::compute (const TrajectoryStateOnSurface& TSoS,
00010 const PropagationDirection propDir) const
00011 {
00012
00013
00014
00015 const Surface& surface = TSoS.surface();
00016
00017
00018
00019 theDeltaP = 0.;
00020 theDeltaCov(0,0) = 0.;
00021
00022
00023
00024 if (surface.mediumProperties()) {
00025
00026
00027
00028 if ( mass()>0.001 )
00029 computeBetheBloch(TSoS.localMomentum(),*surface.mediumProperties());
00030
00031
00032
00033
00034 else
00035 computeElectrons(TSoS.localMomentum(),*surface.mediumProperties(),
00036 propDir);
00037 if (propDir != alongMomentum) theDeltaP *= -1.;
00038 }
00039
00040
00041
00042 storeArguments(TSoS,propDir);
00043 }
00044
00045
00046
00047 void
00048 EnergyLossUpdator::computeBetheBloch (const LocalVector& localP,
00049 const MediumProperties& materialConstants) const {
00050
00051
00052
00053
00054 double p = localP.mag();
00055 double xf = fabs(p/localP.z());
00056
00057 const double m = mass();
00058 const double emass = 0.511e-3;
00059 const double poti = 16.e-9 * 10.75;
00060 const double eplasma = 28.816e-9 * sqrt(2.33*0.498);
00061 const double delta0 = 2*log(eplasma/poti) - 1.;
00062
00063 double e = sqrt(p*p + m*m);
00064 double beta = p/e;
00065 double gamma = e/m;
00066 double eta2 = beta*gamma; eta2 *= eta2;
00067 double lnEta2 = log(eta2);
00068 double ratio = emass/m;
00069 double emax = 2.*emass*eta2/(1. + 2.*ratio*gamma + ratio*ratio);
00070 double delta = delta0 + lnEta2;
00071
00072
00073 double xi = materialConstants.xi()*xf; xi /= (beta*beta);
00074
00075 double dEdx = xi*(log(2.*emass*emax/(poti*poti))+lnEta2 - 2.*(beta*beta) - delta);
00076 double dEdx2 = xi*emax*(1.-beta*beta/2.);
00077 double dP = dEdx/beta;
00078 double sigp2 = dEdx2*e*e/(p*p*p*p*p*p);
00079 theDeltaP += -dP;
00080 theDeltaCov(0,0) += sigp2;
00081 }
00082
00083
00084
00085 void
00086 EnergyLossUpdator::computeElectrons (const LocalVector& localP,
00087 const MediumProperties& materialConstants,
00088 const PropagationDirection propDir) const {
00089
00090
00091
00092
00093 double p = localP.mag();
00094 double normalisedPath = fabs(p/localP.z())*materialConstants.radLen();
00095
00096
00097
00098
00099 double z = exp(-normalisedPath);
00100 double varz = (exp(-normalisedPath*log(3.)/log(2.))-
00101 exp(-2*normalisedPath));
00102
00103 if ( propDir==oppositeToMomentum ) {
00104
00105
00106
00107
00108
00109 theDeltaP += -p*(1/z-1);
00110 theDeltaCov(0,0) += varz/p/p;
00111 }
00112 else {
00113
00114
00115
00116
00117 theDeltaP += p*(z-1);
00118
00119
00120 double f = 1./p/z;
00121 theDeltaCov(0,0) += f*f*varz;
00122 }
00123 }
00124
00125
00126
00127 bool EnergyLossUpdator::newArguments (const TrajectoryStateOnSurface& TSoS,
00128 const PropagationDirection propDir) const {
00129 LocalVector localP = TSoS.localMomentum();
00130 return
00131 localP.mag() != theLastP ||
00132
00133 localP.z() != theLastDz*theLastP ||
00134 propDir!=theLastPropDir ||
00135 TSoS.surface().mediumProperties()->radLen()!=theLastRl ||
00136 TSoS.surface().mediumProperties()->xi()!=theLastXi;
00137 }
00138
00139
00140
00141 void EnergyLossUpdator::storeArguments (const TrajectoryStateOnSurface& TSoS,
00142 const PropagationDirection propDir) const {
00143 LocalVector localP = TSoS.localMomentum();
00144 theLastP = localP.mag();
00145 theLastDz = (theLastP == 0 ? 0 : localP.z()/theLastP);
00146 theLastPropDir = propDir;
00147 theLastRl = TSoS.surface().mediumProperties()->radLen();
00148 theLastXi = TSoS.surface().mediumProperties()->xi();
00149 }
00150