84 std::unique_ptr<TrackingRecHitCollection>
selHits_;
87 std::unique_ptr<TrajTrackAssociationCollection>
selTTAss_;
95 #include <Math/DistFunc.h> 101 copyExtras_(
cfg.getUntrackedParameter<
bool>(
"copyExtras",
false)),
102 copyTrajectories_(
cfg.getUntrackedParameter<
bool>(
"copyTrajectories",
false)),
103 keepAllTracks_(
cfg.exists(
"keepAllTracks") ?
cfg.getParameter<
bool>(
"keepAllTracks")
105 setQualityBit_(
false),
107 chi2n_par_(
cfg.getParameter<double>(
"chi2n_par")),
109 max_d0_(
cfg.getParameter<double>(
"max_d0")),
110 max_z0_(
cfg.getParameter<double>(
"max_z0")),
112 min_pt_(
cfg.getParameter<double>(
"min_pt")),
113 max_eta_(
cfg.getParameter<double>(
"max_eta")),
115 min_nHit_(
cfg.getParameter<uint32_t>(
"min_nHit")),
117 min_nPixelHit_(
cfg.getParameter<uint32_t>(
"min_nPixelHit")),
119 min_layers_(
cfg.getParameter<uint32_t>(
"minNumberLayers")),
120 min_3Dlayers_(
cfg.getParameter<uint32_t>(
"minNumber3DLayers")),
121 max_lostLayers_(
cfg.getParameter<uint32_t>(
"maxNumberLostLayers")) {
122 if (
cfg.exists(
"qualityBit")) {
124 if (!qualityStr.empty()) {
131 <<
"If you set 'keepAllTracks' to true, you must specify which qualityBit to set.\n";
134 <<
"You can't set the quality bit " <<
cfg.getParameter<
std::string>(
"qualityBit")
135 <<
" 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");
156 using namespace reco;
167 vertexBeamSpot = *hBsp;
172 selTracks_ = std::make_unique<TrackCollection>();
176 selHits_ = std::make_unique<TrackingRecHitCollection>();
186 for (TrackCollection::const_iterator
it = hSrcTrack->begin(), ed = hSrcTrack->end();
it != ed; ++
it, ++current) {
189 bool ok =
select(vertexBeamSpot, trk);
217 auto const firstHitIndex =
selHits_->size();
219 selHits_->push_back((*hit)->clone());
233 selTrajs_ = std::make_unique<std::vector<Trajectory>>();
236 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
241 short oldKey =
static_cast<short>(trkRef.
key());
275 uint32_t nPixelHit = 0;
277 if (!((*recHit)->isValid()))
280 DetId id((*recHit)->geographicalId());
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
const math::XYZPoint & outerPosition() const
position of the outermost hit
const Point & position() const
position
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
Quality qualityByName(std::string const &name)
void produce(edm::Event &evt, const edm::EventSetup &es) override
TrackQuality
track quality
TrackBase::TrackQuality qualityToSet_
edm::RefProd< std::vector< Trajectory > > rTrajectories_
int trackerLayersWithMeasurement() const
reco::TrackExtraRefProd rTrackExtras_
std::vector< Track > TrackCollection
collection of Tracks
edm::EDGetTokenT< reco::BeamSpot > beamspot_
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const edm::RefToBase< TrajectorySeed > & seedRef() const
const TrackResiduals & residuals() const
get the residuals
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
key_type key() const
Accessor for product key.
const_iterator find(const key_type &k) const
find element with specified reference key
std::unique_ptr< TrackingRecHitCollection > selHits_
const_iterator end() const
last iterator over the map (read only)
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
EDProductGetter const & productGetter() const
double pt() const
track transverse momentum
std::vector< double > res_par_
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
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::unique_ptr< std::vector< const Trajectory * > > selTrajPtrs_
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
TrackingRecHitRefProd rHits_
Abs< T >::type abs(const T &t)
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
#define DEFINE_FWK_MODULE(type)
unsigned int innerDetId() const
DetId of the detector on which surface the innermost state is located.
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
RefProd< PROD > getRefBeforePut()
bool innerOk() const
return true if the innermost hit is valid
double eta() const
pseudorapidity of momentum vector
std::unique_ptr< TrajTrackAssociationCollection > selTTAss_
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
static constexpr float d0
std::unique_ptr< std::vector< Trajectory > > selTrajs_
int trackerLayersWithoutMeasurement(HitCategory category) const
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
bool select(const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk)
CosmicTrackSelector(const edm::ParameterSet &cfg)
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
static std::string const emptyString("")
edm::EDGetTokenT< reco::TrackCollection > src_
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
int pixelLayersWithMeasurement() const
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
const math::XYZPoint & innerPosition() const
position of the innermost hit
reco::TrackRefProd rTracks_
std::vector< reco::TrackRef > trackRefs_
~CosmicTrackSelector() override
std::unique_ptr< reco::TrackCollection > selTracks_
bool outerOk() const
return true if the outermost hit is valid
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
const TrackExtraRef & extra() const
reference to "extra" object