CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  virtual ~MultiTrackSelector() ;
43 
44  using MVACollection = std::vector<float>;
45  using QualityMaskCollection = std::vector<unsigned char>;
46 
47 
48  protected:
49  void beginStream(edm::StreamID) override 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 
57  typedef math::XYZPoint Point;
59  void produce(edm::Event& evt, const edm::EventSetup& es ) override final {
60  run(evt,es);
61  }
62  virtual void run( edm::Event& evt, const edm::EventSetup& es ) const;
63 
65  bool select (unsigned tsNum,
66  const reco::BeamSpot &vertexBeamSpot,
68  const reco::Track &tk,
69  const std::vector<Point> &points,
70  std::vector<float> &vterr,
71  std::vector<float> &vzerr,
72  double mvaVal) const;
73  void selectVertices ( unsigned int tsNum,
74  const reco::VertexCollection &vtxs,
75  std::vector<Point> &points,
76  std::vector<float> &vterr,
77  std::vector<float> &vzerr) const;
78 
79  void processMVA(edm::Event& evt, const edm::EventSetup& es,const reco::BeamSpot& beamspot,const reco::VertexCollection& vertices, int selIndex, std::vector<float> & mvaVals_, bool writeIt=false) const;
80  Point getBestVertex(const reco::TrackBaseRef,const reco::VertexCollection) const;
81 
88  bool useAnyMVA_;
90 
92  std::vector<bool> setQualityBit_;
93  std::vector<reco::TrackBase::TrackQuality> qualityToSet_;
94 
96  std::vector<int32_t> vtxNumber_;
97  //StringCutObjectSelector is not const thread safe
98  std::vector<StringCutObjectSelector<reco::Vertex> > vertexCut_;
99 
100  // parameters for adapted optimal cuts on chi2 and primary vertex compatibility
101  std::vector< std::vector<double> > res_par_;
102  std::vector< double > chi2n_par_;
103  std::vector< double > chi2n_no1Dmod_par_;
104  std::vector< std::vector<double> > d0_par1_;
105  std::vector< std::vector<double> > dz_par1_;
106  std::vector< std::vector<double> > d0_par2_;
107  std::vector< std::vector<double> > dz_par2_;
108  // Boolean indicating if adapted primary vertex compatibility cuts are to be applied.
109  std::vector<bool> applyAdaptedPVCuts_;
110 
112  std::vector<double> max_d0_;
113  std::vector<double> max_z0_;
114  std::vector<double> nSigmaZ_;
115 
117  std::vector<uint32_t> min_layers_;
118  std::vector<uint32_t> min_3Dlayers_;
119  std::vector<uint32_t> max_lostLayers_;
120  std::vector<uint32_t> min_hits_bypass_;
121 
122  // pterror and nvalid hits cuts
123  std::vector<double> max_relpterr_;
124  std::vector<uint32_t> min_nhits_;
125 
126  std::vector<int32_t> max_minMissHitOutOrIn_;
127  std::vector<int32_t> max_lostHitFraction_;
128 
129  std::vector<double> min_eta_;
130  std::vector<double> max_eta_;
131 
132  // Flag and absolute cuts if no PV passes the selection
133  std::vector<double> max_d0NoPV_;
134  std::vector<double> max_z0NoPV_;
135  std::vector<bool> applyAbsCutsIfNoPV_;
136  //if true, selector flags but does not select
137  std::vector<bool> keepAllTracks_;
138 
139  // allow one of the previous psets to be used as a prefilter
140  std::vector<unsigned int> preFilter_;
141  std::vector<std::string> name_;
142 
143  //setup mva selector
144  std::vector<bool> useMVA_;
145  std::vector<bool> useMVAonly_;
146 
147  std::vector<double> min_MVA_;
148 
149  std::vector<std::string> mvaType_;
150  std::vector<std::string> forestLabel_;
151  std::vector<GBRForest*> forest_;
154 
155 
156  };
157 
158 #endif
std::vector< double > chi2n_no1Dmod_par_
std::vector< uint32_t > min_nhits_
#define dso_hidden
std::vector< double > chi2n_par_
std::vector< std::vector< double > > d0_par1_
std::vector< double > max_d0NoPV_
std::vector< double > max_z0_
tuple cfg
Definition: looper.py:259
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 > 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< 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?
math::XYZPoint Point
std::vector< std::vector< double > > dz_par1_
std::vector< std::vector< double > > dz_par2_
std::vector< std::vector< double > > res_par_
std::vector< double > max_relpterr_
std::vector< int32_t > vtxNumber_
vertex cuts
std::vector< reco::TrackBase::TrackQuality > qualityToSet_
string const
Definition: compareJSON.py:14
std::vector< std::string > forestLabel_
math::XYZVector XYZPoint
std::vector< StringCutObjectSelector< reco::Vertex > > vertexCut_
std::vector< bool > applyAbsCutsIfNoPV_
virtual void beginStream(StreamID)
std::vector< int32_t > max_minMissHitOutOrIn_
std::vector< double > min_MVA_
math::XYZPoint Point
edm::EDGetTokenT< reco::TrackCollection > src_
source collection label
std::vector< std::vector< double > > d0_par2_
std::vector< double > max_d0_
Impact parameter absolute cuts.
std::vector< bool > useMVAonly_
std::vector< double > max_eta_
std::vector< GBRForest * > forest_