CMS 3D CMS Logo

MultipleScatteringParametrisation.cc
Go to the documentation of this file.
1 
2 #include <vector>
7 
8 template <class T>
9 inline T sqr(T t) {
10  return t * t;
11 }
12 
13 #include "MSLayersKeeper.h"
14 #include "MSLayersAtAngle.h"
15 
16 using namespace std;
17 
19 
20 //----------------------------------------------------------------------
22  const MSLayersKeeper *layerKeeper)
23  : theLayerKeeper(layerKeeper) {
24  if (layer) {
26  }
27 }
28 
29 //----------------------------------------------------------------------
30 float MultipleScatteringParametrisation::operator()(float pT, float cotTheta, float) const {
31  float sumX0D = theLayer.sumX0D(cotTheta);
32  return x0ToSigma * sumX0D / pT;
33 }
34 
35 //----------------------------------------------------------------------
37  float cotTheta,
38  const PixelRecoPointRZ &pointI,
39  float tip) const {
40  PixelRecoLineRZ lineIO(pointI, cotTheta, tip);
41  PixelRecoPointRZ pointO = theLayer.crossing(lineIO).first;
42 
43  const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
44 
45  float sumX0D = layersAtEta.sumX0D(pointI, pointO);
46  return x0ToSigma * sumX0D / pT;
47 }
48 
50  float cotTheta,
51  const PixelRecoPointRZ &pointI,
52  int il) const {
53  PixelRecoLineRZ lineIO(pointI, cotTheta);
54  PixelRecoPointRZ pointO = theLayer.crossing(lineIO).first;
55 
56  const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
57 
58  float sumX0D = layersAtEta.sumX0D(il, theLayer.seqNum(), pointI, pointO);
59  return x0ToSigma * sumX0D / pT;
60 }
61 
62 //----------------------------------------------------------------------
64  const PixelRecoPointRZ &pointI,
65  const PixelRecoPointRZ &pointO,
66  Consecutive consecutive,
67  float tip) const {
68  PixelRecoLineRZ lineIO(pointI, pointO, tip);
69  PixelRecoPointRZ pointM = theLayer.crossing(lineIO).first;
70  float cotTheta = lineIO.cotLine();
71 
72  if (consecutive == useConsecutive) {
73  float dist = fabs((pointO.r() - pointM.r()) * (pointM.r() - pointI.r()) / (pointO.r() - pointI.r()));
74  return x0ToSigma * sqrt(theLayer.x0(cotTheta)) * dist / pT;
75  } else {
76  const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
77  float sumX0D = layersAtEta.sumX0D(pointI, pointM, pointO);
78  return x0ToSigma * sumX0D / pT;
79  }
80 }
81 
83  const PixelRecoPointRZ &pointV,
84  const PixelRecoPointRZ &pointO,
85  int ol) const {
86  PixelRecoLineRZ lineIO(pointV, pointO);
87  PixelRecoPointRZ pointI = theLayer.crossing(lineIO).first;
88  float cotTheta = lineIO.cotLine();
89 
90  const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
91  float sumX0D = layersAtEta.sumX0D(pointV.z(), theLayer.seqNum(), ol, pointI, pointO);
92  return x0ToSigma * sumX0D / pT;
93 }
float operator()(float pt, float cotTheta, float transverseIP=0.) const
float cotLine() const
std::pair< PixelRecoPointRZ, bool > crossing(const PixelRecoLineRZ &line) const
Definition: MSLayer.cc:84
int seqNum() const
Definition: MSLayer.h:47
float x0(float cotTheta) const
Definition: MSLayer.cc:131
constexpr std::array< uint8_t, layerIndexSize< TrackerTraits > > layer
MultipleScatteringParametrisation(const DetLayer *layer, const MSLayersKeeper *layerKeeper)
T sqrt(T t)
Definition: SSEVec.h:19
float r() const
virtual const MSLayersAtAngle & layers(float cotTheta) const =0
virtual MSLayer layer(const DetLayer *dl) const
float z() const
float sumX0D(float cotTheta) const
Definition: MSLayer.cc:144
long double T
float sumX0D(const PixelRecoPointRZ &pointI, const PixelRecoPointRZ &pointO) const