test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
14 
16 
24  class PFDisplacedVertex : public Vertex{
25 
26  public:
27 
29  typedef std::pair <unsigned int, unsigned int> PFTrackHitInfo;
30  typedef std::pair <PFTrackHitInfo, PFTrackHitInfo> PFTrackHitFullInfo;
31 
33  enum M_Hypo {
39  };
40 
41 
51  };
52 
55  enum VertexType {
56  ANY = 0,
57  FAKE = 1,
58  LOOPER = 2,
59  NUCL = 10,
60  NUCL_LOOSE = 11,
61  NUCL_KINK = 12,
62  CONVERSION = 20,
65  K0_DECAY = 30,
72  BSM_VERTEX = 100
73  };
74 
75 
78 
81 
83  void addElement( const TrackBaseRef & r, const Track & refTrack,
84  const PFTrackHitFullInfo& hitInfo ,
85  VertexTrackType trackType = T_NOT_FROM_VERTEX, float w=1.0 );
86 
88  void cleanTracks();
89 
92 
95  void setPrimaryDirection(const math::XYZPoint& pvtx);
96 
99 
100  const std::vector < PFTrackHitFullInfo > trackHitFullInfos() const
101  {return trackHitFullInfos_;}
102 
103  const std::vector <VertexTrackType> trackTypes() const
104  {return trackTypes_;}
105 
106 
108 
110  const bool isTherePrimaryTracks() const
111  {return isThereKindTracks(T_TO_VERTEX);}
112 
114  const bool isThereMergedTracks() const
115  {return isThereKindTracks(T_MERGED);}
116 
118  const bool isThereSecondaryTracks() const
120 
122  const bool isThereNotFromVertexTracks() const
124 
125 
126 
127 
130  {
131  size_t itrk = trackPosition(originalTrack);
132  return isTrack(itrk, T_TO_VERTEX);
133  }
134 
137  {
138  size_t itrk = trackPosition(originalTrack);
139  return isTrack(itrk, T_FROM_VERTEX);
140  }
141 
144  {
145  size_t itrk = trackPosition(originalTrack);
146  return isTrack(itrk, T_MERGED);
147  }
148 
150  size_t itrk = trackPosition(originalTrack);
151  return trackHitFullInfos_[itrk];
152  }
153 
154 
155 
158  {
159  size_t itrk = trackPosition(originalTrack);
160  return isTrack(itrk, T_MERGED) || isTrack(itrk, T_TO_VERTEX);
161  }
162 
165  {
166  size_t itrk = trackPosition(originalTrack);
167  return isTrack(itrk, T_FROM_VERTEX);
168  }
169 
170 
172  const int nPrimaryTracks() const
173  {return nKindTracks(T_TO_VERTEX);}
174 
176  const int nMergedTracks() const
177  {return nKindTracks(T_MERGED);}
178 
180  const int nSecondaryTracks() const
181  {return nKindTracks(T_FROM_VERTEX);}
182 
184  const int nNotFromVertexTracks() const
185  {return nKindTracks(T_NOT_FROM_VERTEX);}
186 
188  const int nTracks() const {return trackTypes_.size();}
189 
190  // const reco::VertexTrackType vertexTrackType(reco::TrackBaseRef tkRef) const;
191 
196  secondaryMomentum(std::string massHypo = "PI",
197  bool useRefitted = true, double mass = 0.0) const
198  {return momentum(massHypo, T_FROM_VERTEX, useRefitted, mass);}
199 
202  primaryMomentum(std::string massHypo = "PI",
203  bool useRefitted = true, double mass = 0.0) const
204  {return momentum(massHypo, T_TO_VERTEX, useRefitted, mass);}
205 
206 
207 
213  bool useRefitted = true, double mass = 0.0) const
214  {return momentum(massHypo, T_FROM_VERTEX, useRefitted, mass);}
215 
219  bool useRefitted = true, double mass = 0.0) const
220  {return momentum(massHypo, T_TO_VERTEX, useRefitted, mass);}
221 
222 
224  defaultPrimaryMomentum_ = momentum("PI", T_TO_VERTEX, false, 0.0);
226  }
227 
228 
229  const double secondaryPt() const
230  {return defaultPrimaryMomentum_.Pt();}
231 
233  const double primaryPt() const
234  {return defaultSecondaryMomentum_.Pt();}
235 
236 
237 
239  const int totalCharge() const;
240 
243  const double angle_io() const;
244 
245 
247  const math::XYZVector primaryDirection() const;
248 
249 
250 
251  bool isFake() const { return vertexType_ == FAKE;}
252  bool isLooper() const { return vertexType_ == LOOPER;}
253  bool isNucl() const { return vertexType_ == NUCL;}
254  bool isNucl_Loose() const { return vertexType_ == NUCL_LOOSE;}
255  bool isNucl_Kink() const { return vertexType_ == NUCL_KINK;}
256  bool isConv() const { return vertexType_ == CONVERSION;}
257  bool isConv_Loose() const { return vertexType_ == CONVERSION_LOOSE;}
258  bool isConvertedBremm() const { return vertexType_ == CONVERTED_BREMM;}
259  bool isK0() const { return vertexType_ == K0_DECAY;}
260  bool isLambda() const { return vertexType_ == LAMBDA_DECAY;}
261  bool isLambdaBar() const { return vertexType_ == LAMBDABAR_DECAY;}
262  bool isKplus() const { return vertexType_ == KPLUS_DECAY;}
263  bool isKminus() const { return vertexType_ == KMINUS_DECAY;}
264  bool isKplus_Loose() const { return vertexType_ == KPLUS_DECAY_LOOSE;}
265  bool isKminus_Loose() const { return vertexType_ == KMINUS_DECAY_LOOSE;}
266  bool isBSM() const { return vertexType_ == BSM_VERTEX;}
267 
268 
269  std::string nameVertexType() const;
270 
272  void Dump(std::ostream& out = std::cout) const;
273 
274  private:
275 
277 
279  const bool isThereKindTracks(VertexTrackType) const;
280 
282  const int nKindTracks(VertexTrackType) const;
283 
287  bool, double mass) const;
288 
290  const math::XYZTLorentzVector momentum(M_Hypo massHypo,
292  bool, double mass) const;
293 
295  const double getMass2(M_Hypo, double) const;
296 
297  const size_t trackPosition(const reco::TrackBaseRef& originalTrack) const;
298 
299  const bool isTrack(size_t itrk, VertexTrackType T) const {
300  return trackTypes_[itrk] == T;
301  }
302 
303 
305 
308 
310  std::vector < VertexTrackType > trackTypes_;
311 
313  std::vector < PFTrackHitFullInfo > trackHitFullInfos_;
314 
316 
319 
320 
321  };
322 }
323 
324 #endif
325 
326 
327 
const double getMass2(M_Hypo, double) const
Get the mass with a given hypothesis.
const bool isSecondaryTrack(const reco::TrackBaseRef &originalTrack) const
Is a secondary track was identified.
const int nKindTracks(VertexTrackType) const
Common tool used to get the number of tracks of a given Kind.
const double w
Definition: UKUtility.cc:23
const double angle_io() const
const bool isTherePrimaryTracks() const
--—— Provide useful information --—— ///
void setPrimaryDirection(const math::XYZPoint &pvtx)
const std::vector< PFTrackHitFullInfo > trackHitFullInfos() const
TrackBaseRef originalTrack(const Track &refTrack) const
Definition: Vertex.cc:71
const math::XYZTLorentzVector secondaryMomentum(std::string massHypo="PI", bool useRefitted=true, double mass=0.0) const
const int totalCharge() const
Total Charge.
const bool isIncomingTrack(const reco::TrackBaseRef &originalTrack) const
Is primary or merged track.
void Dump(std::ostream &out=std::cout) const
cout function
const bool isMergedTrack(const reco::TrackBaseRef &originalTrack) const
Is a secondary track was identified.
const PFTrackHitFullInfo trackHitFullInfo(const reco::TrackBaseRef &originalTrack) const
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
const bool isThereKindTracks(VertexTrackType) const
---—— TOOLS --------—— ///
const int nNotFromVertexTracks() const
Number of tracks which was not identified.
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.
void setVertexType(VertexType vertexType)
Set the type of this vertex.
std::pair< unsigned int, unsigned int > PFTrackHitInfo
Information on the distance between track&#39;s hits and the Vertex.
const int nPrimaryTracks() const
Number of primary tracks was identified.
const std::vector< VertexTrackType > trackTypes() const
const math::XYZVector primaryDirection() const
Primary Direction.
const bool isPrimaryTrack(const reco::TrackBaseRef &originalTrack) const
Is a primary track was identified.
const double primaryPt() const
Momentum of primary or merged track calculated with a mass hypothesis.
VertexType vertexType_
--—— MEMBERS --—— ///
const size_t trackPosition(const reco::TrackBaseRef &originalTrack) const
Block of elements.
PFDisplacedVertex()
Default constructor.
std::vector< PFTrackHitFullInfo > trackHitFullInfos_
Information on the distance between track&#39;s hits and the Vertex.
const bool isThereSecondaryTracks() const
If a secondary track was identified.
std::pair< PFTrackHitInfo, PFTrackHitInfo > PFTrackHitFullInfo
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
const double secondaryPt() const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
const bool isOutgoingTrack(const reco::TrackBaseRef &originalTrack) const
Is secondary track.
const bool isTrack(size_t itrk, VertexTrackType T) const
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.
VertexType vertexType()
Get the type of this vertex.
const bool isThereNotFromVertexTracks() const
If there is a track which was not identified.
const math::XYZTLorentzVector momentum(std::string, VertexTrackType, bool, double mass) const
Common tool to calculate the momentum vector of tracks with a given Kind.
math::XYZVector primaryDirection_
void cleanTracks()
Clean the tracks collection and all the associated collections.
std::string nameVertexType() const
const int nMergedTracks() const
Number of merged tracks was identified.
math::XYZTLorentzVector defaultPrimaryMomentum_
math::XYZTLorentzVector defaultSecondaryMomentum_
const math::XYZTLorentzVector secondaryMomentum(M_Hypo massHypo, bool useRefitted=true, double mass=0.0) const
tuple cout
Definition: gather_cfg.py:145
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.
const bool isThereMergedTracks() const
If a merged track was identified.
long double T
const int nSecondaryTracks() const
Number of secondary tracks was identified.
M_Hypo
Mass hypothesis enum.
std::vector< VertexTrackType > trackTypes_
Types of the tracks associated to the vertex.
const int nTracks() const
Number of tracks.