00001 #include "TrackingTools/MaterialEffects/interface/MultipleScatteringUpdator.h"
00002 #include "DataFormats/GeometrySurface/interface/MediumProperties.h"
00003
00004
00005
00006
00007
00008 void MultipleScatteringUpdator::compute (const TrajectoryStateOnSurface& TSoS,
00009 const PropagationDirection propDir) const
00010 {
00011
00012
00013
00014 const Surface& surface = TSoS.surface();
00015
00016
00017
00018
00019 theDeltaCov(1,1) = 0.;
00020 theDeltaCov(1,2) = 0.;
00021 theDeltaCov(2,2) = 0.;
00022
00023
00024
00025 if (surface.mediumProperties()) {
00026
00027 LocalVector d = TSoS.localMomentum();
00028 double p = d.mag();
00029 d *= 1./p;
00030
00031 const MediumProperties& mp = *surface.mediumProperties();
00032 double xf = 1./fabs(d.z());
00033
00034 const double amscon = 1.8496e-4;
00035 const double m = mass();
00036 double e = sqrt(p*p + m*m);
00037 double beta = p/e;
00038
00039 double radLen = mp.radLen()*xf;
00040 double sigt2 = 0.;
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
00050
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
00057
00058 storeArguments(TSoS,propDir);
00059 }
00060
00061
00062
00063 bool MultipleScatteringUpdator::newArguments (const TrajectoryStateOnSurface& TSoS,
00064 const PropagationDirection propDir) const {
00065 LocalVector localP = TSoS.localMomentum();
00066 return
00067 localP.mag() != theLastP ||
00068
00069 localP.z() != theLastDz*theLastP ||
00070 propDir!=theLastPropDir ||
00071 TSoS.surface().mediumProperties()->radLen()!=theLastRadLength;
00072 }
00073
00074
00075
00076 void MultipleScatteringUpdator::storeArguments (const TrajectoryStateOnSurface& TSoS,
00077 const PropagationDirection propDir) const {
00078 LocalVector localP = TSoS.localMomentum();
00079 theLastP = localP.mag();
00080 theLastDz = (theLastP == 0 ? 0 : localP.z()/theLastP);
00081 theLastPropDir = propDir;
00082 theLastRadLength = TSoS.surface().mediumProperties()->radLen();
00083 }
00084