CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
MultiTrackSelector Class Reference

#include <MultiTrackSelector.h>

Inheritance diagram for MultiTrackSelector:
edm::stream::EDProducer<> AnalyticalTrackSelector

Public Types

using MVACollection = std::vector< float >
 
using QualityMaskCollection = std::vector< unsigned char >
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Public Member Functions

 MultiTrackSelector ()
 constructor More...
 
 MultiTrackSelector (const edm::ParameterSet &cfg)
 
 ~MultiTrackSelector () override
 destructor More...
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Protected Types

typedef math::XYZPoint Point
 

Protected Member Functions

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...
 
virtual void run (edm::Event &evt, const edm::EventSetup &es) const
 
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
 

Protected Attributes

std::vector< bool > applyAbsCutsIfNoPV_
 
std::vector< bool > applyAdaptedPVCuts_
 
edm::EDGetTokenT< reco::BeamSpotbeamspot_
 
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< TrackingRecHitCollectionhSrc_
 
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::TrackQualityqualityToSet_
 
std::vector< std::vector< double > > res_par_
 
std::vector< bool > setQualityBit_
 do I have to set a quality bit? More...
 
edm::EDGetTokenT< reco::TrackCollectionsrc_
 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::VertexCollectionvertices_
 
std::vector< int32_t > vtxNumber_
 vertex cuts More...
 

Detailed Description

selects a subset of a track collection, copying extra information on demand

Author
David Lange

Definition at line 35 of file MultiTrackSelector.h.

Member Typedef Documentation

◆ MVACollection

using MultiTrackSelector::MVACollection = std::vector<float>

Definition at line 44 of file MultiTrackSelector.h.

◆ Point

Definition at line 56 of file MultiTrackSelector.h.

◆ QualityMaskCollection

using MultiTrackSelector::QualityMaskCollection = std::vector<unsigned char>

Definition at line 45 of file MultiTrackSelector.h.

Constructor & Destructor Documentation

◆ MultiTrackSelector() [1/2]

MultiTrackSelector::MultiTrackSelector ( )
explicit

constructor

Definition at line 17 of file MultiTrackSelector.cc.

17 { useForestFromDB_ = true; }

◆ MultiTrackSelector() [2/2]

MultiTrackSelector::MultiTrackSelector ( const edm::ParameterSet cfg)
explicit

Definition at line 19 of file MultiTrackSelector.cc.

