CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
ThirdHitCorrection Class Reference

#include <ThirdHitCorrection.h>

Public Types

typedef PixelRecoRange< float > Range
 

Public Member Functions

void correctRPhiRange (Range &range) const
 
void correctRZRange (Range &range) const
 
void init (const edm::EventSetup &es, float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, bool useBendingCorrection)
 
void init (const edm::EventSetup &es, float pt, const DetLayer &layer3, bool useMultipleScattering, bool useBendingCorrection)
 
void init (const PixelRecoLineRZ &line, const PixelRecoPointRZ &constraint, int ol)
 
 ThirdHitCorrection ()
 
 ThirdHitCorrection (const edm::EventSetup &es, float pt, const DetLayer *layer, const PixelRecoLineRZ &line, const PixelRecoPointRZ &constraint, int ol, bool useMultipleScattering, bool useBendingCorrection)
 

Private Attributes

MultipleScatteringParametrisation sigmaRPhi
 
bool theBarrel
 
pixelrecoutilities::LongitudinalBendingCorrection theBendingCorrection
 
PixelRecoLineRZ theLine
 
float theMScoeff = 0
 
float theMultScattCorrRPhi = 0
 
float thePt
 
bool theUseBendingCorrection
 
bool theUseMultipleScattering
 

Detailed Description

Definition at line 16 of file ThirdHitCorrection.h.

Member Typedef Documentation

Definition at line 18 of file ThirdHitCorrection.h.

Constructor & Destructor Documentation

ThirdHitCorrection::ThirdHitCorrection ( )
inline
ThirdHitCorrection::ThirdHitCorrection ( const edm::EventSetup es,
float  pt,
const DetLayer layer,
const PixelRecoLineRZ line,
const PixelRecoPointRZ constraint,
int  ol,
bool  useMultipleScattering,
bool  useBendingCorrection 
)
inline

Definition at line 36 of file ThirdHitCorrection.h.

References HLT_2018_cff::constraint, init, and mps_splice::line.

43  {
45  init(line, constraint, ol);
46  }
void init(const edm::EventSetup &es, float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, bool useBendingCorrection)

Member Function Documentation

void ThirdHitCorrection::correctRPhiRange ( Range range) const
inline

Definition at line 50 of file ThirdHitCorrection.h.

References FastTimerService_cff::range.

void ThirdHitCorrection::correctRZRange ( Range range) const

Definition at line 97 of file ThirdHitCorrection.cc.

References funct::abs(), corr, PixelRecoRange< T >::max(), PixelRecoRange< T >::min(), CosmicsPD_Skims::radius, and crabWrapper::theLine.

97  {
98  range.first -= theMScoeff;
99  range.second += theMScoeff;
100 
102  if (theBarrel) {
103  float cotTheta = theLine.cotLine();
104  if (cotTheta > 0) {
105  float radius = theLine.rAtZ(range.max());
106  float corr = theBendingCorrection(radius) * cotTheta;
107  range.second += corr;
108  } else {
109  float radius = theLine.rAtZ(range.min());
110  float corr = theBendingCorrection(radius) * std::abs(cotTheta);
111  range.first -= corr;
112  }
113  } else {
114  float radius = range.max();
115  float corr = theBendingCorrection(radius);
116  range.first -= corr;
117  }
118  }
119 }
PixelRecoLineRZ theLine
float cotLine() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
pixelrecoutilities::LongitudinalBendingCorrection theBendingCorrection
JetCorrectorParameters corr
Definition: classes.h:5
float rAtZ(float z) const
void ThirdHitCorrection::init ( const edm::EventSetup es,
float  pt,
const DetLayer layer1,
const DetLayer layer2,
const DetLayer layer3,
bool  useMultipleScattering,
bool  useBendingCorrection 
)

Definition at line 37 of file ThirdHitCorrection.cc.

References Surface::bounds(), SimpleLineRZ::cotLine(), init, DetLayer::isBarrel(), Bounds::length(), mps_splice::line, GeometricSearchDet::position(), SimpleLineRZ::rAtZ(), DetLayer::seqNum(), ForwardDetLayer::specificSurface(), BarrelDetLayer::specificSurface(), GeometricSearchDet::surface(), PV3DBase< T, PVType, FrameType >::z(), SimpleLineRZ::zAtR(), and SiStripMonitorCluster_cfi::zmax.

