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().

20  :
21  origin_(origin), actualFitter_(actualFitter.clone()) {}
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_
reco::PositiveSideGhostTrackFitter::~PositiveSideGhostTrackFitter ( )
inlineoverride

Definition at line 22 of file PositiveSideGhostTrackFitter.h.

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

Definition at line 24 of file PositiveSideGhostTrackFitter.h.

References vertices_cff::chi2, fit(), ndof, and fftjetcommon_cfi::prior.

25  :
26  origin_(orig.origin_),
27  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 36 of file PositiveSideGhostTrackFitter.h.

References PositiveSideGhostTrackFitter().

37  { 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_, vertices_cff::chi2, reco::GhostTrackFitter::PredictionUpdater::contribution(), 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().

20 {
21  double rho = prior.rho();
22  for(unsigned int i = 0; i < states.size(); i++) {
23  GhostTrackState &state = states[i];
24  state.linearize(prior, true, .5 / rho);
25  }
26 
28  actualFitter_->fit(updater, prior, states, ndof, chi2);
29 
30  double origin = pred.lambda(origin_);
31  bool done = true;
32  for(unsigned int i = 0; i < states.size(); i++) {
33  GhostTrackState &state = states[i];
34  double lambda = state.lambda();
35  if (lambda < origin && (origin - lambda) < 3.5) {
36  GhostTrackState testState = state;
37  testState.linearize(pred, 2. * origin - lambda);
38  double ndof, chi2;
39 
40  if (testState.isValid()) {
41  updater.contribution(prior, testState, ndof, chi2, true);
42  if (ndof > 0. && chi2 < 10.) {
43  state = testState;
44  if (state.weight() != 1.)
45  state.setWeight(3.);
46  done = false;
47  }
48  } else {
49  edm::LogError("InvalidGhostTrackState") << "Invalid GhostTrackState encountered!";
50  }
51  }
52  }
53 
54  if (!done) {
55  for(unsigned int i = 0; i < states.size(); i++) {
56  GhostTrackState &state = states[i];
57  double lambda = state.lambda();
58  if (state.weight() != 1. && lambda < origin) {
59  double weight =
60  std::exp(10. * (origin - lambda) - .1);
61  state.setWeight(
62  std::min(state.weight(), weight));
63  }
64  }
65 
66  pred = actualFitter_->fit(updater, prior, states, ndof, chi2);
67  }
68 
69  return pred;
70 }
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 40 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().

GlobalPoint reco::PositiveSideGhostTrackFitter::origin_
private

Definition at line 39 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().