|
|
Go to the documentation of this file. 1 #ifndef RecoAlgos_TrackFullCloneSelectorBase_h
2 #define RecoAlgos_TrackFullCloneSelectorBase_h
37 template <
typename Selector>
49 produces<reco::TrackCollection>().setBranchAlias(
alias +
"Tracks");
51 produces<reco::TrackExtraCollection>().setBranchAlias(
alias +
"TrackExtras");
52 produces<TrackingRecHitCollection>().setBranchAlias(
alias +
"RecHits");
54 produces<std::vector<Trajectory> >().setBranchAlias(
alias +
"Trajectories");
55 produces<TrajTrackAssociationCollection>().setBranchAlias(
alias +
"TrajectoryTrackAssociations");
68 selTracks_ = std::make_unique<reco::TrackCollection>();
71 selHits_ = std::make_unique<TrackingRecHitCollection>();
74 TrackRefProd rTracks = evt.template getRefBeforePut<TrackCollection>();
79 rHits = evt.template getRefBeforePut<TrackingRecHitCollection>();
80 rTrackExtras = evt.template getRefBeforePut<TrackExtraCollection>();
84 std::map<TrackRefKey, reco::TrackRef>
goodTracks;
85 TrackRefKey current = 0;
88 auto tkBegin = hSrcTrack->begin();
89 for (reco::TrackCollection::const_iterator it = tkBegin, ed = hSrcTrack->end(); it != ed; ++it, ++current) {
114 auto const firstHitIndex =
selHits_->size();
130 selTrajs_ = std::make_unique<std::vector<Trajectory> >();
131 selTTAss_ = std::make_unique<TrajTrackAssociationCollection>();
132 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
137 TrackRefKey oldKey = trkRef.
key();
138 std::map<TrackRefKey, reco::TrackRef>::iterator getref =
goodTracks.find(oldKey);
172 std::unique_ptr<TrackingRecHitCollection>
selHits_;
174 std::unique_ptr<TrajTrackAssociationCollection>
selTTAss_;
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
edm::EDGetTokenT< reco::TrackCollection > hSrcTrackToken_
source collection label
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
Functor that operates on <T>
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
const_iterator find(const key_type &k) const
find element with specified reference key
bool copyTrajectories_
copy also trajectories and trajectory->track associations
Selector selector_
filter event
bool outerOk() const
return true if the outermost hit is valid
const TrackExtraRef & extra() const
reference to "extra" object
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
bool innerOk() const
return true if the innermost hit is valid
const_iterator end() const
last iterator over the map (read only)
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
edm::EDGetTokenT< TrajTrackAssociationCollection > hTTAssToken_
auto recHits() const
Access to reconstructed hits on the track.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
TrackFullCloneSelectorBase(const edm::ParameterSet &cfg)
constructor
edm::EDGetTokenT< std::vector< Trajectory > > hTrajToken_
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
friend struct const_iterator
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
std::unique_ptr< TrackingRecHitCollection > selHits_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
const math::XYZPoint & innerPosition() const
position of the innermost hit
bool copyExtras_
copy only the tracks, not extras and rechits (for AOD)
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
std::unique_ptr< std::vector< Trajectory > > selTrajs_
def template(fileName, svg, replaceme="REPLACEME")
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
std::unique_ptr< TrajTrackAssociationCollection > selTTAss_
std::unique_ptr< reco::TrackCollection > selTracks_
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
key_type key() const
Accessor for product key.
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
~TrackFullCloneSelectorBase() override
destructor
std::vector< Track > TrackCollection
collection of Tracks