CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GsfMultipleScatteringUpdator.cc
Go to the documentation of this file.
2 
4 
5 // #include "CommonDet/DetUtilities/interface/DetExceptions.h"
6 
7 // #include "Utilities/Notification/interface/Verbose.h"
8 
9 void
11  const PropagationDirection propDir) const
12 {
13  //
14  // clear cache
15  //
16  theWeights.clear();
17  theDeltaPs.clear();
18  theDeltaCovs.clear();
19  //
20  // Get surface and check presence of medium properties
21  //
22  const Surface& surface = TSoS.surface();
23  //
24  // calculate components
25  //
26  if ( surface.mediumProperties() ) {
27  LocalVector pvec = TSoS.localMomentum();
28  double p = TSoS.localMomentum().mag();
29  pvec *= 1./p;
30  // thickness in radiation lengths
31  double rl = surface.mediumProperties()->radLen()/fabs(pvec.z());
32  // auxiliary variables for modified X0
33  const double z = 14; // atomic number of silicon
34  const double logz = log(z);
35  const double h = (z+1)/z*log(287*sqrt(z))/log(159*pow(z,-1./3.));
36  double beta2 = 1./(1.+mass()*mass()/p/p);
37  // reduced thickness
38  double dp1 = rl/beta2/h;
39  double logdp1 = log(dp1);
40  double logdp2 = 2./3.*logz + logdp1;
41  // means are always 0
42  theDeltaPs.push_back(0.);
43  theDeltaPs.push_back(0.);
44  // weights
45  double w2;
46  if ( logdp2<log(0.5) )
47  w2 = 0.05283+0.0077*logdp2+0.00069*logdp2*logdp2;
48  else
49  w2 =-0.01517+0.1151*logdp2-0.00653*logdp2*logdp2;
50  double w1 = 1.-w2;
51  theWeights.push_back(w1);
52  theWeights.push_back(w2);
53  // reduced variances
54  double var1 = 0.8510+0.03314*logdp1-0.001825*logdp1*logdp1;
55  double var2 = (1.-w1*var1)/w2;
56  for ( int ic=0; ic<2; ic++ ) {
57  // choose component and multiply with total variance
58  double var = ic==0 ? var1 : var2;
59  var *= 225.e-6*dp1/p/p;
61  // transform from orthogonal planes containing the
62  // momentum vector to local parameters
63  double sl = pvec.perp();
64  double cl = pvec.z();
65  double cf = pvec.x()/sl;
66  double sf = pvec.y()/sl;
67  cov(1,1) = var*(sf*sf*cl*cl + cf*cf)/(cl*cl*cl*cl);
68  cov(1,2) = var*(cf*sf*sl*sl )/(cl*cl*cl*cl);
69  cov(2,2) = var*(cf*cf*cl*cl + sf*sf)/(cl*cl*cl*cl);
70  theDeltaCovs.push_back(cov);
71  }
72  }
73  else {
74  theWeights.push_back(1.);
75  theDeltaPs.push_back(0.);
77  }
78  //
79  // Save arguments to avoid duplication of computation
80  //
81  storeArguments(TSoS,propDir);
82 }
83 
84 //
85 // Compare arguments with the ones of the previous call
86 //
87 bool
89  const PropagationDirection propDir) const {
90  return TSoS.localMomentum().unit().z()!=theLastDz ||
91  TSoS.localMomentum().mag()!=theLastP || propDir!=theLastPropDir ||
93 }
94 //
95 // Save arguments
96 //
98  const PropagationDirection propDir) const {
99  theLastDz = TSoS.localMomentum().unit().z();
100  theLastP = TSoS.localMomentum().mag();
101  theLastPropDir = propDir;
103 }
float radLen() const
std::vector< AlgebraicSymMatrix55 > theDeltaCovs
T perp() const
Definition: PV3DBase.h:71
common ppss p3p6s2 common epss epspn46 common const1 w2
Definition: inclppp.h:1
virtual void compute(const TrajectoryStateOnSurface &, const PropagationDirection) const
Computation: generates vectors of weights, means and standard deviations.
virtual void storeArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
T y() const
Definition: PV3DBase.h:62
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
PropagationDirection
double double double z
const MediumProperties * mediumProperties() const
Definition: Surface.h:93
LocalVector localMomentum() const
T mag() const
Definition: PV3DBase.h:66
T sqrt(T t)
Definition: SSEVec.h:46
T z() const
Definition: PV3DBase.h:63
float cl
Definition: Combine.cc:71
Vector3DBase unit() const
Definition: Vector3DBase.h:57
virtual bool newArguments(const TrajectoryStateOnSurface &, const PropagationDirection) const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
const Surface & surface() const
T x() const
Definition: PV3DBase.h:61
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40