84 std::auto_ptr< TrackingRecHitCollection>
selHits_;
87 std::auto_ptr< TrajTrackAssociationCollection >
selTTAss_;
96 #include <Math/DistFunc.h>
102 copyExtras_(cfg.getUntrackedParameter<bool>(
"copyExtras",
false)),
103 copyTrajectories_(cfg.getUntrackedParameter<bool>(
"copyTrajectories",
false)),
104 keepAllTracks_( cfg.exists(
"keepAllTracks") ?
105 cfg.getParameter<bool>(
"keepAllTracks") :
107 setQualityBit_(
false ),
108 qualityToSet_(
TrackBase::undefQuality ),
109 chi2n_par_( cfg.getParameter<double>(
"chi2n_par") ),
111 max_d0_(cfg.getParameter<double>(
"max_d0")),
112 max_z0_(cfg.getParameter<double>(
"max_z0")),
114 min_pt_(cfg.getParameter<double>(
"min_pt")),
115 max_eta_(cfg.getParameter<double>(
"max_eta")),
117 min_nHit_(cfg.getParameter<uint32_t>(
"min_nHit")),
119 min_nPixelHit_(cfg.getParameter<uint32_t>(
"min_nPixelHit")),
121 min_layers_(cfg.getParameter<uint32_t>(
"minNumberLayers") ),
122 min_3Dlayers_(cfg.getParameter<uint32_t>(
"minNumber3DLayers") ),
123 max_lostLayers_(cfg.getParameter<uint32_t>(
"maxNumberLostLayers") )
125 if (cfg.
exists(
"qualityBit")) {
127 if (qualityStr !=
"") {
133 "If you set 'keepAllTracks' to true, you must specify which qualityBit to set.\n";
135 "You can't set the quality bit " << cfg.
getParameter<
std::string>(
"qualityBit") <<
" as it is 'undefQuality' or unknown.\n";
138 produces<reco::TrackCollection>().setBranchAlias( alias +
"Tracks");
140 produces<reco::TrackExtraCollection>().setBranchAlias( alias +
"TrackExtras");
141 produces<TrackingRecHitCollection>().setBranchAlias( alias +
"RecHits");
146 produces< std::vector<Trajectory> >().setBranchAlias( alias +
"Trajectories");
147 produces< TrajTrackAssociationCollection >().setBranchAlias( alias +
"TrajectoryTrackAssociations");
159 using namespace reco;
170 vertexBeamSpot = *hBsp;
188 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
189 const Track & trk = * it;
191 bool ok =
select(vertexBeamSpot, trk);
209 auto const firstHitIndex =
selHits_->size();
211 selHits_->push_back( (*hit)->clone() );
224 selTrajs_ = auto_ptr< vector<Trajectory> >(
new vector<Trajectory>());
227 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
230 if (match != hTTAss->end()) {
232 short oldKey =
static_cast<short>(trkRef.
key());
267 uint32_t nPixelHit = 0;
269 if ( !((*recHit)->isValid()) )
continue;
271 DetId id((*recHit)->geographicalId());
287 double d0 = -tk.
dxy(vertexBeamSpot.
position()), dz = tk.
dz();
T getParameter(std::string const &) const
std::auto_ptr< TrajTrackAssociationCollection > selTTAss_
friend struct const_iterator
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
void produce(edm::Event &evt, const edm::EventSetup &es) override
TrackQuality
track quality
TrackBase::TrackQuality qualityToSet_
#define DEFINE_FWK_MODULE(type)
EDProductGetter const & productGetter() const
std::auto_ptr< reco::TrackCollection > selTracks_
reco::TrackExtraRefProd rTrackExtras_
std::vector< Track > TrackCollection
collection of Tracks
edm::EDGetTokenT< reco::BeamSpot > beamspot_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
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.
int pixelLayersWithMeasurement() const
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
const math::XYZPoint & outerPosition() const
position of the outermost hit
int trackerLayersWithMeasurement() const
const math::XYZPoint & innerPosition() const
position of the innermost hit
edm::RefProd< std::vector< Trajectory > > rTrajectories_
std::vector< double > res_par_
double eta() const
pseudorapidity of momentum vector
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
double pt() const
track transverse momentum
virtual ~CosmicTrackSelector()
TrackingRecHitRefProd rHits_
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
Abs< T >::type abs(const T &t)
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
std::auto_ptr< reco::TrackExtraCollection > selTrackExtras_
RefProd< PROD > getRefBeforePut()
std::auto_ptr< std::vector< const Trajectory * > > selTrajPtrs_
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
edm::RefToBase< TrajectorySeed > seedRef() const
std::auto_ptr< std::vector< Trajectory > > selTrajs_
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
bool outerOk() const
return true if the outermost hit is valid
bool select(const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk)
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
CosmicTrackSelector(const edm::ParameterSet &cfg)
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
std::auto_ptr< TrackingRecHitCollection > selHits_
static std::string const emptyString("")
int trackerLayersWithoutMeasurement(HitCategory category) const
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
const TrackResiduals & residuals() const
PropagationDirection seedDirection() const
direction of how the hits were sorted in the original seed
edm::EDGetTokenT< reco::TrackCollection > src_
const Point & position() const
position
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
volatile std::atomic< bool > shutdown_flag false
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
reco::TrackRefProd rTracks_
std::vector< reco::TrackRef > trackRefs_
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.