CMS 3D CMS Logo

RecoTracktoTP.cc
Go to the documentation of this file.
2 
3 
4 // Constructors
6 {
7  SetBeamSpot(math::XYZPoint(-9999.0, -9999.0, -9999.0));
8  SetTrackingParticlePCA(GlobalPoint(-9999.0, -9999.0, -9999.0));
9  SetTrackingParticleMomentumPCA(GlobalVector(-9999.0, -9999.0, -9999.0));
10 }
11 
12 
14 {
15 }
16 
17 
19 {
20  std::vector<TrackingParticle> result;
21 
22  if( TP().parentVertex().isNonnull())
23  {
24  if(TP().parentVertex()->nSourceTracks() > 0)
25  {
26  for(TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
27  si != TP().parentVertex()->sourceTracks_end(); ++si)
28  {
29  for(TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
30  di != TP().parentVertex()->daughterTracks_end(); ++di)
31  {
32  if(si != di)
33  {
34  result.push_back(**si);
35  break;
36  }
37  }
38  if(result.size()) break;
39  }
40  }
41  else
42  {
43  return TrackingParticle();
44  }
45  }
46  else
47  {
48  return TrackingParticle();
49  }
50 
51  return i < result.size() ? result[i] : TrackingParticle();
52 }
53 
54 
56 {
57  int count = 0;
58  for(TrackingParticleRefVector::iterator si = TP().parentVertex()->sourceTracks_begin();
59  si != TP().parentVertex()->sourceTracks_end(); ++si)
60  {
61  for(TrackingParticleRefVector::iterator di = TP().parentVertex()->daughterTracks_begin();
62  di != TP().parentVertex()->daughterTracks_end(); ++di)
63  {
64  if(si != di) count++;
65  break;
66  }
67  if(count>0) break;
68  }
69  return count;
70 }
71 
72 
73 
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: RecoTracktoTP.h:56
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: RecoTracktoTP.h:57
int numTPMothers() const
TrackingParticle TP() const
Definition: RecoTracktoTP.h:36
const TrackingVertexRef & parentVertex() const
TrackingParticle TPMother() const
Definition: RecoTracktoTP.h:77
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void SetBeamSpot(const math::XYZPoint &bs)
Definition: RecoTracktoTP.h:31
Monte Carlo truth information used for tracking validation.
Global3DVector GlobalVector
Definition: GlobalVector.h:10