Added event cut set for MC
[u/mrichter/AliRoot.git] / PWGLF / RESONANCES / AliRsnMiniParticle.cxx
CommitLineData
03d23846 1//
2// This object is used as lightweight temporary container
61f275d1 3// of all information needed from any input object and
03d23846 4// useful for resonance analysis.
5// Lists of such objects are stored in a buffer, in order
6// to allow an event mixing.
7//
8
4fb0dfa3 9#include <TDatabasePDG.h>
10#include <TParticlePDG.h>
11
03d23846 12#include "AliRsnDaughter.h"
13#include "AliRsnMiniParticle.h"
14
15ClassImp(AliRsnMiniParticle)
16
17//__________________________________________________________________________________________________
18void AliRsnMiniParticle::CopyDaughter(AliRsnDaughter *daughter)
19{
20//
21// Sets data members from the passed object
22//
23
24 // reset what could not be initialized
25 fPDG = 0;
26 fMother = -1;
27 fMotherPDG = 0;
28 fCutBits = 0x0;
29 fPsim[0] = fPrec[0] = fPsim[1] = fPrec[1] = fPsim[2] = fPrec[2] = 0.0;
30
31 // charge
32 if (daughter->IsPos())
33 fCharge = '+';
34 else if (daughter->IsNeg())
35 fCharge = '-';
36 else
37 fCharge = '0';
61f275d1 38
03d23846 39 // rec info
40 if (daughter->GetRef()) {
41 fPrec[0] = daughter->GetRef()->Px();
42 fPrec[1] = daughter->GetRef()->Py();
43 fPrec[2] = daughter->GetRef()->Pz();
44 }
61f275d1 45
03d23846 46 // MC info
47 if (daughter->GetRefMC()) {
48 fPsim[0] = daughter->GetRefMC()->Px();
49 fPsim[1] = daughter->GetRefMC()->Py();
50 fPsim[2] = daughter->GetRefMC()->Pz();
51 fPDG = daughter->GetPDG();
52 fMother = daughter->GetMother();
53 fMotherPDG = daughter->GetMotherPDG();
54 }
55}
4fb0dfa3 56
57
58//__________________________________________________________________________________________________
59Double_t AliRsnMiniParticle::Mass()
60{
61 //
62 // return mass of particle
63 //
64
65 TDatabasePDG *db = TDatabasePDG::Instance();
66 TParticlePDG *part = db->GetParticle(PDG());
67 return part->Mass();
68}
69
70//__________________________________________________________________________________________________
71void AliRsnMiniParticle::Set4Vector(TLorentzVector &v, Float_t mass, Bool_t mc)
72{
73 //
74 // return 4 vector of particle
75 //
76
77 if (mass<0.0) mass = Mass();
78 v.SetXYZM(Px(mc), Py(mc), Pz(mc),mass);
79}