|
|
|
using | MVACollection = std::vector< float > |
|
using | QualityMaskCollection = std::vector< unsigned char > |
|
typedef CacheContexts< T... > | CacheTypes |
|
typedef CacheTypes::GlobalCache | GlobalCache |
|
typedef AbilityChecker< T... > | HasAbility |
|
typedef CacheTypes::LuminosityBlockCache | LuminosityBlockCache |
|
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > | LuminosityBlockContext |
|
typedef CacheTypes::LuminosityBlockSummaryCache | LuminosityBlockSummaryCache |
|
typedef CacheTypes::RunCache | RunCache |
|
typedef RunContextT< RunCache, GlobalCache > | RunContext |
|
typedef CacheTypes::RunSummaryCache | RunSummaryCache |
|
typedef math::XYZPoint | Point |
|
void | beginStream (edm::StreamID) final |
|
Point | getBestVertex (const reco::TrackBaseRef, const reco::VertexCollection) const |
|
void | processMVA (edm::Event &evt, const edm::EventSetup &es, const reco::BeamSpot &beamspot, const reco::VertexCollection &vertices, int selIndex, std::vector< float > &mvaVals_, bool writeIt=false) const |
|
void | produce (edm::Event &evt, const edm::EventSetup &es) final |
| process one event More...
|
|
bool | select (unsigned tsNum, const reco::BeamSpot &vertexBeamSpot, const TrackingRecHitCollection &recHits, const reco::Track &tk, const std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr, double mvaVal) const |
| return class, or -1 if rejected More...
|
|
void | selectVertices (unsigned int tsNum, const reco::VertexCollection &vtxs, std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr) const |
|
std::vector< bool > | applyAbsCutsIfNoPV_ |
|
std::vector< bool > | applyAdaptedPVCuts_ |
|
edm::EDGetTokenT< reco::BeamSpot > | beamspot_ |
|
std::vector< double > | chi2n_no1Dmod_par_ |
|
std::vector< double > | chi2n_par_ |
|
std::vector< std::vector< double > > | d0_par1_ |
|
std::vector< std::vector< double > > | d0_par2_ |
|
std::string | dbFileName_ |
|
std::vector< std::vector< double > > | dz_par1_ |
|
std::vector< std::vector< double > > | dz_par2_ |
|
std::vector< GBRForest * > | forest_ |
|
std::vector< std::string > | forestLabel_ |
|
edm::EDGetTokenT< TrackingRecHitCollection > | hSrc_ |
|
std::vector< bool > | keepAllTracks_ |
|
std::vector< double > | max_d0_ |
| Impact parameter absolute cuts. More...
|
|
std::vector< double > | max_d0NoPV_ |
|
std::vector< double > | max_eta_ |
|
std::vector< int32_t > | max_lostHitFraction_ |
|
std::vector< uint32_t > | max_lostLayers_ |
|
std::vector< int32_t > | max_minMissHitOutOrIn_ |
|
std::vector< double > | max_relpterr_ |
|
std::vector< double > | max_z0_ |
|
std::vector< double > | max_z0NoPV_ |
|
std::vector< uint32_t > | min_3Dlayers_ |
|
std::vector< double > | min_eta_ |
|
std::vector< uint32_t > | min_hits_bypass_ |
|
std::vector< uint32_t > | min_layers_ |
| Cuts on numbers of layers with hits/3D hits/lost hits. More...
|
|
std::vector< double > | min_MVA_ |
|
std::vector< uint32_t > | min_nhits_ |
|
std::vector< std::string > | mvaType_ |
|
std::vector< std::string > | name_ |
|
std::vector< double > | nSigmaZ_ |
|
std::vector< unsigned int > | preFilter_ |
|
std::vector< reco::TrackBase::TrackQuality > | qualityToSet_ |
|
std::vector< std::vector< double > > | res_par_ |
|
std::vector< bool > | setQualityBit_ |
| do I have to set a quality bit? More...
|
|
edm::EDGetTokenT< reco::TrackCollection > | src_ |
| source collection label More...
|
|
bool | useAnyMVA_ |
|
bool | useForestFromDB_ |
|
std::vector< bool > | useMVA_ |
|
std::vector< bool > | useMVAonly_ |
|
bool | useVertices_ |
|
bool | useVtxError_ |
|
std::vector< StringCutObjectSelector< reco::Vertex > > | vertexCut_ |
|
edm::EDGetTokenT< reco::VertexCollection > | vertices_ |
|
std::vector< int32_t > | vtxNumber_ |
| vertex cuts More...
|
|
selects a subset of a track collection, copying extra information on demand
- Author
- Paolo Azzurri, Giovanni Petrucciani
Definition at line 36 of file AnalyticalTrackSelector.cc.
◆ Point
◆ AnalyticalTrackSelector()
constructor
Definition at line 67 of file AnalyticalTrackSelector.cc.
102 produces<edm::ValueMap<float>>(
"MVAVals");
104 produces<MVACollection>(
"MVAValues");
107 if (
cfg.exists(
"useAnyMVA"))
117 copyExtras_ =
cfg.getUntrackedParameter<
bool>(
"copyExtras",
false);
129 res_par_.push_back(
cfg.getParameter<std::vector<double>>(
"res_par"));
132 d0_par1_.push_back(
cfg.getParameter<std::vector<double>>(
"d0_par1"));
133 dz_par1_.push_back(
cfg.getParameter<std::vector<double>>(
"dz_par1"));
134 d0_par2_.push_back(
cfg.getParameter<std::vector<double>>(
"d0_par2"));
135 dz_par2_.push_back(
cfg.getParameter<std::vector<double>>(
"dz_par2"));
140 max_d0_.push_back(
cfg.getParameter<
double>(
"max_d0"));
141 max_z0_.push_back(
cfg.getParameter<
double>(
"max_z0"));
142 nSigmaZ_.push_back(
cfg.getParameter<
double>(
"nSigmaZ"));
144 min_layers_.push_back(
cfg.getParameter<uint32_t>(
"minNumberLayers"));
149 min_nhits_.push_back(
cfg.getParameter<uint32_t>(
"min_nhits"));
151 cfg.existsAs<int32_t>(
"max_minMissHitOutOrIn") ?
cfg.getParameter<int32_t>(
"max_minMissHitOutOrIn") : 99);
153 cfg.existsAs<
double>(
"max_lostHitFraction") ?
cfg.getParameter<
double>(
"max_lostHitFraction") : 1.0);
154 min_eta_.push_back(
cfg.getParameter<
double>(
"min_eta"));
155 max_eta_.push_back(
cfg.getParameter<
double>(
"max_eta"));
159 keepAllTracks_.push_back(
cfg.exists(
"keepAllTracks") ?
cfg.getParameter<
bool>(
"keepAllTracks") :
false);
165 edm::LogError(
"MisConfiguration") <<
"vector of size less then 2";
169 if (
cfg.exists(
"qualityBit")) {
171 if (!qualityStr.empty()) {
179 <<
"If you set 'keepAllTracks' to true, you must specify which qualityBit to set.\n";
182 <<
"You can't set the quality bit " <<
cfg.getParameter<
std::string>(
"qualityBit")
183 <<
" as it is 'undefQuality' or unknown.\n";
193 bool thisMVA =
false;
194 if (
cfg.exists(
"useMVA"))
195 thisMVA =
cfg.getParameter<
bool>(
"useMVA");
199 if (
cfg.exists(
"minMVA"))
200 minVal =
cfg.getParameter<
double>(
"minMVA");
204 :
"MVASelectorIter0");
205 useMVAonly_.push_back(
cfg.exists(
"useMVAonly") ?
cfg.getParameter<
bool>(
"useMVAonly") :
false);
221 produces<reco::TrackCollection>().setBranchAlias(
alias +
"Tracks");
223 produces<reco::TrackExtraCollection>().setBranchAlias(
alias +
"TrackExtras");
224 produces<TrackingRecHitCollection>().setBranchAlias(
alias +
"RecHits");
227 produces<std::vector<Trajectory>>().setBranchAlias(
alias +
"Trajectories");
228 produces<TrajTrackAssociationCollection>().setBranchAlias(
alias +
"TrajectoryTrackAssociations");
References SiStripOfflineCRack_cfg::alias, MultiTrackSelector::applyAbsCutsIfNoPV_, MultiTrackSelector::applyAdaptedPVCuts_, MultiTrackSelector::beamspot_, looper::cfg, MultiTrackSelector::chi2n_no1Dmod_par_, MultiTrackSelector::chi2n_par_, copyExtras_, copyTrajectories_, MultiTrackSelector::d0_par1_, MultiTrackSelector::d0_par2_, MultiTrackSelector::dz_par1_, MultiTrackSelector::dz_par2_, Exception, MultiTrackSelector::forest_, MultiTrackSelector::forestLabel_, MultiTrackSelector::hSrc_, MultiTrackSelector::keepAllTracks_, MultiTrackSelector::max_d0_, MultiTrackSelector::max_d0NoPV_, MultiTrackSelector::max_eta_, MultiTrackSelector::max_lostHitFraction_, MultiTrackSelector::max_lostLayers_, MultiTrackSelector::max_minMissHitOutOrIn_, MultiTrackSelector::max_relpterr_, MultiTrackSelector::max_z0_, MultiTrackSelector::max_z0NoPV_, MultiTrackSelector::min_3Dlayers_, MultiTrackSelector::min_eta_, MultiTrackSelector::min_hits_bypass_, MultiTrackSelector::min_layers_, MultiTrackSelector::min_MVA_, MultiTrackSelector::min_nhits_, MultiTrackSelector::mvaType_, MultiTrackSelector::nSigmaZ_, MultiTrackSelector::preFilter_, MultiTrackSelector::qualityToSet_, MultiTrackSelector::res_par_, MultiTrackSelector::setQualityBit_, findQualityFiles::size, MultiTrackSelector::src_, srcTass_, srcTraj_, AlCaHLTBitMon_QueryRunRegistry::string, MultiTrackSelector::useAnyMVA_, MultiTrackSelector::useMVA_, MultiTrackSelector::useMVAonly_, MultiTrackSelector::useVertices_, MultiTrackSelector::useVtxError_, MultiTrackSelector::vertexCut_, MultiTrackSelector::vertices_, and MultiTrackSelector::vtxNumber_.
◆ ~AnalyticalTrackSelector()
AnalyticalTrackSelector::~AnalyticalTrackSelector |
( |
| ) |
|
|
override |
◆ run()
process one event
Reimplemented from MultiTrackSelector.
Definition at line 234 of file AnalyticalTrackSelector.cc.
236 std::unique_ptr<reco::TrackCollection> selTracks_;
237 std::unique_ptr<reco::TrackExtraCollection> selTrackExtras_;
238 std::unique_ptr<TrackingRecHitCollection> selHits_;
239 std::unique_ptr<std::vector<Trajectory>> selTrajs_;
240 std::unique_ptr<std::vector<const Trajectory*>> selTrajPtrs_;
241 std::unique_ptr<TrajTrackAssociationCollection> selTTAss_;
246 std::vector<reco::TrackRef> trackRefs_;
250 using namespace reco;
261 vertexBeamSpot = *hBsp;
265 std::vector<Point>
points;
266 std::vector<float> vterr, vzerr;
271 LogDebug(
"SelectVertex") <<
points.size() <<
" good pixel vertices";
281 selTracks_ = std::make_unique<TrackCollection>();
284 selTrackExtras_ = std::make_unique<TrackExtraCollection>();
285 selHits_ = std::make_unique<TrackingRecHitCollection>();
291 trackRefs_.resize(hSrcTrack->size());
293 std::vector<float> mvaVals_(hSrcTrack->size(), -99.f);
298 for (TrackCollection::const_iterator it = hSrcTrack->begin(), ed = hSrcTrack->end(); it != ed; ++it, ++current) {
299 const Track& trk = *it;
302 LogTrace(
"TrackSelection") <<
"ready to check track with pt=" << trk.
pt();
306 mvaVal = mvaVals_[current];
307 bool ok =
select(0, vertexBeamSpot, srcHits, trk,
points, vterr, vzerr, mvaVal);
309 LogTrace(
"TrackSelection") <<
"track with pt=" << trk.
pt() <<
" NOT selected";
316 LogTrace(
"TrackSelection") <<
"track with pt=" << trk.
pt() <<
" selected";
317 selTracks_->push_back(
Track(trk));
321 selTracks_->back().setQuality(TrackBase::loose);
323 selTracks_->back().setQuality(TrackBase::loose);
324 selTracks_->back().setQuality(TrackBase::tight);
328 selTracks_->back().setQuality(TrackBase::looseSetWithPV);
330 selTracks_->back().setQuality(TrackBase::looseSetWithPV);
331 selTracks_->back().setQuality(TrackBase::highPuritySetWithPV);
349 selTracks_->back().setExtra(
TrackExtraRef(rTrackExtras_, selTrackExtras_->size() - 1));
353 auto const firstHitIndex = selHits_->size();
355 selHits_->push_back((*hit)->clone());
357 tx.
setHits(rHits_, firstHitIndex, selHits_->size() - firstHitIndex);
361 trackRefs_[current] =
TrackRef(rTracks_, selTracks_->size() - 1);
369 selTrajs_ = std::make_unique<std::vector<Trajectory>>();
371 selTTAss_ = std::make_unique<TrajTrackAssociationCollection>(rTrajectories_, rTracks_);
372 for (
size_t i = 0,
n = hTraj->size();
i <
n; ++
i) {
377 short oldKey = static_cast<short>(trkRef.
key());
378 if (trackRefs_[oldKey].isNonnull()) {
380 selTTAss_->insert(
Ref<vector<Trajectory>>(rTrajectories_, selTrajs_->size() - 1), trackRefs_[oldKey]);
References MultiTrackSelector::beamspot_, edm::AssociationMap< edm::OneToOne< std::vector< Trajectory >, reco::TrackCollection, unsigned short > >::const_iterator, copyExtras_, copyTrajectories_, edm::AssociationMap< Tag >::end(), reco::Track::extra(), edm::AssociationMap< Tag >::find(), edm::Event::getByToken(), edm::Event::getRefBeforePut(), muons_cff::highPurity, MultiTrackSelector::hSrc_, mps_fire::i, reco::Track::innerDetId(), reco::Track::innerMomentum(), reco::Track::innerOk(), reco::Track::innerPosition(), reco::Track::innerStateCovariance(), MultiTrackSelector::keepAllTracks_, edm::Ref< C, T, F >::key(), LogDebug, LogTrace, match(), eostools::move(), dqmiodumpmetadata::n, convertSQLiteXML::ok, reco::Track::outerDetId(), reco::Track::outerMomentum(), reco::Track::outerOk(), reco::Track::outerPosition(), reco::Track::outerStateCovariance(), HLT_2018_cff::points, MultiTrackSelector::processMVA(), edm::Handle< T >::product(), reco::TrackBase::pt(), edm::Event::put(), MultiTrackSelector::qualityToSet_, reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::Track::residuals(), reco::Track::seedDirection(), reco::Track::seedRef(), MultiTrackSelector::select(), MultiTrackSelector::selectVertices(), reco::TrackExtraBase::setHits(), MultiTrackSelector::setQualityBit_, reco::TrackExtra::setResiduals(), reco::TrackExtraBase::setTrajParams(), edm::OwnVector< T, P >::size(), MultiTrackSelector::src_, srcTass_, srcTraj_, MultiTrackSelector::useAnyMVA_, MultiTrackSelector::useVertices_, and MultiTrackSelector::vertices_.
◆ copyExtras_
bool AnalyticalTrackSelector::copyExtras_ |
|
private |
◆ copyTrajectories_
bool AnalyticalTrackSelector::copyTrajectories_ |
|
private |
◆ maxEta_
double AnalyticalTrackSelector::maxEta_ |
|
private |
◆ minEta_
double AnalyticalTrackSelector::minEta_ |
|
private |
◆ srcTass_
◆ srcTraj_
const math::XYZPoint & outerPosition() const
position of the outermost hit
const math::XYZVector & outerMomentum() const
momentum vector at the outermost hit position
std::vector< std::vector< double > > d0_par1_
std::vector< double > max_eta_
CovarianceMatrix outerStateCovariance() const
outermost trajectory state curvilinear errors
RefProd< PROD > getRefBeforePut()
unsigned int outerDetId() const
DetId of the detector on which surface the outermost state is located.
bool select(unsigned tsNum, const reco::BeamSpot &vertexBeamSpot, const TrackingRecHitCollection &recHits, const reco::Track &tk, const std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr, double mvaVal) const
return class, or -1 if rejected
const_iterator find(const key_type &k) const
find element with specified reference key
std::vector< double > max_relpterr_
T const * product() const
std::vector< int32_t > vtxNumber_
vertex cuts
std::vector< uint32_t > min_nhits_
void processMVA(edm::Event &evt, const edm::EventSetup &es, const reco::BeamSpot &beamspot, const reco::VertexCollection &vertices, int selIndex, std::vector< float > &mvaVals_, bool writeIt=false) const
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
std::vector< double > chi2n_no1Dmod_par_
bool copyTrajectories_
copy also trajectories and trajectory->track associations
edm::EDGetTokenT< std::vector< Trajectory > > srcTraj_
edm::EDGetTokenT< TrajTrackAssociationCollection > srcTass_
std::vector< double > max_z0NoPV_
std::vector< std::string > forestLabel_
std::vector< uint32_t > min_hits_bypass_
bool outerOk() const
return true if the outermost hit is valid
std::vector< bool > applyAbsCutsIfNoPV_
const TrackExtraRef & extra() const
reference to "extra" object
CovarianceMatrix innerStateCovariance() const
innermost trajectory state curvilinear errors
bool innerOk() const
return true if the innermost hit is valid
double pt() const
track transverse momentum
std::vector< std::string > mvaType_
const_iterator end() const
last iterator over the map (read only)
std::vector< std::vector< double > > dz_par2_
const math::XYZVector & innerMomentum() const
momentum vector at the innermost hit position
std::vector< int32_t > max_minMissHitOutOrIn_
std::vector< double > chi2n_par_
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
void selectVertices(unsigned int tsNum, const reco::VertexCollection &vtxs, std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr) const
edm::EDGetTokenT< reco::VertexCollection > vertices_
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
edm::Ref< TrackCollection > TrackRef
persistent reference to a Track
std::vector< double > min_eta_
std::vector< std::vector< double > > d0_par2_
friend struct const_iterator
std::vector< double > max_d0NoPV_
const PropagationDirection & seedDirection() const
direction of how the hits were sorted in the original seed
std::pair< typename Association::data_type::first_type, double > match(Reference key, Association association, bool bestMatchByMaxValue)
Generic matching function.
edm::Ref< TrackExtraCollection > TrackExtraRef
persistent reference to a TrackExtra
std::vector< bool > useMVA_
std::vector< std::vector< double > > dz_par1_
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.
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
std::vector< bool > applyAdaptedPVCuts_
MultiTrackSelector()
constructor
std::vector< bool > keepAllTracks_
std::vector< unsigned int > preFilter_
std::vector< uint32_t > min_3Dlayers_
const edm::RefToBase< TrajectorySeed > & seedRef() const
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
const TrackResiduals & residuals() const
get the residuals
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
std::vector< double > nSigmaZ_
std::vector< uint32_t > max_lostLayers_
std::vector< double > max_d0_
Impact parameter absolute cuts.
key_type key() const
Accessor for product key.
std::vector< int32_t > max_lostHitFraction_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
std::vector< GBRForest * > forest_
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
std::vector< Track > TrackCollection
collection of Tracks
bool copyExtras_
copy only the tracks, not extras and rechits (for AOD)
std::vector< double > max_z0_
std::vector< bool > useMVAonly_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
std::vector< double > min_MVA_
std::vector< std::vector< double > > res_par_