CMS 3D CMS Logo

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   // Save arguments to avoid duplication of computation
00041   //
00042   storeArguments(TSoS,propDir);
00043 }
00044 //
00045 // Computation of energy loss according to Bethe-Bloch
00046 //
00047 void
00048 EnergyLossUpdator::computeBetheBloch (const LocalVector& localP,
00049                                       const MediumProperties& materialConstants) const {
00050   //
00051   // calculate absolute momentum and correction to path length from angle 
00052   // of incidence
00053   //
00054   double p = localP.mag();
00055   double xf = fabs(p/localP.z());
00056   // constants
00057   const double m = mass();            // use mass hypothesis from constructor
00058   const double emass = 0.511e-3;
00059   const double poti = 16.e-9 * 10.75; // = 16 eV * Z**0.9, for Si Z=14
00060   const double eplasma = 28.816e-9 * sqrt(2.33*0.498); // 28.816 eV * sqrt(rho*(Z/A)) for Si
00061   const double delta0 = 2*log(eplasma/poti) - 1.;
00062   // calculate general physics things
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   // calculate the mean and sigma of energy loss
00072   // xi = d[g/cm2] * 0.307075MeV/(g/cm2) * Z/A * 1/2
00073   double xi = materialConstants.xi()*xf; xi /= (beta*beta);
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   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 // Computation of energy loss for electrons
00084 //
00085 void 
00086 EnergyLossUpdator::computeElectrons (const LocalVector& localP,
00087                                      const MediumProperties& materialConstants,
00088                                      const PropagationDirection propDir) const {
00089   //
00090   // calculate absolute momentum and correction to path length from angle 
00091   // of incidence
00092   //
00093   double p = localP.mag();
00094   double normalisedPath = fabs(p/localP.z())*materialConstants.radLen();
00095   //
00096   // Energy loss and variance according to Bethe and Heitler, see also
00097   // Comp. Phys. Comm. 79 (1994) 157. 
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     // for backward propagation: delta(1/p) is linear in z=p_outside/p_inside
00106     // convert to obtain equivalent delta(p). Sign of deltaP is corrected
00107     // in method compute -> deltaP<0 at this place!!!
00108     //
00109     theDeltaP += -p*(1/z-1);
00110     theDeltaCov(0,0) += varz/p/p;
00111   }
00112   else {        
00113     //
00114     // for forward propagation: calculate in p (linear in 1/z=p_inside/p_outside),
00115     // then convert sig(p) to sig(1/p). 
00116     //
00117     theDeltaP += p*(z-1);
00118     //    double f = 1/p/z/z;
00119     // patch to ensure consistency between for- and backward propagation
00120     double f = 1./p/z;
00121     theDeltaCov(0,0) += f*f*varz;
00122   }
00123 }
00124 //
00125 // Compare arguments with the ones of the previous call
00126 //
00127 bool EnergyLossUpdator::newArguments (const TrajectoryStateOnSurface& TSoS, 
00128                                       const PropagationDirection propDir) const {
00129   LocalVector localP = TSoS.localMomentum(); // let's call localMomentum only once
00130   return 
00131     localP.mag() != theLastP || 
00132     //TSoS.localMomentum().unit().z()!=theLastDz ||   // if we get there,  TSoS.localMomentum().mag() = theLastP!
00133     localP.z() != theLastDz*theLastP   ||   // so we can just do this, I think
00134     propDir!=theLastPropDir ||
00135     TSoS.surface().mediumProperties()->radLen()!=theLastRl ||
00136     TSoS.surface().mediumProperties()->xi()!=theLastXi;
00137 }
00138 //
00139 // Save arguments
00140 //
00141 void EnergyLossUpdator::storeArguments (const TrajectoryStateOnSurface& TSoS, 
00142                                         const PropagationDirection propDir) const {
00143   LocalVector localP = TSoS.localMomentum(); // let's call localMomentum only once
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 

Generated on Tue Jun 9 17:48:22 2009 for CMSSW by  doxygen 1.5.4