CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TPtoRecoTrack.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 
int i
Definition: DBlmapReader.cc:9
TrackingParticle TP() const
Definition: TPtoRecoTrack.h:44
void SetTrackingParticleMomentumPCA(const GlobalVector &p)
Definition: TPtoRecoTrack.h:81
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
void SetTrackingParticlePCA(const GlobalPoint &v)
Definition: TPtoRecoTrack.h:82
TrackingParticle TPMother() const
tuple result
Definition: query.py:137
const TrackingVertexRef & parentVertex() const
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:13
int numTPMothers() const
void SetBeamSpot(math::XYZPoint bs)
Definition: TPtoRecoTrack.h:39
Global3DVector GlobalVector
Definition: GlobalVector.h:10