2 // This object is used as lightweight temporary container
3 // of all information needed from any input object and
4 // useful for resonance analysis.
5 // Lists of such objects are stored in a buffer, in order
6 // to allow an event mixing.
9 #include <TDatabasePDG.h>
10 #include <TParticlePDG.h>
12 #include "AliAODEvent.h"
13 #include "AliRsnEvent.h"
14 #include "AliRsnMiniParticle.h"
16 ClassImp(AliRsnMiniParticle)
18 //__________________________________________________________________________________________________
19 void AliRsnMiniParticle::CopyDaughter(AliRsnDaughter *daughter)
22 // Sets data members from the passed object
25 // reset what could not be initialized
26 fDCA = 0.0; //typically used for D0 analysis
31 fPsim[0] = fPrec[0] = fPsim[1] = fPrec[1] = fPsim[2] = fPrec[2] = 0.0;
34 if (daughter->IsPos())
36 else if (daughter->IsNeg())
42 if (daughter->GetRef()) {
43 fPrec[0] = daughter->GetRef()->Px();
44 fPrec[1] = daughter->GetRef()->Py();
45 fPrec[2] = daughter->GetRef()->Pz();
49 if (daughter->GetRefMC()) {
50 fPsim[0] = daughter->GetRefMC()->Px();
51 fPsim[1] = daughter->GetRefMC()->Py();
52 fPsim[2] = daughter->GetRefMC()->Pz();
53 fPDG = daughter->GetPDG();
54 fMother = daughter->GetMother();
55 fMotherPDG = daughter->GetMotherPDG();
58 AliRsnEvent *event = (AliRsnEvent *) daughter->GetOwnerEvent();
59 if (event && event->IsAOD()){
60 AliAODTrack *track = (AliAODTrack*) daughter->Ref2AODtrack();
61 AliAODEvent *aodEvent = (AliAODEvent*) event->GetRefAOD();
62 if (track && aodEvent) {
63 AliVVertex *vertex = (AliVVertex*) aodEvent->GetPrimaryVertex();
64 Double_t b[2], cov[3];
66 track->PropagateToDCA(vertex, aodEvent->GetMagneticField(), kVeryBig, b, cov);
71 AliWarning("DCA not implemented for ESDs");
76 //__________________________________________________________________________________________________
77 Double_t AliRsnMiniParticle::Mass()
80 // return mass of particle
83 TDatabasePDG *db = TDatabasePDG::Instance();
84 TParticlePDG *part = db->GetParticle(PDG());
88 //__________________________________________________________________________________________________
89 void AliRsnMiniParticle::Set4Vector(TLorentzVector &v, Float_t mass, Bool_t mc)
92 // return 4 vector of particle
95 if (mass<0.0) mass = Mass();
96 v.SetXYZM(Px(mc), Py(mc), Pz(mc),mass);