15 iConfig.getParameter<bool>(
"useHitsSplitting")),
21 std::string constraint_str = iConfig.
getParameter<std::string>(
"constraint" );
30 edm::LogError(
"TrackRefitter")<<
"constraint: "<<constraint_str<<
" not understood. Set it to 'momentum', 'vertex', 'trackParameters' or leave it empty";
31 throw cms::Exception(
"TrackRefitter") <<
"unknown type of contraint! Set it to 'momentum', 'vertex', 'trackParameters' or leave it empty";
35 produces<reco::TrackCollection>().setBranchAlias(
alias_ +
"Tracks" );
36 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras" );
37 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits" );
38 produces<std::vector<Trajectory> >() ;
39 produces<TrajTrackAssociationCollection>();
45 LogDebug(
"TrackRefitter") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
52 std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(
new std::vector<Trajectory>);
63 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
76 edm::LogError(
"TrackRefitter")<<
"could not get the reco::TrackCollection.";
break;}
77 LogDebug(
"TrackRefitter") <<
"run the algorithm" <<
"\n";
82 theBuilder.
product(), bs, algoResults);
83 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
94 bs = *recoBeamSpotHandle;
98 LogDebug(
"TrackRefitter") <<
"run the algorithm" <<
"\n";
102 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
111 bs = *recoBeamSpotHandle;
113 edm::LogError(
"TrackRefitter")<<
"could not get TrackVtxConstraintAssociationCollection product.";
break;}
114 LogDebug(
"TrackRefitter") <<
"run the algorithm" <<
"\n";
118 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
126 bs = *recoBeamSpotHandle;
130 LogDebug(
"TrackRefitter") <<
"run the algorithm" <<
"\n";
134 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
141 putInEvt(theEvent, thePropagator.
product(), theMeasTk.
product(), outputRHColl, outputTColl, outputTEColl, outputTrajectoryColl, algoResults);
142 LogDebug(
"TrackRefitter") <<
"end" <<
"\n";
T getParameter(std::string const &) const
virtual void produce(edm::Event &, const edm::EventSetup &)
Implementation of produce method.
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
std::vector< Track > TrackCollection
collection of Tracks
void setAlias(std::string alias)
set the aliases of produced collections
TrackProducerAlgorithm< reco::Track > theAlgo
void runWithMomentum(const TrackingGeometry *, const MagneticField *, const TrackMomConstraintAssociationCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
Run the Final Fit taking TrackMomConstraintAssociation as input (Refitter with momentum constraint) ...
void setConf(edm::ParameterSet conf)
Set parameter set.
edm::InputTag trkconstrcoll_
std::vector< AlgoProduct > AlgoProductCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
void setSrc(edm::InputTag src, edm::InputTag bsSrc)
set label of source collection
void runWithVertex(const TrackingGeometry *, const MagneticField *, const VtxConstraintAssociationCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
T const * product() const
void runWithTrackParameters(const TrackingGeometry *, const MagneticField *, const TrackParamConstraintAssociationCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::TrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &)
Put produced collections in the event.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
virtual void getFromES(const edm::EventSetup &, edm::ESHandle< TrackerGeometry > &, edm::ESHandle< MagneticField > &, edm::ESHandle< TrajectoryFitter > &, edm::ESHandle< Propagator > &, edm::ESHandle< MeasurementTracker > &, edm::ESHandle< TransientTrackingRecHitBuilder > &)
Get needed services from the Event Setup.
void runWithTrack(const TrackingGeometry *, const MagneticField *, const TrackCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
Run the Final Fit taking Tracks as input (for Refitter)
TrackRefitter(const edm::ParameterSet &iConfig)
Constructor.