CMS 3D CMS Logo

PFDisplacedVertex.h
Go to the documentation of this file.
1 #ifndef DataFormat_ParticleFlowReco_PFDisplacedVertex_h
2 #define DataFormat_ParticleFlowReco_PFDisplacedVertex_h
3 
7 
8 #include <vector>
9 #include <string>
10 #include <iostream>
11 
12 namespace reco {
13 
15 
23  class PFDisplacedVertex : public Vertex {
24  public:
26  typedef std::pair<unsigned int, unsigned int> PFTrackHitInfo;
27  typedef std::pair<PFTrackHitInfo, PFTrackHitInfo> PFTrackHitFullInfo;
28 
31 
37 
40  enum VertexType {
41  ANY = 0,
42  FAKE = 1,
43  LOOPER = 2,
44  NUCL = 10,
45  NUCL_LOOSE = 11,
46  NUCL_KINK = 12,
47  CONVERSION = 20,
50  K0_DECAY = 30,
57  BSM_VERTEX = 100
58  };
59 
62 
65 
67  void addElement(const TrackBaseRef& r,
68  const Track& refTrack,
69  const PFTrackHitFullInfo& hitInfo,
71  float w = 1.0);
72 
74  void cleanTracks();
75 
78 
81  void setPrimaryDirection(const math::XYZPoint& pvtx);
82 
85 
86  const std::vector<PFTrackHitFullInfo> trackHitFullInfos() const { return trackHitFullInfos_; }
87 
88  const std::vector<VertexTrackType> trackTypes() const { return trackTypes_; }
89 
91 
93  const bool isTherePrimaryTracks() const { return isThereKindTracks(T_TO_VERTEX); }
94 
96  const bool isThereMergedTracks() const { return isThereKindTracks(T_MERGED); }
97 
99  const bool isThereSecondaryTracks() const { return isThereKindTracks(T_FROM_VERTEX); }
100 
103 
106  size_t itrk = trackPosition(originalTrack);
107  return isTrack(itrk, T_TO_VERTEX);
108  }
109 
112  size_t itrk = trackPosition(originalTrack);
113  return isTrack(itrk, T_FROM_VERTEX);
114  }
115 
117  const bool isMergedTrack(const reco::TrackBaseRef& originalTrack) const {
118  size_t itrk = trackPosition(originalTrack);
119  return isTrack(itrk, T_MERGED);
120  }
121 
123  size_t itrk = trackPosition(originalTrack);
124  return trackHitFullInfos_[itrk];
125  }
126 
129  size_t itrk = trackPosition(originalTrack);
130  return isTrack(itrk, T_MERGED) || isTrack(itrk, T_TO_VERTEX);
131  }
132 
135  size_t itrk = trackPosition(originalTrack);
136  return isTrack(itrk, T_FROM_VERTEX);
137  }
138 
140  const int nPrimaryTracks() const { return nKindTracks(T_TO_VERTEX); }
141 
143  const int nMergedTracks() const { return nKindTracks(T_MERGED); }
144 
146  const int nSecondaryTracks() const { return nKindTracks(T_FROM_VERTEX); }
147 
149  const int nNotFromVertexTracks() const { return nKindTracks(T_NOT_FROM_VERTEX); }
150 
152  const int nTracks() const { return trackTypes_.size(); }
153 
154  // const reco::VertexTrackType vertexTrackType(reco::TrackBaseRef tkRef) const;
155 
160  bool useRefitted = true,
161  double mass = 0.0) const {
162  return momentum(massHypo, T_FROM_VERTEX, useRefitted, mass);
163  }
164 
167  bool useRefitted = true,
168  double mass = 0.0) const {
169  return momentum(massHypo, T_TO_VERTEX, useRefitted, mass);
170  }
171 
175  const math::XYZTLorentzVector secondaryMomentum(M_Hypo massHypo, bool useRefitted = true, double mass = 0.0) const {
176  return momentum(massHypo, T_FROM_VERTEX, useRefitted, mass);
177  }
178 
180  const math::XYZTLorentzVector primaryMomentum(M_Hypo massHypo, bool useRefitted = true, double mass = 0.0) const {
181  return momentum(massHypo, T_TO_VERTEX, useRefitted, mass);
182  }
183 
184  void calcKinematics() {
185  defaultPrimaryMomentum_ = momentum("PI", T_TO_VERTEX, false, 0.0);
187  }
188 
189  const double secondaryPt() const { return defaultPrimaryMomentum_.Pt(); }
190 
192  const double primaryPt() const { return defaultSecondaryMomentum_.Pt(); }
193 
195  const int totalCharge() const;
196 
199  const double angle_io() const;
200 
202  const math::XYZVector primaryDirection() const;
203 
204  bool isFake() const { return vertexType_ == FAKE; }
205  bool isLooper() const { return vertexType_ == LOOPER; }
206  bool isNucl() const { return vertexType_ == NUCL; }
207  bool isNucl_Loose() const { return vertexType_ == NUCL_LOOSE; }
208  bool isNucl_Kink() const { return vertexType_ == NUCL_KINK; }
209  bool isConv() const { return vertexType_ == CONVERSION; }
210  bool isConv_Loose() const { return vertexType_ == CONVERSION_LOOSE; }
211  bool isConvertedBremm() const { return vertexType_ == CONVERTED_BREMM; }
212  bool isK0() const { return vertexType_ == K0_DECAY; }
213  bool isLambda() const { return vertexType_ == LAMBDA_DECAY; }
214  bool isLambdaBar() const { return vertexType_ == LAMBDABAR_DECAY; }
215  bool isKplus() const { return vertexType_ == KPLUS_DECAY; }
216  bool isKminus() const { return vertexType_ == KMINUS_DECAY; }
217  bool isKplus_Loose() const { return vertexType_ == KPLUS_DECAY_LOOSE; }
218  bool isKminus_Loose() const { return vertexType_ == KMINUS_DECAY_LOOSE; }
219  bool isBSM() const { return vertexType_ == BSM_VERTEX; }
220 
221  std::string nameVertexType() const;
222 
224  void Dump(std::ostream& out = std::cout) const;
225 
226  private:
228 
230  const bool isThereKindTracks(VertexTrackType) const;
231 
233  const int nKindTracks(VertexTrackType) const;
234 
237 
239  const math::XYZTLorentzVector momentum(M_Hypo massHypo, VertexTrackType, bool, double mass) const;
240 
242  const double getMass2(M_Hypo, double) const;
243 
244  const size_t trackPosition(const reco::TrackBaseRef& originalTrack) const;
245 
246  const bool isTrack(size_t itrk, VertexTrackType T) const { return trackTypes_[itrk] == T; }
247 
249 
252 
254  std::vector<VertexTrackType> trackTypes_;
255 
257  std::vector<PFTrackHitFullInfo> trackHitFullInfos_;
258 
260 
263  };
264 } // namespace reco
265 
266 #endif
reco::PFDisplacedVertex::isK0
bool isK0() const
Definition: PFDisplacedVertex.h:212
reco::PFDisplacedVertex::Dump
void Dump(std::ostream &out=std::cout) const
cout function
Definition: PFDisplacedVertex.cc:222
reco::PFDisplacedVertex::isLooper
bool isLooper() const
Definition: PFDisplacedVertex.h:205
reco::Vertex::originalTrack
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:81
reco::PFDisplacedVertex::KPLUS_DECAY
Definition: PFDisplacedVertex.h:53
reco::PFDisplacedVertex::nKindTracks
const int nKindTracks(VertexTrackType) const
Common tool used to get the number of tracks of a given Kind.
Definition: PFDisplacedVertex.cc:33
reco::PFDisplacedVertex::LOOPER
Definition: PFDisplacedVertex.h:43
reco::PFDisplacedVertex::isConv
bool isConv() const
Definition: PFDisplacedVertex.h:209
reco::PFDisplacedVertex::isConvertedBremm
bool isConvertedBremm() const
Definition: PFDisplacedVertex.h:211
reco::PFDisplacedVertex::T_TO_VERTEX
Definition: PFDisplacedVertex.h:36
reco::PFDisplacedVertex::T_FROM_VERTEX
Definition: PFDisplacedVertex.h:36
reco::PFDisplacedVertex::nSecondaryTracks
const int nSecondaryTracks() const
Number of secondary tracks was identified.
Definition: PFDisplacedVertex.h:146
reco::PFDisplacedVertex::KMINUS_DECAY
Definition: PFDisplacedVertex.h:54
reco::PFDisplacedVertex::T_MERGED
Definition: PFDisplacedVertex.h:36
reco::PFDisplacedVertex::primaryMomentum
const math::XYZTLorentzVector primaryMomentum(std::string massHypo="PI", bool useRefitted=true, double mass=0.0) const
Momentum of primary or merged track calculated with a mass hypothesis.
Definition: PFDisplacedVertex.h:166
reco::PFDisplacedVertex::isFake
bool isFake() const
Definition: PFDisplacedVertex.h:204
reco::PFDisplacedVertex::PFTrackHitInfo
std::pair< unsigned int, unsigned int > PFTrackHitInfo
Information on the distance between track's hits and the Vertex.
Definition: PFDisplacedVertex.h:26
reco::PFDisplacedVertex::M_LAMBDA
Definition: PFDisplacedVertex.h:30
gather_cfg.cout
cout
Definition: gather_cfg.py:144
reco::PFDisplacedVertex::secondaryMomentum
const math::XYZTLorentzVector secondaryMomentum(M_Hypo massHypo, bool useRefitted=true, double mass=0.0) const
Definition: PFDisplacedVertex.h:175
reco::PFDisplacedVertex::M_KAON
Definition: PFDisplacedVertex.h:30
reco::PFDisplacedVertex::PFTrackHitFullInfo
std::pair< PFTrackHitInfo, PFTrackHitInfo > PFTrackHitFullInfo
Definition: PFDisplacedVertex.h:27
reco::PFDisplacedVertex::KMINUS_DECAY_LOOSE
Definition: PFDisplacedVertex.h:56
reco::PFDisplacedVertex::isNucl_Kink
bool isNucl_Kink() const
Definition: PFDisplacedVertex.h:208
reco::PFDisplacedVertex::isPrimaryTrack
const bool isPrimaryTrack(const reco::TrackBaseRef &originalTrack) const
Is a primary track was identified.
Definition: PFDisplacedVertex.h:105
reco::PFDisplacedVertex::isIncomingTrack
const bool isIncomingTrack(const reco::TrackBaseRef &originalTrack) const
Is primary or merged track.
Definition: PFDisplacedVertex.h:128
reco::PFDisplacedVertex::LAMBDABAR_DECAY
Definition: PFDisplacedVertex.h:52
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:46
reco::PFDisplacedVertex::isThereSecondaryTracks
const bool isThereSecondaryTracks() const
If a secondary track was identified.
Definition: PFDisplacedVertex.h:99
reco::PFDisplacedVertex::isKminus_Loose
bool isKminus_Loose() const
Definition: PFDisplacedVertex.h:218
reco::PFDisplacedVertex::NUCL
Definition: PFDisplacedVertex.h:44
reco::PFDisplacedVertex::isOutgoingTrack
const bool isOutgoingTrack(const reco::TrackBaseRef &originalTrack) const
Is secondary track.
Definition: PFDisplacedVertex.h:134
reco::PFDisplacedVertex::isNucl_Loose
bool isNucl_Loose() const
Definition: PFDisplacedVertex.h:207
reco::PFDisplacedVertex::trackTypes
const std::vector< VertexTrackType > trackTypes() const
Definition: PFDisplacedVertex.h:88
reco::PFDisplacedVertex::angle_io
const double angle_io() const
Definition: PFDisplacedVertex.cc:172
reco::PFDisplacedVertex::totalCharge
const int totalCharge() const
Total Charge.
Definition: PFDisplacedVertex.cc:159
reco::PFDisplacedVertex::trackPosition
const size_t trackPosition(const reco::TrackBaseRef &originalTrack) const
Definition: PFDisplacedVertex.cc:37
reco::PFDisplacedVertex::isMergedTrack
const bool isMergedTrack(const reco::TrackBaseRef &originalTrack) const
Is a secondary track was identified.
Definition: PFDisplacedVertex.h:117
TrackFwd.h
reco::PFDisplacedVertex::nTracks
const int nTracks() const
Number of tracks.
Definition: PFDisplacedVertex.h:152
reco::PFDisplacedVertex::trackHitFullInfos_
std::vector< PFTrackHitFullInfo > trackHitFullInfos_
Information on the distance between track's hits and the Vertex.
Definition: PFDisplacedVertex.h:257
reco::PFDisplacedVertex::isKplus_Loose
bool isKplus_Loose() const
Definition: PFDisplacedVertex.h:217
reco::PFDisplacedVertex::secondaryMomentum
const math::XYZTLorentzVector secondaryMomentum(std::string massHypo="PI", bool useRefitted=true, double mass=0.0) const
Definition: PFDisplacedVertex.h:159
w
const double w
Definition: UKUtility.cc:23
reco::PFDisplacedVertex::nPrimaryTracks
const int nPrimaryTracks() const
Number of primary tracks was identified.
Definition: PFDisplacedVertex.h:140
reco::PFDisplacedVertex::M_PION
Definition: PFDisplacedVertex.h:30
reco::Track
Definition: Track.h:27
reco::PFDisplacedVertex::isThereNotFromVertexTracks
const bool isThereNotFromVertexTracks() const
If there is a track which was not identified.
Definition: PFDisplacedVertex.h:102
reco::PFDisplacedVertex::primaryDirection
const math::XYZVector primaryDirection() const
Primary Direction.
Definition: PFDisplacedVertex.cc:184
reco::PFDisplacedVertex::isTherePrimaryTracks
const bool isTherePrimaryTracks() const
-----— Provide useful information -----— ///
Definition: PFDisplacedVertex.h:93
reco::PFDisplacedVertex::setVertexType
void setVertexType(VertexType vertexType)
Set the type of this vertex.
Definition: PFDisplacedVertex.h:77
reco::PFDisplacedVertex::vertexType_
VertexType vertexType_
-----— MEMBERS -----— ///
Definition: PFDisplacedVertex.h:251
reco::PFDisplacedVertex::NUCL_LOOSE
Definition: PFDisplacedVertex.h:45
reco::PFDisplacedVertex::defaultPrimaryMomentum_
math::XYZTLorentzVector defaultPrimaryMomentum_
Definition: PFDisplacedVertex.h:261
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
reco::PFDisplacedVertex
Block of elements.
Definition: PFDisplacedVertex.h:23
reco::PFDisplacedVertex::addElement
void addElement(const TrackBaseRef &r, const Track &refTrack, const PFTrackHitFullInfo &hitInfo, VertexTrackType trackType=T_NOT_FROM_VERTEX, float w=1.0)
Add a new track to the vertex.
Definition: PFDisplacedVertex.cc:12
reco::PFDisplacedVertex::trackHitFullInfos
const std::vector< PFTrackHitFullInfo > trackHitFullInfos() const
Definition: PFDisplacedVertex.h:86
reco::PFDisplacedVertex::LAMBDA_DECAY
Definition: PFDisplacedVertex.h:51
reco::PFDisplacedVertex::BSM_VERTEX
Definition: PFDisplacedVertex.h:57
reco::PFDisplacedVertex::primaryPt
const double primaryPt() const
Momentum of primary or merged track calculated with a mass hypothesis.
Definition: PFDisplacedVertex.h:192
reco::PFDisplacedVertex::getMass2
const double getMass2(M_Hypo, double) const
Get the mass with a given hypothesis.
Definition: PFDisplacedVertex.cc:199
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
LorentzVector.h
reco::PFDisplacedVertex::defaultSecondaryMomentum_
math::XYZTLorentzVector defaultSecondaryMomentum_
Definition: PFDisplacedVertex.h:262
reco::PFDisplacedVertex::PFDisplacedVertex
PFDisplacedVertex()
Default constructor.
Definition: PFDisplacedVertex.cc:8
reco::PFDisplacedVertex::isLambda
bool isLambda() const
Definition: PFDisplacedVertex.h:213
reco::PFDisplacedVertex::primaryDirection_
math::XYZVector primaryDirection_
Definition: PFDisplacedVertex.h:259
reco::PFDisplacedVertex::isThereMergedTracks
const bool isThereMergedTracks() const
If a merged track was identified.
Definition: PFDisplacedVertex.h:96
reco::PFDisplacedVertex::isThereKindTracks
const bool isThereKindTracks(VertexTrackType) const
------— TOOLS -----------— ///
Definition: PFDisplacedVertex.cc:28
reco::PFDisplacedVertex::primaryMomentum
const math::XYZTLorentzVector primaryMomentum(M_Hypo massHypo, bool useRefitted=true, double mass=0.0) const
Momentum of primary or merged track calculated with a mass hypothesis.
Definition: PFDisplacedVertex.h:180
reco::PFDisplacedVertex::nMergedTracks
const int nMergedTracks() const
Number of merged tracks was identified.
Definition: PFDisplacedVertex.h:143
reco::PFDisplacedVertex::isTrack
const bool isTrack(size_t itrk, VertexTrackType T) const
Definition: PFDisplacedVertex.h:246
reco::PFDisplacedVertex::trackTypes_
std::vector< VertexTrackType > trackTypes_
Types of the tracks associated to the vertex.
Definition: PFDisplacedVertex.h:254
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::PFDisplacedVertex::VertexTrackType
VertexTrackType
Definition: PFDisplacedVertex.h:36
PbPb_ZMuSkimMuonDPG_cff.trackType
trackType
Definition: PbPb_ZMuSkimMuonDPG_cff.py:36
alignCSCRings.r
r
Definition: alignCSCRings.py:93
reco::PFDisplacedVertex::isLambdaBar
bool isLambdaBar() const
Definition: PFDisplacedVertex.h:214
reco::PFDisplacedVertex::calcKinematics
void calcKinematics()
Definition: PFDisplacedVertex.h:184
reco::PFDisplacedVertex::momentum
const math::XYZTLorentzVector momentum(std::string, VertexTrackType, bool, double mass) const
Common tool to calculate the momentum vector of tracks with a given Kind.
reco::PFDisplacedVertex::M_MASSLESS
Definition: PFDisplacedVertex.h:30
reco::PFDisplacedVertex::cleanTracks
void cleanTracks()
Clean the tracks collection and all the associated collections.
Definition: PFDisplacedVertex.cc:22
reco::PFDisplacedVertex::isConv_Loose
bool isConv_Loose() const
Definition: PFDisplacedVertex.h:210
reco::PFDisplacedVertex::nNotFromVertexTracks
const int nNotFromVertexTracks() const
Number of tracks which was not identified.
Definition: PFDisplacedVertex.h:149
Vertex.h
T
long double T
Definition: Basic3DVectorLD.h:48
math::XYZTLorentzVector
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
reco::PFDisplacedVertex::nameVertexType
std::string nameVertexType() const
Definition: PFDisplacedVertex.cc:62
VertexType
Definition: Vx3DHLTAnalyzer.h:36
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
reco::PFDisplacedVertex::CONVERSION_LOOSE
Definition: PFDisplacedVertex.h:48
edm::RefToBase< reco::Track >
reco::PFDisplacedVertex::isSecondaryTrack
const bool isSecondaryTrack(const reco::TrackBaseRef &originalTrack) const
Is a secondary track was identified.
Definition: PFDisplacedVertex.h:111
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
reco::PFDisplacedVertex::NUCL_KINK
Definition: PFDisplacedVertex.h:46
reco::PFDisplacedVertex::isNucl
bool isNucl() const
Definition: PFDisplacedVertex.h:206
reco::PFDisplacedVertex::setPrimaryDirection
void setPrimaryDirection(const math::XYZPoint &pvtx)
Definition: PFDisplacedVertex.cc:54
reco::PFDisplacedVertex::K0_DECAY
Definition: PFDisplacedVertex.h:50
reco::PFDisplacedVertex::KPLUS_DECAY_LOOSE
Definition: PFDisplacedVertex.h:55
reco::PFDisplacedVertex::M_Hypo
M_Hypo
Mass hypothesis enum.
Definition: PFDisplacedVertex.h:30
reco::PFDisplacedVertex::CONVERSION
Definition: PFDisplacedVertex.h:47
reco::PFDisplacedVertex::isBSM
bool isBSM() const
Definition: PFDisplacedVertex.h:219
reco::PFDisplacedVertex::trackHitFullInfo
const PFTrackHitFullInfo trackHitFullInfo(const reco::TrackBaseRef &originalTrack) const
Definition: PFDisplacedVertex.h:122
reco::PFDisplacedVertex::secondaryPt
const double secondaryPt() const
Definition: PFDisplacedVertex.h:189
reco::PFDisplacedVertex::vertexType
VertexType vertexType()
Get the type of this vertex.
Definition: PFDisplacedVertex.h:84
reco::Vertex
Definition: Vertex.h:35
reco::PFDisplacedVertex::ANY
Definition: PFDisplacedVertex.h:41
reco::PFDisplacedVertex::FAKE
Definition: PFDisplacedVertex.h:42
reco::PFDisplacedVertex::M_CUSTOM
Definition: PFDisplacedVertex.h:30
reco::PFDisplacedVertex::isKplus
bool isKplus() const
Definition: PFDisplacedVertex.h:215
reco::PFDisplacedVertex::T_NOT_FROM_VERTEX
Definition: PFDisplacedVertex.h:36
reco::PFDisplacedVertex::CONVERTED_BREMM
Definition: PFDisplacedVertex.h:49
reco::PFDisplacedVertex::isKminus
bool isKminus() const
Definition: PFDisplacedVertex.h:216