]>
Commit | Line | Data |
---|---|---|
e0baff8c | 1 | // |
2 | // Class AliRsnMCInfo | |
3 | // | |
4 | // Contains informations from the MonteCarlo particle is associated to a track. | |
5 | // It is used when looking at "perfect" PID and at "true" pairs, but the user | |
6 | // does not need to access its methods. | |
7 | // | |
8 | ||
06351446 | 9 | #include "AliLog.h" |
10 | ||
11 | #include "AliRsnMCInfo.h" | |
12 | ||
aec0ec32 | 13 | ClassImp(AliRsnMCInfo) |
06351446 | 14 | |
15 | //_____________________________________________________________________________ | |
e0baff8c | 16 | AliRsnMCInfo::AliRsnMCInfo() : |
15d5fd02 | 17 | TObject(), fEnergy(0), fPDG(0), fMother(-1), fMotherPDG(0) |
06351446 | 18 | { |
19 | // | |
20 | // Default constructor. | |
e0baff8c | 21 | // Initializes all data-members to meaningless values. |
06351446 | 22 | // |
e0baff8c | 23 | |
24 | Int_t i; | |
15d5fd02 | 25 | for (i = 0; i < 3; i++) fP[i] = fV[i] = 0.0; |
06351446 | 26 | } |
27 | ||
28 | //_____________________________________________________________________________ | |
e0baff8c | 29 | AliRsnMCInfo::AliRsnMCInfo(const AliRsnMCInfo & copy) : |
15d5fd02 | 30 | TObject(copy), |
31 | fEnergy(copy.fEnergy), | |
32 | fPDG(copy.fPDG), | |
33 | fMother(copy.fMother), | |
34 | fMotherPDG(copy.fMotherPDG) | |
06351446 | 35 | { |
36 | // | |
37 | // Copy constructor. | |
06351446 | 38 | // |
aec0ec32 | 39 | |
e0baff8c | 40 | Int_t i; |
15d5fd02 | 41 | for (i = 0; i < 3; i++) { |
42 | fP[i] = copy.fP[i]; | |
43 | fV[i] = copy.fV[i]; | |
44 | } | |
06351446 | 45 | } |
46 | ||
47 | //_____________________________________________________________________________ | |
48 | AliRsnMCInfo::~AliRsnMCInfo() | |
49 | { | |
e0baff8c | 50 | // |
51 | // Destructor. | |
52 | // Does nothing because there are no pointers to clean. | |
53 | // | |
06351446 | 54 | } |
55 | ||
56 | //_____________________________________________________________________________ | |
aec0ec32 | 57 | void AliRsnMCInfo::Adopt(TParticle * particle) |
06351446 | 58 | { |
59 | // | |
e0baff8c | 60 | // Uses a TParticle to initialize its data members. |
61 | // If the argument is NULL, nothing is done and an error message is returned. | |
06351446 | 62 | // |
63 | ||
15d5fd02 | 64 | if (!particle) return; |
aec0ec32 | 65 | |
66 | fP[0] = particle->Px(); | |
67 | fP[1] = particle->Py(); | |
68 | fP[2] = particle->Pz(); | |
69 | ||
15d5fd02 | 70 | fV[0] = particle->Vx(); |
71 | fV[1] = particle->Vy(); | |
72 | fV[2] = particle->Vz(); | |
73 | ||
aec0ec32 | 74 | fEnergy = particle->Energy(); |
75 | ||
76 | fPDG = particle->GetPdgCode(); | |
77 | fMother = particle->GetFirstMother(); | |
78 | fMotherPDG = (Short_t) 0; | |
06351446 | 79 | } |