CMS 3D CMS Logo

Public Member Functions | Private Member Functions | Private Attributes

reco::PositiveSideGhostTrackFitter Class Reference

#include <PositiveSideGhostTrackFitter.h>

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

List of all members.

Public Member Functions

GhostTrackPrediction fit (const GhostTrackFitter::PredictionUpdater &updater, const GhostTrackPrediction &prior, std::vector< GhostTrackState > &states, double &ndof, double &chi2)
 PositiveSideGhostTrackFitter (const GlobalPoint &origin, const GhostTrackFitter::FitterImpl &actualFitter)
 PositiveSideGhostTrackFitter (const PositiveSideGhostTrackFitter &orig)
 ~PositiveSideGhostTrackFitter ()

Private Member Functions

virtual FitterImpl * clone () const

Private Attributes

std::auto_ptr
< GhostTrackFitter::FitterImpl
actualFitter_
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().

                                                                        :
                origin_(origin), actualFitter_(actualFitter.clone()) {}
reco::PositiveSideGhostTrackFitter::~PositiveSideGhostTrackFitter ( ) [inline]

Definition at line 22 of file PositiveSideGhostTrackFitter.h.

{}
reco::PositiveSideGhostTrackFitter::PositiveSideGhostTrackFitter ( const PositiveSideGhostTrackFitter orig) [inline]

Definition at line 24 of file PositiveSideGhostTrackFitter.h.

                                                                          :
                origin_(orig.origin_),
                actualFitter_(orig.actualFitter_->clone()) {}

Member Function Documentation

virtual FitterImpl* reco::PositiveSideGhostTrackFitter::clone ( void  ) const [inline, private, virtual]
GhostTrackPrediction PositiveSideGhostTrackFitter::fit ( const GhostTrackFitter::PredictionUpdater updater,
const GhostTrackPrediction prior,
std::vector< GhostTrackState > &  states,
double &  ndof,
double &  chi2 
) [virtual]

Implements reco::GhostTrackFitter::FitterImpl.

Definition at line 14 of file PositiveSideGhostTrackFitter.cc.

References actualFitter_, reco::GhostTrackFitter::PredictionUpdater::contribution(), run_regression::done, funct::exp(), i, reco::GhostTrackState::lambda(), reco::GhostTrackPrediction::lambda(), reco::GhostTrackState::linearize(), min, origin_, reco::GhostTrackPrediction::rho(), rho, reco::GhostTrackState::setWeight(), evf::utils::state, CommonMethods::weight(), and reco::GhostTrackState::weight().

{
        double rho = prior.rho();
        for(unsigned int i = 0; i < states.size(); i++) {
                GhostTrackState &state = states[i];
                state.linearize(prior, true, .5 / rho);
        }

        GhostTrackPrediction pred =
                        actualFitter_->fit(updater, prior, states, ndof, chi2);

        double origin = pred.lambda(origin_);
        bool done = true;
        for(unsigned int i = 0; i < states.size(); i++) {
                GhostTrackState &state = states[i];
                double lambda = state.lambda();
                if (lambda < origin && (origin - lambda) < 3.5) {
                        GhostTrackState testState = state;
                        testState.linearize(pred, 2. * origin - lambda);
                        double ndof, chi2;

                        updater.contribution(prior, testState, ndof, chi2, true);
                        if (ndof > 0. && chi2 < 10.) {
                                state = testState;
                                if (state.weight() != 1.)
                                        state.setWeight(3.);
                                done = false;
                        }
                }
        }

        if (!done) {
                for(unsigned int i = 0; i < states.size(); i++) {
                        GhostTrackState &state = states[i];
                        double lambda = state.lambda();
                        if (state.weight() != 1. && lambda < origin) {
                                double weight =
                                        std::exp(10. * (origin - lambda) - .1);
                                state.setWeight(
                                        std::min(state.weight(), weight));
                        }
                }

                pred = actualFitter_->fit(updater, prior, states, ndof, chi2);
        }

        return pred;
}

Member Data Documentation

Definition at line 40 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().

Definition at line 39 of file PositiveSideGhostTrackFitter.h.

Referenced by fit().