17 iConfig.getParameter<bool>(
"useHitsSplitting")),
27 else if (constraint_str ==
"vertex") {
31 edm::LogError(
"GsfTrackRefitter")<<
"constraint: "<<constraint_str<<
" not understood. Set it to 'momentum', 'vertex' or leave it empty";
32 throw cms::Exception(
"GsfTrackRefitter") <<
"unknown type of contraint! Set it to 'momentum', 'vertex' or leave it empty";
36 produces<reco::GsfTrackCollection>().setBranchAlias(
alias_ +
"GsfTracks" );
37 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras" );
38 produces<reco::GsfTrackExtraCollection>().setBranchAlias(
alias_ +
"GsfTrackExtras" );
39 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits" );
40 produces<std::vector<Trajectory> >() ;
41 produces<TrajGsfTrackAssociationCollection>();
47 edm::LogInfo(
"GsfTrackRefitter") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
55 std::auto_ptr<std::vector<Trajectory> > outputTrajectoryColl(
new std::vector<Trajectory>);
67 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
80 edm::LogError(
"GsfTrackRefitter")<<
"could not get the reco::GsfTrackCollection.";
return;}
81 LogDebug(
"GsfTrackRefitter") <<
"run the algorithm" <<
"\n";
85 theBuilder.
product(), bs, algoResults);
86 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
95 bs = *recoBeamSpotHandle;
97 edm::LogError(
"TrackRefitter")<<
"could not get TrackVtxConstraintAssociationCollection product.";
break;}
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; }
109 outputRHColl, outputTColl, outputTEColl, outputGsfTEColl, outputTrajectoryColl, algoResults, bs);
110 LogDebug(
"GsfTrackRefitter") <<
"end" <<
"\n";
T getParameter(std::string const &) const
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
void setSrc(const edm::InputTag &src, const edm::InputTag &bsSrc)
set label of source collection
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
void setAlias(std::string alias)
set the aliases of produced collections
void setConf(const edm::ParameterSet &conf)
Set parameter set.
GsfTrackRefitter(const edm::ParameterSet &iConfig)
Constructor.
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::auto_ptr< TrackingRecHitCollection > &, std::auto_ptr< reco::GsfTrackCollection > &, std::auto_ptr< reco::TrackExtraCollection > &, std::auto_ptr< reco::GsfTrackExtraCollection > &, std::auto_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, const reco::BeamSpot &)
Put produced collections in the event.
virtual void produce(edm::Event &, const edm::EventSetup &) override
Implementation of produce method.
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
std::vector< AlgoProduct > AlgoProductCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
edm::InputTag gsfTrackVtxConstraintTag_
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)