CMS 3D CMS Logo

MultiTrackSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_MultiTrackSelector_h
2 #define RecoAlgos_MultiTrackSelector_h
3 
13 #include <utility>
14 #include <vector>
15 #include <memory>
16 #include <algorithm>
17 #include <map>
22 
34 
36 private:
37 public:
39  explicit MultiTrackSelector();
40  explicit MultiTrackSelector(const edm::ParameterSet &cfg);
42  ~MultiTrackSelector() override;
43 
44  using MVACollection = std::vector<float>;
45  using QualityMaskCollection = std::vector<unsigned char>;
46 
47 protected:
48  void beginStream(edm::StreamID) final;
49 
50  // void streamBeginRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const final {
51  // init();
52  //}
53  //void beginRun(edm::Run const&, edm::EventSetup const&) final { init(); }
54  // void init(edm::EventSetup const& es) const;
55 
58  void produce(edm::Event &evt, const edm::EventSetup &es) final { run(evt, es); }
59  virtual void run(edm::Event &evt, const edm::EventSetup &es) const;
60 
62  bool select(unsigned tsNum,
63  const reco::BeamSpot &vertexBeamSpot,
65  const reco::Track &tk,
66  const std::vector<Point> &points,
67  std::vector<float> &vterr,
68  std::vector<float> &vzerr,
69  double mvaVal) const;
70  void selectVertices(unsigned int tsNum,
71  const reco::VertexCollection &vtxs,
72  std::vector<Point> &points,
73  std::vector<float> &vterr,
74  std::vector<float> &vzerr) const;
75 
76  void processMVA(edm::Event &evt,
77  const edm::EventSetup &es,
78  const reco::BeamSpot &beamspot,
80  int selIndex,
81  std::vector<float> &mvaVals_,
82  bool writeIt = false) const;
84 
91  bool useAnyMVA_;
93 
95  std::vector<bool> setQualityBit_;
96  std::vector<reco::TrackBase::TrackQuality> qualityToSet_;
97 
99  std::vector<int32_t> vtxNumber_;
100  //StringCutObjectSelector is not const thread safe
101  std::vector<StringCutObjectSelector<reco::Vertex> > vertexCut_;
102 
103  // parameters for adapted optimal cuts on chi2 and primary vertex compatibility
104  std::vector<std::vector<double> > res_par_;
105  std::vector<double> chi2n_par_;
106  std::vector<double> chi2n_no1Dmod_par_;
107  std::vector<std::vector<double> > d0_par1_;
108  std::vector<std::vector<double> > dz_par1_;
109  std::vector<std::vector<double> > d0_par2_;
110  std::vector<std::vector<double> > dz_par2_;
111  // Boolean indicating if adapted primary vertex compatibility cuts are to be applied.
112  std::vector<bool> applyAdaptedPVCuts_;
113 
115  std::vector<double> max_d0_;
116  std::vector<double> max_z0_;
117  std::vector<double> nSigmaZ_;
118 
120  std::vector<uint32_t> min_layers_;
121  std::vector<uint32_t> min_3Dlayers_;
122  std::vector<uint32_t> max_lostLayers_;
123  std::vector<uint32_t> min_hits_bypass_;
124 
125  // pterror and nvalid hits cuts
126  std::vector<double> max_relpterr_;
127  std::vector<uint32_t> min_nhits_;
128 
129  std::vector<int32_t> max_minMissHitOutOrIn_;
130  std::vector<int32_t> max_lostHitFraction_;
131 
132  std::vector<double> min_eta_;
133  std::vector<double> max_eta_;
134 
135  // Flag and absolute cuts if no PV passes the selection
136  std::vector<double> max_d0NoPV_;
137  std::vector<double> max_z0NoPV_;
138  std::vector<bool> applyAbsCutsIfNoPV_;
139  //if true, selector flags but does not select
140  std::vector<bool> keepAllTracks_;
141 
142  // allow one of the previous psets to be used as a prefilter
143  std::vector<unsigned int> preFilter_;
144  std::vector<std::string> name_;
145 
146  //setup mva selector
147  std::vector<bool> useMVA_;
148  std::vector<bool> useMVAonly_;
149 
150  std::vector<double> min_MVA_;
151 
152  std::vector<std::string> mvaType_;
153  std::vector<std::string> forestLabel_;
154  std::vector<GBRForest *> forest_;
157 };
158 
159 #endif
HLT_2018_cff.points
points
Definition: HLT_2018_cff.py:20125
edm::StreamID
Definition: StreamID.h:30
TrackExtra.h
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::max_relpterr_
std::vector< double > max_relpterr_
Definition: MultiTrackSelector.h:126
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::chi2n_no1Dmod_par_
std::vector< double > chi2n_no1Dmod_par_
Definition: MultiTrackSelector.h:106
edm::EDGetTokenT< reco::TrackCollection >
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
EDProducer.h
MultiTrackSelector::max_z0NoPV_
std::vector< double > max_z0NoPV_
Definition: MultiTrackSelector.h:137
MultiTrackSelector::forestLabel_
std::vector< std::string > forestLabel_
Definition: MultiTrackSelector.h:153
MultiTrackSelector
Definition: MultiTrackSelector.h:35
MultiTrackSelector::min_hits_bypass_
std::vector< uint32_t > min_hits_bypass_
Definition: MultiTrackSelector.h:123
GBRForest.h
MultiTrackSelector::useAnyMVA_
bool useAnyMVA_
Definition: MultiTrackSelector.h:91
MultiTrackSelector::MVACollection
std::vector< float > MVACollection
Definition: MultiTrackSelector.h:44
MultiTrackSelector::applyAbsCutsIfNoPV_
std::vector< bool > applyAbsCutsIfNoPV_
Definition: MultiTrackSelector.h:138
MultiTrackSelector::mvaType_
std::vector< std::string > mvaType_
Definition: MultiTrackSelector.h:152
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
Track.h
TrackFwd.h
BeamSpot.h
MultiTrackSelector::useForestFromDB_
bool useForestFromDB_
Definition: MultiTrackSelector.h:155
MultiTrackSelector::useVertices_
bool useVertices_
Definition: MultiTrackSelector.h:89
MultiTrackSelector::chi2n_par_
std::vector< double > chi2n_par_
Definition: MultiTrackSelector.h:105
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
MultiTrackSelector::vertices_
edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: MultiTrackSelector.h:92
beamspot
Definition: BeamSpotWrite2Txt.h:8
MultiTrackSelector::src_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
Definition: MultiTrackSelector.h:86
TrajTrackAssociation.h
dso_hidden
#define dso_hidden
Definition: Visibility.h:12
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
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::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Event.h
MultiTrackSelector::name_
std::vector< std::string > name_
Definition: MultiTrackSelector.h:144
MultiTrackSelector::useMVA_
std::vector< bool > useMVA_
Definition: MultiTrackSelector.h:147
MultiTrackSelector::dz_par1_
std::vector< std::vector< double > > dz_par1_
Definition: MultiTrackSelector.h:108
edm::stream::EDProducer
Definition: EDProducer.h:38
MultiTrackSelector::min_layers_
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
Definition: MultiTrackSelector.h:120
MultiTrackSelector::applyAdaptedPVCuts_
std::vector< bool > applyAdaptedPVCuts_
Definition: MultiTrackSelector.h:112
edm::EventSetup
Definition: EventSetup.h:57
InputTag.h
looper.cfg
cfg
Definition: looper.py:297
SiStripRecHit1D.h
MultiTrackSelector::keepAllTracks_
std::vector< bool > keepAllTracks_
Definition: MultiTrackSelector.h:140
VertexFwd.h
Trajectory.h
MultiTrackSelector::useVtxError_
bool useVtxError_
Definition: MultiTrackSelector.h:90
MultiTrackSelector::preFilter_
std::vector< unsigned int > preFilter_
Definition: MultiTrackSelector.h:143
writedatasetfile.run
run
Definition: writedatasetfile.py:27
StringCutObjectSelector.h
MultiTrackSelector::min_3Dlayers_
std::vector< uint32_t > min_3Dlayers_
Definition: MultiTrackSelector.h:121
MultiTrackSelector::qualityToSet_
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
Definition: MultiTrackSelector.h:96
MultiTrackSelector::hSrc_
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
Definition: MultiTrackSelector.h:87
MultiTrackSelector::Point
math::XYZPoint Point
Definition: MultiTrackSelector.h:56
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< reco::Track >
MultiTrackSelector::QualityMaskCollection
std::vector< unsigned char > QualityMaskCollection
Definition: MultiTrackSelector.h:45
MultiTrackSelector::max_d0_
std::vector< double > max_d0_
Impact parameter absolute cuts.
Definition: MultiTrackSelector.h:115
MultiTrackSelector::max_lostHitFraction_
std::vector< int32_t > max_lostHitFraction_
Definition: MultiTrackSelector.h:130
MultiTrackSelector::beamspot_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
Definition: MultiTrackSelector.h:88
ParameterSet.h
edm::Event
Definition: Event.h:73
MultiTrackSelector::forest_
std::vector< GBRForest * > forest_
Definition: MultiTrackSelector.h:154
MultiTrackSelector::vertexCut_
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
Definition: MultiTrackSelector.h:101
edm::OwnVector< TrackingRecHit >
getBestVertex
Point getBestVertex(reco::Track const &trk, reco::VertexCollection const &vertices, const size_t minNtracks=2)
Definition: getBestVertex.h:8
MultiTrackSelector::max_z0_
std::vector< double > max_z0_
Definition: MultiTrackSelector.h:116
pwdgSkimBPark_cfi.vertices
vertices
Definition: pwdgSkimBPark_cfi.py:7
MultiTrackSelector::useMVAonly_
std::vector< bool > useMVAonly_
Definition: MultiTrackSelector.h:148
MultiTrackSelector::produce
void produce(edm::Event &evt, const edm::EventSetup &es) final
process one event
Definition: MultiTrackSelector.h:58
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