CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

Definition at line 19 of file ThirdHitCorrection.h.

19 {}
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 init().

48  {
49  init(es, pt, *layer, useMultipleScattering, useBendingCorrection);
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.

References theMultScattCorrRPhi.

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

Definition at line 106 of file ThirdHitCorrection.cc.

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

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

Referenced by ThirdHitCorrection().

47  {
48 
49  init(es,pt,layer3, useMultipleScattering, useBendingCorrection);
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 }
virtual const BoundSurface & surface() const =0
The surface of the GeometricSearchDet.
virtual float length() const =0
const Bounds & bounds() const
Definition: Surface.h:120
MultipleScatteringParametrisation sigmaRPhi
int seqNum() const
Definition: DetLayer.h:36
T z() const
Definition: PV3DBase.h:64
bool isBarrel() const
Definition: DetLayer.h:32
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
void init(const edm::EventSetup &es, float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, bool useBendingCorrection)
virtual const BoundDisk & specificSurface() const final
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(), and EnergyCorrector::pt.

22  {
23 
24  theUseMultipleScattering = useMultipleScattering;
25  theUseBendingCorrection = useBendingCorrection;
26  if (useBendingCorrection) theBendingCorrection.init(pt,es);
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 84 of file ThirdHitCorrection.cc.

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

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

Referenced by correctRPhiRange().

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.