1 #ifndef RecoAlgos_TrackFullCloneSelectorBase_h
2 #define RecoAlgos_TrackFullCloneSelectorBase_h
35 template<
typename Selector>
47 produces<reco::TrackCollection>().setBranchAlias( alias +
"Tracks" );
49 produces<reco::TrackExtraCollection>().setBranchAlias( alias +
"TrackExtras" );
50 produces<TrackingRecHitCollection>().setBranchAlias( alias +
"RecHits" );
52 produces< std::vector<Trajectory> >().setBranchAlias( alias +
"Trajectories" );
53 produces< TrajTrackAssociationCollection >().setBranchAlias( alias +
"TrajectoryTrackAssociations" );
72 TrackRefProd rTracks = evt.template getRefBeforePut<TrackCollection>();
77 rHits = evt.template getRefBeforePut<TrackingRecHitCollection>();
78 rTrackExtras = evt.template getRefBeforePut<TrackExtraCollection>();
82 std::map<TrackRefKey, reco::TrackRef >
goodTracks;
83 TrackRefKey current = 0;
86 for (reco::TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++current) {
102 auto const firstHitIndex =
selHits_->size();
104 selHits_->push_back( (*hit)->clone() );
118 selTrajs_ = std::auto_ptr< std::vector<Trajectory> >(
new std::vector<Trajectory>());
120 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
123 if (match != hTTAss->end()) {
125 TrackRefKey oldKey = trkRef.
key();
126 std::map<TrackRefKey, reco::TrackRef>::iterator getref = goodTracks.find(oldKey);
127 if (getref != goodTracks.end()) {
130 selTTAss_->insert (
edm::Ref< std::vector<Trajectory> >(TrajRefProd, selTrajs_->size() - 1),
162 std::auto_ptr< TrajTrackAssociationCollection >
selTTAss_;
T getParameter(std::string const &) const
edm::EDGetTokenT< std::vector< Trajectory > > hTrajToken_
friend struct const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void produce(edm::Event &evt, const edm::EventSetup &es) override
process one event
TrackFullCloneSelectorBase(const edm::ParameterSet &cfg)
constructor
std::vector< Track > TrackCollection
collection of Tracks
bool innerOk() const
return true if the innermost hit is valid
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
key_type key() const
Accessor for product key.
const math::XYZPoint & outerPosition() const
position of the outermost hit
std::auto_ptr< reco::TrackExtraCollection > selTrackExtras_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const math::XYZPoint & innerPosition() const
position of the innermost hit
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
std::auto_ptr< TrajTrackAssociationCollection > selTTAss_
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
bool copyExtras_
copy only the tracks, not extras and rechits (for AOD)
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
Selector selector_
filter event
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
virtual ~TrackFullCloneSelectorBase()
destructor
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
bool outerOk() const
return true if the outermost hit is valid
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
edm::EDGetTokenT< reco::TrackCollection > hSrcTrackToken_
source collection label
std::auto_ptr< std::vector< Trajectory > > selTrajs_
bool copyTrajectories_
copy also trajectories and trajectory->track associations
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
std::auto_ptr< reco::TrackCollection > selTracks_
edm::EDGetTokenT< TrajTrackAssociationCollection > hTTAssToken_
PropagationDirection seedDirection() const
direction of how the hits were sorted in the original seed
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
std::auto_ptr< TrackingRecHitCollection > selHits_
volatile std::atomic< bool > shutdown_flag false
EDGetTokenT< ProductType > mayConsume(edm::InputTag const &tag)
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.