20  : src_(consumes<reco::TrackCollection>(cfg.getParameter<edm::InputTag>("src"))),
21  hSrc_(consumes<TrackingRecHitCollection>(cfg.getParameter<edm::InputTag>("src"))),
22  beamspot_(consumes<reco::BeamSpot>(cfg.getParameter<edm::InputTag>("beamspot"))),
23  useVertices_(cfg.getParameter<bool>("useVertices")),
24  useVtxError_(cfg.getParameter<bool>("useVtxError"))
25 // now get the pset for each selector
26 {
27  if (useVertices_)
28  vertices_ = consumes<reco::VertexCollection>(cfg.getParameter<edm::InputTag>("vertices"));
29  if (useVtxError_) {
30  edm::LogWarning("MultiTRackSelector") << "you are executing buggy code, if intentional please help to fix it";
31  }
32  useAnyMVA_ = false;
33  useForestFromDB_ = true;
34  dbFileName_ = "";
35 
36  if (cfg.exists("useAnyMVA"))
37  useAnyMVA_ = cfg.getParameter<bool>("useAnyMVA");
38 
39  if (useAnyMVA_) {
40  if (cfg.exists("GBRForestFileName")) {
41  dbFileName_ = cfg.getParameter<std::string>("GBRForestFileName");
42  useForestFromDB_ = false;
43  }
44  }
45  std::vector<edm::ParameterSet> trkSelectors(cfg.getParameter<std::vector<edm::ParameterSet>>("trackSelectors"));
46  qualityToSet_.reserve(trkSelectors.size());
47  vtxNumber_.reserve(trkSelectors.size());
48  vertexCut_.reserve(trkSelectors.size());
49  res_par_.reserve(trkSelectors.size());
50  chi2n_par_.reserve(trkSelectors.size());
51  chi2n_no1Dmod_par_.reserve(trkSelectors.size());
52  d0_par1_.reserve(trkSelectors.size());
53  dz_par1_.reserve(trkSelectors.size());
54  d0_par2_.reserve(trkSelectors.size());
55  dz_par2_.reserve(trkSelectors.size());
56  applyAdaptedPVCuts_.reserve(trkSelectors.size());
57  max_d0_.reserve(trkSelectors.size());
58  max_z0_.reserve(trkSelectors.size());
59  nSigmaZ_.reserve(trkSelectors.size());
60  min_layers_.reserve(trkSelectors.size());
61  min_3Dlayers_.reserve(trkSelectors.size());
62  max_lostLayers_.reserve(trkSelectors.size());
63  min_hits_bypass_.reserve(trkSelectors.size());
64  applyAbsCutsIfNoPV_.reserve(trkSelectors.size());
65  max_d0NoPV_.reserve(trkSelectors.size());
66  max_z0NoPV_.reserve(trkSelectors.size());
67  preFilter_.reserve(trkSelectors.size());
68  max_relpterr_.reserve(trkSelectors.size());
69  min_nhits_.reserve(trkSelectors.size());
70  max_minMissHitOutOrIn_.reserve(trkSelectors.size());
71  max_lostHitFraction_.reserve(trkSelectors.size());
72  min_eta_.reserve(trkSelectors.size());
73  max_eta_.reserve(trkSelectors.size());
74  useMVA_.reserve(trkSelectors.size());
75  useMVAonly_.reserve(trkSelectors.size());
76  //mvaReaders_.reserve(trkSelectors.size());
77  min_MVA_.reserve(trkSelectors.size());
78  mvaType_.reserve(trkSelectors.size());
79  forestLabel_.reserve(trkSelectors.size());
80  forest_.reserve(trkSelectors.size());
81 
82  produces<edm::ValueMap<float>>("MVAVals");
83 
84  //foward compatibility
85  produces<MVACollection>("MVAValues");
86 
87  for (unsigned int i = 0; i < trkSelectors.size(); i++) {
88  qualityToSet_.push_back(TrackBase::undefQuality);
89  // parameters for vertex selection
90  vtxNumber_.push_back(useVertices_ ? trkSelectors[i].getParameter<int32_t>("vtxNumber") : 0);
91  vertexCut_.push_back(useVertices_ ? trkSelectors[i].getParameter<std::string>("vertexCut") : nullptr);
92  // parameters for adapted optimal cuts on chi2 and primary vertex compatibility
93  res_par_.push_back(trkSelectors[i].getParameter<std::vector<double>>("res_par"));
94  chi2n_par_.push_back(trkSelectors[i].getParameter<double>("chi2n_par"));
95  chi2n_no1Dmod_par_.push_back(trkSelectors[i].getParameter<double>("chi2n_no1Dmod_par"));
96  d0_par1_.push_back(trkSelectors[i].getParameter<std::vector<double>>("d0_par1"));
97  dz_par1_.push_back(trkSelectors[i].getParameter<std::vector<double>>("dz_par1"));
98  d0_par2_.push_back(trkSelectors[i].getParameter<std::vector<double>>("d0_par2"));
99  dz_par2_.push_back(trkSelectors[i].getParameter<std::vector<double>>("dz_par2"));
100  // Boolean indicating if adapted primary vertex compatibility cuts are to be applied.
101  applyAdaptedPVCuts_.push_back(trkSelectors[i].getParameter<bool>("applyAdaptedPVCuts"));
102  // Impact parameter absolute cuts.
103  max_d0_.push_back(trkSelectors[i].getParameter<double>("max_d0"));
104  max_z0_.push_back(trkSelectors[i].getParameter<double>("max_z0"));
105  nSigmaZ_.push_back(trkSelectors[i].getParameter<double>("nSigmaZ"));
106  // Cuts on numbers of layers with hits/3D hits/lost hits.
107  min_layers_.push_back(trkSelectors[i].getParameter<uint32_t>("minNumberLayers"));
108  min_3Dlayers_.push_back(trkSelectors[i].getParameter<uint32_t>("minNumber3DLayers"));
109  max_lostLayers_.push_back(trkSelectors[i].getParameter<uint32_t>("maxNumberLostLayers"));
110  min_hits_bypass_.push_back(trkSelectors[i].getParameter<uint32_t>("minHitsToBypassChecks"));
111  // Flag to apply absolute cuts if no PV passes the selection
112  applyAbsCutsIfNoPV_.push_back(trkSelectors[i].getParameter<bool>("applyAbsCutsIfNoPV"));
113  keepAllTracks_.push_back(trkSelectors[i].getParameter<bool>("keepAllTracks"));
114  max_relpterr_.push_back(trkSelectors[i].getParameter<double>("max_relpterr"));
115  min_nhits_.push_back(trkSelectors[i].getParameter<uint32_t>("min_nhits"));
116  max_minMissHitOutOrIn_.push_back(trkSelectors[i].existsAs<int32_t>("max_minMissHitOutOrIn")
117  ? trkSelectors[i].getParameter<int32_t>("max_minMissHitOutOrIn")
118  : 99);
119  max_lostHitFraction_.push_back(trkSelectors[i].existsAs<double>("max_lostHitFraction")
120  ? trkSelectors[i].getParameter<double>("max_lostHitFraction")
121  : 1.0);
122  min_eta_.push_back(trkSelectors[i].existsAs<double>("min_eta") ? trkSelectors[i].getParameter<double>("min_eta")
123  : -9999);
124  max_eta_.push_back(trkSelectors[i].existsAs<double>("max_eta") ? trkSelectors[i].getParameter<double>("max_eta")
125  : 9999);
126 
127  setQualityBit_.push_back(false);
128  std::string qualityStr = trkSelectors[i].getParameter<std::string>("qualityBit");
129  if (!qualityStr.empty()) {
130  setQualityBit_[i] = true;
131  qualityToSet_[i] = TrackBase::qualityByName(trkSelectors[i].getParameter<std::string>("qualityBit"));
132  }
133 
134  if (setQualityBit_[i] && (qualityToSet_[i] == TrackBase::undefQuality))
135  throw cms::Exception("Configuration")
136  << "You can't set the quality bit " << trkSelectors[i].getParameter<std::string>("qualityBit")
137  << " as it is 'undefQuality' or unknown.\n";
138 
139  if (applyAbsCutsIfNoPV_[i]) {
140  max_d0NoPV_.push_back(trkSelectors[i].getParameter<double>("max_d0NoPV"));
141  max_z0NoPV_.push_back(trkSelectors[i].getParameter<double>("max_z0NoPV"));
142  } else { //dummy values
143  max_d0NoPV_.push_back(0.);
144  max_z0NoPV_.push_back(0.);
145  }
146 
147  name_.push_back(trkSelectors[i].getParameter<std::string>("name"));
148 
149  preFilter_[i] = trkSelectors.size(); // no prefilter
150 
151  std::string pfName = trkSelectors[i].getParameter<std::string>("preFilterName");
152  if (!pfName.empty()) {
153  bool foundPF = false;
154  for (unsigned int j = 0; j < i; j++)
155  if (name_[j] == pfName) {
156  foundPF = true;
157  preFilter_[i] = j;
158  }
159  if (!foundPF)
160  throw cms::Exception("Configuration") << "Invalid prefilter name in MultiTrackSelector "
161  << trkSelectors[i].getParameter<std::string>("preFilterName");
162  }
163 
164  // produces<std::vector<int> >(name_[i]).setBranchAlias( name_[i] + "TrackQuals");
165  produces<edm::ValueMap<int>>(name_[i]).setBranchAlias(name_[i] + "TrackQuals");
166  produces<QualityMaskCollection>(name_[i]).setBranchAlias(name_[i] + "QualityMasks");
167  if (useAnyMVA_) {
168  bool thisMVA = false;
169  if (trkSelectors[i].exists("useMVA"))
170  thisMVA = trkSelectors[i].getParameter<bool>("useMVA");
171  useMVA_.push_back(thisMVA);
172  if (thisMVA) {
173  double minVal = -1;
174  if (trkSelectors[i].exists("minMVA"))
175  minVal = trkSelectors[i].getParameter<double>("minMVA");
176  min_MVA_.push_back(minVal);
177  mvaType_.push_back(trkSelectors[i].exists("mvaType") ? trkSelectors[i].getParameter<std::string>("mvaType")
178  : "Detached");
179  forestLabel_.push_back(trkSelectors[i].exists("GBRForestLabel")
180  ? trkSelectors[i].getParameter<std::string>("GBRForestLabel")
181  : "MVASelectorIter0");
182  useMVAonly_.push_back(trkSelectors[i].exists("useMVAonly") ? trkSelectors[i].getParameter<bool>("useMVAonly")
183  : false);
184  } else {
185  min_MVA_.push_back(-9999.0);
186  useMVAonly_.push_back(false);
187  mvaType_.push_back("Detached");
188  forestLabel_.push_back("MVASelectorIter0");
189  }
190  } else {
191  useMVA_.push_back(false);
192  useMVAonly_.push_back(false);
193  min_MVA_.push_back(-9999.0);
194  mvaType_.push_back("Detached");
195  forestLabel_.push_back("MVASelectorIter0");
196  }
197  }
198 }

References applyAbsCutsIfNoPV_, applyAdaptedPVCuts_, looper::cfg, chi2n_no1Dmod_par_, chi2n_par_, d0_par1_, d0_par2_, dbFileName_, dz_par1_, dz_par2_, Exception, forest_, forestLabel_, mps_fire::i, dqmiolumiharvest::j, keepAllTracks_, max_d0_, max_d0NoPV_, max_eta_, max_lostHitFraction_, max_lostLayers_, max_minMissHitOutOrIn_, max_relpterr_, max_z0_, max_z0NoPV_, min_3Dlayers_, min_eta_, min_hits_bypass_, min_layers_, min_MVA_, min_nhits_, mvaType_, name_, nSigmaZ_, preFilter_, qualityToSet_, res_par_, setQualityBit_, AlCaHLTBitMon_QueryRunRegistry::string, useAnyMVA_, useForestFromDB_, useMVA_, useMVAonly_, useVertices_, useVtxError_, vertexCut_, vertices_, and vtxNumber_.

◆ ~MultiTrackSelector()

MultiTrackSelector::~MultiTrackSelector ( )
override

destructor

Definition at line 200 of file MultiTrackSelector.cc.

200  {
201  for (auto forest : forest_)
202  delete forest;
203 }

References forest_.

Member Function Documentation

◆ beginStream()

void MultiTrackSelector::beginStream ( edm::StreamID  )
finalprotected

Definition at line 205 of file MultiTrackSelector.cc.

205  {
206  if (!useForestFromDB_) {
207  TFile gbrfile(dbFileName_.c_str());
208  for (int i = 0; i < (int)forestLabel_.size(); i++) {
209  forest_[i] = (GBRForest*)gbrfile.Get(forestLabel_[i].c_str());
210  }
211  }
212 }

