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
std::vector< std::string > name_
std::vector< std::vector< double > > dz_par2_
std::vector< uint32_t > max_lostLayers_
std::vector< std::vector< double > > dz_par1_
std::vector< double > chi2n_no1Dmod_par_
std::vector< uint32_t > min_hits_bypass_
std::vector< std::vector< double > > pixel_pTMaxCut_
std::vector< uint32_t > min_nhits_
std::vector< bool > useMVA_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< int32_t > max_minMissHitOutOrIn_
std::vector< uint32_t > min_3Dlayers_
void produce(edm::Event &evt, const edm::EventSetup &es) final
process one event
std::vector< double > min_eta_
std::vector< double > max_eta_
std::vector< double > max_d0NoPV_
edm::EDGetTokenT< reco::VertexCollection > vertices_
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
std::vector< std::vector< double > > d0_par1_
std::vector< int32_t > vtxNumber_
vertex cuts
std::vector< double > max_z0_
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
std::vector< double > nSigmaZ_
std::vector< double > max_d0_
Impact parameter absolute cuts.
std::vector< bool > applyAdaptedPVCuts_
std::vector< double > max_relpterr_
std::vector< int > mvavars_indices
#define dso_hidden
Definition: Visibility.h:12
std::vector< std::vector< double > > d0_par2_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< std::string > forestVars_
std::vector< int32_t > max_lostHitFraction_
std::vector< double > chi2n_par_
std::vector< std::vector< double > > res_par_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
std::vector< bool > applyAbsCutsIfNoPV_
select
when omitted electron plots will be filled w/o cut on electronId electronId = cms.PSet( src = cms.InputTag("mvaTrigV0"), cutValue = cms.double(0.5) ), when omitted electron plots will be filled w/o additional pre- selection of the electron candidates
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
std::vector< std::vector< double > > pixel_pTMinCut_
std::vector< double > max_z0NoPV_
std::vector< bool > keepAllTracks_
std::vector< double > min_MVA_
std::vector< unsigned int > preFilter_
std::vector< reco::TrackBase::TrackQuality > qualityToSet_