CMS 3D CMS Logo

HIMultiTrackSelector.h
Go to the documentation of this file.
1 #ifndef RecoAlgos_HIMultiTrackSelector_h
2 #define RecoAlgos_HIMultiTrackSelector_h
3 
13 #include <utility>
14 #include <vector>
15 #include <memory>
16 #include <algorithm>
17 #include <map>
22 
34 
39  relpterr = 3,
41  minlost = 5,
42  nhits = 6,
43  eta = 7,
45  chi2n = 9,
47  nlayers3d = 11,
48  nlayers = 12,
49  ndof = 13,
50  etaerror = 14
51 };
52 
54 private:
55 public:
57  explicit HIMultiTrackSelector();
60  ~HIMultiTrackSelector() override;
61 
62 protected:
63  void beginStream(edm::StreamID) final;
64 
65  // void streamBeginRun(edm::StreamID, edm::Run const&, edm::EventSetup const&) const final {
66  // init();
67  //}
68  //void beginRun(edm::Run const&, edm::EventSetup const&) final { init(); }
69  // void init(edm::EventSetup const& es) const;
70 
73  void produce(edm::Event &evt, const edm::EventSetup &es) final { run(evt, es); }
74  virtual void run(edm::Event &evt, const edm::EventSetup &es) const;
75 
77  bool select(unsigned tsNum,
78  const reco::BeamSpot &vertexBeamSpot,
80  const reco::Track &tk,
81  const std::vector<Point> &points,
82  std::vector<float> &vterr,
83  std::vector<float> &vzerr,
84  double mvaVal) const;
85  void selectVertices(unsigned int tsNum,
86  const reco::VertexCollection &vtxs,
87  std::vector<Point> &points,
88  std::vector<float> &vterr,
89  std::vector<float> &vzerr) const;
90 
91  void processMVA(edm::Event &evt,
92  const edm::EventSetup &es,
93  std::vector<float> &mvaVals_,
94  const reco::VertexCollection &hVtx) const;
95 
96  void ParseForestVars();
105 
106  // Boolean indicating if pixel track merging related cuts are to be applied
108 
110  std::vector<bool> setQualityBit_;
111  std::vector<reco::TrackBase::TrackQuality> qualityToSet_;
112 
114  std::vector<int32_t> vtxNumber_;
115  //StringCutObjectSelector is not const thread safe
116  std::vector<StringCutObjectSelector<reco::Vertex> > vertexCut_;
117 
118  // parameters for adapted optimal cuts on chi2 and primary vertex compatibility
119  std::vector<std::vector<double> > res_par_;
120  std::vector<double> chi2n_par_;
121  std::vector<double> chi2n_no1Dmod_par_;
122  std::vector<std::vector<double> > d0_par1_;
123  std::vector<std::vector<double> > dz_par1_;
124  std::vector<std::vector<double> > d0_par2_;
125  std::vector<std::vector<double> > dz_par2_;
126  // Boolean indicating if adapted primary vertex compatibility cuts are to be applied.
127  std::vector<bool> applyAdaptedPVCuts_;
128 
130  std::vector<double> max_d0_;
131  std::vector<double> max_z0_;
132  std::vector<double> nSigmaZ_;
133 
134  // parameters for pixel track merging pT dependent chi2 cuts
135  std::vector<std::vector<double> > pixel_pTMinCut_;
136  std::vector<std::vector<double> > pixel_pTMaxCut_;
137 
139  std::vector<uint32_t> min_layers_;
140  std::vector<uint32_t> min_3Dlayers_;
141  std::vector<uint32_t> max_lostLayers_;
142  std::vector<uint32_t> min_hits_bypass_;
143 
144  // pterror and nvalid hits cuts
145  std::vector<double> max_relpterr_;
146  std::vector<uint32_t> min_nhits_;
147 
148  std::vector<int32_t> max_minMissHitOutOrIn_;
149  std::vector<int32_t> max_lostHitFraction_;
150 
151  std::vector<double> min_eta_;
152  std::vector<double> max_eta_;
153 
154  // Flag and absolute cuts if no PV passes the selection
155  std::vector<double> max_d0NoPV_;
156  std::vector<double> max_z0NoPV_;
157  std::vector<bool> applyAbsCutsIfNoPV_;
158  //if true, selector flags but does not select
159  std::vector<bool> keepAllTracks_;
160 
161  // allow one of the previous psets to be used as a prefilter
162  std::vector<unsigned int> preFilter_;
163  std::vector<std::string> name_;
164 
165  //setup mva selector
166  std::vector<bool> useMVA_;
167  //std::vector<TMVA::Reader*> mvaReaders_;
168 
169  std::vector<int> mvavars_indices;
170 
171  std::vector<double> min_MVA_;
172 
173  //std::vector<std::string> mvaType_;
176  std::vector<std::string> forestVars_;
180 };
181 
182 #endif
HIMultiTrackSelector::max_d0_
std::vector< double > max_d0_
Impact parameter absolute cuts.
Definition: HIMultiTrackSelector.h:130
HIMultiTrackSelector::mvaType_
std::string mvaType_
Definition: HIMultiTrackSelector.h:174
edm::StreamID
Definition: StreamID.h:30
TrackExtra.h
HIMultiTrackSelector::min_nhits_
std::vector< uint32_t > min_nhits_
Definition: HIMultiTrackSelector.h:146
HIMultiTrackSelector::max_lostLayers_
std::vector< uint32_t > max_lostLayers_
Definition: HIMultiTrackSelector.h:141
chi2n
Definition: HIMultiTrackSelector.h:45
HIMultiTrackSelector::applyAdaptedPVCuts_
std::vector< bool > applyAdaptedPVCuts_
Definition: HIMultiTrackSelector.h:127
HIMultiTrackSelector::max_d0NoPV_
std::vector< double > max_d0NoPV_
Definition: HIMultiTrackSelector.h:155
HLT_FULL_cff.points
points
Definition: HLT_FULL_cff.py:21521
HIMultiTrackSelector
Definition: HIMultiTrackSelector.h:53
HIMultiTrackSelector::res_par_
std::vector< std::vector< double > > res_par_
Definition: HIMultiTrackSelector.h:119
HIMultiTrackSelector::d0_par2_
std::vector< std::vector< double > > d0_par2_
Definition: HIMultiTrackSelector.h:124
HIMultiTrackSelector::forest_
GBRForest * forest_
Definition: HIMultiTrackSelector.h:177
nlayers3d
Definition: HIMultiTrackSelector.h:47
edm::EDGetTokenT< reco::TrackCollection >
HIMultiTrackSelector::min_eta_
std::vector< double > min_eta_
Definition: HIMultiTrackSelector.h:151
GBRForest
Definition: GBRForest.h:25
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
HIMultiTrackSelector::max_eta_
std::vector< double > max_eta_
Definition: HIMultiTrackSelector.h:152
HIMultiTrackSelector::Point
math::XYZPoint Point
Definition: HIMultiTrackSelector.h:71
HIMultiTrackSelector::min_layers_
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
Definition: HIMultiTrackSelector.h:139
HIMultiTrackSelector::vertexCut_
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
Definition: HIMultiTrackSelector.h:116
HIMultiTrackSelector::vertices_
edm::EDGetTokenT< reco::VertexCollection > vertices_
Definition: HIMultiTrackSelector.h:104
GBRForest.h
HIMultiTrackSelector::preFilter_
std::vector< unsigned int > preFilter_
Definition: HIMultiTrackSelector.h:162
HIMultiTrackSelector::chi2n_no1Dmod_par_
std::vector< double > chi2n_no1Dmod_par_
Definition: HIMultiTrackSelector.h:121
HIMultiTrackSelector::max_z0NoPV_
std::vector< double > max_z0NoPV_
Definition: HIMultiTrackSelector.h:156
HIMultiTrackSelector::max_minMissHitOutOrIn_
std::vector< int32_t > max_minMissHitOutOrIn_
Definition: HIMultiTrackSelector.h:148
HIMultiTrackSelector::name_
std::vector< std::string > name_
Definition: HIMultiTrackSelector.h:163
chi2n_no1dmod
Definition: HIMultiTrackSelector.h:44
HIMultiTrackSelector::max_lostHitFraction_
std::vector< int32_t > max_lostHitFraction_
Definition: HIMultiTrackSelector.h:149
HIMultiTrackSelector::pixel_pTMinCut_
std::vector< std::vector< double > > pixel_pTMinCut_
Definition: HIMultiTrackSelector.h:135
ndof
Definition: HIMultiTrackSelector.h:49
HIMultiTrackSelector::applyPixelMergingCuts_
bool applyPixelMergingCuts_
Definition: HIMultiTrackSelector.h:107
lostmidfrac
Definition: HIMultiTrackSelector.h:40
HIMultiTrackSelector::d0_par1_
std::vector< std::vector< double > > d0_par1_
Definition: HIMultiTrackSelector.h:122
HIMultiTrackSelector::dz_par2_
std::vector< std::vector< double > > dz_par2_
Definition: HIMultiTrackSelector.h:125
HIMultiTrackSelector::keepAllTracks_
std::vector< bool > keepAllTracks_
Definition: HIMultiTrackSelector.h:159
Track.h
HIMultiTrackSelector::useForestFromDB_
bool useForestFromDB_
Definition: HIMultiTrackSelector.h:178
TrackFwd.h
BeamSpot.h
MVAVARIABLES
MVAVARIABLES
Definition: HIMultiTrackSelector.h:35
relpterr
Definition: HIMultiTrackSelector.h:39
nlayerslost
Definition: HIMultiTrackSelector.h:46
reco::BeamSpot
Definition: BeamSpot.h:21
reco::Track
Definition: Track.h:27
nhits
Definition: HIMultiTrackSelector.h:42
TrajTrackAssociation.h
dso_hidden
#define dso_hidden
Definition: Visibility.h:12
HIMultiTrackSelector::setQualityBit_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
Definition: HIMultiTrackSelector.h:110
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Vertex.h
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
HIMultiTrackSelector::applyAbsCutsIfNoPV_
std::vector< bool > applyAbsCutsIfNoPV_
Definition: HIMultiTrackSelector.h:157
HIMultiTrackSelector::min_hits_bypass_
std::vector< uint32_t > min_hits_bypass_
Definition: HIMultiTrackSelector.h:142
HIMultiTrackSelector::hSrc_
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
Definition: HIMultiTrackSelector.h:99
edm::ParameterSet
Definition: ParameterSet.h:47
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
Event.h
etaerror
Definition: HIMultiTrackSelector.h:50
HIMultiTrackSelector::nSigmaZ_
std::vector< double > nSigmaZ_
Definition: HIMultiTrackSelector.h:132
HIMultiTrackSelector::forestLabel_
std::string forestLabel_
Definition: HIMultiTrackSelector.h:175
HIMultiTrackSelector::useVertices_
bool useVertices_
Definition: HIMultiTrackSelector.h:101
HIMultiTrackSelector::max_relpterr_
std::vector< double > max_relpterr_
Definition: HIMultiTrackSelector.h:145
HIMultiTrackSelector::useVtxError_
bool useVtxError_
Definition: HIMultiTrackSelector.h:102
edm::stream::EDProducer
Definition: EDProducer.h:38
HIMultiTrackSelector::mvavars_indices
std::vector< int > mvavars_indices
Definition: HIMultiTrackSelector.h:169
HIMultiTrackSelector::produce
void produce(edm::Event &evt, const edm::EventSetup &es) final
process one event
Definition: HIMultiTrackSelector.h:73
edm::EventSetup
Definition: EventSetup.h:57
HIMultiTrackSelector::beamspot_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
Definition: HIMultiTrackSelector.h:100
HIMultiTrackSelector::qualityToSet_
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
Definition: HIMultiTrackSelector.h:111
InputTag.h
HIMultiTrackSelector::dz_par1_
std::vector< std::vector< double > > dz_par1_
Definition: HIMultiTrackSelector.h:123
HIMultiTrackSelector::pixel_pTMaxCut_
std::vector< std::vector< double > > pixel_pTMaxCut_
Definition: HIMultiTrackSelector.h:136
looper.cfg
cfg
Definition: looper.py:297
SiStripRecHit1D.h
chi2perdofperlayer
Definition: HIMultiTrackSelector.h:36
VertexFwd.h
HIMultiTrackSelector::src_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
Definition: HIMultiTrackSelector.h:98
Trajectory.h
HIMultiTrackSelector::max_z0_
std::vector< double > max_z0_
Definition: HIMultiTrackSelector.h:131
writedatasetfile.run
run
Definition: writedatasetfile.py:27
StringCutObjectSelector.h
HIMultiTrackSelector::vtxNumber_
std::vector< int32_t > vtxNumber_
vertex cuts
Definition: HIMultiTrackSelector.h:114
dzperdzerror
Definition: HIMultiTrackSelector.h:38
HIMultiTrackSelector::useMVA_
std::vector< bool > useMVA_
Definition: HIMultiTrackSelector.h:166
HIMultiTrackSelector::useAnyMVA_
bool useAnyMVA_
Definition: HIMultiTrackSelector.h:103
dxyperdxyerror
Definition: HIMultiTrackSelector.h:37
HIMultiTrackSelector::chi2n_par_
std::vector< double > chi2n_par_
Definition: HIMultiTrackSelector.h:120
HIMultiTrackSelector::forestVars_
std::vector< std::string > forestVars_
Definition: HIMultiTrackSelector.h:176
ParameterSet.h
HIMultiTrackSelector::min_MVA_
std::vector< double > min_MVA_
Definition: HIMultiTrackSelector.h:171
HIMultiTrackSelector::dbFileName_
std::string dbFileName_
Definition: HIMultiTrackSelector.h:179
edm::Event
Definition: Event.h:73
HIMultiTrackSelector::min_3Dlayers_
std::vector< uint32_t > min_3Dlayers_
Definition: HIMultiTrackSelector.h:140
eta
Definition: HIMultiTrackSelector.h:43
edm::OwnVector< TrackingRecHit >
nlayers
Definition: HIMultiTrackSelector.h:48
minlost
Definition: HIMultiTrackSelector.h:41