References dbFileName_, forest_, forestLabel_, mps_fire::i, createfilelist::int, and useForestFromDB_.

◆ getBestVertex()

MultiTrackSelector::Point MultiTrackSelector::getBestVertex ( const reco::TrackBaseRef  track,
const reco::VertexCollection  vertices 
) const
protected

Definition at line 653 of file MultiTrackSelector.cc.

653  {
654  Point p(0, 0, -99999);
655  Point p_dz(0, 0, -99999);
656  float bestWeight = 0;
657  float dzmin = 10000;
658  bool weightMatch = false;
659  for (auto const& vertex : vertices) {
660  float w = vertex.trackWeight(track);
661  const Point& v_pos = vertex.position();
662  if (w > bestWeight) {
663  p = v_pos;
664  bestWeight = w;
665  weightMatch = true;
666  }
667  float dz = fabs(track.get()->dz(v_pos));
668  if (dz < dzmin) {
669  p_dz = v_pos;
670  dzmin = dz;
671  }
672  }
673  if (weightMatch)
674  return p;
675  else
676  return p_dz;
677 }

References PVValHelper::dz, AlCaHLTBitMon_ParallelJobs::p, HLT_FULL_cff::track, bphysicsOniaDQM_cfi::vertex, pwdgSkimBPark_cfi::vertices, and w.

Referenced by processMVA().

◆ processMVA()

void MultiTrackSelector::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
protected

Definition at line 527 of file MultiTrackSelector.cc.

533  {
534  using namespace std;
535  using namespace edm;
536  using namespace reco;
537 
538  // Get tracks
539  Handle<TrackCollection> hSrcTrack;
540  evt.getByToken(src_, hSrcTrack);
541  const TrackCollection& srcTracks(*hSrcTrack);
542  RefToBaseProd<Track> rtbpTrackCollection(hSrcTrack);
543  assert(mvaVals_.size() == srcTracks.size());
544 
545  // get hits in track..
547  evt.getByToken(hSrc_, hSrcHits);
548  const TrackingRecHitCollection& srcHits(*hSrcHits);
549 
550  auto mvaValValueMap = std::make_unique<edm::ValueMap<float>>();
551  edm::ValueMap<float>::Filler mvaFiller(*mvaValValueMap);
552 
553  if (!useAnyMVA_ && writeIt) {
554  // mvaVals_ already initalized...
555  mvaFiller.insert(hSrcTrack, mvaVals_.begin(), mvaVals_.end());
556  mvaFiller.fill();
557  evt.put(std::move(mvaValValueMap), "MVAVals");
558  auto mvas = std::make_unique<MVACollection>(mvaVals_.begin(), mvaVals_.end());
559  evt.put(std::move(mvas), "MVAValues");
560  return;
561  }
562 
563  if (!useMVA_[selIndex] && !writeIt)
564  return;
565 
566  size_t current = 0;
567  for (TrackCollection::const_iterator it = srcTracks.begin(), ed = srcTracks.end(); it != ed; ++it, ++current) {
568  const Track& trk = *it;
569  RefToBase<Track> trackRef(rtbpTrackCollection, current);
570  auto tmva_ndof_ = trk.ndof();
571  auto tmva_nlayers_ = trk.hitPattern().trackerLayersWithMeasurement();
572  auto tmva_nlayers3D_ =
575  float chi2n = trk.normalizedChi2();
576  float chi2n_no1Dmod = chi2n;
577 
578  int count1dhits = 0;
579  auto ith = trk.extra()->firstRecHit();
580  auto edh = ith + trk.recHitsSize();
581  for (; ith < edh; ++ith) {
582  const TrackingRecHit& hit = srcHits[ith];
583  if (hit.dimension() == 1)
584  ++count1dhits;
585  }
586  if (count1dhits > 0) {
587  float chi2 = trk.chi2();
588  float ndof = trk.ndof();
589  chi2n = (chi2 + count1dhits) / float(ndof + count1dhits);
590  }
591  auto tmva_chi2n_ = chi2n;
592  auto tmva_chi2n_no1dmod_ = chi2n_no1Dmod;
593  auto tmva_eta_ = trk.eta();
594  auto tmva_relpterr_ = float(trk.ptError()) / std::max(float(trk.pt()), 0.000001f);
595  auto tmva_nhits_ = trk.numberOfValidHits();
598  auto tmva_minlost_ = std::min(lostIn, lostOut);
599  auto tmva_lostmidfrac_ = trk.numberOfLostHits() / (trk.numberOfValidHits() + trk.numberOfLostHits());
600  auto tmva_absd0_ = fabs(-trk.dxy(beamspot.position()));
601  auto tmva_absdz_ = fabs(trk.dz(beamspot.position()));
602  Point bestVertex = getBestVertex(trackRef, vertices);
603  auto tmva_absd0PV_ = fabs(trk.dxy(bestVertex));
604  auto tmva_absdzPV_ = fabs(trk.dz(bestVertex));
605  auto tmva_pt_ = trk.pt();
606 
607  GBRForest const* forest = forest_[selIndex];
608  if (useForestFromDB_) {
609  edm::ESHandle<GBRForest> forestHandle;
610  es.get<GBRWrapperRcd>().get(forestLabel_[selIndex], forestHandle);
611  forest = forestHandle.product();
612  }
613 
614  float gbrVals_[16];
615  gbrVals_[0] = tmva_pt_;
616  gbrVals_[1] = tmva_lostmidfrac_;
617  gbrVals_[2] = tmva_minlost_;
618  gbrVals_[3] = tmva_nhits_;
619  gbrVals_[4] = tmva_relpterr_;
620  gbrVals_[5] = tmva_eta_;
621  gbrVals_[6] = tmva_chi2n_no1dmod_;
622  gbrVals_[7] = tmva_chi2n_;
623  gbrVals_[8] = tmva_nlayerslost_;
624  gbrVals_[9] = tmva_nlayers3D_;
625  gbrVals_[10] = tmva_nlayers_;
626  gbrVals_[11] = tmva_ndof_;
627  gbrVals_[12] = tmva_absd0PV_;
628  gbrVals_[13] = tmva_absdzPV_;
629  gbrVals_[14] = tmva_absdz_;
630  gbrVals_[15] = tmva_absd0_;
631 
632  if (mvaType_[selIndex] == "Prompt") {
633  auto gbrVal = forest->GetClassifier(gbrVals_);
634  mvaVals_[current] = gbrVal;
635  } else {
636  float detachedGbrVals_[12];
637  for (int jjj = 0; jjj < 12; jjj++)
638  detachedGbrVals_[jjj] = gbrVals_[jjj];
639  auto gbrVal = forest->GetClassifier(detachedGbrVals_);
640  mvaVals_[current] = gbrVal;
641  }
642  }
643 
644  if (writeIt) {
645  mvaFiller.insert(hSrcTrack, mvaVals_.begin(), mvaVals_.end());
646  mvaFiller.fill();
647  evt.put(std::move(mvaValValueMap), "MVAVals");
648  auto mvas = std::make_unique<MVACollection>(mvaVals_.begin(), mvaVals_.end());
649  evt.put(std::move(mvas), "MVAValues");
650  }
651 }

