CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultipleScatteringUpdator.cc
Go to the documentation of this file.
3 
4 
5 void oldMUcompute (const TrajectoryStateOnSurface& TSoS,
6  const PropagationDirection propDir, double mass, double ptmin);
7 
8 //#define DBG_MSU
9 
10 //
11 // Computation of contribution of multiple scatterning to covariance matrix
12 // of local parameters based on Highland formula for sigma(alpha) in plane.
13 //
15  const PropagationDirection propDir) const
16 {
17  //
18  // Get surface
19  //
20  const Surface& surface = TSoS.surface();
21  //
22  // Initialise the update to the covariance matrix
23  // (dP is constantly 0).
24  //
25  theDeltaCov(1,1) = 0.;
26  theDeltaCov(1,2) = 0.;
27  theDeltaCov(2,2) = 0.;
28  //
29  // Now get information on medium
30  //
31  if (surface.mediumProperties()) {
32  // Momentum vector
33  LocalVector d = TSoS.localMomentum();
34  double p2 = d.mag2();
35  d *= 1./sqrt(p2);
36  // MediumProperties mp(0.02, .5e-4);
37  const MediumProperties& mp = *surface.mediumProperties();
38  double xf = 1./fabs(d.z()); // increase of path due to angle of incidence
39  // calculate general physics things
40  const double amscon = 1.8496e-4; // (13.6MeV)**2
41  const double m2 = mass()*mass(); // use mass hypothesis from constructor
42  double e2 = p2 + m2;
43  double beta2 = p2/e2;
44  // calculate the multiple scattering angle
45  double radLen = mp.radLen()*xf; // effective rad. length
46  double sigt2 = 0.; // sigma(alpha)**2
47  if (radLen > 0) {
48  // Calculated rms scattering angle squared.
49  double fact = 1. + 0.038*log(radLen); fact *=fact;
50  double a = fact/(beta2*p2);
51  sigt2 = amscon*radLen*a;
52  if (thePtMin > 0) {
53 #ifdef DBG_MSU
54  std::cout<<"Original rms scattering = "<<sqrt(sigt2);
55 #endif
56  // Inflate estimated rms scattering angle, to take into account
57  // that 1/p is not known precisely.
58  AlgebraicSymMatrix55 const & covMatrix = TSoS.localError().matrix();
59  double error2_QoverP = covMatrix(0,0);
60  // Formula valid for ultra-relativistic particles.
61  // sigt2 *= (1. + p2 * error2_QoverP);
62  // Exact formula
63  sigt2 *= (1. + p2 * error2_QoverP *
64  (1. + 5.*m2/e2 + 3.*m2*beta2*error2_QoverP));
65 #ifdef DBG_MSU
66  std::cout<<" new = "<<sqrt(sigt2);
67 #endif
68  // Convert Pt constraint to P constraint, neglecting uncertainty in
69  // track angle.
70  double pMin2 = thePtMin*thePtMin*(p2/TSoS.globalMomentum().perp2());
71  // Use P constraint to calculate rms maximum scattering angle.
72  double betaMin2 = pMin2/(pMin2 + m2);
73  double a_max = fact/(betaMin2 * pMin2);
74  double sigt2_max = amscon*radLen*a_max;
75  if (sigt2 > sigt2_max) sigt2 = sigt2_max;
76 #ifdef DBG_MSU
77  std::cout<<" after P constraint ("<<pMin<<") = "<<sqrt(sigt2);
78  std::cout<<" for track with 1/p="<<1/p<<"+-"<<sqrt(error2_QoverP)<<std::endl;
79 #endif
80  }
81  }
82  double sl2 = d.perp2();
83  double cl2 = (d.z()*d.z());
84  double cf2 = (d.x()*d.x())/sl2;
85  double sf2 = (d.y()*d.y())/sl2;
86  // Create update (transformation of independant variations
87  // on angle in orthogonal planes to local parameters.
88  double den = 1./(cl2*cl2);
89  theDeltaCov(1,1) = (den*sigt2)*(sf2*cl2 + cf2);
90  theDeltaCov(1,2) = (den*sigt2)*(d.x()*d.y() );
91  theDeltaCov(2,2) = (den*sigt2)*(cf2*cl2 + sf2);
92 
93  /*
94  std::cout << "new " << theDeltaCov(1,1) << " " << theDeltaCov(1,2) << " " << theDeltaCov(2,2) << std::endl;
95  oldMUcompute(TSoS,propDir, mass(), thePtMin);
96  */
97  }
98 
99 }
100 
101 
102 
103 
104 //
105 // Computation of contribution of multiple scatterning to covariance matrix
106 // of local parameters based on Highland formula for sigma(alpha) in plane.
107 //
109  const PropagationDirection propDir, double mass, double thePtMin)
110 {
111  //
112  // Get surface
113  //
114  const Surface& surface = TSoS.surface();
115  //
116  //
117  // Now get information on medium
118  //
119  if (surface.mediumProperties()) {
120  // Momentum vector
121  LocalVector d = TSoS.localMomentum();
122  double p = d.mag();
123  d *= 1./p;
124  // MediumProperties mp(0.02, .5e-4);
125  const MediumProperties& mp = *surface.mediumProperties();
126  double xf = 1./fabs(d.z()); // increase of path due to angle of incidence
127  // calculate general physics things
128  const double amscon = 1.8496e-4; // (13.6MeV)**2
129  const double m = mass; // use mass hypothesis from constructor
130  double e = sqrt(p*p + m*m);
131  double beta = p/e;
132  // calculate the multiple scattering angle
133  double radLen = mp.radLen()*xf; // effective rad. length
134  double sigt2 = 0.; // sigma(alpha)**2
135  if (radLen > 0) {
136  // Calculated rms scattering angle squared.
137  double a = (1. + 0.038*log(radLen))/(beta*p); a *= a;
138  sigt2 = amscon*radLen*a;
139  if (thePtMin > 0) {
140 #ifdef DBG_MSU
141  std::cout<<"Original rms scattering = "<<sqrt(sigt2);
142 #endif
143  // Inflate estimated rms scattering angle, to take into account
144  // that 1/p is not known precisely.
145  AlgebraicSymMatrix55 covMatrix = TSoS.localError().matrix();
146  double error2_QoverP = covMatrix(0,0);
147  // Formula valid for ultra-relativistic particles.
148 // sigt2 *= (1. + (p*p) * error2_QoverP);
149  // Exact formula
150  sigt2 *= (1. + (p*p) * error2_QoverP *
151  (1. + 5*m*m/(e*e) + 3*m*m*beta*beta*error2_QoverP));
152 #ifdef DBG_MSU
153  std::cout<<" new = "<<sqrt(sigt2);
154 #endif
155  // Convert Pt constraint to P constraint, neglecting uncertainty in
156  // track angle.
157  double pMin = thePtMin*(TSoS.globalMomentum().mag()/TSoS.globalMomentum().perp());
158  // Use P constraint to calculate rms maximum scattering angle.
159  double betaMin = pMin/sqrt(pMin * pMin + m*m);
160  double a_max = (1. + 0.038*log(radLen))/(betaMin * pMin); a_max *= a_max;
161  double sigt2_max = amscon*radLen*a_max;
162  if (sigt2 > sigt2_max) sigt2 = sigt2_max;
163 #ifdef DBG_MSU
164  std::cout<<" after P constraint ("<<pMin<<") = "<<sqrt(sigt2);
165  std::cout<<" for track with 1/p="<<1/p<<"+-"<<sqrt(error2_QoverP)<<std::endl;
166 #endif
167  }
168  }
169  double sl = d.perp();
170  double cl = d.z();
171  double cf = d.x()/sl;
172  double sf = d.y()/sl;
173  // Create update (transformation of independant variations
174  // on angle in orthogonal planes to local parameters.
175  std::cout << "old " << sigt2*(sf*sf*cl*cl + cf*cf)/(cl*cl*cl*cl)
176  << " " << sigt2*(cf*sf*sl*sl )/(cl*cl*cl*cl)
177  << " " << sigt2*(cf*cf*cl*cl + sf*sf)/(cl*cl*cl*cl) << std::endl;
178  }
179 }
const double beta
T mag2() const
Definition: PV3DBase.h:60
float radLen() const
T perp() const
Definition: PV3DBase.h:66
T y() const
Definition: PV3DBase.h:57
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
T perp2() const
Definition: PV3DBase.h:65
PropagationDirection
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
LocalVector localMomentum() const
T mag() const
Definition: PV3DBase.h:61
T sqrt(T t)
Definition: SSEVec.h:28
T z() const
Definition: PV3DBase.h:58
const AlgebraicSymMatrix55 & matrix() const
const LocalTrajectoryError & localError() const
double p2[4]
Definition: TauolaWrapper.h:90
Log< T >::type log(const T &t)
Definition: Log.h:22
double ptmin
Definition: HydjetWrapper.h:86
GlobalVector globalMomentum() const
void oldMUcompute(const TrajectoryStateOnSurface &TSoS, const PropagationDirection propDir, double mass, double ptmin)
double a
Definition: hdecay.h:121
const Surface & surface() const
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const
tuple cout
Definition: gather_cfg.py:41
T x() const
Definition: PV3DBase.h:56
AlgebraicSymMatrix55 theDeltaCov