1 #ifndef RecoAlgos_TrackFullCloneSelectorBase_h
2 #define RecoAlgos_TrackFullCloneSelectorBase_h
32 namespace reco {
namespace modules {
34 template<
typename Selector>
39 src_( cfg.
template getParameter<edm::InputTag>(
"src" ) ),
44 produces<reco::TrackCollection>().setBranchAlias( alias +
"Tracks" );
46 produces<reco::TrackExtraCollection>().setBranchAlias( alias +
"TrackExtras" );
47 produces<TrackingRecHitCollection>().setBranchAlias( alias +
"RecHits" );
49 produces< std::vector<Trajectory> >().setBranchAlias( alias +
"Trajectories" );
50 produces< TrajTrackAssociationCollection >().setBranchAlias( alias +
"TrajectoryTrackAssociations" );
71 TrackRefProd rTracks = evt.template getRefBeforePut<TrackCollection>();
76 rHits = evt.template getRefBeforePut<TrackingRecHitCollection>();
77 rTrackExtras = evt.template getRefBeforePut<TrackExtraCollection>();
81 std::map<TrackRefKey, reco::TrackRef >
goodTracks;
84 for (reco::TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
101 selHits_->push_back( (*hit)->clone() );
114 selTrajs_ = std::auto_ptr< std::vector<Trajectory> >(
new std::vector<Trajectory>());
116 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
119 if (match != hTTAss->end()) {
121 TrackRefKey oldKey = trkRef.
key();
122 std::map<TrackRefKey, reco::TrackRef>::iterator getref = goodTracks.find(oldKey);
123 if (getref != goodTracks.end()) {
126 selTTAss_->insert (
edm::Ref< std::vector<Trajectory> >(TrajRefProd, selTrajs_->size() - 1),
156 std::auto_ptr< TrajTrackAssociationCollection >
selTTAss_;
T getParameter(std::string const &) 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
const math::XYZPoint & outerPosition() const
position of the outermost hit
std::auto_ptr< reco::TrackExtraCollection > selTrackExtras_
const math::XYZPoint & innerPosition() const
position of the innermost hit
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
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
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
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
key_type key() const
Accessor for product key.
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_
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_
edm::InputTag src_
source collection label
boost::remove_cv< typename boost::remove_reference< argument_type >::type >::type key_type
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.