CMS 3D CMS Logo

PFDisplacedVertexHelper.h
Go to the documentation of this file.
1 #ifndef RecoParticleFlow_PFTracking_PFDisplacedVertexHelper_h
2 #define RecoParticleFlow_PFTracking_PFDisplacedVertexHelper_h
3 
10 
12 
18 public:
21 
24 
27 
30  edm::Handle<reco::BeamSpot> beamSpotHandle);
31 
33  bool isTrackSelected(const reco::Track& trk, const reco::PFDisplacedVertex::VertexTrackType vertexTrackType) const;
34 
37 
39  math::XYZPoint primaryVertex() const { return pvtx_; }
40 
41  void Dump(std::ostream& out = std::cout) const;
42 
43 private:
45  int lambdaCP(const reco::PFDisplacedVertex& v) const;
46  bool isKaonMass(const reco::PFDisplacedVertex& v) const;
47 
49  struct TracksSelector {
52  nChi2_min_(0),
53  nChi2_max_(100),
54  pt_min_(0),
55  dxy_min_(0),
56  nHits_min_(3),
57  nOuterHits_max_(100),
58  quality_("loose") {}
59 
61  bSelectTracks_ = ps.getParameter<bool>("bSelectTracks");
62  nChi2_min_ = ps.getParameter<double>("nChi2_min");
63  nChi2_max_ = ps.getParameter<double>("nChi2_max");
64  pt_min_ = ps.getParameter<double>("pt_min");
65  dxy_min_ = ps.getParameter<double>("dxy_min");
66  nHits_min_ = ps.getParameter<int>("nHits_min");
67  nOuterHits_max_ = ps.getParameter<int>("nOuterHits_max");
69  }
70 
71  bool selectTracks() const { return bSelectTracks_; }
72  double nChi2_min() const { return nChi2_min_; }
73  double nChi2_max() const { return nChi2_max_; }
74  double pt_min() const { return pt_min_; }
75  double dxy_min() const { return dxy_min_; }
76  int nHits_min() const { return nHits_min_; }
77  int nOuterHits_max() const { return nOuterHits_max_; }
78  std::string quality() const { return quality_; }
79  double dxy(const reco::Track& trk) const { return trk.dxy(pvtx_); }
80 
82  double nChi2_min_;
83  double nChi2_max_;
84  double pt_min_;
85  double dxy_min_;
90 
91  void Dump(std::ostream& out = std::cout) const {
92  if (!out)
93  return;
94  std::string s = bSelectTracks_ ? "On" : "Off";
95 
96  out << "" << std::endl;
97  out << " ==== The TrackerSelector is " << s.data() << " ==== " << std::endl;
98 
99  out << " nChi2_min_ = " << nChi2_min_ << " nChi2_max_ = " << nChi2_max_ << std::endl
100  << " pt_min_ = " << pt_min_ << " dxy_min_ = " << dxy_min_ << std::endl
101  << " nHits_min_ = " << nHits_min_ << " nOuterHits_max_ = " << nOuterHits_max_ << std::endl
102  << " quality = " << quality_ << std::endl;
103  }
104  };
105 
110  double m[] = {0.050, 0.470, 0.525, 0.470, 0.525, 1.107, 1.125, 0.200};
111  std::vector<double> masses(m, m + 8);
112  masses_ = masses;
113 
114  double a[] = {60, 40};
115  std::vector<double> angles(a, a + 1);
116  angles_ = angles;
117  };
118 
120  bIdentifyVertices_ = ps.getParameter<bool>("bIdentifyVertices");
121  angles_ = ps.getParameter<std::vector<double> >("angles");
122  masses_ = ps.getParameter<std::vector<double> >("masses");
123  pt_min_ = ps.getParameter<double>("pt_min");
124  pt_kink_min_ = ps.getParameter<double>("pt_kink_min");
125  looper_eta_max_ = ps.getParameter<double>("looper_eta_max");
126  logPrimSec_min_ = ps.getParameter<double>("logPrimSec_min");
127  }
128 
129  bool identifyVertices() const { return bIdentifyVertices_; }
130 
131  double angle_max() const { return angles_[0]; }
132  double angle_V0Conv_max() const { return angles_[1]; }
133 
134  double pt_min() const { return pt_min_; }
135  double pt_kink_min() const { return pt_kink_min_; }
136 
137  double mConv_max() const { return masses_[0]; }
138  double mK0_min() const { return masses_[1]; }
139  double mK0_max() const { return masses_[2]; }
140  double mK_min() const { return masses_[3]; }
141  double mK_max() const { return masses_[4]; }
142  double mLambda_min() const { return masses_[5]; }
143  double mLambda_max() const { return masses_[6]; }
144  double mNucl_min() const { return masses_[7]; }
145 
146  double looper_eta_max() const { return looper_eta_max_; }
147  double logPrimSec_min() const { return logPrimSec_min_; }
148 
150  std::vector<double> angles_;
151  std::vector<double> masses_;
152  double pt_min_;
153  double pt_kink_min_;
156 
157  void Dump(std::ostream& out = std::cout) const {
158  if (!out)
159  return;
160  std::string s = bIdentifyVertices_ ? "On" : "Off";
161  out << "" << std::endl;
162  out << " ==== The Vertex Identifier is " << s.data() << " ==== " << std::endl;
163 
164  out << " pt_min_ = " << pt_min_ << " pt_kink_min_ = " << pt_kink_min_ << std::endl
165  << " looper_eta_max_ = " << looper_eta_max_ << " log10(P_Prim/P_Sec)_min " << logPrimSec_min_ << std::endl
166  << " Mass_conv > " << mConv_max() << std::endl
167  << " " << mK0_min() << " < Mass_K0 < " << mK0_max() << std::endl
168  << " " << mK_min() << " < Mass_K+- < " << mK_max() << std::endl
169  << " " << mLambda_min() << " < Mass_Lambda < " << mLambda_max() << std::endl
170  << " Mass_Nucl_ee > " << mNucl_min() << std::endl
171  << " angle_max = " << angle_max() << " angle_V0Conv_max = " << angle_V0Conv_max() << std::endl;
172  }
173  };
174 
179 
181  static const double pion_mass2;
182  static const double muon_mass2;
183  static const double proton_mass2;
184 };
185 
186 #endif
void Dump(std::ostream &out=std::cout) const
void setVertexIdentifier(const edm::ParameterSet &ps)
Set Vertex identifier parameters.
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
void setTracksSelector(const edm::ParameterSet &ps)
Set Tracks selector parameters.
void Dump(std::ostream &out=std::cout) const
bool isKaonMass(const reco::PFDisplacedVertex &v) const
static const double proton_mass2
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
Update the primary vertex information.
double dxy(const reco::Track &trk) const
Displaced Vertex Finder Algorithm.
static const double pion_mass2
Masses2 taken from PDG.
math::XYZPoint primaryVertex() const
Set Vertex direction using the primary vertex.
int lambdaCP(const reco::PFDisplacedVertex &v) const
Tools used to calculate quantities for vertex identification.
Block of elements.
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
double a
Definition: hdecay.h:121
math::XYZPoint pvtx_
Primary vertex information updated for each event.
Tool which store the information for the tracks selection.
bool isTrackSelected(const reco::Track &trk, const reco::PFDisplacedVertex::VertexTrackType vertexTrackType) const
Select tracks tool.
void Dump(std::ostream &out=std::cout) const
Tool which store the information for the vertex identification.
reco::PFDisplacedVertex::VertexType identifyVertex(const reco::PFDisplacedVertex &v) const
Vertex identification tool.
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:608