CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
PixelNtupletsFitter Class Referencefinal

#include <PixelNtupletsFitter.h>

Inheritance diagram for PixelNtupletsFitter:
PixelFitterBase

Public Member Functions

 PixelNtupletsFitter (float nominalB, const MagneticField *field, bool useRiemannFit)
 
std::unique_ptr< reco::Trackrun (const std::vector< const TrackingRecHit * > &hits, const TrackingRegion &region, const edm::EventSetup &setup) const override
 
 ~PixelNtupletsFitter () override=default
 
- Public Member Functions inherited from PixelFitterBase
virtual ~PixelFitterBase ()
 

Private Attributes

const MagneticFieldfield_
 
float nominalB_
 
bool useRiemannFit_
 

Detailed Description

Definition at line 13 of file PixelNtupletsFitter.h.

Constructor & Destructor Documentation

◆ PixelNtupletsFitter()

PixelNtupletsFitter::PixelNtupletsFitter ( float  nominalB,
const MagneticField field,
bool  useRiemannFit 
)
explicit

Definition at line 23 of file PixelNtupletsFitter.cc.

24  : nominalB_(nominalB), field_(field), useRiemannFit_(useRiemannFit) {}

◆ ~PixelNtupletsFitter()

PixelNtupletsFitter::~PixelNtupletsFitter ( )
overridedefault

Member Function Documentation

◆ run()

std::unique_ptr< reco::Track > PixelNtupletsFitter::run ( const std::vector< const TrackingRecHit * > &  hits,
const TrackingRegion region,
const edm::EventSetup setup 
) const
overridevirtual

Implements PixelFitterBase.

Definition at line 26 of file PixelNtupletsFitter.cc.

28  {
29  using namespace riemannFit;
30 
31  std::unique_ptr<reco::Track> ret;
32 
33  unsigned int nhits = hits.size();
34 
35  if (nhits < 2)
36  return ret;
37 
41 
42  for (unsigned int i = 0; i != nhits; ++i) {
43  auto const& recHit = hits[i];
44  points[i] = GlobalPoint(recHit->globalPosition().basicVector() - region.origin().basicVector());
45  errors[i] = recHit->globalPositionError();
46  isBarrel[i] = recHit->detUnit()->type().isBarrel();
47  }
48 
49  assert(nhits == 4);
51 
52  Eigen::Matrix<float, 6, 4> hits_ge = Eigen::Matrix<float, 6, 4>::Zero();
53 
54  for (unsigned int i = 0; i < nhits; ++i) {
55  hits_gp.col(i) << points[i].x(), points[i].y(), points[i].z();
56 
57  hits_ge.col(i) << errors[i].cxx(), errors[i].cyx(), errors[i].cyy(), errors[i].czx(), errors[i].czy(),
58  errors[i].czz();
59  }
60 
61  HelixFit fittedTrack = useRiemannFit_ ? riemannFit::helixFit(hits_gp, hits_ge, nominalB_, true)
62  : brokenline::helixFit(hits_gp, hits_ge, nominalB_);
63 
64  int iCharge = fittedTrack.qCharge;
65 
66  // parameters are:
67  // 0: phi
68  // 1: tip
69  // 2: curvature
70  // 3: cottheta
71  // 4: zip
72  float valPhi = fittedTrack.par(0);
73 
74  float valTip = fittedTrack.par(1);
75 
76  float valCotTheta = fittedTrack.par(3);
77 
78  float valZip = fittedTrack.par(4);
79  float valPt = fittedTrack.par(2);
80  //
81  // PixelTrackErrorParam param(valEta, valPt);
82  float errValPhi = std::sqrt(fittedTrack.cov(0, 0));
83  float errValTip = std::sqrt(fittedTrack.cov(1, 1));
84 
85  float errValPt = std::sqrt(fittedTrack.cov(2, 2));
86 
87  float errValCotTheta = std::sqrt(fittedTrack.cov(3, 3));
88  float errValZip = std::sqrt(fittedTrack.cov(4, 4));
89 
90  float chi2 = fittedTrack.chi2_line + fittedTrack.chi2_circle;
91 
92  PixelTrackBuilder builder;
93  Measurement1D phi(valPhi, errValPhi);
94  Measurement1D tip(valTip, errValTip);
95 
96  Measurement1D pt(valPt, errValPt);
97  Measurement1D cotTheta(valCotTheta, errValCotTheta);
98  Measurement1D zip(valZip, errValZip);
99 
100  ret.reset(builder.build(pt, phi, cotTheta, tip, zip, chi2, iCharge, hits, field_, region.origin()));
101  return ret;
102 }

