CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 (float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, const MultipleScatteringParametrisationMaker *msmaker, bool useBendingCorrection, const MagneticField *bfield)
 
void init (float pt, const DetLayer &layer3, bool useMultipleScattering, const MultipleScatteringParametrisationMaker *msmaker, bool useBendingCorrection, const MagneticField *bfield)
 
void init (const PixelRecoLineRZ &line, const PixelRecoPointRZ &constraint, int ol)
 
 ThirdHitCorrection ()
 
 ThirdHitCorrection (float pt, const DetLayer *layer, const PixelRecoLineRZ &line, const PixelRecoPointRZ &constraint, int ol, bool useMultipleScattering, const MultipleScatteringParametrisationMaker *msmaker, bool useBendingCorrection, const MagneticField *bfield)
 

Private Attributes

std::optional
< 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 17 of file ThirdHitCorrection.h.

Member Typedef Documentation

Definition at line 19 of file ThirdHitCorrection.h.

Constructor & Destructor Documentation

ThirdHitCorrection::ThirdHitCorrection ( )
inline

Definition at line 21 of file ThirdHitCorrection.h.

21 {}
ThirdHitCorrection::ThirdHitCorrection ( float  pt,
const DetLayer layer,
const PixelRecoLineRZ line,
const PixelRecoPointRZ constraint,
int  ol,
bool  useMultipleScattering,
const MultipleScatteringParametrisationMaker msmaker,
bool  useBendingCorrection,
const MagneticField bfield 
)
inline

Definition at line 39 of file ThirdHitCorrection.h.

References init().

47  {
48  init(pt, *layer, useMultipleScattering, msmaker, useBendingCorrection, bfield);
49  init(line, constraint, ol);
50  }
void init(float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, const MultipleScatteringParametrisationMaker *msmaker, bool useBendingCorrection, const MagneticField *bfield)
tuple useBendingCorrection

Member Function Documentation

void ThirdHitCorrection::correctRPhiRange ( Range range) const
inline

Definition at line 54 of file ThirdHitCorrection.h.

References theMultScattCorrRPhi.

54  {
55  range.first -= theMultScattCorrRPhi;
56  range.second += theMultScattCorrRPhi;
57  }
const uint16_t range(const Frame &aFrame)
void ThirdHitCorrection::correctRZRange ( Range range) const

Definition at line 101 of file ThirdHitCorrection.cc.

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

101  {
102  range.first -= theMScoeff;
103  range.second += theMScoeff;
104 
106  if (theBarrel) {
107  float cotTheta = theLine.cotLine();
108  if (cotTheta > 0) {
109  float radius = theLine.rAtZ(range.max());
110  float corr = theBendingCorrection(radius) * cotTheta;
111  range.second += corr;
112  } else {
113  float radius = theLine.rAtZ(range.min());
114  float corr = theBendingCorrection(radius) * std::abs(cotTheta);
115  range.first -= corr;
116  }
117  } else {
118  float radius = range.max();
119  float corr = theBendingCorrection(radius);
120  range.first -= corr;
121  }
122  }
123 }
const uint16_t range(const Frame &aFrame)
PixelRecoLineRZ theLine
float cotLine() const
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
pixelrecoutilities::LongitudinalBendingCorrection theBendingCorrection
float rAtZ(float z) const
void ThirdHitCorrection::init ( float  pt,
const DetLayer layer1,
const DetLayer layer2,
const DetLayer layer3,
bool  useMultipleScattering,
const MultipleScatteringParametrisationMaker msmaker,
bool  useBendingCorrection,
const MagneticField bfield 
)

Definition at line 40 of file ThirdHitCorrection.cc.

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

Referenced by ThirdHitCorrection().

