CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::PositiveSideGhostTrackFitter Class Reference

#include <PositiveSideGhostTrackFitter.h>

Inheritance diagram for reco::PositiveSideGhostTrackFitter:
reco::GhostTrackFitter::FitterImpl

Public Member Functions

GhostTrackPrediction fit (const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &prior, std::vector< GhostTrackState > &states, double &ndof, double &chi2) override
 
 PositiveSideGhostTrackFitter (const GlobalPoint &origin, const GhostTrackFitter::FitterImpl &actualFitter)
 
 PositiveSideGhostTrackFitter (const PositiveSideGhostTrackFitter &orig)
 
 ~PositiveSideGhostTrackFitter () override
 
- Public Member Functions inherited from reco::GhostTrackFitter::FitterImpl
virtual ~FitterImpl ()
 

Private Member Functions

FitterImpl * clone () const override
 

Private Attributes

std::unique_ptr< GhostTrackFitter::FitterImplactualFitter_
 
GlobalPoint origin_
 

Detailed Description

Definition at line 16 of file PositiveSideGhostTrackFitter.h.

Constructor & Destructor Documentation

◆ PositiveSideGhostTrackFitter() [1/2]

reco::PositiveSideGhostTrackFitter::PositiveSideGhostTrackFitter ( const GlobalPoint origin,
const GhostTrackFitter::FitterImpl actualFitter 
)
inline

Definition at line 18 of file PositiveSideGhostTrackFitter.h.

Referenced by clone().

19  : origin_(origin), actualFitter_(actualFitter.clone()) {}
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_

◆ ~PositiveSideGhostTrackFitter()

reco::PositiveSideGhostTrackFitter::~PositiveSideGhostTrackFitter ( )
inlineoverride

Definition at line 20 of file PositiveSideGhostTrackFitter.h.

20 {}

◆ PositiveSideGhostTrackFitter() [2/2]

reco::PositiveSideGhostTrackFitter::PositiveSideGhostTrackFitter ( const PositiveSideGhostTrackFitter orig)
inline

Definition at line 22 of file PositiveSideGhostTrackFitter.h.

23  : origin_(orig.origin_), actualFitter_(orig.actualFitter_->clone()) {}
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_

Member Function Documentation

◆ clone()

FitterImpl* reco::PositiveSideGhostTrackFitter::clone ( void  ) const
inlineoverrideprivatevirtual

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 32 of file PositiveSideGhostTrackFitter.h.

References PositiveSideGhostTrackFitter().

32 { return new PositiveSideGhostTrackFitter(*this); }
PositiveSideGhostTrackFitter(const GlobalPoint &origin, const GhostTrackFitter::FitterImpl &actualFitter)

◆ fit()

GhostTrackPrediction PositiveSideGhostTrackFitter::fit ( const GhostTrackFitter::PredictionUpdater updater,
const GhostTrackPrediction prior,
std::vector< GhostTrackState > &  states,
double &  ndof,
double &  chi2 
)
overridevirtual

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 15 of file PositiveSideGhostTrackFitter.cc.

References actualFitter_, hltPixelTracks_cff::chi2, reco::GhostTrackFitter::PredictionUpdater::contribution(), fileCollector::done, JetChargeProducer_cfi::exp, mps_fire::i, reco::GhostTrackState::isValid(), reco::GhostTrackPrediction::lambda(), reco::GhostTrackState::linearize(), SiStripPI::min, ndof, origin_, bookConverter::prior, and mps_merge::weight.

Referenced by trackingPlots.Iteration::modules().

19  {
20  double rho = prior.rho();
21  for (unsigned int i = 0; i < states.size(); i++) {
22  GhostTrackState &state = states[i];
23  state.linearize(prior, true, .5 / rho);
24  }
25 
26  GhostTrackPrediction pred = actualFitter_->fit(updater, prior, states, ndof, chi2);
27 
28  double origin = pred.lambda(origin_);
29  bool done = true;
30  for (unsigned int i = 0; i < states.size(); i++) {
31  GhostTrackState &state = states[i];
32  double lambda = state.lambda();
33  if (lambda < origin && (origin - lambda) < 3.5) {
34  GhostTrackState testState = state;
35  testState.linearize(pred, 2. * origin - lambda);
36  double ndof, chi2;
37 
38  if (testState.isValid()) {
39  updater.contribution(prior, testState, ndof, chi2, true);
40  if (ndof > 0. && chi2 < 10.) {
41  state = testState;
42  if (state.weight() != 1.)
43  state.setWeight(3.);
44  done = false;
45  }
46  } else {
47  edm::LogError("InvalidGhostTrackState") << "Invalid GhostTrackState encountered!";
48  }
49  }
50  }
51 
52  if (!done) {
53  for (unsigned int i = 0; i < states.size(); i++) {
54  GhostTrackState &state = states[i];
55  double lambda = state.lambda();
56  if (state.weight() != 1. && lambda < origin) {
57  double weight = std::exp(10. * (origin - lambda) - .1);
58  state.setWeight(std::min(state.weight(), weight));
59  }
60  }
61 
62  pred = actualFitter_->fit(updater, prior, states, ndof, chi2);
63  }
64 
65  return pred;
66 }
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_
Definition: weight.py:1
Log< level::Error, false > LogError
virtual void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const =0
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
double lambda(const GlobalPoint &point) const

Member Data Documentation

◆ actualFitter_

std::unique_ptr<GhostTrackFitter::FitterImpl> reco::PositiveSideGhostTrackFitter::actualFitter_
private

Definition at line 35 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().

◆ origin_

GlobalPoint reco::PositiveSideGhostTrackFitter::origin_
private

Definition at line 34 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().