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
PFDisplacedVertexHelper::TracksSelector::selectTracks
bool selectTracks() const
Definition: PFDisplacedVertexHelper.h:71
PFDisplacedVertexHelper::VertexIdentifier::angle_max
double angle_max() const
Definition: PFDisplacedVertexHelper.h:131
PFDisplacedVertexHelper::VertexIdentifier::identifyVertices
bool identifyVertices() const
Definition: PFDisplacedVertexHelper.h:129
PFDisplacedVertexHelper::VertexIdentifier::VertexIdentifier
VertexIdentifier()
Definition: PFDisplacedVertexHelper.h:108
PFDisplacedVertexHelper::VertexIdentifier::logPrimSec_min
double logPrimSec_min() const
Definition: PFDisplacedVertexHelper.h:147
PFDisplacedVertexHelper::VertexIdentifier::bIdentifyVertices_
bool bIdentifyVertices_
Definition: PFDisplacedVertexHelper.h:149
funct::false
false
Definition: Factorize.h:34
PFDisplacedVertexHelper::Dump
void Dump(std::ostream &out=std::cout) const
Definition: PFDisplacedVertexHelper.cc:307
PFDisplacedVertexHelper::TracksSelector::nOuterHits_max
int nOuterHits_max() const
Definition: PFDisplacedVertexHelper.h:77
PFDisplacedVertexHelper::proton_mass2
static const double proton_mass2
Definition: PFDisplacedVertexHelper.h:183
ESHandle.h
PFDisplacedVertexHelper::TracksSelector::TracksSelector
TracksSelector()
Definition: PFDisplacedVertexHelper.h:50
PFDisplacedVertexHelper::TracksSelector::nChi2_min
double nChi2_min() const
Definition: PFDisplacedVertexHelper.h:72
PFDisplacedVertexHelper::TracksSelector::nChi2_max
double nChi2_max() const
Definition: PFDisplacedVertexHelper.h:73
gather_cfg.cout
cout
Definition: gather_cfg.py:144
PFDisplacedVertexHelper::PFDisplacedVertexHelper
PFDisplacedVertexHelper()
Definition: PFDisplacedVertexHelper.cc:18
PFDisplacedVertexHelper::TracksSelector::bSelectTracks_
bool bSelectTracks_
Definition: PFDisplacedVertexHelper.h:81
PFDisplacedVertexHelper::VertexIdentifier::mLambda_max
double mLambda_max() const
Definition: PFDisplacedVertexHelper.h:143
PFDisplacedVertexHelper::TracksSelector::nChi2_min_
double nChi2_min_
Definition: PFDisplacedVertexHelper.h:82
PFDisplacedVertexHelper
Displaced Vertex Finder Algorithm.
Definition: PFDisplacedVertexHelper.h:17
PFDisplacedVertexHelper::setVertexIdentifier
void setVertexIdentifier(const edm::ParameterSet &ps)
Set Vertex identifier parameters.
Definition: PFDisplacedVertexHelper.h:26
PFDisplacedVertexHelper::setTracksSelector
void setTracksSelector(const edm::ParameterSet &ps)
Set Tracks selector parameters.
Definition: PFDisplacedVertexHelper.h:23
PFDisplacedVertexHelper::setPrimaryVertex
void setPrimaryVertex(edm::Handle< reco::VertexCollection > mainVertexHandle, edm::Handle< reco::BeamSpot > beamSpotHandle)
Update the primary vertex information.
Definition: PFDisplacedVertexHelper.cc:23
PFDisplacedVertexHelper::VertexIdentifier::logPrimSec_min_
double logPrimSec_min_
Definition: PFDisplacedVertexHelper.h:155
PFDisplacedVertexHelper::VertexIdentifier::VertexIdentifier
VertexIdentifier(const edm::ParameterSet &ps)
Definition: PFDisplacedVertexHelper.h:119
PFDisplacedVertexHelper::isKaonMass
bool isKaonMass(const reco::PFDisplacedVertex &v) const
Definition: PFDisplacedVertexHelper.cc:285
findQualityFiles.v
v
Definition: findQualityFiles.py:179
PFDisplacedVertexHelper::TracksSelector::dxy_min
double dxy_min() const
Definition: PFDisplacedVertexHelper.h:75
edm::Handle< reco::VertexCollection >
PFDisplacedVertexHelper::VertexIdentifier::angle_V0Conv_max
double angle_V0Conv_max() const
Definition: PFDisplacedVertexHelper.h:132
PFDisplacedVertexHelper::TracksSelector::pt_min
double pt_min() const
Definition: PFDisplacedVertexHelper.h:74
PFDisplacedVertexHelper::TracksSelector::pvtx_
math::XYZPoint pvtx_
Definition: PFDisplacedVertexHelper.h:88
PFDisplacedVertexHelper::VertexIdentifier::looper_eta_max
double looper_eta_max() const
Definition: PFDisplacedVertexHelper.h:146
PFDisplacedVertexHelper::TracksSelector::nChi2_max_
double nChi2_max_
Definition: PFDisplacedVertexHelper.h:83
alignCSCRings.s
s
Definition: alignCSCRings.py:92
PFDisplacedVertexHelper::VertexIdentifier::mK0_max
double mK0_max() const
Definition: PFDisplacedVertexHelper.h:139
Track.h
BeamSpot.h
PFDisplacedVertexHelper::VertexIdentifier::mConv_max
double mConv_max() const
Definition: PFDisplacedVertexHelper.h:137
PFDisplacedVertexHelper::TracksSelector::pt_min_
double pt_min_
Definition: PFDisplacedVertexHelper.h:84
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:72
reco::Track
Definition: Track.h:27
PFDisplacedVertexHelper::TracksSelector::Dump
void Dump(std::ostream &out=std::cout) const
Definition: PFDisplacedVertexHelper.h:91
PFDisplacedVertexHelper::primaryVertex
math::XYZPoint primaryVertex() const
Set Vertex direction using the primary vertex.
Definition: PFDisplacedVertexHelper.h:39
PFDisplacedVertexHelper::VertexIdentifier::pt_min_
double pt_min_
Definition: PFDisplacedVertexHelper.h:152
PFDisplacedVertexHelper::pion_mass2
static const double pion_mass2
Masses2 taken from PDG.
Definition: PFDisplacedVertexHelper.h:181
PFDisplacedVertexHelper::TracksSelector::nHits_min
int nHits_min() const
Definition: PFDisplacedVertexHelper.h:76
PFDisplacedVertexHelper::VertexIdentifier::mLambda_min
double mLambda_min() const
Definition: PFDisplacedVertexHelper.h:142
PFDisplacedVertexHelper::~PFDisplacedVertexHelper
~PFDisplacedVertexHelper()
Definition: PFDisplacedVertexHelper.cc:21
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PFDisplacedVertexHelper::TracksSelector::dxy_min_
double dxy_min_
Definition: PFDisplacedVertexHelper.h:85
edm::ParameterSet
Definition: ParameterSet.h:36
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::PFDisplacedVertex
Block of elements.
Definition: PFDisplacedVertex.h:23
a
double a
Definition: hdecay.h:119
PFDisplacedVertexHelper::TracksSelector::dxy
double dxy(const reco::Track &trk) const
Definition: PFDisplacedVertexHelper.h:79
PFDisplacedVertexHelper::muon_mass2
static const double muon_mass2
Definition: PFDisplacedVertexHelper.h:182
PFDisplacedVertexHelper::VertexIdentifier::mNucl_min
double mNucl_min() const
Definition: PFDisplacedVertexHelper.h:144
PFDisplacedVertexHelper::VertexIdentifier::masses_
std::vector< double > masses_
Definition: PFDisplacedVertexHelper.h:151
PFDisplacedVertex.h
PFDisplacedVertexHelper::VertexIdentifier::Dump
void Dump(std::ostream &out=std::cout) const
Definition: PFDisplacedVertexHelper.h:157
PFDisplacedVertexHelper::TracksSelector
Tool which store the information for the tracks selection.
Definition: PFDisplacedVertexHelper.h:49
PFDisplacedVertexHelper::VertexIdentifier::pt_kink_min_
double pt_kink_min_
Definition: PFDisplacedVertexHelper.h:153
PFDisplacedVertexHelper::VertexIdentifier::pt_kink_min
double pt_kink_min() const
Definition: PFDisplacedVertexHelper.h:135
PFDisplacedVertexHelper::TracksSelector::TracksSelector
TracksSelector(const edm::ParameterSet &ps)
Definition: PFDisplacedVertexHelper.h:60
PFDisplacedVertexHelper::TracksSelector::nHits_min_
int nHits_min_
Definition: PFDisplacedVertexHelper.h:86
PFDisplacedVertexHelper::VertexIdentifier::angles_
std::vector< double > angles_
Definition: PFDisplacedVertexHelper.h:150
particleFlowDisplacedVertex_cfi.masses
masses
Definition: particleFlowDisplacedVertex_cfi.py:80
reco::PFDisplacedVertex::VertexTrackType
VertexTrackType
Definition: PFDisplacedVertex.h:36
VertexFwd.h
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
particleFlowDisplacedVertex_cfi.angles
angles
Definition: particleFlowDisplacedVertex_cfi.py:84
PFDisplacedVertexHelper::vertexIdentifier_
VertexIdentifier vertexIdentifier_
Definition: PFDisplacedVertexHelper.h:176
reco::PFDisplacedVertex::VertexType
VertexType
Definition: PFDisplacedVertex.h:40
PFDisplacedVertexHelper::lambdaCP
int lambdaCP(const reco::PFDisplacedVertex &v) const
Tools used to calculate quantities for vertex identification.
Definition: PFDisplacedVertexHelper.cc:214
PFDisplacedVertexHelper::VertexIdentifier
Tool which store the information for the vertex identification.
Definition: PFDisplacedVertexHelper.h:107
PFDisplacedVertexHelper::identifyVertex
reco::PFDisplacedVertex::VertexType identifyVertex(const reco::PFDisplacedVertex &v) const
Vertex identification tool.
Definition: PFDisplacedVertexHelper.cc:72
PFDisplacedVertexHelper::VertexIdentifier::pt_min
double pt_min() const
Definition: PFDisplacedVertexHelper.h:134
PFDisplacedVertexHelper::tracksSelector_
TracksSelector tracksSelector_
Definition: PFDisplacedVertexHelper.h:175
PFDisplacedVertexHelper::VertexIdentifier::mK_max
double mK_max() const
Definition: PFDisplacedVertexHelper.h:141
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
PFDisplacedVertexHelper::VertexIdentifier::looper_eta_max_
double looper_eta_max_
Definition: PFDisplacedVertexHelper.h:154
PFDisplacedVertexHelper::TracksSelector::nOuterHits_max_
int nOuterHits_max_
Definition: PFDisplacedVertexHelper.h:87
ParameterSet.h
reco::TrackBase::dxy
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:593
PFDisplacedVertexHelper::VertexIdentifier::mK_min
double mK_min() const
Definition: PFDisplacedVertexHelper.h:140
PFDisplacedVertexHelper::TracksSelector::quality_
std::string quality_
Definition: PFDisplacedVertexHelper.h:89
PFDisplacedVertexHelper::pvtx_
math::XYZPoint pvtx_
Primary vertex information updated for each event.
Definition: PFDisplacedVertexHelper.h:178
PFDisplacedVertexHelper::isTrackSelected
bool isTrackSelected(const reco::Track &trk, const reco::PFDisplacedVertex::VertexTrackType vertexTrackType) const
Select tracks tool.
Definition: PFDisplacedVertexHelper.cc:38
PFDisplacedVertexHelper::VertexIdentifier::mK0_min
double mK0_min() const
Definition: PFDisplacedVertexHelper.h:138
PFDisplacedVertexHelper::TracksSelector::quality
std::string quality() const
Definition: PFDisplacedVertexHelper.h:78