|
|
selects a subset of a track collection, copying extra information on demand
- Author
- Paolo Azzurri, Giovanni Petrucciani
Definition at line 32 of file CosmicTrackSelector.cc.
◆ Point
◆ CosmicTrackSelector()
Definition at line 98 of file CosmicTrackSelector.cc.
101 copyExtras_(
cfg.getUntrackedParameter<
bool>(
"copyExtras",
false)),
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");
References SiStripOfflineCRack_cfg::alias, looper::cfg, copyExtras_, copyTrajectories_, Exception, keepAllTracks_, pixelTrack::qualityByName(), qualityToSet_, setQualityBit_, srcTass_, srcTraj_, and AlCaHLTBitMon_QueryRunRegistry::string.
◆ ~CosmicTrackSelector()
CosmicTrackSelector::~CosmicTrackSelector |
( |
| ) |
|
|
override |
◆ produce()
Definition at line 153 of file CosmicTrackSelector.cc.
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) {
187 const Track &trk = *it;
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());
References beamspot_, edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, copyExtras_, copyTrajectories_, edm::friendlyname::emptyString(), edm::AssociationMap< Tag >::end(), reco::Track::extra(), edm::AssociationMap< Tag >::find(), edm::Event::getByToken(), edm::Event::getRefBeforePut(), mps_fire::i, reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerOk(), reco::Track::innerPosition(), reco::Track::innerStateCovariance(), keepAllTracks_, edm::Ref< C, T, F >::key(), match(), eostools::move(), dqmiodumpmetadata::n, convertSQLiteXML::ok, reco::Track::outerDetId(), reco::Track::outerMomentum(), reco::Track::outerOk(), reco::Track::outerPosition(), reco::Track::outerStateCovariance(), edm::Event::productGetter(), edm::Event::put(), qualityToSet_, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::Track::residuals(), rHits_, rTrackExtras_, rTracks_, rTrajectories_, reco::Track::seedDirection(), reco::Track::seedRef(), select(), selHits_, selTrackExtras_, selTracks_, selTrajs_, selTTAss_, reco::TrackExtraBase::setHits(), setQualityBit_, reco::TrackExtra::setResiduals(), reco::TrackExtraBase::setTrajParams(), src_, srcTass_, srcTraj_, AlCaHLTBitMon_QueryRunRegistry::string, and trackRefs_.
◆ select()
Definition at line 262 of file CosmicTrackSelector.cc.
275 uint32_t nPixelHit = 0;
277 if (!((*recHit)->isValid()))
280 DetId id((*recHit)->geographicalId());
References funct::abs(), chi2n, chi2n_par_, d0, reco::TrackBase::dxy(), PVValHelper::dz, reco::TrackBase::dz(), PVValHelper::eta, reco::TrackBase::eta(), reco::TrackBase::hitPattern(), triggerObjects_cff::id, createfilelist::int, max_d0_, max_eta_, max_lostLayers_, max_z0_, min_3Dlayers_, min_layers_, min_nHit_, min_nPixelHit_, min_pt_, nlayers, reco::TrackBase::normalizedChi2(), reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo(), PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, reco::HitPattern::pixelLayersWithMeasurement(), reco::BeamSpot::position(), DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::pt(), rpcPointValidation_cfi::recHit, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::HitPattern::TRACK_HITS, reco::HitPattern::trackerLayersWithMeasurement(), and reco::HitPattern::trackerLayersWithoutMeasurement().
Referenced by produce().
◆ beamspot_
◆ chi2n_par_
double CosmicTrackSelector::chi2n_par_ |
|
private |
◆ copyExtras_
bool CosmicTrackSelector::copyExtras_ |
|
private |
◆ copyTrajectories_
bool CosmicTrackSelector::copyTrajectories_ |
|
private |
◆ keepAllTracks_
bool CosmicTrackSelector::keepAllTracks_ |
|
private |
◆ max_d0_
double CosmicTrackSelector::max_d0_ |
|
private |
◆ max_eta_
double CosmicTrackSelector::max_eta_ |
|
private |
◆ max_lostLayers_
uint32_t CosmicTrackSelector::max_lostLayers_ |
|
private |
◆ max_z0_
double CosmicTrackSelector::max_z0_ |
|
private |
◆ min_3Dlayers_
uint32_t CosmicTrackSelector::min_3Dlayers_ |
|
private |
◆ min_layers_
uint32_t CosmicTrackSelector::min_layers_ |
|
private |
◆ min_nHit_
uint32_t CosmicTrackSelector::min_nHit_ |
|
private |
◆ min_nPixelHit_
uint32_t CosmicTrackSelector::min_nPixelHit_ |
|
private |
◆ min_pt_
double CosmicTrackSelector::min_pt_ |
|
private |
◆ qualityToSet_
◆ res_par_
std::vector<double> CosmicTrackSelector::res_par_ |
|
private |
◆ rHits_
◆ rTrackExtras_
◆ rTracks_
◆ rTrajectories_
◆ selHits_
◆ selTrackExtras_
◆ selTracks_
◆ selTrajPtrs_
std::unique_ptr<std::vector<const Trajectory *> > CosmicTrackSelector::selTrajPtrs_ |
|
private |
◆ selTrajs_
std::unique_ptr<std::vector<Trajectory> > CosmicTrackSelector::selTrajs_ |
|
private |
◆ selTTAss_
◆ setQualityBit_
bool CosmicTrackSelector::setQualityBit_ |
|
private |
◆ src_
◆ srcTass_
◆ srcTraj_
◆ trackRefs_
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
edm::EDGetTokenT< reco::BeamSpot > beamspot_
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
RefProd< PROD > getRefBeforePut()
std::unique_ptr< reco::TrackCollection > selTracks_
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
TrackBase::TrackQuality qualityToSet_
const_iterator find(const key_type &k) const
find element with specified reference key
std::unique_ptr< reco::TrackExtraCollection > selTrackExtras_
edm::RefProd< std::vector< Trajectory > > rTrajectories_
int trackerLayersWithoutMeasurement(HitCategory category) const
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
EDProductGetter const & productGetter() const
static const std::string emptyString("")
std::vector< reco::TrackRef > trackRefs_
bool outerOk() const
return true if the outermost hit is valid
const TrackExtraRef & extra() const
reference to "extra" object
int pixelLayersWithMeasurement() const
TrackingRecHitRefProd rHits_
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
bool innerOk() const
return true if the innermost hit is valid
edm::EDGetTokenT< reco::TrackCollection > src_
double pt() const
track transverse momentum
const_iterator end() const
last iterator over the map (read only)
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
int trackerLayersWithMeasurement() const
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
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...
bool getByToken(EDGetToken token, Handle< PROD > &result) const
const Point & position() const
position
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
friend struct const_iterator
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
reco::TrackExtraRefProd rTrackExtras_
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
double eta() const
pseudorapidity of momentum vector
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
const math::XYZPoint & innerPosition() const
position of the innermost hit
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int innerDetId() const
DetId of the detector on which surface the innermost 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)
std::unique_ptr< std::vector< Trajectory > > selTrajs_
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
const edm::RefToBase< TrajectorySeed > & seedRef() const
bool select(const reco::BeamSpot &vertexBeamSpot, const reco::Track &tk)
const TrackResiduals & residuals() const
get the residuals
Quality qualityByName(std::string const &name)
key_type key() const
Accessor for product key.
reco::TrackRefProd rTracks_
Abs< T >::type abs(const T &t)
static constexpr float d0
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
std::unique_ptr< TrajTrackAssociationCollection > selTTAss_
std::unique_ptr< TrackingRecHitCollection > selHits_
std::vector< Track > TrackCollection
collection of Tracks
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_