Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-23 22:53:23

0001 
0002 #include <vector>
0003 #include "RecoTracker/TkMSParametrization/interface/MultipleScatteringParametrisation.h"
0004 #include "TrackingTools/DetLayers/interface/DetLayer.h"
0005 #include "RecoTracker/TkMSParametrization/interface/PixelRecoPointRZ.h"
0006 #include "RecoTracker/TkMSParametrization/interface/PixelRecoLineRZ.h"
0007 
0008 template <class T>
0009 inline T sqr(T t) {
0010   return t * t;
0011 }
0012 
0013 #include "MSLayersKeeper.h"
0014 #include "MSLayersAtAngle.h"
0015 
0016 using namespace std;
0017 
0018 const float MultipleScatteringParametrisation::x0ToSigma = 0.0136f;
0019 
0020 //----------------------------------------------------------------------
0021 MultipleScatteringParametrisation::MultipleScatteringParametrisation(const DetLayer *layer,
0022                                                                      const MSLayersKeeper *layerKeeper)
0023     : theLayerKeeper(layerKeeper) {
0024   if (layer) {
0025     theLayer = theLayerKeeper->layer(layer);
0026   }
0027 }
0028 
0029 //----------------------------------------------------------------------
0030 float MultipleScatteringParametrisation::operator()(float pT, float cotTheta, float) const {
0031   float sumX0D = theLayer.sumX0D(cotTheta);
0032   return x0ToSigma * sumX0D / pT;
0033 }
0034 
0035 //----------------------------------------------------------------------
0036 float MultipleScatteringParametrisation::operator()(float pT,
0037                                                     float cotTheta,
0038                                                     const PixelRecoPointRZ &pointI,
0039                                                     float tip) const {
0040   PixelRecoLineRZ lineIO(pointI, cotTheta, tip);
0041   PixelRecoPointRZ pointO = theLayer.crossing(lineIO).first;
0042 
0043   const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
0044 
0045   float sumX0D = layersAtEta.sumX0D(pointI, pointO);
0046   return x0ToSigma * sumX0D / pT;
0047 }
0048 
0049 float MultipleScatteringParametrisation::operator()(float pT,
0050                                                     float cotTheta,
0051                                                     const PixelRecoPointRZ &pointI,
0052                                                     int il) const {
0053   PixelRecoLineRZ lineIO(pointI, cotTheta);
0054   PixelRecoPointRZ pointO = theLayer.crossing(lineIO).first;
0055 
0056   const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
0057 
0058   float sumX0D = layersAtEta.sumX0D(il, theLayer.seqNum(), pointI, pointO);
0059   return x0ToSigma * sumX0D / pT;
0060 }
0061 
0062 //----------------------------------------------------------------------
0063 float MultipleScatteringParametrisation::operator()(float pT,
0064                                                     const PixelRecoPointRZ &pointI,
0065                                                     const PixelRecoPointRZ &pointO,
0066                                                     Consecutive consecutive,
0067                                                     float tip) const {
0068   PixelRecoLineRZ lineIO(pointI, pointO, tip);
0069   PixelRecoPointRZ pointM = theLayer.crossing(lineIO).first;
0070   float cotTheta = lineIO.cotLine();
0071 
0072   if (consecutive == useConsecutive) {
0073     float dist = fabs((pointO.r() - pointM.r()) * (pointM.r() - pointI.r()) / (pointO.r() - pointI.r()));
0074     return x0ToSigma * sqrt(theLayer.x0(cotTheta)) * dist / pT;
0075   } else {
0076     const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
0077     float sumX0D = layersAtEta.sumX0D(pointI, pointM, pointO);
0078     return x0ToSigma * sumX0D / pT;
0079   }
0080 }
0081 
0082 float MultipleScatteringParametrisation::operator()(float pT,
0083                                                     const PixelRecoPointRZ &pointV,
0084                                                     const PixelRecoPointRZ &pointO,
0085                                                     int ol) const {
0086   PixelRecoLineRZ lineIO(pointV, pointO);
0087   PixelRecoPointRZ pointI = theLayer.crossing(lineIO).first;
0088   float cotTheta = lineIO.cotLine();
0089 
0090   const MSLayersAtAngle &layersAtEta = theLayerKeeper->layers(cotTheta);
0091   float sumX0D = layersAtEta.sumX0D(pointV.z(), theLayer.seqNum(), ol, pointI, pointO);
0092   return x0ToSigma * sumX0D / pT;
0093 }