Go to the documentation of this file.00001 #include "TrackingTools/MaterialEffects/interface/MultipleScatteringUpdator.h"
00002 #include "DataFormats/GeometrySurface/interface/MediumProperties.h"
00003
00004 #include "DataFormats/Math/interface/approx_log.h"
00005
00006 void oldMUcompute (const TrajectoryStateOnSurface& TSoS,
00007 const PropagationDirection propDir, double mass, double ptmin);
00008
00009
00010
00011
00012
00013
00014
00015 void MultipleScatteringUpdator::compute (const TrajectoryStateOnSurface& TSoS,
00016 const PropagationDirection propDir, Effect & effect) const
00017 {
00018
00019
00020
00021 const Surface& surface = TSoS.surface();
00022
00023
00024
00025
00026 const MediumProperties& mp = surface.mediumProperties();
00027 if unlikely(mp.radLen()==0) return;
00028
00029
00030 LocalVector d = TSoS.localMomentum();
00031 float p2 = d.mag2();
00032 d *= 1.f/sqrt(p2);
00033 float xf = 1.f/std::abs(d.z());
00034
00035 constexpr float amscon = 1.8496e-4;
00036 const float m2 = mass()*mass();
00037 float e2 = p2 + m2;
00038 float beta2 = p2/e2;
00039
00040 float radLen = mp.radLen()*xf;
00041 float sigt2 = 0.;
00042
00043
00044 float fact = 1.f + 0.038f*unsafe_logf<2>(radLen); fact *=fact;
00045 float a = fact/(beta2*p2);
00046 sigt2 = amscon*radLen*a;
00047
00048 if (thePtMin > 0) {
00049 #ifdef DBG_MSU
00050 std::cout<<"Original rms scattering = "<<sqrt(sigt2);
00051 #endif
00052
00053
00054 AlgebraicSymMatrix55 const & covMatrix = TSoS.localError().matrix();
00055 float error2_QoverP = covMatrix(0,0);
00056
00057
00058
00059 sigt2 *= 1.f + error2_QoverP *( p2 + m2*beta2*(5.f + 3.f*p2*error2_QoverP) ) ;
00060 #ifdef DBG_MSU
00061 std::cout<<" new = "<<sqrt(sigt2);
00062 #endif
00063
00064
00065 float pMin2 = thePtMin*thePtMin*(p2/TSoS.globalMomentum().perp2());
00066
00067 float betaMin2 = pMin2/(pMin2 + m2);
00068 float a_max = fact/(betaMin2 * pMin2);
00069 float sigt2_max = amscon*radLen*a_max;
00070 if (sigt2 > sigt2_max) sigt2 = sigt2_max;
00071 #ifdef DBG_MSU
00072 std::cout<<" after P constraint ("<<pMin<<") = "<<sqrt(sigt2);
00073 std::cout<<" for track with 1/p="<<1/p<<"+-"<<sqrt(error2_QoverP)<<std::endl;
00074 #endif
00075 }
00076
00077 float isl2 = 1.f/d.perp2();
00078 float cl2 = (d.z()*d.z());
00079 float cf2 = (d.x()*d.x())*isl2;
00080 float sf2 = (d.y()*d.y())*isl2;
00081
00082
00083 float den = 1.f/(cl2*cl2);
00084 using namespace materialEffect;
00085 effect.deltaCov[msxx] += (den*sigt2)*(sf2*cl2 + cf2);
00086 effect.deltaCov[msxy] += (den*sigt2)*(d.x()*d.y() );
00087 effect.deltaCov[msyy] += (den*sigt2)*(cf2*cl2 + sf2);
00088
00089
00090
00091
00092
00093
00094 }
00095
00096
00097
00098
00099
00100
00101
00102
00103 void oldMUcompute (const TrajectoryStateOnSurface& TSoS,
00104 const PropagationDirection propDir, float mass, float thePtMin)
00105 {
00106
00107
00108
00109 const Surface& surface = TSoS.surface();
00110
00111
00112
00113
00114 if (surface.mediumProperties().isValid()) {
00115
00116 LocalVector d = TSoS.localMomentum();
00117 float p = d.mag();
00118 d *= 1./p;
00119
00120 const MediumProperties& mp = surface.mediumProperties();
00121 float xf = 1./fabs(d.z());
00122
00123 const float amscon = 1.8496e-4;
00124 const float m = mass;
00125 float e = sqrt(p*p + m*m);
00126 float beta = p/e;
00127
00128 float radLen = mp.radLen()*xf;
00129 float sigt2 = 0.;
00130 if (radLen > 0) {
00131
00132 float a = (1. + 0.038*log(radLen))/(beta*p); a *= a;
00133 sigt2 = amscon*radLen*a;
00134 if (thePtMin > 0) {
00135 #ifdef DBG_MSU
00136 std::cout<<"Original rms scattering = "<<sqrt(sigt2);
00137 #endif
00138
00139
00140 AlgebraicSymMatrix55 covMatrix = TSoS.localError().matrix();
00141 float error2_QoverP = covMatrix(0,0);
00142
00143
00144
00145 sigt2 *= (1. + (p*p) * error2_QoverP *
00146 (1. + 5*m*m/(e*e) + 3*m*m*beta*beta*error2_QoverP));
00147 #ifdef DBG_MSU
00148 std::cout<<" new = "<<sqrt(sigt2);
00149 #endif
00150
00151
00152 float pMin = thePtMin*(TSoS.globalMomentum().mag()/TSoS.globalMomentum().perp());
00153
00154 float betaMin = pMin/sqrt(pMin * pMin + m*m);
00155 float a_max = (1. + 0.038*log(radLen))/(betaMin * pMin); a_max *= a_max;
00156 float sigt2_max = amscon*radLen*a_max;
00157 if (sigt2 > sigt2_max) sigt2 = sigt2_max;
00158 #ifdef DBG_MSU
00159 std::cout<<" after P constraint ("<<pMin<<") = "<<sqrt(sigt2);
00160 std::cout<<" for track with 1/p="<<1/p<<"+-"<<sqrt(error2_QoverP)<<std::endl;
00161 #endif
00162 }
00163 }
00164 float sl = d.perp();
00165 float cl = d.z();
00166 float cf = d.x()/sl;
00167 float sf = d.y()/sl;
00168
00169
00170 std::cout << "old " << sigt2*(sf*sf*cl*cl + cf*cf)/(cl*cl*cl*cl)
00171 << " " << sigt2*(cf*sf*sl*sl )/(cl*cl*cl*cl)
00172 << " " << sigt2*(cf*cf*cl*cl + sf*sf)/(cl*cl*cl*cl) << std::endl;
00173 }
00174 }