3 #include <Math/DistFunc.h>
9 src_( cfg.getParameter<edm::InputTag>(
"src" ) ),
10 beamspot_( cfg.getParameter<edm::InputTag>(
"beamspot" ) ),
11 copyExtras_(cfg.getUntrackedParameter<bool>(
"copyExtras",
false)),
12 copyTrajectories_(cfg.getUntrackedParameter<bool>(
"copyTrajectories",
false)),
13 keepAllTracks_( cfg.exists(
"keepAllTracks") ?
14 cfg.getParameter<bool>(
"keepAllTracks") :
16 setQualityBit_(
false ),
18 chi2n_par_( cfg.getParameter<double>(
"chi2n_par") ),
20 max_d0_(cfg.getParameter<double>(
"max_d0")),
21 max_z0_(cfg.getParameter<double>(
"max_z0")),
23 min_pt_(cfg.getParameter<double>(
"min_pt")),
24 max_eta_(cfg.getParameter<double>(
"max_eta")),
26 min_nHit_(cfg.getParameter<uint32_t>(
"min_nHit")),
28 min_nPixelHit_(cfg.getParameter<uint32_t>(
"min_nPixelHit")),
30 min_layers_(cfg.getParameter<uint32_t>(
"minNumberLayers") ),
31 min_3Dlayers_(cfg.getParameter<uint32_t>(
"minNumber3DLayers") ),
32 max_lostLayers_(cfg.getParameter<uint32_t>(
"maxNumberLostLayers") )
34 if (cfg.
exists(
"qualityBit")) {
35 std::string qualityStr = cfg.
getParameter<std::string>(
"qualityBit");
36 if (qualityStr !=
"") {
42 "If you set 'keepAllTracks' to true, you must specify which qualityBit to set.\n";
44 "You can't set the quality bit " << cfg.
getParameter<std::string>(
"qualityBit") <<
" as it is 'undefQuality' or unknown.\n";
46 std::string alias( cfg.
getParameter<std::string>(
"@module_label" ) );
47 produces<reco::TrackCollection>().setBranchAlias( alias +
"Tracks");
49 produces<reco::TrackExtraCollection>().setBranchAlias( alias +
"TrackExtras");
50 produces<TrackingRecHitCollection>().setBranchAlias( alias +
"RecHits");
53 produces< std::vector<Trajectory> >().setBranchAlias( alias +
"Trajectories");
54 produces< TrajTrackAssociationCollection >().setBranchAlias( alias +
"TrajectoryTrackAssociations");
77 vertexBeamSpot = *hBsp;
95 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
96 const Track & trk = * it;
98 bool ok =
select(vertexBeamSpot, trk);
117 selHits_->push_back( (*hit)->clone() );
130 selTrajs_ = auto_ptr< vector<Trajectory> >(
new vector<Trajectory>());
133 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
136 if (match != hTTAss->end()) {
138 short oldKey =
static_cast<short>(trkRef.
key());
173 uint32_t nPixelHit = 0;
175 if ( !((*recHit)->isValid()) )
continue;
177 DetId id((*recHit)->geographicalId());
193 double d0 = -tk.
dxy(vertexBeamSpot.
position()), dz = tk.
dz();
201 if (pt <
min_pt_)
return false;
T getParameter(std::string const &) const
std::auto_ptr< reco::TrackExtraCollection > selTrackExtras_
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
edm::RefProd< std::vector< Trajectory > > rTrajectories_
reco::TrackRefProd rTracks_
std::auto_ptr< std::vector< Trajectory > > selTrajs_
std::vector< Track > TrackCollection
collection of Tracks
bool exists(std::string const ¶meterName) const
checks if a parameter exists
reco::TrackExtraRefProd rTrackExtras_
int pixelLayersWithMeasurement() const
std::vector< reco::TrackRef > trackRefs_
int trackerLayersWithoutMeasurement() const
bool innerOk() const
return true if the innermost hit is valid
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
int numberOfValidStripLayersWithMonoAndStereo() const
const math::XYZPoint & outerPosition() const
position of the outermost hit
TrackingRecHitRefProd rHits_
const math::XYZPoint & innerPosition() const
position of the innermost hit
TrackBase::TrackQuality qualityToSet_
std::auto_ptr< TrajTrackAssociationCollection > selTTAss_
double eta() const
pseudorapidity of momentum vector
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
int trackerLayersWithMeasurement() const
edm::Ref< TrackingRecHitCollection > TrackingRecHitRef
persistent reference to a TrackingRecHit
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
double pt() const
track transverse momentum
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::auto_ptr< TrackingRecHitCollection > selHits_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
void produce(edm::Event &evt, const edm::EventSetup &es)
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
RefProd< PROD > getRefBeforePut()
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
static TrackQuality qualityByName(const std::string &name)
std::auto_ptr< reco::TrackCollection > selTracks_
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.
virtual ~CosmicTrackSelector()
bool select(const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk)
static std::string const emptyString("")
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
const Point & position() const
position
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
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.
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.