References cms::cuda::assert(), hltPixelTracks_cff::chi2, reco::TrackBase::chi2(), chi2n, reco::TrackBase::dxy(), reco::TrackBase::dz(), reco::TrackBase::eta(), reco::Track::extra(), f, dqmMemoryStats::float, forest_, forestLabel_, edm::EventSetup::get(), get, getBestVertex(), edm::Event::getByToken(), GBRForest::GetClassifier(), reco::TrackBase::hitPattern(), hSrc_, SiStripPI::max, min(), reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, eostools::move(), mvaType_, ndof, reco::TrackBase::ndof(), reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfLostHits(), reco::HitPattern::numberOfLostTrackerHits(), reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo(), reco::HitPattern::pixelLayersWithMeasurement(), edm::ESHandle< T >::product(), reco::TrackBase::pt(), reco::TrackBase::ptError(), edm::Event::put(), reco::Track::recHitsSize(), src_, HiCentrality_cfi::srcTracks, reco::HitPattern::TRACK_HITS, reco::HitPattern::trackerLayersWithMeasurement(), reco::HitPattern::trackerLayersWithoutMeasurement(), useAnyMVA_, useForestFromDB_, useMVA_, and pwdgSkimBPark_cfi::vertices.

Referenced by AnalyticalTrackSelector::run(), and run().

◆ produce()

void MultiTrackSelector::produce ( edm::Event evt,
const edm::EventSetup es 
)
inlinefinalprotected

process one event

Definition at line 58 of file MultiTrackSelector.h.

58 { run(evt, es); }

References writedatasetfile::run.

◆ run()

void MultiTrackSelector::run ( edm::Event evt,
const edm::EventSetup es 
) const
protectedvirtual

Reimplemented in AnalyticalTrackSelector.

Definition at line 214 of file MultiTrackSelector.cc.

214  {
215  using namespace std;
216  using namespace edm;
217  using namespace reco;
218 
219  // Get tracks
220  Handle<TrackCollection> hSrcTrack;
221  evt.getByToken(src_, hSrcTrack);
222 
223  const TrackCollection& srcTracks(*hSrcTrack);
224  if (hSrcTrack.failedToGet())
225  edm::LogWarning("MultiTrackSelector") << "could not get Track collection";
226 
227  // get hits in track..
229  evt.getByToken(hSrc_, hSrcHits);
230  const TrackingRecHitCollection& srcHits(*hSrcHits);
231 
232  // looking for the beam spot
234  evt.getByToken(beamspot_, hBsp);
235  const reco::BeamSpot& vertexBeamSpot(*hBsp);
236 
237  // Select good primary vertices for use in subsequent track selection
239  if (useVertices_) {
240  evt.getByToken(vertices_, hVtx);
241  if (hVtx.failedToGet())
242  edm::LogWarning("MultiTrackSelector") << "could not get Vertex collection";
243  }
244 
245  unsigned int trkSize = srcTracks.size();
246  std::vector<int> selTracksSave(qualityToSet_.size() * trkSize, 0);
247 
248  std::vector<Point> points;
249  std::vector<float> vterr, vzerr;
250  if (useVertices_)
251  selectVertices(0, *hVtx, points, vterr, vzerr);
252  //auto vtxP = points.empty() ? vertexBeamSpot.position() : points[0]; // rare, very rare, still happens!
253  for (unsigned int i = 0; i < qualityToSet_.size(); i++) {
254  std::vector<float> mvaVals_(srcTracks.size(), -99.f);
255  processMVA(evt, es, vertexBeamSpot, *(hVtx.product()), i, mvaVals_, i == 0 ? true : false);
256  std::vector<int> selTracks(trkSize, 0);
257  auto selTracksValueMap = std::make_unique<edm::ValueMap<int>>();
258  edm::ValueMap<int>::Filler filler(*selTracksValueMap);
259 
260  if (useVertices_)
261  selectVertices(i, *hVtx, points, vterr, vzerr);
262 
263  // Loop over tracks
264  size_t current = 0;
265  for (TrackCollection::const_iterator it = srcTracks.begin(), ed = srcTracks.end(); it != ed; ++it, ++current) {
266  const Track& trk = *it;
267  // Check if this track passes cuts
268 
269  LogTrace("TrackSelection") << "ready to check track with pt=" << trk.pt();
270 
271  //already removed
272  bool ok = true;
273  if (preFilter_[i] < i && selTracksSave[preFilter_[i] * trkSize + current] < 0) {
274  selTracks[current] = -1;
275  ok = false;
276  if (!keepAllTracks_[i])
277  continue;
278  } else {
279  float mvaVal = 0;
280  if (useAnyMVA_)
281  mvaVal = mvaVals_[current];
282  ok = select(i, vertexBeamSpot, srcHits, trk, points, vterr, vzerr, mvaVal);
283  if (!ok) {
284  LogTrace("TrackSelection") << "track with pt=" << trk.pt() << " NOT selected";
285  if (!keepAllTracks_[i]) {
286  selTracks[current] = -1;
287  continue;
288  }
289  } else
290  LogTrace("TrackSelection") << "track with pt=" << trk.pt() << " selected";
291  }
292 
293  if (preFilter_[i] < i) {
294  selTracks[current] = selTracksSave[preFilter_[i] * trkSize + current];
295  } else {
296  selTracks[current] = trk.qualityMask();
297  }
298  if (ok && setQualityBit_[i]) {
299  selTracks[current] = (selTracks[current] | (1 << qualityToSet_[i]));
300  if (qualityToSet_[i] == TrackBase::tight) {
301  selTracks[current] = (selTracks[current] | (1 << TrackBase::loose));
302  } else if (qualityToSet_[i] == TrackBase::highPurity) {
303  selTracks[current] = (selTracks[current] | (1 << TrackBase::loose));
304  selTracks[current] = (selTracks[current] | (1 << TrackBase::tight));
305  }
306  if (!points.empty()) {
307  if (qualityToSet_[i] == TrackBase::loose) {
308  selTracks[current] = (selTracks[current] | (1 << TrackBase::looseSetWithPV));
309  } else if (qualityToSet_[i] == TrackBase::highPurity) {
310  selTracks[current] = (selTracks[current] | (1 << TrackBase::looseSetWithPV));
311  selTracks[current] = (selTracks[current] | (1 << TrackBase::highPuritySetWithPV));
312  }
313  }
314  }
315  }
316  for (unsigned int j = 0; j < trkSize; j++)
317  selTracksSave[j + i * trkSize] = selTracks[j];
318  filler.insert(hSrcTrack, selTracks.begin(), selTracks.end());
319  filler.fill();
320 
321  // evt.put(std::move(selTracks),name_[i]);
322  evt.put(std::move(selTracksValueMap), name_[i]);
323  for (auto& q : selTracks)
324  q = std::max(q, 0);
325  auto quals = std::make_unique<QualityMaskCollection>(selTracks.begin(), selTracks.end());
326  evt.put(std::move(quals), name_[i]);
327  }
328 }

References beamspot_, edm::HandleBase::failedToGet(), trigObjTnPSource_cfi::filler, edm::Event::getByToken(), muons_cff::highPurity, hSrc_, mps_fire::i, dqmiolumiharvest::j, keepAllTracks_, LogTrace, SiStripPI::max, eostools::move(), name_, convertSQLiteXML::ok, HLT_FULL_cff::points, preFilter_, processMVA(), edm::Handle< T >::product(), reco::TrackBase::pt(), edm::Event::put(), submitPVResolutionJobs::q, reco::TrackBase::qualityMask(), qualityToSet_, select(), selectVertices(), setQualityBit_, src_, HiCentrality_cfi::srcTracks, useAnyMVA_, useVertices_, and vertices_.

◆ select()

bool MultiTrackSelector::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
protected

return class, or -1 if rejected

Definition at line 330 of file MultiTrackSelector.cc.

