|
|
#include <TrackRefitter.h>
|
void | produce (edm::Event &, const edm::EventSetup &) override |
| Implementation of produce method. More...
|
|
| TrackRefitter (const edm::ParameterSet &iConfig) |
| Constructor. More...
|
|
| KfTrackProducerBase (bool trajectoryInEvent, bool split) |
| Constructor. More...
|
|
virtual void | putInEvt (edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::unique_ptr< TrackingRecHitCollection > &, std::unique_ptr< reco::TrackCollection > &, std::unique_ptr< reco::TrackExtraCollection > &, std::unique_ptr< std::vector< Trajectory > > &, std::unique_ptr< std::vector< int > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const TrackerTopology *ttopo, int BeforeOrAfter=0) |
| Put produced collections in the event. More...
|
|
const edm::ParameterSet & | getConf () 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. More...
|
|
virtual void | getFromEvt (edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &) |
| Get TrackCandidateCollection from the Event (needed by TrackProducer) More...
|
|
virtual void | getFromEvt (edm::Event &, edm::Handle< TrackView > &, reco::BeamSpot &) |
| Get TrackCollection from the Event (needed by TrackRefitter) More...
|
|
void | setAlias (std::string alias) |
| set the aliases of produced collections More...
|
|
void | setClusterRemovalInfo (const edm::InputTag &clusterRemovalInfo) |
| Sets the information on cluster removal, and turns it on. More...
|
|
void | setConf (const edm::ParameterSet &conf) |
| Set parameter set. More...
|
|
void | setSecondHitPattern (Trajectory *traj, reco::Track &track, const Propagator *prop, const MeasurementTrackerEvent *measTk, const TrackerTopology *ttopo) |
|
void | setSrc (const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc) |
| set label of source collection More...
|
|
| TrackProducerBase (bool trajectoryInEvent=false) |
| Constructor. More...
|
|
virtual | ~TrackProducerBase () noexcept(false) |
| Destructor. More...
|
|
| EDProducer ()=default |
|
| EDProducer (const EDProducer &)=delete |
|
bool | hasAbilityToProduceInBeginLumis () const final |
|
bool | hasAbilityToProduceInBeginProcessBlocks () const final |
|
bool | hasAbilityToProduceInBeginRuns () const final |
|
bool | hasAbilityToProduceInEndLumis () const final |
|
bool | hasAbilityToProduceInEndProcessBlocks () const final |
|
bool | hasAbilityToProduceInEndRuns () const final |
|
const EDProducer & | operator= (const EDProducer &)=delete |
|
Refit Tracks: Produce Tracks from TrackCollection. It performs a new final fit on a TrackCollection.
- Author
- cerati
Definition at line 14 of file TrackRefitter.h.
◆ Constraint
Enumerator |
---|
none | |
momentum | |
vertex | |
trackParameters | |
Definition at line 24 of file TrackRefitter.h.
◆ TrackRefitter()
Constructor.
Definition at line 16 of file TrackRefitter.cc.
28 if (constraint_str.empty())
30 else if (constraint_str ==
"momentum") {
32 trkconstrcoll_ = consumes<TrackMomConstraintAssociationCollection>(trkconstrcoll);
33 }
else if (constraint_str ==
"vertex") {
35 trkconstrcoll_ = consumes<TrackVtxConstraintAssociationCollection>(trkconstrcoll);
36 }
else if (constraint_str ==
"trackParameters") {
38 trkconstrcoll_ = consumes<TrackParamConstraintAssociationCollection>(trkconstrcoll);
41 <<
"constraint: " << constraint_str
42 <<
" not understood. Set it to 'momentum', 'vertex', 'trackParameters' or leave it empty";
44 <<
"unknown type of contraint! Set it to 'momentum', 'vertex', 'trackParameters' or leave it empty";
48 produces<reco::TrackCollection>().setBranchAlias(
alias_ +
"Tracks");
49 produces<reco::TrackExtraCollection>().setBranchAlias(
alias_ +
"TrackExtras");
50 produces<TrackingRecHitCollection>().setBranchAlias(
alias_ +
"RecHits");
51 produces<std::vector<Trajectory>>();
52 produces<std::vector<int>>();
53 produces<TrajTrackAssociationCollection>();
References TrackProducerBase< reco::Track >::alias_, constraint_, Exception, edm::ParameterSet::getParameter(), momentum, none, TrackProducerBase< reco::Track >::setAlias(), TrackProducerBase< reco::Track >::setConf(), TrackProducerBase< reco::Track >::setSrc(), AlCaHLTBitMon_QueryRunRegistry::string, trackParameters, trkconstrcoll_, and vertex.
◆ produce()
Implementation of produce method.
Implements TrackProducerBase< reco::Track >.
Definition at line 56 of file TrackRefitter.cc.
57 LogDebug(
"TrackRefitter") <<
"Analyzing event number: " << theEvent.
id() <<
"\n";
64 std::unique_ptr<std::vector<Trajectory>> outputTrajectoryColl(
new std::vector<Trajectory>);
65 std::unique_ptr<std::vector<int>> outputIndecesInputColl(
new std::vector<int>);
76 getFromES(
setup, theG, theMF, theFitter, thePropagator, theMeasTk, theBuilder);
91 LogDebug(
"TrackRefitter") <<
"TrackRefitter::produce(none):Number of Trajectories:" << (*theTCollection).size();
94 edm::LogError(
"TrackRefitter") <<
" BeamSpot is (0,0,0), it is probably because is not valid in the event";
101 edm::LogError(
"TrackRefitter") <<
"could not get the reco::TrackCollection." <<
labels.module;
104 LogDebug(
"TrackRefitter") <<
"run the algorithm"
117 edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrack."
130 if (!recoBeamSpotHandle.
isValid())
132 bs = *recoBeamSpotHandle;
137 LogDebug(
"TrackRefitter") <<
"run the algorithm"
142 *theTCollectionWithConstraint,
149 edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithMomentum."
161 if (!recoBeamSpotHandle.
isValid())
163 bs = *recoBeamSpotHandle;
165 edm::LogError(
"TrackRefitter") <<
"could not get TrackVtxConstraintAssociationCollection product.";
168 LogDebug(
"TrackRefitter") <<
"run the algorithm"
173 *theTCollectionWithConstraint,
180 edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithVertex."
192 if (!recoBeamSpotHandle.
isValid())
194 bs = *recoBeamSpotHandle;
199 LogDebug(
"TrackRefitter") <<
"run the algorithm"
204 *theTCollectionWithConstraint,
211 edm::LogError(
"TrackProducer") <<
"cms::Exception caught during theAlgo.runWithTrackParameters."
227 outputTrajectoryColl,
228 outputIndecesInputColl,
References cms::cuda::bs, TrackProducerBase< reco::Track >::bsSrc_, constraint_, MillePedeFileConverter_cfg::e, edm::HandleBase::failedToGet(), get, edm::Event::getByToken(), TrackProducerBase< reco::Track >::getFromES(), TrackProducerBase< reco::Track >::getFromEvt(), edm::EventBase::id(), edm::HandleBase::isValid(), SummaryClient_cfi::labels, LogDebug, momentum, none, edm::ESHandle< T >::product(), KfTrackProducerBase::putInEvt(), TrackProducerAlgorithm< T >::runWithMomentum(), TrackProducerAlgorithm< T >::runWithTrack(), TrackProducerAlgorithm< T >::runWithTrackParameters(), TrackProducerAlgorithm< T >::runWithVertex(), singleTopDQM_cfi::setup, TrackProducerBase< reco::Track >::src_, theAlgo, trackParameters, trkconstrcoll_, reco::BeamSpot::Unknown, and vertex.
◆ constraint_
◆ theAlgo
◆ trkconstrcoll_
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.
virtual void getFromEvt(edm::Event &, edm::Handle< TrackCandidateCollection > &, reco::BeamSpot &)
Get TrackCandidateCollection from the Event (needed by TrackProducer)
KfTrackProducerBase(bool trajectoryInEvent, bool split)
Constructor.
void runWithVertex(const TrackingGeometry *, const MagneticField *, const VtxConstraintAssociationCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
void setConf(const edm::ParameterSet &conf)
Set parameter set.
void runWithTrackParameters(const TrackingGeometry *, const MagneticField *, const TrackParamConstraintAssociationCollection &, const TrajectoryFitter *, const Propagator *, const TransientTrackingRecHitBuilder *, const reco::BeamSpot &, AlgoProductCollection &)
typename Base::AlgoProductCollection AlgoProductCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
void setAlias(std::string alias)
set the aliases of produced collections
bool getByToken(EDGetToken token, Handle< PROD > &result) const
XYZPointD XYZPoint
point in space with cartesian internal representation
virtual void putInEvt(edm::Event &, const Propagator *prop, const MeasurementTracker *measTk, std::unique_ptr< TrackingRecHitCollection > &, std::unique_ptr< reco::TrackCollection > &, std::unique_ptr< reco::TrackExtraCollection > &, std::unique_ptr< std::vector< Trajectory > > &, std::unique_ptr< std::vector< int > > &, AlgoProductCollection &, TransientTrackingRecHitBuilder const *, const TrackerTopology *ttopo, int BeforeOrAfter=0)
Put produced collections in the event.
Log< level::Error, false > LogError
void setSrc(const edm::EDGetToken &src, const edm::EDGetTokenT< reco::BeamSpot > &bsSrc, const edm::EDGetTokenT< MeasurementTrackerEvent > &mteSrc)
set label of source collection
edm::EDGetTokenT< reco::BeamSpot > bsSrc_
edm::EDGetToken trkconstrcoll_
T getParameter(std::string const &) const
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 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)
std::vector< Track > TrackCollection
collection of Tracks