References cms::cuda::assert(), PixelTrackBuilder::build(), hltPixelTracks_cff::chi2, riemannFit::HelixFit::chi2_circle, riemannFit::HelixFit::chi2_line, riemannFit::HelixFit::cov, declareDynArray, field_, brokenline::helixFit(), riemannFit::helixFit(), hfClusterShapes_cfi::hits, mps_fire::i, PixelPluginsPhase0_cfi::isBarrel, nhits, nominalB_, riemannFit::HelixFit::par, phi, HLT_FULL_cff::points, DiDispStaMuonMonitor_cfi::pt, riemannFit::HelixFit::qCharge, rpcPointValidation_cfi::recHit, HLT_FULL_cff::region, runTheMatrix::ret, mathSSE::sqrt(), qcdUeDQM_cfi::tip, useRiemannFit_, and ComparisonHelper::zip().

Member Data Documentation

◆ field_

const MagneticField* PixelNtupletsFitter::field_
private

Definition at line 23 of file PixelNtupletsFitter.h.

Referenced by run().

◆ nominalB_

float PixelNtupletsFitter::nominalB_
private

Definition at line 22 of file PixelNtupletsFitter.h.

Referenced by run().

◆ useRiemannFit_

bool PixelNtupletsFitter::useRiemannFit_
private

Definition at line 24 of file PixelNtupletsFitter.h.

Referenced by run().

runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
Measurement1D
Definition: Measurement1D.h:11
mps_fire.i
i
Definition: mps_fire.py:428
PixelNtupletsFitter::nominalB_
float nominalB_
Definition: PixelNtupletsFitter.h:22
riemannFit::helixFit
HelixFit helixFit(const Matrix3xNd< N > &hits, const Eigen::Matrix< float, 6, N > &hits_ge, const double bField, const bool error)
Helix fit by three step: -fast pre-fit (see Fast_fit() for further info); -circle fit of hits proje...
Definition: RiemannFit.h:975
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21469
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
riemannFit::HelixFit::qCharge
int32_t qCharge
particle charge
Definition: FitResult.h:61
cms::cuda::assert
assert(be >=bs)
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
PixelNtupletsFitter::useRiemannFit_
bool useRiemannFit_
Definition: PixelNtupletsFitter.h:24
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
brokenline
Definition: BrokenLine.h:8
riemannFit::HelixFit::cov
Matrix5d cov
Definition: FitResult.h:50
errors
Definition: errors.py:1
PixelNtupletsFitter::field_
const MagneticField * field_
Definition: PixelNtupletsFitter.h:23
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
declareDynArray
#define declareDynArray(T, n, x)
Definition: DynArray.h:91
PixelTrackBuilder
Definition: PixelTrackBuilder.h:13
GlobalPoint
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
Point3DBase< float, GlobalTag >
nhits
Definition: HIMultiTrackSelector.h:42
riemannFit::HelixFit::chi2_line
float chi2_line
Definition: FitResult.h:59
qcdUeDQM_cfi.tip
tip
Definition: qcdUeDQM_cfi.py:23
PixelPluginsPhase0_cfi.isBarrel
isBarrel
Definition: PixelPluginsPhase0_cfi.py:17
riemannFit::Matrix3xNd
Eigen::Matrix< double, 3, N > Matrix3xNd
Definition: FitResult.h:24
riemannFit::HelixFit::chi2_circle
float chi2_circle
Definition: FitResult.h:58
HLT_FULL_cff.region
region
Definition: HLT_FULL_cff.py:88286
GlobalErrorBase< double, ErrorMatrixTag >
riemannFit::HelixFit::par
Vector5d par
(phi,Tip,pt,cotan(theta)),Zip)
Definition: FitResult.h:49
ComparisonHelper::zip
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
Definition: L1TStage2CaloLayer1.h:41
PixelTrackBuilder::build
reco::Track * build(const Measurement1D &pt, const Measurement1D &phi, const Measurement1D &cotTheta, const Measurement1D &tip, const Measurement1D &zip, float chi2, int charge, const std::vector< const TrackingRecHit * > &hits, const MagneticField *mf, const GlobalPoint &reference=GlobalPoint(0, 0, 0)) const
Definition: PixelTrackBuilder.cc:123
DDAxes::phi
riemannFit::HelixFit
Definition: FitResult.h:48
riemannFit
Definition: FitResult.h:11
brokenline::helixFit
riemannFit::HelixFit helixFit(const riemannFit::Matrix3xNd< n > &hits, const Eigen::Matrix< float, 6, 4 > &hits_ge, const double bField)
Helix fit by three step: -fast pre-fit (see Fast_fit() for further info); -circle fit of the hits pr...
Definition: BrokenLine.h:566