337  {
338  // Decide if the given track passes selection cuts.
339 
340  using namespace std;
341 
342  //cuts on number of valid hits
343  auto nhits = tk.numberOfValidHits();
344  if (nhits >= min_hits_bypass_[tsNum])
345  return true;
346  if (nhits < min_nhits_[tsNum])
347  return false;
348 
349  if (tk.ndof() < 1E-5)
350  return false;
351 
353  //Adding the MVA selection before any other cut//
355  if (useAnyMVA_ && useMVA_[tsNum]) {
356  if (useMVAonly_[tsNum])
357  return mvaVal > min_MVA_[tsNum];
358  if (mvaVal < min_MVA_[tsNum])
359  return false;
360  }
362  //End of MVA selection section//
364 
365  // Cuts on numbers of layers with hits/3D hits/lost hits.
367  uint32_t nlayers3D =
370  LogDebug("TrackSelection") << "cuts on nlayers: " << nlayers << " " << nlayers3D << " " << nlayersLost << " vs "
371  << min_layers_[tsNum] << " " << min_3Dlayers_[tsNum] << " " << max_lostLayers_[tsNum];
372  if (nlayers < min_layers_[tsNum])
373  return false;
374  if (nlayers3D < min_3Dlayers_[tsNum])
375  return false;
376  if (nlayersLost > max_lostLayers_[tsNum])
377  return false;
378  LogTrace("TrackSelection") << "cuts on nlayers passed";
379 
380  float chi2n = tk.normalizedChi2();
381  float chi2n_no1Dmod = chi2n;
382 
383  int count1dhits = 0;
384  auto ith = tk.extra()->firstRecHit();
385  auto edh = ith + tk.recHitsSize();
386  for (; ith < edh; ++ith) {
387  const TrackingRecHit& hit = recHits[ith];
388  if (hit.dimension() == 1)
389  ++count1dhits;
390  }
391  if (count1dhits > 0) {
392  float chi2 = tk.chi2();
393  float ndof = tk.ndof();
394  chi2n = (chi2 + count1dhits) / float(ndof + count1dhits);
395  }
396  // For each 1D rechit, the chi^2 and ndof is increased by one. This is a way of retaining approximately
397  // the same normalized chi^2 distribution as with 2D rechits.
398  if (chi2n > chi2n_par_[tsNum] * nlayers)
399  return false;
400 
401  if (chi2n_no1Dmod > chi2n_no1Dmod_par_[tsNum] * nlayers)
402  return false;
403 
404  // Get track parameters
405  float pt = std::max(float(tk.pt()), 0.000001f);
406  float eta = tk.eta();
407  if (eta < min_eta_[tsNum] || eta > max_eta_[tsNum])
408  return false;
409 
410  //cuts on relative error on pt
411  float relpterr = float(tk.ptError()) / pt;
412  if (relpterr > max_relpterr_[tsNum])
413  return false;
414 
417  int minLost = std::min(lostIn, lostOut);
418  if (minLost > max_minMissHitOutOrIn_[tsNum])
419  return false;
420  float lostMidFrac = tk.numberOfLostHits() / (tk.numberOfValidHits() + tk.numberOfLostHits());
421  if (lostMidFrac > max_lostHitFraction_[tsNum])
422  return false;
423 
424  //other track parameters
425  float d0 = -tk.dxy(vertexBeamSpot.position()), d0E = tk.d0Error(), dz = tk.dz(vertexBeamSpot.position()),
426  dzE = tk.dzError();
427 
428  // parametrized d0 resolution for the track pt
429  float nomd0E = sqrt(res_par_[tsNum][0] * res_par_[tsNum][0] + (res_par_[tsNum][1] / pt) * (res_par_[tsNum][1] / pt));
430  // parametrized z0 resolution for the track pt and eta
431  float nomdzE = nomd0E * (std::cosh(eta));
432 
433  float dzCut = std::min(powN(dz_par1_[tsNum][0] * nlayers, int(dz_par1_[tsNum][1] + 0.5)) * nomdzE,
434  powN(dz_par2_[tsNum][0] * nlayers, int(dz_par2_[tsNum][1] + 0.5)) * dzE);
435  float d0Cut = std::min(powN(d0_par1_[tsNum][0] * nlayers, int(d0_par1_[tsNum][1] + 0.5)) * nomd0E,
436  powN(d0_par2_[tsNum][0] * nlayers, int(d0_par2_[tsNum][1] + 0.5)) * d0E);
437 
438  // ---- PrimaryVertex compatibility cut
439  bool primaryVertexZCompatibility(false);
440  bool primaryVertexD0Compatibility(false);
441 
442  if (points.empty()) { //If not primaryVertices are reconstructed, check just the compatibility with the BS
443  //z0 within (n sigma + dzCut) of the beam spot z, if no good vertex is found
444  if (abs(dz) < hypot(vertexBeamSpot.sigmaZ() * nSigmaZ_[tsNum], dzCut))
445  primaryVertexZCompatibility = true;
446  // d0 compatibility with beam line
447  if (abs(d0) < d0Cut)
448  primaryVertexD0Compatibility = true;
449  }
450 
451  int iv = 0;
452  for (std::vector<Point>::const_iterator point = points.begin(), end = points.end(); point != end; ++point) {
453  LogTrace("TrackSelection") << "Test track w.r.t. vertex with z position " << point->z();
454  if (primaryVertexZCompatibility && primaryVertexD0Compatibility)
455  break;
456  float dzPV = tk.dz(*point); //re-evaluate the dz with respect to the vertex position
457  float d0PV = tk.dxy(*point); //re-evaluate the dxy with respect to the vertex position
458  if (useVtxError_) {
459  float dzErrPV = std::sqrt(dzE * dzE + vzerr[iv] * vzerr[iv]); // include vertex error in z
460  float d0ErrPV = std::sqrt(d0E * d0E + vterr[iv] * vterr[iv]); // include vertex error in xy
461  iv++;
462  if (abs(dzPV) < dz_par1_[tsNum][0] * pow(nlayers, dz_par1_[tsNum][1]) * nomdzE &&
463  abs(dzPV) < dz_par2_[tsNum][0] * pow(nlayers, dz_par2_[tsNum][1]) * dzErrPV && abs(dzPV) < max_z0_[tsNum])
464  primaryVertexZCompatibility = true;
465  if (abs(d0PV) < d0_par1_[tsNum][0] * pow(nlayers, d0_par1_[tsNum][1]) * nomd0E &&
466  abs(d0PV) < d0_par2_[tsNum][0] * pow(nlayers, d0_par2_[tsNum][1]) * d0ErrPV && abs(d0PV) < max_d0_[tsNum])
467  primaryVertexD0Compatibility = true;
468  } else {
469  if (abs(dzPV) < dzCut)
470  primaryVertexZCompatibility = true;
471  if (abs(d0PV) < d0Cut)
472  primaryVertexD0Compatibility = true;
473  }
474  LogTrace("TrackSelection") << "distances " << dzPV << " " << d0PV << " vs " << dzCut << " " << d0Cut;
475  }
476 
477  if (points.empty() && applyAbsCutsIfNoPV_[tsNum]) {
478  if (abs(dz) > max_z0NoPV_[tsNum] || abs(d0) > max_d0NoPV_[tsNum])
479  return false;
480  } else {
481  // Absolute cuts on all tracks impact parameters with respect to beam-spot.
482  // If BS is not compatible, verify if at least the reco-vertex is compatible (useful for incorrect BS settings)
483  if (abs(d0) > max_d0_[tsNum] && !primaryVertexD0Compatibility)
484  return false;
485  LogTrace("TrackSelection") << "absolute cuts on d0 passed";
486  if (abs(dz) > max_z0_[tsNum] && !primaryVertexZCompatibility)
487  return false;
488  LogTrace("TrackSelection") << "absolute cuts on dz passed";
489  }
490 
491  LogTrace("TrackSelection") << "cuts on PV: apply adapted PV cuts? " << applyAdaptedPVCuts_[tsNum]
492  << " d0 compatibility? " << primaryVertexD0Compatibility << " z compatibility? "
493  << primaryVertexZCompatibility;
494 
495  if (applyAdaptedPVCuts_[tsNum]) {
496  return (primaryVertexD0Compatibility && primaryVertexZCompatibility);
497  } else {
498  return true;
499  }
500 }

