CMS 3D CMS Logo

MultipleScatteringUpdator.cc

Go to the documentation of this file.
00001 #include "TrackingTools/MaterialEffects/interface/MultipleScatteringUpdator.h"
00002 #include "DataFormats/GeometrySurface/interface/MediumProperties.h"
00003 
00004 //
00005 // Computation of contribution of multiple scatterning to covariance matrix 
00006 //   of local parameters based on Highland formula for sigma(alpha) in plane.
00007 //
00008 void MultipleScatteringUpdator::compute (const TrajectoryStateOnSurface& TSoS, 
00009                                          const PropagationDirection propDir) const
00010 {
00011   //
00012   // Get surface
00013   //
00014   const Surface& surface = TSoS.surface();
00015   //
00016   // Initialise the update to the covariance matrix
00017   // (dP is constantly 0).
00018   //
00019   theDeltaCov(1,1) = 0.;
00020   theDeltaCov(1,2) = 0.;
00021   theDeltaCov(2,2) = 0.;
00022   //
00023   // Now get information on medium
00024   //
00025   if (surface.mediumProperties()) {
00026     // Momentum vector
00027     LocalVector d = TSoS.localMomentum();
00028     double p = d.mag();
00029     d *= 1./p;
00030     // MediumProperties mp(0.02, .5e-4);
00031     const MediumProperties& mp = *surface.mediumProperties();
00032     double xf = 1./fabs(d.z());         // increase of path due to angle of incidence
00033     // calculate general physics things
00034     const double amscon = 1.8496e-4;    // (13.6MeV)**2
00035     const double m = mass();            // use mass hypothesis from constructor
00036     double e     = sqrt(p*p + m*m);
00037     double beta  = p/e;
00038     // calculate the multiple scattering angle
00039     double radLen = mp.radLen()*xf;     // effective rad. length
00040     double sigt2 = 0.;                  // sigma(alpha)**2
00041     if (radLen > 0) {
00042       double a = (1. + 0.038*log(radLen))/(beta*p); a *= a;
00043       sigt2 = amscon*radLen*a;
00044     }
00045     double sl = d.perp();
00046     double cl = d.z();
00047     double cf = d.x()/sl;
00048     double sf = d.y()/sl;
00049     // Create update (transformation of independant variations
00050     //   on angle in orthogonal planes to local parameters.
00051     theDeltaCov(1,1) = sigt2*(sf*sf*cl*cl + cf*cf)/(cl*cl*cl*cl);
00052     theDeltaCov(1,2) = sigt2*(cf*sf*sl*sl        )/(cl*cl*cl*cl);
00053     theDeltaCov(2,2) = sigt2*(cf*cf*cl*cl + sf*sf)/(cl*cl*cl*cl);
00054   }
00055   //
00056   // Save arguments to avoid duplication of computation
00057   //
00058   storeArguments(TSoS,propDir);
00059 }
00060 //
00061 // Compare arguments with the ones of the previous call
00062 //
00063 bool MultipleScatteringUpdator::newArguments (const TrajectoryStateOnSurface& TSoS, 
00064                                               const PropagationDirection propDir) const {
00065   LocalVector localP = TSoS.localMomentum(); // let's call localMomentum only once
00066   return 
00067     localP.mag() != theLastP || 
00068     //TSoS.localMomentum().unit().z()!=theLastDz ||   // if we get there,  TSoS.localMomentum().mag() = theLastP!
00069     localP.z() != theLastDz*theLastP   ||   // so we can just do this, I think
00070     propDir!=theLastPropDir ||
00071     TSoS.surface().mediumProperties()->radLen()!=theLastRadLength;
00072 }
00073 //
00074 // Save arguments
00075 //
00076 void MultipleScatteringUpdator::storeArguments (const TrajectoryStateOnSurface& TSoS, 
00077                                                 const PropagationDirection propDir) const {
00078   LocalVector localP = TSoS.localMomentum(); // let's call localMomentum only once
00079   theLastP = localP.mag();
00080   theLastDz = (theLastP == 0 ? 0 : localP.z()/theLastP);
00081   theLastPropDir = propDir;
00082   theLastRadLength = TSoS.surface().mediumProperties()->radLen();
00083 }
00084 

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