20 iConfig.getParameter<bool>(
"useHitsSplitting")),
27 if (constraint_str.empty())
30 else if (constraint_str ==
"vertex") {
35 edm::LogError(
"GsfTrackRefitter") <<
"constraint: " << constraint_str
36 <<
" not understood. Set it to 'momentum', 'vertex' or leave it empty";
38 <<
"unknown type of contraint! Set it to 'momentum', 'vertex' or leave it empty";
42 produces<reco::GsfTrackCollection>().setBranchAlias(
alias_ +
"GsfTracks");
43 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras");
44 produces<reco::GsfTrackExtraCollection>().setBranchAlias(
alias_ +
"GsfTrackExtras");
45 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits");
46 produces<std::vector<Trajectory>>();
47 produces<TrajGsfTrackAssociationCollection>();
53 edm::LogInfo(
"GsfTrackRefitter") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
61 std::unique_ptr<std::vector<Trajectory>> outputTrajectoryColl(
new std::vector<Trajectory>);
73 getFromES(setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
87 edm::LogError(
"GsfTrackRefitter") <<
"could not get the reco::GsfTrackCollection.";
90 LogDebug(
"GsfTrackRefitter") <<
"run the algorithm"
102 edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack."
114 bs = *recoBeamSpotHandle;
116 edm::LogError(
"TrackRefitter") <<
"could not get TrackVtxConstraintAssociationCollection product.";
119 LogDebug(
"TrackRefitter") <<
"run the algorithm"
124 *theTCollectionWithConstraint,
131 edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack."
148 outputTrajectoryColl,
153 LogDebug(
"GsfTrackRefitter") <<
"end"
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
void initTrackProducerBase(const edm::ParameterSet &conf, edm::ConsumesCollector cc, const edm::EDGetToken &src)
Call this method in inheriting class' constructor.
Log< level::Error, false > LogError
void setAlias(std::string alias)
set the aliases of produced collections
GsfTrackRefitter(const edm::ParameterSet &iConfig)
Constructor.
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
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.
Log< level::Info, false > LogInfo
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
T const * product() const
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
TrackProducerAlgorithm< reco::GsfTrack > theAlgo
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::EDGetTokenT< GsfTrackVtxConstraintAssociationCollection > 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.