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

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_
reco::PositiveSideGhostTrackFitter::~PositiveSideGhostTrackFitter ( )
inlineoverride

Definition at line 20 of file PositiveSideGhostTrackFitter.h.

20 {}
reco::PositiveSideGhostTrackFitter::PositiveSideGhostTrackFitter ( const PositiveSideGhostTrackFitter orig)
inline

Definition at line 22 of file PositiveSideGhostTrackFitter.h.

References hltPixelTracks_cff::chi2, fit(), ndof, and bookConverter::prior.

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

Member Function Documentation

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)
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::GhostTrackState::lambda(), reco::GhostTrackPrediction::lambda(), reco::GhostTrackState::linearize(), min(), ndof, origin_, reco::GhostTrackPrediction::rho(), reco::GhostTrackState::setWeight(), reco::GhostTrackState::weight(), and mps_merge::weight.

Referenced by trackingPlots.Iteration::modules(), and PositiveSideGhostTrackFitter().

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 }
double lambda(const GlobalPoint &point) const
double weight() const
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_
Definition: weight.py:1
void setWeight(double weight)
T min(T a, T b)
Definition: MathUtil.h:58
double lambda() const
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
virtual void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const =0

Member Data Documentation

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

Definition at line 35 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().

GlobalPoint reco::PositiveSideGhostTrackFitter::origin_
private

Definition at line 34 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().