References funct::abs(), applyAbsCutsIfNoPV_, applyAdaptedPVCuts_, hltPixelTracks_cff::chi2, reco::TrackBase::chi2(), chi2n, chi2n_no1Dmod_par_, chi2n_par_, d0, d0_par1_, d0_par2_, TrackSplittingMonitor_cfi::d0Cut, reco::TrackBase::d0Error(), reco::TrackBase::dxy(), PVValHelper::dz, reco::TrackBase::dz(), dz_par1_, dz_par2_, TrackSplittingMonitor_cfi::dzCut, reco::TrackBase::dzError(), mps_fire::end, PVValHelper::eta, reco::TrackBase::eta(), reco::Track::extra(), f, dqmMemoryStats::float, reco::TrackBase::hitPattern(), LogDebug, LogTrace, SiStripPI::max, max_d0_, max_d0NoPV_, max_eta_, max_lostHitFraction_, max_lostLayers_, max_minMissHitOutOrIn_, max_relpterr_, max_z0_, max_z0NoPV_, min(), min_3Dlayers_, min_eta_, min_hits_bypass_, min_layers_, min_MVA_, min_nhits_, reco::HitPattern::MISSING_INNER_HITS, reco::HitPattern::MISSING_OUTER_HITS, ndof, reco::TrackBase::ndof(), nhits, nlayers, reco::TrackBase::normalizedChi2(), nSigmaZ_, reco::TrackBase::numberOfLostHits(), reco::HitPattern::numberOfLostTrackerHits(), reco::TrackBase::numberOfValidHits(), reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo(), reco::HitPattern::pixelLayersWithMeasurement(), point, HLT_FULL_cff::points, reco::BeamSpot::position(), funct::pow(), DiDispStaMuonMonitor_cfi::pt, reco::TrackBase::pt(), reco::TrackBase::ptError(), FastTrackerRecHitMaskProducer_cfi::recHits, reco::Track::recHitsSize(), relpterr, res_par_, reco::BeamSpot::sigmaZ(), mathSSE::sqrt(), reco::HitPattern::TRACK_HITS, reco::HitPattern::trackerLayersWithMeasurement(), reco::HitPattern::trackerLayersWithoutMeasurement(), useAnyMVA_, useMVA_, useMVAonly_, and useVtxError_.

Referenced by AnalyticalTrackSelector::run(), and run().

◆ selectVertices()

void MultiTrackSelector::selectVertices ( unsigned int  tsNum,
const reco::VertexCollection vtxs,
std::vector< Point > &  points,
std::vector< float > &  vterr,
std::vector< float > &  vzerr 
) const
protected

Definition at line 502 of file MultiTrackSelector.cc.

506  {
507  // Select good primary vertices
508  using namespace reco;
509  int32_t toTake = vtxNumber_[tsNum];
510  for (VertexCollection::const_iterator it = vtxs.begin(), ed = vtxs.end(); it != ed; ++it) {
511  LogDebug("SelectVertex") << " select vertex with z position " << it->z() << " " << it->chi2() << " " << it->ndof()
512  << " " << TMath::Prob(it->chi2(), static_cast<int32_t>(it->ndof()));
513  Vertex vtx = *it;
514  bool pass = vertexCut_[tsNum](vtx);
515  if (pass) {
516  points.push_back(it->position());
517  vterr.push_back(sqrt(it->yError() * it->xError()));
518  vzerr.push_back(it->zError());
519  LogTrace("SelectVertex") << " SELECTED vertex with z position " << it->z();
520  toTake--;
521  if (toTake == 0)
522  break;
523  }
524  }
525 }

References LogDebug, LogTrace, HLT_FULL_cff::points, mathSSE::sqrt(), vertexCut_, extraflags_cff::vtx, and vtxNumber_.

Referenced by AnalyticalTrackSelector::run(), and run().

Member Data Documentation

◆ applyAbsCutsIfNoPV_

std::vector<bool> MultiTrackSelector::applyAbsCutsIfNoPV_
protected

◆ applyAdaptedPVCuts_

std::vector<bool> MultiTrackSelector::applyAdaptedPVCuts_
protected

◆ beamspot_

edm::EDGetTokenT<reco::BeamSpot> MultiTrackSelector::beamspot_
protected

◆ chi2n_no1Dmod_par_

std::vector<double> MultiTrackSelector::chi2n_no1Dmod_par_
protected

◆ chi2n_par_

std::vector<double> MultiTrackSelector::chi2n_par_
protected

◆ d0_par1_

std::vector<std::vector<double> > MultiTrackSelector::d0_par1_
protected

◆ d0_par2_

std::vector<std::vector<double> > MultiTrackSelector::d0_par2_
protected

◆ dbFileName_

std::string MultiTrackSelector::dbFileName_
protected

Definition at line 156 of file MultiTrackSelector.h.

Referenced by beginStream(), and MultiTrackSelector().

◆ dz_par1_

std::vector<std::vector<double> > MultiTrackSelector::dz_par1_
protected

◆ dz_par2_

std::vector<std::vector<double> > MultiTrackSelector::dz_par2_
protected

◆ forest_

std::vector<GBRForest *> MultiTrackSelector::forest_
protected

◆ forestLabel_

std::vector<std::string> MultiTrackSelector::forestLabel_
protected

◆ hSrc_

edm::EDGetTokenT<TrackingRecHitCollection> MultiTrackSelector::hSrc_
protected

◆ keepAllTracks_

std::vector<bool> MultiTrackSelector::keepAllTracks_
protected

◆ max_d0_

std::vector<double> MultiTrackSelector::max_d0_
protected

Impact parameter absolute cuts.

Definition at line 115 of file MultiTrackSelector.h.

Referenced by AnalyticalTrackSelector::AnalyticalTrackSelector(), MultiTrackSelector(), and select().

◆ max_d0NoPV_

std::vector<double> MultiTrackSelector::max_d0NoPV_
protected

◆ max_eta_

std::vector<double> MultiTrackSelector::max_eta_
protected

◆ max_lostHitFraction_

std::vector<int32_t> MultiTrackSelector::max_lostHitFraction_
protected

◆ max_lostLayers_

std::vector<uint32_t> MultiTrackSelector::max_lostLayers_
protected

◆ max_minMissHitOutOrIn_

std::vector<int32_t> MultiTrackSelector::max_minMissHitOutOrIn_
protected

◆ max_relpterr_

std::vector<double> MultiTrackSelector::max_relpterr_
protected

◆ max_z0_

std::vector<double> MultiTrackSelector::max_z0_
protected

◆ max_z0NoPV_

std::vector<double> MultiTrackSelector::max_z0NoPV_
protected

◆ min_3Dlayers_

std::vector<uint32_t> MultiTrackSelector::min_3Dlayers_
protected

◆ min_eta_

