Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forward originalAlgo and algoMask in TrackRefitter #11112

Merged
merged 2 commits into from Sep 5, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 10 additions & 11 deletions RecoTracker/TrackProducer/interface/TrackProducerAlgorithm.h
Expand Up @@ -51,18 +51,17 @@ class TrackProducerAlgorithm {

/// Constructor
TrackProducerAlgorithm(const edm::ParameterSet& conf) :
conf_(conf),
algoName_(conf_.getParameter<std::string>( "AlgorithmName" )),
algo_(reco::TrackBase::algoByName(algoName_)),
algo_(reco::TrackBase::algoByName(conf.getParameter<std::string>("AlgorithmName"))),
originalAlgo_(reco::TrackBase::undefAlgorithm),
reMatchSplitHits_(false),
usePropagatorForPCA_(false)
{
geometricInnerState_ = (conf_.exists("GeometricInnerState") ?
conf_.getParameter<bool>( "GeometricInnerState" ) : true);
if (conf_.exists("reMatchSplitHits"))
reMatchSplitHits_=conf_.getParameter<bool>("reMatchSplitHits");
if (conf_.exists("usePropagatorForPCA"))
usePropagatorForPCA_ = conf_.getParameter<bool>("usePropagatorForPCA");
geometricInnerState_ = (conf.exists("GeometricInnerState") ?
conf.getParameter<bool>( "GeometricInnerState" ) : true);
if (conf.exists("reMatchSplitHits"))
reMatchSplitHits_=conf.getParameter<bool>("reMatchSplitHits");
if (conf.exists("usePropagatorForPCA"))
usePropagatorForPCA_ = conf.getParameter<bool>("usePropagatorForPCA");
}

/// Destructor
Expand Down Expand Up @@ -135,9 +134,9 @@ class TrackProducerAlgorithm {


private:
edm::ParameterSet conf_;
std::string algoName_;
reco::TrackBase::TrackAlgorithm algo_;
reco::TrackBase::TrackAlgorithm originalAlgo_;
reco::TrackBase::AlgoMask algoMask_;
bool reMatchSplitHits_;
bool geometricInnerState_;
bool usePropagatorForPCA_;
Expand Down
Expand Up @@ -171,6 +171,8 @@ TrackProducerAlgorithm<T>::runWithTrack(const TrackingGeometry * theG,

//set the algo_ member in order to propagate the old alog name
algo_=theT->algo();
originalAlgo_ = theT->originalAlgo();
algoMask_ = theT->algoMask();

//===== the hits are in the same order as they were in the track::extra.
FitterCloner fc(theFitter,builder);
Expand Down
4 changes: 4 additions & 0 deletions RecoTracker/TrackProducer/src/TrackProducerAlgorithm.cc
Expand Up @@ -211,6 +211,8 @@ std::cout << algo_ << ": " << hits.size() <<'|' <<theTraj->measurements().size(
tscbl.trackStateAtPCA().curvilinearError(),
algo_);

if(originalAlgo_ != reco::TrackBase::undefAlgorithm) theTrack->setOriginalAlgorithm(originalAlgo_);
if(algoMask_.any()) theTrack->setAlgoMask(algoMask_);
theTrack->setQualityMask(qualityMask);
theTrack->setNLoops(nLoops);

Expand Down Expand Up @@ -340,6 +342,8 @@ TrackProducerAlgorithm<reco::GsfTrack>::buildTrack (const TrajectoryFitter * the
// theTraj->lostHits(),//FIXME to be fixed in Trajectory.h
pos, mom, tscbl.trackStateAtPCA().charge(), tscbl.trackStateAtPCA().curvilinearError());
theTrack->setAlgorithm(algo_);
if(originalAlgo_ != reco::TrackBase::undefAlgorithm) theTrack->setOriginalAlgorithm(originalAlgo_);
if(algoMask_.any()) theTrack->setAlgoMask(algoMask_);

LogDebug("GsfTrackProducer") <<"track done\n";

Expand Down