43  {
45 
47  return;
48 
49  auto point3 = [&]() -> PixelRecoPointRZ {
50  if (theBarrel) {
51  const BarrelDetLayer &bl = static_cast<const BarrelDetLayer &>(layer3);
52  float rLayer = bl.specificSurface().radius();
53  auto zmax = 0.5f * layer3.surface().bounds().length();
54  return PixelRecoPointRZ(rLayer, zmax);
55  } else {
56  const ForwardDetLayer &fl = static_cast<const ForwardDetLayer &>(layer3);
57  auto maxR = fl.specificSurface().outerRadius();
58  auto layerZ = layer3.position().z();
59  return PixelRecoPointRZ(maxR, layerZ);
60  }
61  };
62 
63  PixelRecoPointRZ zero(0., 0.);
64  SimpleLineRZ line(zero, point3());
65 
66  auto point2 = [&]() -> PixelRecoPointRZ {
67  if (layer2.isBarrel()) {
68  const BarrelDetLayer &bl = static_cast<const BarrelDetLayer &>(layer2);
69  float rLayer = bl.specificSurface().radius();
70  return PixelRecoPointRZ(rLayer, line.zAtR(rLayer));
71  } else {
72  auto layerZ = layer2.position().z();
73  return PixelRecoPointRZ(line.rAtZ(layerZ), layerZ);
74  }
75  };
76 
77  theMultScattCorrRPhi = 3.f * sigmaRPhi(pt, line.cotLine(), point2(), layer2.seqNum());
78 }
virtual float length() const =0
const Bounds & bounds() const
Definition: Surface.h:89
MultipleScatteringParametrisation sigmaRPhi
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
int seqNum() const
Definition: DetLayer.h:35
T z() const
Definition: PV3DBase.h:61
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
bool isBarrel() const
Definition: DetLayer.h:31
virtual const BoundDisk & specificSurface() const final
virtual const Surface::PositionType & position() const
Returns position of the surface.
void init(const edm::EventSetup &es, float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, bool useBendingCorrection)
void ThirdHitCorrection::init ( const edm::EventSetup es,
float  pt,
const DetLayer layer3,
bool  useMultipleScattering,
bool  useBendingCorrection 
)

Definition at line 17 of file ThirdHitCorrection.cc.

References DetLayer::isBarrel(), DiDispStaMuonMonitor_cfi::pt, HLT_2018_cff::useBendingCorrection, and HLT_2018_cff::useMultipleScattering.

21  {
26 
28  theMScoeff = 0;
29 
30  theBarrel = layer3.isBarrel();
31  thePt = pt;
32 
34  sigmaRPhi.init(&layer3, es);
35 }
MultipleScatteringParametrisation sigmaRPhi
pixelrecoutilities::LongitudinalBendingCorrection theBendingCorrection
bool isBarrel() const
Definition: DetLayer.h:31
void init(const DetLayer *layer, const edm::EventSetup &iSetup, X0Source x0source=useX0AtEta)
void ThirdHitCorrection::init ( const PixelRecoLineRZ line,
const PixelRecoPointRZ constraint,
int  ol 
)

Definition at line 80 of file ThirdHitCorrection.cc.

References funct::abs(), HLT_2018_cff::constraint, PixelRecoLineRZ::cotLine(), MillePedeFileConverter_cfg::e, f, mps_splice::line, funct::sqr(), mathSSE::sqrt(), and crabWrapper::theLine.

80  {
81  theLine = line;
83  return;
84 
85  // auto newCorr = theMultScattCorrRPhi;
87  // std::cout << "ThirdHitCorr " << (theBarrel ? "B " : "F " )<< theMultScattCorrRPhi << ' ' << newCorr << ' ' << newCorr/theMultScattCorrRPhi << std::endl;
88  float overSinTheta = std::sqrt(1.f + sqr(line.cotLine()));
89  if (theBarrel) {
90  theMScoeff = theMultScattCorrRPhi * overSinTheta;
91  } else {
92  float overCosTheta = std::abs(line.cotLine()) < 1.e-4f ? 1.e4f : overSinTheta / std::abs(line.cotLine());
93  theMScoeff = theMultScattCorrRPhi * overCosTheta;
94  }
95 }
MultipleScatteringParametrisation sigmaRPhi
PixelRecoLineRZ theLine
float cotLine() const
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
Square< F >::type sqr(const F &f)
Definition: Square.h:14

Member Data Documentation

MultipleScatteringParametrisation ThirdHitCorrection::sigmaRPhi
private

Definition at line 69 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theBarrel
private

Definition at line 58 of file ThirdHitCorrection.h.

pixelrecoutilities::LongitudinalBendingCorrection ThirdHitCorrection::theBendingCorrection
private

Definition at line 68 of file ThirdHitCorrection.h.

PixelRecoLineRZ ThirdHitCorrection::theLine
private

Definition at line 63 of file ThirdHitCorrection.h.

float ThirdHitCorrection::theMScoeff = 0
private

Definition at line 65 of file ThirdHitCorrection.h.

float ThirdHitCorrection::theMultScattCorrRPhi = 0
private

Definition at line 64 of file ThirdHitCorrection.h.

float ThirdHitCorrection::thePt
private

Definition at line 66 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theUseBendingCorrection
private

Definition at line 61 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theUseMultipleScattering
private

Definition at line 60 of file ThirdHitCorrection.h.