CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_8_patch3/src/TrackingTools/MaterialEffects/src/EnergyLossUpdator.cc

Go to the documentation of this file.
00001 #include "TrackingTools/MaterialEffects/interface/EnergyLossUpdator.h"
00002 #include "DataFormats/GeometrySurface/interface/MediumProperties.h"
00003 
00004 //
00005 // Computation of contribution of energy loss to momentum and covariance
00006 // matrix of local parameters based on Bethe-Bloch. For electrons 
00007 // contribution of radiation acc. to Bethe & Heitler.
00008 //
00009 void EnergyLossUpdator::compute (const TrajectoryStateOnSurface& TSoS, 
00010                                  const PropagationDirection propDir) const
00011 {
00012   //
00013   // Get surface
00014   //
00015   const Surface& surface = TSoS.surface();
00016   //
00017   // Initialise dP and the update to the covariance matrix
00018   //
00019   theDeltaP = 0.;
00020   theDeltaCov(0,0) = 0.;
00021   //
00022   // Now get information on medium
00023   //
00024   if (surface.mediumProperties()) {
00025     //
00026     // Bethe-Bloch
00027     //
00028     if ( mass()>0.001 )
00029       computeBetheBloch(TSoS.localMomentum(),*surface.mediumProperties());
00030     //
00031     // Special treatment for electrons (currently rather crude
00032     // distinction using mass)
00033     //
00034     else
00035       computeElectrons(TSoS.localMomentum(),*surface.mediumProperties(),
00036                        propDir);
00037     if (propDir != alongMomentum) theDeltaP *= -1.;
00038   }
00039 }
00040 //
00041 // Computation of energy loss according to Bethe-Bloch
00042 //
00043 void
00044 EnergyLossUpdator::computeBetheBloch (const LocalVector& localP,
00045                                       const MediumProperties& materialConstants) const {
00046   //
00047   // calculate absolute momentum and correction to path length from angle 
00048   // of incidence
00049   //
00050   double p = localP.mag();
00051   double xf = fabs(p/localP.z());
00052   // constants
00053   const double m = mass();            // use mass hypothesis from constructor
00054 
00055   const double emass = 0.511e-3;
00056   const double poti = 16.e-9 * 10.75; // = 16 eV * Z**0.9, for Si Z=14
00057   const double eplasma = 28.816e-9 * sqrt(2.33*0.498); // 28.816 eV * sqrt(rho*(Z/A)) for Si
00058   const double delta0 = 2*log(eplasma/poti) - 1.;
00059 
00060   // calculate general physics things
00061   double e     = sqrt(p*p + m*m);
00062   double beta  = p/e;
00063   double gamma = e/m;
00064   double eta2  = beta*gamma; eta2 *= eta2;
00065   //  double lnEta2 = log(eta2);
00066   double ratio = emass/m;
00067   double emax  = 2.*emass*eta2/(1. + 2.*ratio*gamma + ratio*ratio);
00068   // double delta = delta0 + lnEta2;
00069 
00070   // calculate the mean and sigma of energy loss
00071   // xi = d[g/cm2] * 0.307075MeV/(g/cm2) * Z/A * 1/2
00072   double xi = materialConstants.xi()*xf; xi /= (beta*beta);
00073 
00074 //   double dEdx = xi*(log(2.*emass*eta2*emax/(poti*poti)) - 2.*(beta*beta));
00075   //double dEdx = xi*(log(2.*emass*emax/(poti*poti))+lnEta2 - 2.*(beta*beta) - delta);
00076 
00077   double dEdx = xi*(log(2.*emass*emax/(poti*poti)) - 2.*(beta*beta) - delta0);
00078   double dEdx2 = xi*emax*(1.-0.5*(beta*beta));
00079   double dP    = dEdx/beta;
00080   double sigp2 = dEdx2*e*e/(p*p*p*p*p*p);
00081   theDeltaP += -dP;
00082   theDeltaCov(0,0) += sigp2;
00083 }
00084 //
00085 // Computation of energy loss for electrons
00086 //
00087 void 
00088 EnergyLossUpdator::computeElectrons (const LocalVector& localP,
00089                                      const MediumProperties& materialConstants,
00090                                      const PropagationDirection propDir) const {
00091   //
00092   // calculate absolute momentum and correction to path length from angle 
00093   // of incidence
00094   //
00095   double p = localP.mag();
00096   double normalisedPath = fabs(p/localP.z())*materialConstants.radLen();
00097   //
00098   // Energy loss and variance according to Bethe and Heitler, see also
00099   // Comp. Phys. Comm. 79 (1994) 157. 
00100   //
00101   double z = exp(-normalisedPath);
00102   double varz = exp(-normalisedPath*log(3.)/log(2.))- 
00103                 z*z;
00104                 // exp(-2*normalisedPath);
00105 
00106   if ( propDir==oppositeToMomentum ) {
00107     //
00108     // for backward propagation: delta(1/p) is linear in z=p_outside/p_inside
00109     // convert to obtain equivalent delta(p). Sign of deltaP is corrected
00110     // in method compute -> deltaP<0 at this place!!!
00111     //
00112     theDeltaP += -p*(1/z-1);
00113     theDeltaCov(0,0) += varz/(p*p);
00114   }
00115   else {        
00116     //
00117     // for forward propagation: calculate in p (linear in 1/z=p_inside/p_outside),
00118     // then convert sig(p) to sig(1/p). 
00119     //
00120     theDeltaP += p*(z-1);
00121     //    double f = 1/p/z/z;
00122     // patch to ensure consistency between for- and backward propagation
00123     double f = 1./(p*z);
00124     theDeltaCov(0,0) += f*f*varz;
00125   }
00126 }