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 14 of file ThirdHitCorrection.h.

Member Typedef Documentation

Definition at line 17 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 40 of file ThirdHitCorrection.h.

References pfSecondaryVertexTagInfos_cfi::constraint, init, and geometryCSVtoXML::line.

48  {
50  init(line, constraint, ol);
51  }
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 58 of file ThirdHitCorrection.h.

58  {
59  range.first -= theMultScattCorrRPhi;
60  range.second += theMultScattCorrRPhi;
61  }
void ThirdHitCorrection::correctRZRange ( Range range) const

Definition at line 107 of file ThirdHitCorrection.cc.

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

108 {
109  range.first -= theMScoeff;
110  range.second += theMScoeff;
111 
112 
114  if (theBarrel) {
115  float cotTheta = theLine.cotLine();
116  if (cotTheta > 0) {
117  float radius = theLine.rAtZ(range.max());
118  float corr = theBendingCorrection(radius) * cotTheta;
119  range.second += corr;
120  } else {
121  float radius = theLine.rAtZ(range.min());
122  float corr = theBendingCorrection(radius) * std::abs(cotTheta);
123  range.first -= corr;
124  }
125  }
126  else {
127  float radius = range.max();
128  float corr = theBendingCorrection(radius);
129  range.first -= corr;
130  }
131  }
132 }
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 40 of file ThirdHitCorrection.cc.

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

47  {
48 
50 
51  if (!theUseMultipleScattering) return;
52 
53  auto point3 = [&]()->PixelRecoPointRZ {
54  if(theBarrel) {
55  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(layer3);
56  float rLayer = bl.specificSurface().radius();
57  auto zmax = 0.5f*layer3.surface().bounds().length();
58  return PixelRecoPointRZ(rLayer, zmax);
59  } else {
60  const ForwardDetLayer &fl = static_cast<const ForwardDetLayer&>(layer3);
61  auto maxR = fl.specificSurface().outerRadius();
62  auto layerZ = layer3.position().z();
63  return PixelRecoPointRZ(maxR, layerZ);
64  }
65  };
66 
67  PixelRecoPointRZ zero(0., 0.);
68  SimpleLineRZ line(zero,point3());
69 
70  auto point2 = [&]()->PixelRecoPointRZ {
71  if (layer2.isBarrel()) {
72  const BarrelDetLayer& bl = static_cast<const BarrelDetLayer&>(layer2);
73  float rLayer = bl.specificSurface().radius();
74  return PixelRecoPointRZ(rLayer, line.zAtR(rLayer));
75  } else {
76  auto layerZ = layer2.position().z();
77  return PixelRecoPointRZ(line.rAtZ(layerZ), layerZ);
78  }
79  };
80 
81  theMultScattCorrRPhi = 3.f*sigmaRPhi(pt, line.cotLine(), point2(), layer2.seqNum());
82 
83 }
virtual float length() const =0
const Bounds & bounds() const
Definition: Surface.h:120
MultipleScatteringParametrisation sigmaRPhi
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
int seqNum() const
Definition: DetLayer.h:36
T z() const
Definition: PV3DBase.h:64
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
bool isBarrel() const
Definition: DetLayer.h:32
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(), EnergyCorrector::pt, hiDetachedQuadStep_cff::useBendingCorrection, and hiDetachedQuadStep_cff::useMultipleScattering.

22  {
23 
27 
29  theMScoeff=0;
30 
31  theBarrel = layer3.isBarrel();
32  thePt = pt;
33 
34  if (theUseMultipleScattering) sigmaRPhi.init(&layer3,es);
35 }
MultipleScatteringParametrisation sigmaRPhi
pixelrecoutilities::LongitudinalBendingCorrection theBendingCorrection
bool isBarrel() const
Definition: DetLayer.h:32
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 85 of file ThirdHitCorrection.cc.

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

87  {
88 
89  theLine = line;
90  if (!theUseMultipleScattering) return;
91 
92  // auto newCorr = theMultScattCorrRPhi;
94  // std::cout << "ThirdHitCorr " << (theBarrel ? "B " : "F " )<< theMultScattCorrRPhi << ' ' << newCorr << ' ' << newCorr/theMultScattCorrRPhi << std::endl;
95  float overSinTheta = std::sqrt(1.f+sqr(line.cotLine()));
96  if (theBarrel) {
97  theMScoeff = theMultScattCorrRPhi*overSinTheta;
98  } else {
99  float overCosTheta = std::abs(line.cotLine()) < 1.e-4f ?
100  1.e4f : overSinTheta/std::abs(line.cotLine());
101  theMScoeff = theMultScattCorrRPhi*overCosTheta;
102  }
103 
104 }
MultipleScatteringParametrisation sigmaRPhi
PixelRecoLineRZ theLine
float cotLine() const
T sqrt(T t)
Definition: SSEVec.h:18
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:13

Member Data Documentation

MultipleScatteringParametrisation ThirdHitCorrection::sigmaRPhi
private

Definition at line 77 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theBarrel
private

Definition at line 66 of file ThirdHitCorrection.h.

pixelrecoutilities::LongitudinalBendingCorrection ThirdHitCorrection::theBendingCorrection
private

Definition at line 76 of file ThirdHitCorrection.h.

PixelRecoLineRZ ThirdHitCorrection::theLine
private

Definition at line 71 of file ThirdHitCorrection.h.

float ThirdHitCorrection::theMScoeff =0
private

Definition at line 73 of file ThirdHitCorrection.h.

float ThirdHitCorrection::theMultScattCorrRPhi =0
private

Definition at line 72 of file ThirdHitCorrection.h.

float ThirdHitCorrection::thePt
private

Definition at line 74 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theUseBendingCorrection
private

Definition at line 69 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theUseMultipleScattering
private

Definition at line 68 of file ThirdHitCorrection.h.