std::vector<double> MultiTrackSelector::min_eta_
protected

◆ min_hits_bypass_

std::vector<uint32_t> MultiTrackSelector::min_hits_bypass_
protected

◆ min_layers_

std::vector<uint32_t> MultiTrackSelector::min_layers_
protected

Cuts on numbers of layers with hits/3D hits/lost hits.

Definition at line 120 of file MultiTrackSelector.h.

Referenced by AnalyticalTrackSelector::AnalyticalTrackSelector(), MultiTrackSelector(), and select().

◆ min_MVA_

std::vector<double> MultiTrackSelector::min_MVA_
protected

◆ min_nhits_

std::vector<uint32_t> MultiTrackSelector::min_nhits_
protected

◆ mvaType_

std::vector<std::string> MultiTrackSelector::mvaType_
protected

◆ name_

std::vector<std::string> MultiTrackSelector::name_
protected

Definition at line 144 of file MultiTrackSelector.h.

Referenced by MultiTrackSelector(), and run().

◆ nSigmaZ_

std::vector<double> MultiTrackSelector::nSigmaZ_
protected

◆ preFilter_

std::vector<unsigned int> MultiTrackSelector::preFilter_
protected

◆ qualityToSet_

std::vector<reco::TrackBase::TrackQuality> MultiTrackSelector::qualityToSet_
protected

◆ res_par_

std::vector<std::vector<double> > MultiTrackSelector::res_par_
protected

◆ setQualityBit_

std::vector<bool> MultiTrackSelector::setQualityBit_
protected

do I have to set a quality bit?

Definition at line 95 of file MultiTrackSelector.h.

Referenced by AnalyticalTrackSelector::AnalyticalTrackSelector(), MultiTrackSelector(), AnalyticalTrackSelector::run(), and run().

◆ src_

edm::EDGetTokenT<reco::TrackCollection> MultiTrackSelector::src_
protected

source collection label

Definition at line 86 of file MultiTrackSelector.h.

Referenced by AnalyticalTrackSelector::AnalyticalTrackSelector(), processMVA(), AnalyticalTrackSelector::run(), and run().

◆ useAnyMVA_

bool MultiTrackSelector::useAnyMVA_
protected

◆ useForestFromDB_

bool MultiTrackSelector::useForestFromDB_
protected

Definition at line 155 of file MultiTrackSelector.h.

Referenced by beginStream(), MultiTrackSelector(), and processMVA().

◆ useMVA_

std::vector<bool> MultiTrackSelector::useMVA_
protected

◆ useMVAonly_

std::vector<bool> MultiTrackSelector::useMVAonly_
protected

◆ useVertices_

bool MultiTrackSelector::useVertices_
protected

◆ useVtxError_

bool MultiTrackSelector::useVtxError_
protected

◆ vertexCut_

std::vector<StringCutObjectSelector<reco::Vertex> > MultiTrackSelector::vertexCut_
protected

◆ vertices_

edm::EDGetTokenT<reco::VertexCollection> MultiTrackSelector::vertices_
protected

◆ vtxNumber_

