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.

19  : origin_(origin), actualFitter_(actualFitter.clone()) {}

Referenced by clone().

◆ ~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()) {}

Member Function Documentation

◆ clone()

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

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 32 of file PositiveSideGhostTrackFitter.h.

32 { return new PositiveSideGhostTrackFitter(*this); }

References PositiveSideGhostTrackFitter().

◆ 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.

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 }

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_, bookConverter::prior, reco::GhostTrackState::setWeight(), reco::GhostTrackState::weight(), and mps_merge::weight.

Referenced by trackingPlots.Iteration::modules().

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

reco::GhostTrackState::isValid
bool isValid() const
Definition: GhostTrackState.h:42
mps_fire.i
i
Definition: mps_fire.py:355
reco::PositiveSideGhostTrackFitter::PositiveSideGhostTrackFitter
PositiveSideGhostTrackFitter(const GlobalPoint &origin, const GhostTrackFitter::FitterImpl &actualFitter)
Definition: PositiveSideGhostTrackFitter.h:18
min
T min(T a, T b)
Definition: MathUtil.h:58
mps_merge.weight
weight
Definition: mps_merge.py:88
ZElectronSkim_cff.rho
rho
Definition: ZElectronSkim_cff.py:38
reco::GhostTrackState::setWeight
void setWeight(double weight)
Definition: GhostTrackState.h:64
reco::GhostTrackFitter::PredictionUpdater::contribution
virtual void contribution(const GhostTrackPrediction &pred, const GhostTrackState &state, double &ndof, double &chi2, bool withPredError=false) const =0
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
reco::GhostTrackState
Definition: GhostTrackState.h:21
ndof
Definition: HIMultiTrackSelector.h:49
reco::GhostTrackState::lambda
double lambda() const
Definition: GhostTrackState.h:40
fileCollector.done
done
Definition: fileCollector.py:123
edm::LogError
Definition: MessageLogger.h:183
reco::GhostTrackState::linearize
bool linearize(const GhostTrackPrediction &pred, bool initial=false, double lambda=0.)
Definition: GhostTrackState.h:47
reco::PositiveSideGhostTrackFitter::origin_
GlobalPoint origin_
Definition: PositiveSideGhostTrackFitter.h:34
reco::PositiveSideGhostTrackFitter::actualFitter_
std::unique_ptr< GhostTrackFitter::FitterImpl > actualFitter_
Definition: PositiveSideGhostTrackFitter.h:35
bookConverter.prior
prior
Definition: bookConverter.py:146
reco::GhostTrackPrediction
Definition: GhostTrackPrediction.h:21
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
reco::GhostTrackState::weight
double weight() const
Definition: GhostTrackState.h:63
weight
Definition: weight.py:1
reco::GhostTrackPrediction::lambda
double lambda(const GlobalPoint &point) const
Definition: GhostTrackPrediction.h:65