3 #include <Math/DistFunc.h>
10 beamspot_( consumes<
reco::
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")) {
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";
47 produces<reco::TrackCollection>().setBranchAlias( alias +
"Tracks");
49 produces<reco::TrackExtraCollection>().setBranchAlias( alias +
"TrackExtras");
50 produces<TrackingRecHitCollection>().setBranchAlias( alias +
"RecHits");
55 produces< std::vector<Trajectory> >().setBranchAlias( alias +
"Trajectories");
56 produces< TrajTrackAssociationCollection >().setBranchAlias( alias +
"TrajectoryTrackAssociations");
79 vertexBeamSpot = *hBsp;
97 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++
current) {
98 const Track & trk = * it;
100 bool ok =
select(vertexBeamSpot, trk);
119 selHits_->push_back( (*hit)->clone() );
132 selTrajs_ = auto_ptr< vector<Trajectory> >(
new vector<Trajectory>());
135 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
138 if (match != hTTAss->end()) {
140 short oldKey =
static_cast<short>(trkRef.
key());
175 uint32_t nPixelHit = 0;
177 if ( !((*recHit)->isValid()) )
continue;
179 DetId id((*recHit)->geographicalId());
195 double d0 = -tk.
dxy(vertexBeamSpot.
position()), dz = tk.
dz();
T getParameter(std::string const &) const
std::auto_ptr< reco::TrackExtraCollection > selTrackExtras_
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
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
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
edm::EDGetTokenT< reco::TrackCollection > src_
bool innerOk() const
return true if the innermost hit is valid
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
void produce(edm::Event &evt, const edm::EventSetup &es) override
const math::XYZPoint & outerPosition() const
position of the outermost hit
TrackingRecHitRefProd rHits_
const math::XYZPoint & innerPosition() const
position of the innermost hit
edm::EDGetTokenT< reco::BeamSpot > beamspot_
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.
Abs< T >::type abs(const T &t)
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.
edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > > TrajTrackAssociationCollection
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)
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
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.
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.
int numberOfValidStripLayersWithMonoAndStereo(uint32_t stripdet, uint32_t layer) const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.