47  {
48  init(pt, layer3, useMultipleScattering, msmaker, useBendingCorrection, bfield);
49 
51  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:87
int seqNum() const
Definition: DetLayer.h:35
T z() const
Definition: PV3DBase.h:61
void init(float pt, const DetLayer &layer1, const DetLayer &layer2, const DetLayer &layer3, bool useMultipleScattering, const MultipleScatteringParametrisationMaker *msmaker, bool useBendingCorrection, const MagneticField *bfield)
bool isBarrel() const
Definition: DetLayer.h:31
tuple useBendingCorrection
virtual const Surface::PositionType & position() const
Returns position of the surface.
virtual const BoundCylinder & specificSurface() const final
Extension of the interface.
virtual const BoundDisk & specificSurface() const final
void ThirdHitCorrection::init ( float  pt,
const DetLayer layer3,
bool  useMultipleScattering,
const MultipleScatteringParametrisationMaker msmaker,
bool  useBendingCorrection,
const MagneticField bfield 
)

Definition at line 18 of file ThirdHitCorrection.cc.

References DetLayer::isBarrel(), MultipleScatteringParametrisationMaker::parametrisation(), DiDispStaMuonMonitor_cfi::pt, HLT_FULL_cff::useBendingCorrection, and globalTrackingRegionWithVertices_cff::useMultipleScattering.

23  {
27  theBendingCorrection.init(pt, *bfield);
28  }
29 
31  theMScoeff = 0;
32 
33  theBarrel = layer3.isBarrel();
34  thePt = pt;
35 
37  sigmaRPhi = msmaker->parametrisation(&layer3);
38 }
std::optional< MultipleScatteringParametrisation > sigmaRPhi
MultipleScatteringParametrisation parametrisation(const DetLayer *layer, X0Source x0Source=X0Source::useX0AtEta) const
pixelrecoutilities::LongitudinalBendingCorrection theBendingCorrection
bool isBarrel() const
Definition: DetLayer.h:31
tuple useBendingCorrection
void ThirdHitCorrection::init ( const PixelRecoLineRZ line,
const PixelRecoPointRZ constraint,
int  ol 
)

Definition at line 84 of file ThirdHitCorrection.cc.

References funct::abs(), HLT_FULL_cff::constraint, PixelRecoLineRZ::cotLine(), alignCSCRings::e, validate-o2o-wbm::f, geometryCSVtoXML::line, sqr(), mathSSE::sqrt(), and crabWrapper::theLine.

84  {
85  theLine = line;
87  return;
88 
89  // auto newCorr = theMultScattCorrRPhi;
90  theMultScattCorrRPhi = 3.f * (*sigmaRPhi)(thePt, line.cotLine(), constraint, il);
91  // std::cout << "ThirdHitCorr " << (theBarrel ? "B " : "F " )<< theMultScattCorrRPhi << ' ' << newCorr << ' ' << newCorr/theMultScattCorrRPhi << std::endl;
92  float overSinTheta = std::sqrt(1.f + sqr(line.cotLine()));
93  if (theBarrel) {
94  theMScoeff = theMultScattCorrRPhi * overSinTheta;
95  } else {
96  float overCosTheta = std::abs(line.cotLine()) < 1.e-4f ? 1.e4f : overSinTheta / std::abs(line.cotLine());
97  theMScoeff = theMultScattCorrRPhi * overCosTheta;
98  }
99 }
int sqr(const T &t)
PixelRecoLineRZ theLine
float cotLine() const
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

std::optional<MultipleScatteringParametrisation> ThirdHitCorrection::sigmaRPhi
private

Definition at line 73 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theBarrel
private

Definition at line 62 of file ThirdHitCorrection.h.

pixelrecoutilities::LongitudinalBendingCorrection ThirdHitCorrection::theBendingCorrection
private

Definition at line 72 of file ThirdHitCorrection.h.

PixelRecoLineRZ ThirdHitCorrection::theLine
private

Definition at line 67 of file ThirdHitCorrection.h.

float ThirdHitCorrection::theMScoeff = 0
private

Definition at line 69 of file ThirdHitCorrection.h.

float ThirdHitCorrection::theMultScattCorrRPhi = 0
private

Definition at line 68 of file ThirdHitCorrection.h.

Referenced by correctRPhiRange().

float ThirdHitCorrection::thePt
private

Definition at line 70 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theUseBendingCorrection
private

Definition at line 65 of file ThirdHitCorrection.h.

bool ThirdHitCorrection::theUseMultipleScattering
private

Definition at line 64 of file ThirdHitCorrection.h.