std::vector<int32_t> MultiTrackSelector::vtxNumber_
protected
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
reco::HitPattern::MISSING_OUTER_HITS
Definition: HitPattern.h:155
MultiTrackSelector::d0_par1_
std::vector< std::vector< double > > d0_par1_
Definition: MultiTrackSelector.h:107
MultiTrackSelector::max_eta_
std::vector< double > max_eta_
Definition: MultiTrackSelector.h:133
MultiTrackSelector::select
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
Definition: MultiTrackSelector.cc:330
mps_fire.i
i
Definition: mps_fire.py:428
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
reco::TrackBase::ptError
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:754
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
chi2n
Definition: HIMultiTrackSelector.h:45
GBRForest::GetClassifier
double GetClassifier(const float *vector) const
Definition: GBRForest.h:34
MultiTrackSelector::max_relpterr_
std::vector< double > max_relpterr_
Definition: MultiTrackSelector.h:126
edm::Handle::product
T const * product() const
Definition: Handle.h:70
MultiTrackSelector::vtxNumber_
std::vector< int32_t > vtxNumber_
vertex cuts
Definition: MultiTrackSelector.h:99
MultiTrackSelector::min_nhits_
std::vector< uint32_t > min_nhits_
Definition: MultiTrackSelector.h:127
MultiTrackSelector::processMVA
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
Definition: MultiTrackSelector.cc:527
reco::HitPattern::trackerLayersWithoutMeasurement
int trackerLayersWithoutMeasurement(HitCategory category) const
Definition: HitPattern.cc:532
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21521
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
MultiTrackSelector::chi2n_no1Dmod_par_
std::vector< double > chi2n_no1Dmod_par_
Definition: MultiTrackSelector.h:106
min
T min(T a, T b)
Definition: MathUtil.h:58
edm
HLT enums.
Definition: AlignableModifier.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
GBRForest
Definition: GBRForest.h:25
cms::cuda::assert
assert(be >=bs)
MultiTrackSelector::max_z0NoPV_
std::vector< double > max_z0NoPV_
Definition: MultiTrackSelector.h:137
MultiTrackSelector::forestLabel_
std::vector< std::string > forestLabel_
Definition: MultiTrackSelector.h:153
reco::TrackBase::ndof
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:590
HiCentrality_cfi.srcTracks
srcTracks
Definition: HiCentrality_cfi.py:21
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
MultiTrackSelector::min_hits_bypass_
std::vector< uint32_t > min_hits_bypass_
Definition: MultiTrackSelector.h:123
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
MultiTrackSelector::useAnyMVA_
bool useAnyMVA_
Definition: MultiTrackSelector.h:91
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
edm::Handle
Definition: AssociativeIterator.h:50
reco::TrackBase::numberOfValidHits
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:798
MultiTrackSelector::applyAbsCutsIfNoPV_
std::vector< bool > applyAbsCutsIfNoPV_
Definition: MultiTrackSelector.h:138
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
reco::Track::extra
const TrackExtraRef & extra() const
reference to "extra" object
Definition: Track.h:139
reco::HitPattern::pixelLayersWithMeasurement
int pixelLayersWithMeasurement() const
Definition: HitPattern.cc:492
ndof
Definition: HIMultiTrackSelector.h:49
reco::TrackBase::pt
double pt() const
track transverse momentum
Definition: TrackBase.h:637
MultiTrackSelector::mvaType_
std::vector< std::string > mvaType_
Definition: MultiTrackSelector.h:152
reco::BeamSpot::sigmaZ
double sigmaZ() const
sigma z
Definition: BeamSpot.h:76
MultiTrackSelector::dz_par2_
std::vector< std::vector< double > > dz_par2_
Definition: MultiTrackSelector.h:110
MultiTrackSelector::max_minMissHitOutOrIn_
std::vector< int32_t > max_minMissHitOutOrIn_
Definition: MultiTrackSelector.h:129
reco::Track::recHitsSize
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits).
Definition: Track.h:97
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
MultiTrackSelector::useForestFromDB_
bool useForestFromDB_
Definition: MultiTrackSelector.h:155
reco::HitPattern::trackerLayersWithMeasurement
int trackerLayersWithMeasurement() const
Definition: HitPattern.cc:513
MultiTrackSelector::useVertices_
bool useVertices_
Definition: MultiTrackSelector.h:89
relpterr
Definition: HIMultiTrackSelector.h:39
PVValHelper::eta
Definition: PVValidationHelpers.h:69
w
const double w
Definition: UKUtility.cc:23
MultiTrackSelector::chi2n_par_
std::vector< double > chi2n_par_
Definition: MultiTrackSelector.h:105
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
mps_fire.end
end
Definition: mps_fire.py:242
reco::BeamSpot
Definition: BeamSpot.h:21
TrackSplittingMonitor_cfi.dzCut
dzCut
Definition: TrackSplittingMonitor_cfi.py:20
reco::TrackBase::numberOfLostHits
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:801
reco::Track
Definition: Track.h:27
edm::ESHandle< GBRForest >
TrackSplittingMonitor_cfi.d0Cut
d0Cut
Definition: TrackSplittingMonitor_cfi.py:19
MultiTrackSelector::selectVertices
void selectVertices(unsigned int tsNum, const reco::VertexCollection &vtxs, std::vector< Point > &points, std::vector< float > &vterr, std::vector< float > &vzerr) const
Definition: MultiTrackSelector.cc:502
MultiTrackSelector::vertices_
edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: MultiTrackSelector.h:92
beamspot
Definition: BeamSpotWrite2Txt.h:8
reco::TrackBase::dz
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...
Definition: TrackBase.h:622
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
reco::TrackBase::qualityMask
int qualityMask() const
Definition: TrackBase.h:843
MultiTrackSelector::src_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
Definition: MultiTrackSelector.h:86
reco::BeamSpot::position
const Point & position() const
position
Definition: BeamSpot.h:59
nhits
Definition: HIMultiTrackSelector.h:42
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
MultiTrackSelector::min_eta_
std::vector< double > min_eta_
Definition: MultiTrackSelector.h:132
MultiTrackSelector::d0_par2_
std::vector< std::vector< double > > d0_par2_
Definition: MultiTrackSelector.h:109
MultiTrackSelector::max_d0NoPV_
std::vector< double > max_d0NoPV_
Definition: MultiTrackSelector.h:136
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
edm::HandleBase::failedToGet
bool failedToGet() const
Definition: HandleBase.h:72
bphysicsOniaDQM_cfi.vertex
vertex
Definition: bphysicsOniaDQM_cfi.py:7
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:223
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
MultiTrackSelector::name_
std::vector< std::string > name_
Definition: MultiTrackSelector.h:144
trigObjTnPSource_cfi.filler
filler
Definition: trigObjTnPSource_cfi.py:21
MultiTrackSelector::run
virtual void run(edm::Event &evt, const edm::EventSetup &es) const
Definition: MultiTrackSelector.cc:214
reco::TrackBase::eta
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:652
MultiTrackSelector::useMVA_
std::vector< bool > useMVA_
Definition: MultiTrackSelector.h:147
MultiTrackSelector::dz_par1_
std::vector< std::vector< double > > dz_par1_
Definition: MultiTrackSelector.h:108
reco::TrackBase::dzError
double dzError() const
error on dz
Definition: TrackBase.h:778
createfilelist.int
int
Definition: createfilelist.py:10
edm::Event::put
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
MultiTrackSelector::min_layers_
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
Definition: MultiTrackSelector.h:120
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
MultiTrackSelector::applyAdaptedPVCuts_
std::vector< bool > applyAdaptedPVCuts_
Definition: MultiTrackSelector.h:112
reco::TrackBase::chi2
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:587
reco::TrackBase::normalizedChi2
double normalizedChi2() const
chi-squared divided by n.d.o.f. (or chi-squared * 1e6 if n.d.o.f. is zero)
Definition: TrackBase.h:593
get
#define get
reco::HitPattern::TRACK_HITS
Definition: HitPattern.h:155
looper.cfg
cfg
Definition: looper.py:297
TrackingRecHit
Definition: TrackingRecHit.h:21
MultiTrackSelector::keepAllTracks_
std::vector< bool > keepAllTracks_
Definition: MultiTrackSelector.h:140
reco::TrackBase::hitPattern
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:504
MultiTrackSelector::useVtxError_
bool useVtxError_
Definition: MultiTrackSelector.h:90
MultiTrackSelector::preFilter_
std::vector< unsigned int > preFilter_
Definition: MultiTrackSelector.h:143
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
reco::TrackBase::d0Error
double d0Error() const
error on d0
Definition: TrackBase.h:772
extraflags_cff.vtx
vtx
Definition: extraflags_cff.py:18
MultiTrackSelector::min_3Dlayers_
std::vector< uint32_t > min_3Dlayers_
Definition: MultiTrackSelector.h:121
PVValHelper::dz
Definition: PVValidationHelpers.h:50
Exception
Definition: hltDiff.cc:246
reco::HitPattern::MISSING_INNER_HITS
Definition: HitPattern.h:155
MultiTrackSelector::qualityToSet_
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
Definition: MultiTrackSelector.h:96
MultiTrackSelector::hSrc_
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
Definition: MultiTrackSelector.h:87
muons_cff.highPurity
highPurity
Definition: muons_cff.py:136
GBRWrapperRcd
Definition: GBRWrapperRcd.h:24
MultiTrackSelector::nSigmaZ_
std::vector< double > nSigmaZ_
Definition: MultiTrackSelector.h:117
MultiTrackSelector::max_lostLayers_
std::vector< uint32_t > max_lostLayers_
Definition: MultiTrackSelector.h:122
MultiTrackSelector::dbFileName_
std::string dbFileName_
Definition: MultiTrackSelector.h:156
edm::RefToBase
Definition: AssociativeIterator.h:54
MultiTrackSelector::max_d0_
std::vector< double > max_d0_
Impact parameter absolute cuts.
Definition: MultiTrackSelector.h:115
reco::HitPattern::numberOfLostTrackerHits
int numberOfLostTrackerHits(HitCategory category) const
Definition: HitPattern.h:862
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:29
MultiTrackSelector::max_lostHitFraction_
std::vector< int32_t > max_lostHitFraction_
Definition: MultiTrackSelector.h:130
MultiTrackSelector::beamspot_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
Definition: MultiTrackSelector.h:88
edm::helper::Filler
Definition: ValueMap.h:22
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:224
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
MultiTrackSelector::forest_
std::vector< GBRForest * > forest_
Definition: MultiTrackSelector.h:154
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
edm::Log
Definition: MessageLogger.h:70
reco::TrackBase::dxy
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608
MultiTrackSelector::vertexCut_
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
Definition: MultiTrackSelector.h:101
MultiTrackSelector::getBestVertex
Point getBestVertex(const reco::TrackBaseRef, const reco::VertexCollection) const
Definition: MultiTrackSelector.cc:653
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
reco::Vertex
Definition: Vertex.h:35
hit
Definition: SiStripHitEffFromCalibTree.cc:88
reco::HitPattern::numberOfValidStripLayersWithMonoAndStereo
int numberOfValidStripLayersWithMonoAndStereo(uint16_t stripdet, uint16_t layer) const
Definition: HitPattern.cc:348
edm::OwnVector< TrackingRecHit >
MultiTrackSelector::max_z0_
std::vector< double > max_z0_
Definition: MultiTrackSelector.h:116
edm::RefToBaseProd
Definition: RefToBase.h:65
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
nlayers
Definition: HIMultiTrackSelector.h:48
MultiTrackSelector::useMVAonly_
std::vector< bool > useMVAonly_
Definition: MultiTrackSelector.h:148
MultiTrackSelector::setQualityBit_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
Definition: MultiTrackSelector.h:95
MultiTrackSelector::min_MVA_
std::vector< double > min_MVA_
Definition: MultiTrackSelector.h:150
MultiTrackSelector::res_par_
std::vector< std::vector< double > > res_par_
Definition: MultiTrackSelector.h:104