StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StGimParticle.cxx
1 // @(#)root/eg:$Id: StGimParticle.cxx,v 1.3 2016/06/21 20:28:51 jwebb Exp $
2 // Author: Victor Perev 17/03/2009
3 
4 //______________________________________________________________________________
5 #include "stdlib.h"
6 #include "math.h"
7 #include "string.h"
8 
9 #include "StGimParticle.h"
10 
11 //______________________________________________________________________________
12 StGimParticle::StGimParticle(int idx) :
13  StGenParticle(idx),
14  fBeg{0},
15  fPdgCode{0},
16  fGeaCode{0},
17  fStatusCode{0},
18  fMother{0,0},
19  fWeight{0},
20  fP{0,0,0,0,0},
21  fV{0,0,0,0},
22  fDaughter(0)
23 {
24  Clear();
25 }
26 //______________________________________________________________________________
27 StGimParticle::~StGimParticle()
28 {}
29 //______________________________________________________________________________
30 const StGenParticle *StGimParticle::GetDaughter(int i) const
31 {
32  if (i>=(int)fDaughter.size()) return 0;
33  return fDaughter[i];
34 }
35 //______________________________________________________________________________
36 void StGimParticle::Momentum(double p4[4]) const
37 {
38  memcpy(p4,fP,4*sizeof(*fP));
39 }
40 //______________________________________________________________________________
41 void StGimParticle::Vertex(double v3[3]) const
42 {
43  memcpy(v3,fV,3*sizeof(*fV));
44 }
45 //______________________________________________________________________________
46 void StGimParticle::Clear()
47 {
48  memset(fBeg,0,fEnd-fBeg+1);
49  fWeight = 1; fStatusCode=1;
50  fDaughter.clear();
51 }
52 //______________________________________________________________________________
53 void StGimParticle::SetVert(float v[4])
54 {
55  for (int i=0;i<4;i++) { fV[i]=v[i];}
56 }
57 //______________________________________________________________________________
58 void StGimParticle::SetMom(float p[5])
59 {
60  for (int i=0;i<5;i++) { fP[i]=p[i];}
61 }
62 //______________________________________________________________________________
63 void StGimParticle::AddDaughter(const StGimParticle *m)
64 {
65  fDaughter.push_back(m);
66 }
67 
68 
Abstract base class for particles related to common /HEPEVT/.
Implementation of StGenParticle similar to ROOT TParticle.
Definition: StGimParticle.h:16