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
std::vector< uint32_t > min_nhits_
std::vector< double > max_d0NoPV_
std::vector< double > max_z0_
void produce(edm::Event &evt, const edm::EventSetup &es) final
process one event
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_
#define dso_hidden
Definition: Visibility.h:12
std::vector< int32_t > vtxNumber_
vertex cuts
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
std::vector< edm::ESGetToken< GBRForest, GBRWrapperRcd > > forestToken_
std::vector< std::string > forestLabel_
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_
math::XYZPoint Point
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_