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 
56  typedef math::XYZPoint Point;
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
std::vector< uint32_t > min_nhits_
std::vector< double > max_d0NoPV_
std::vector< double > max_z0_
std::vector< uint32_t > min_layers_
Cuts on numbers of layers with hits/3D hits/lost hits.
std::vector< std::string > name_
std::vector< double > max_z0NoPV_
std::vector< bool > useMVA_
std::vector< bool > keepAllTracks_
std::vector< uint32_t > min_hits_bypass_
std::vector< bool > applyAdaptedPVCuts_
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
std::vector< double > chi2n_no1Dmod_par_
std::vector< double > nSigmaZ_
std::vector< std::string > mvaType_
std::vector< unsigned int > preFilter_
edm::EDGetTokenT< TrackingRecHitCollection > hSrc_
edm::EDGetTokenT< reco::VertexCollection > vertices_
std::vector< uint32_t > min_3Dlayers_
std::vector< unsigned char > QualityMaskCollection
std::vector< float > MVACollection
std::vector< uint32_t > max_lostLayers_
std::vector< GBRForest * > forest_
std::vector< int32_t > max_lostHitFraction_
edm::EDGetTokenT< reco::BeamSpot > beamspot_
std::vector< double > min_eta_
std::vector< bool > setQualityBit_
do I have to set a quality bit?
std::vector< std::vector< double > > dz_par1_
std::vector< std::vector< double > > d0_par1_
std::vector< double > max_relpterr_
Definition: Error.h:15
#define dso_hidden
Definition: Visibility.h:12
std::vector< int32_t > vtxNumber_
vertex cuts
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
std::vector< std::string > forestLabel_
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
math::XYZVector XYZPoint
HLT enums.
Structure Point Contains parameters of Gaussian fits to DMRs.
Definition: DMRtrends.cc:57
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
Point getBestVertex(reco::Track const &trk, reco::VertexCollection const &vertices, const size_t minNtracks=2)
Definition: getBestVertex.h:8
std::vector< std::vector< double > > dz_par2_
std::vector< bool > applyAbsCutsIfNoPV_
std::vector< int32_t > max_minMissHitOutOrIn_
std::vector< double > min_MVA_
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
std::vector< double > max_d0_
Impact parameter absolute cuts.
std::vector< bool > useMVAonly_
std::vector< std::vector< double > > res_par_
std::vector< double > max_eta_
std::vector< double > chi2n_par_
std::vector< std::vector< double > > d0_par2_