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 
35 
37 private:
38 public:
40  explicit MultiTrackSelector();
41  explicit MultiTrackSelector(const edm::ParameterSet &cfg);
43  ~MultiTrackSelector() override;
44 
45  using MVACollection = std::vector<float>;
46  using QualityMaskCollection = std::vector<unsigned char>;
47 
48 protected:
49  void beginStream(edm::StreamID) final;
50 
51  // void streamBeginRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const final {
52  // init();
53  //}
54  //void beginRun(edm::Run const&, edm::EventSetup const&) final { init(); }
55  // void init(edm::EventSetup const& es) const;
56 
59  void produce(edm::Event &evt, const edm::EventSetup &es) final { run(evt, es); }
60  virtual void run(edm::Event &evt, const edm::EventSetup &es) const;
61 
63  bool select(unsigned tsNum,
64  const reco::BeamSpot &vertexBeamSpot,
66  const reco::Track &tk,
67  const std::vector<Point> &points,
68  std::vector<float> &vterr,
69  std::vector<float> &vzerr,
70  double mvaVal) const;
71  void selectVertices(unsigned int tsNum,
72  const reco::VertexCollection &vtxs,
73  std::vector<Point> &points,
74  std::vector<float> &vterr,
75  std::vector<float> &vzerr) const;
76 
77  void processMVA(edm::Event &evt,
78  const edm::EventSetup &es,
79  const reco::BeamSpot &beamspot,
81  int selIndex,
82  std::vector<float> &mvaVals_,
83  bool writeIt = false) const;
85 
92  bool useAnyMVA_;
94 
96  std::vector<bool> setQualityBit_;
97  std::vector<reco::TrackBase::TrackQuality> qualityToSet_;
98 
100  std::vector<int32_t> vtxNumber_;
101  //StringCutObjectSelector is not const thread safe
102  std::vector<StringCutObjectSelector<reco::Vertex>> vertexCut_;
103 
104  // parameters for adapted optimal cuts on chi2 and primary vertex compatibility
105  std::vector<std::vector<double>> res_par_;
106  std::vector<double> chi2n_par_;
107  std::vector<double> chi2n_no1Dmod_par_;
108  std::vector<std::vector<double>> d0_par1_;
109  std::vector<std::vector<double>> dz_par1_;
110  std::vector<std::vector<double>> d0_par2_;
111  std::vector<std::vector<double>> dz_par2_;
112  // Boolean indicating if adapted primary vertex compatibility cuts are to be applied.
113  std::vector<bool> applyAdaptedPVCuts_;
114 
116  std::vector<double> max_d0_;
117  std::vector<double> max_z0_;
118  std::vector<double> nSigmaZ_;
119 
121  std::vector<uint32_t> min_layers_;
122  std::vector<uint32_t> min_3Dlayers_;
123  std::vector<uint32_t> max_lostLayers_;
124  std::vector<uint32_t> min_hits_bypass_;
125 
126  // pterror and nvalid hits cuts
127  std::vector<double> max_relpterr_;
128  std::vector<uint32_t> min_nhits_;
129 
130  std::vector<int32_t> max_minMissHitOutOrIn_;
131  std::vector<int32_t> max_lostHitFraction_;
132 
133  std::vector<double> min_eta_;
134  std::vector<double> max_eta_;
135 
136  // Flag and absolute cuts if no PV passes the selection
137  std::vector<double> max_d0NoPV_;
138  std::vector<double> max_z0NoPV_;
139  std::vector<bool> applyAbsCutsIfNoPV_;
140  //if true, selector flags but does not select
141  std::vector<bool> keepAllTracks_;
142 
143  // allow one of the previous psets to be used as a prefilter
144  std::vector<unsigned int> preFilter_;
145  std::vector<std::string> name_;
146 
147  //setup mva selector
148  std::vector<bool> useMVA_;
149  std::vector<bool> useMVAonly_;
150 
151  std::vector<double> min_MVA_;
152 
153  std::vector<std::string> mvaType_;
154  std::vector<std::string> forestLabel_;
155  std::vector<edm::ESGetToken<GBRForest, GBRWrapperRcd>> forestToken_;
156  std::vector<GBRForest *> forest_;
159 };
160 
161 #endif
edm::StreamID
Definition: StreamID.h:30
TrackExtra.h
MultiTrackSelector::d0_par1_
std::vector< std::vector< double > > d0_par1_
Definition: MultiTrackSelector.h:108
MultiTrackSelector::max_eta_
std::vector< double > max_eta_
Definition: MultiTrackSelector.h:134
MultiTrackSelector::max_relpterr_
std::vector< double > max_relpterr_
Definition: MultiTrackSelector.h:127
MultiTrackSelector::vtxNumber_
std::vector< int32_t > vtxNumber_
vertex cuts
Definition: MultiTrackSelector.h:100
MultiTrackSelector::min_nhits_
std::vector< uint32_t > min_nhits_
Definition: MultiTrackSelector.h:128
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21469
MultiTrackSelector::chi2n_no1Dmod_par_
std::vector< double > chi2n_no1Dmod_par_
Definition: MultiTrackSelector.h:107
edm::EDGetTokenT< reco::TrackCollection >
GBRWrapperRcd.h
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
singleTopDQM_cfi.select
select
Definition: singleTopDQM_cfi.py:50
MultiTrackSelector::forestToken_
std::vector< edm::ESGetToken< GBRForest, GBRWrapperRcd > > forestToken_
Definition: MultiTrackSelector.h:155
EDProducer.h
MultiTrackSelector::max_z0NoPV_
std::vector< double > max_z0NoPV_
Definition: MultiTrackSelector.h:138
MultiTrackSelector::forestLabel_
std::vector< std::string > forestLabel_
Definition: MultiTrackSelector.h:154
MultiTrackSelector
Definition: MultiTrackSelector.h:36
MultiTrackSelector::min_hits_bypass_
std::vector< uint32_t > min_hits_bypass_
Definition: MultiTrackSelector.h:124
GBRForest.h
MultiTrackSelector::useAnyMVA_
bool useAnyMVA_
Definition: MultiTrackSelector.h:92
MultiTrackSelector::MVACollection
std::vector< float > MVACollection
Definition: MultiTrackSelector.h:45
MultiTrackSelector::applyAbsCutsIfNoPV_
std::vector< bool > applyAbsCutsIfNoPV_
Definition: MultiTrackSelector.h:139
AlignmentTracksFromVertexSelector_cfi.vertices
vertices
Definition: AlignmentTracksFromVertexSelector_cfi.py:5
MultiTrackSelector::mvaType_
std::vector< std::string > mvaType_
Definition: MultiTrackSelector.h:153
MultiTrackSelector::dz_par2_
std::vector< std::vector< double > > dz_par2_
Definition: MultiTrackSelector.h:111
MultiTrackSelector::max_minMissHitOutOrIn_
std::vector< int32_t > max_minMissHitOutOrIn_
Definition: MultiTrackSelector.h:130
Track.h
TrackFwd.h
BeamSpot.h
MultiTrackSelector::useForestFromDB_
bool useForestFromDB_
Definition: MultiTrackSelector.h:157
MultiTrackSelector::useVertices_
bool useVertices_
Definition: MultiTrackSelector.h:90
MultiTrackSelector::chi2n_par_
std::vector< double > chi2n_par_
Definition: MultiTrackSelector.h:106
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
MultiTrackSelector::vertices_
edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: MultiTrackSelector.h:93
beamspot
Definition: BeamSpotWrite2Txt.h:8
MultiTrackSelector::src_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
Definition: MultiTrackSelector.h:87
TrajTrackAssociation.h
dso_hidden
#define dso_hidden
Definition: Visibility.h:12
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
MultiTrackSelector::min_eta_
std::vector< double > min_eta_
Definition: MultiTrackSelector.h:133
MultiTrackSelector::d0_par2_
std::vector< std::vector< double > > d0_par2_
Definition: MultiTrackSelector.h:110
MultiTrackSelector::max_d0NoPV_
std::vector< double > max_d0NoPV_
Definition: MultiTrackSelector.h:137
Point
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
edm::ParameterSet
Definition: ParameterSet.h:47
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:145
MultiTrackSelector::useMVA_
std::vector< bool > useMVA_
Definition: MultiTrackSelector.h:148
MultiTrackSelector::dz_par1_
std::vector< std::vector< double > > dz_par1_
Definition: MultiTrackSelector.h:109
edm::stream::EDProducer
Definition: EDProducer.h:36
MultiTrackSelector::min_layers_
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
Definition: MultiTrackSelector.h:121
MultiTrackSelector::applyAdaptedPVCuts_
std::vector< bool > applyAdaptedPVCuts_
Definition: MultiTrackSelector.h:113
edm::EventSetup
Definition: EventSetup.h:58
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
InputTag.h
looper.cfg
cfg
Definition: looper.py:296
SiStripRecHit1D.h
MultiTrackSelector::keepAllTracks_
std::vector< bool > keepAllTracks_
Definition: MultiTrackSelector.h:141
VertexFwd.h
Trajectory.h
MultiTrackSelector::useVtxError_
bool useVtxError_
Definition: MultiTrackSelector.h:91
MultiTrackSelector::preFilter_
std::vector< unsigned int > preFilter_
Definition: MultiTrackSelector.h:144
writedatasetfile.run
run
Definition: writedatasetfile.py:27
StringCutObjectSelector.h
MultiTrackSelector::min_3Dlayers_
std::vector< uint32_t > min_3Dlayers_
Definition: MultiTrackSelector.h:122
Vertex.h
MultiTrackSelector::qualityToSet_
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
Definition: MultiTrackSelector.h:97
MultiTrackSelector::hSrc_
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
Definition: MultiTrackSelector.h:88
MultiTrackSelector::Point
math::XYZPoint Point
Definition: MultiTrackSelector.h:57
MultiTrackSelector::nSigmaZ_
std::vector< double > nSigmaZ_
Definition: MultiTrackSelector.h:118
MultiTrackSelector::max_lostLayers_
std::vector< uint32_t > max_lostLayers_
Definition: MultiTrackSelector.h:123
MultiTrackSelector::dbFileName_
std::string dbFileName_
Definition: MultiTrackSelector.h:158
edm::RefToBase< reco::Track >
MultiTrackSelector::QualityMaskCollection
std::vector< unsigned char > QualityMaskCollection
Definition: MultiTrackSelector.h:46
MultiTrackSelector::max_d0_
std::vector< double > max_d0_
Impact parameter absolute cuts.
Definition: MultiTrackSelector.h:116
MultiTrackSelector::max_lostHitFraction_
std::vector< int32_t > max_lostHitFraction_
Definition: MultiTrackSelector.h:131
MultiTrackSelector::beamspot_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
Definition: MultiTrackSelector.h:89
ParameterSet.h
edm::Event
Definition: Event.h:73
MultiTrackSelector::forest_
std::vector< GBRForest * > forest_
Definition: MultiTrackSelector.h:156
MultiTrackSelector::vertexCut_
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
Definition: MultiTrackSelector.h:102
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:117
MultiTrackSelector::useMVAonly_
std::vector< bool > useMVAonly_
Definition: MultiTrackSelector.h:149
MultiTrackSelector::produce
void produce(edm::Event &evt, const edm::EventSetup &es) final
process one event
Definition: MultiTrackSelector.h:59
MultiTrackSelector::setQualityBit_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
Definition: MultiTrackSelector.h:96
MultiTrackSelector::min_MVA_
std::vector< double > min_MVA_
Definition: MultiTrackSelector.h:151
MultiTrackSelector::res_par_
std::vector< std::vector< double > > res_par_
Definition: MultiTrackSelector.h:105