20 iConfig.getParameter<
bool>(
"useHitsSplitting")),
32 else if (constraint_str ==
"vertex") {
36 edm::LogError(
"GsfTrackRefitter")<<
"constraint: "<<constraint_str<<
" not understood. Set it to 'momentum', 'vertex' or leave it empty";
37 throw cms::Exception(
"GsfTrackRefitter") <<
"unknown type of contraint! Set it to 'momentum', 'vertex' or leave it empty";
41 produces<reco::GsfTrackCollection>().setBranchAlias(
alias_ +
"GsfTracks" );
42 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras" );
43 produces<reco::GsfTrackExtraCollection>().setBranchAlias(
alias_ +
"GsfTrackExtras" );
44 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits" );
45 produces<std::vector<Trajectory> >() ;
46 produces<TrajGsfTrackAssociationCollection>();
52 edm::LogInfo(
"GsfTrackRefitter") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
60 std::unique_ptr<std::vector<Trajectory> > outputTrajectoryColl(
new std::vector<Trajectory>);
72 getFromES(setup,theG,theMF,theFitter,thePropagator,theMeasTk,theBuilder);
88 edm::LogError(
"GsfTrackRefitter")<<
"could not get the reco::GsfTrackCollection.";
return;}
89 LogDebug(
"GsfTrackRefitter") <<
"run the algorithm" <<
"\n";
93 theBuilder.
product(), bs, algoResults);
94 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
103 bs = *recoBeamSpotHandle;
105 edm::LogError(
"TrackRefitter")<<
"could not get TrackVtxConstraintAssociationCollection product.";
break;}
106 LogDebug(
"TrackRefitter") <<
"run the algorithm" <<
"\n";
110 }
catch (
cms::Exception &
e){
edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack." <<
"\n" << e <<
"\n";
throw; }
117 outputRHColl, outputTColl, outputTEColl, outputGsfTEColl, outputTrajectoryColl, algoResults, theBuilder.
product(), bs, httopo.
product());
118 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)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::vector< GsfTrackExtra > GsfTrackExtraCollection
collection of GsfTrackExtra objects
def setup(process, global_tag, zero_tesla=False)
void setAlias(std::string alias)
set the aliases of produced collections
void setConf(const edm::ParameterSet &conf)
Set parameter set.
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
GsfTrackRefitter(const edm::ParameterSet &iConfig)
Constructor.
void runWithTrack(const TrackingGeometry *, const MagneticField *, const TrackView &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
Run the Final Fit taking Tracks as input (for Refitter)
void produce(edm::Event &, const edm::EventSetup &) override
Implementation of produce method.
std::vector< GsfTrack > GsfTrackCollection
collection of GsfTracks
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::unique_ptr< TrackingRecHitCollection > &, std::unique_ptr< reco::GsfTrackCollection > &, std::unique_ptr< reco::TrackExtraCollection > &, std::unique_ptr< reco::GsfTrackExtraCollection > &, std::unique_ptr< std::vector< Trajectory > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const reco::BeamSpot &, const TrackerTopology *ttopo)
Put produced collections in the event.
void setSrc(const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
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
std::vector< AlgoProduct > AlgoProductCollection
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
edm::EDGetTokenT< GsfTrackVtxConstraintAssociationCollection > gsfTrackVtxConstraintTag_
T const * product() const
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.