2 // *** Class AliRsnEvent ***
4 // A container for a collection of AliRsnDaughter objects from an event.
5 // Contains also the primary vertex, useful for some cuts.
6 // In order to retrieve easily the tracks which have been identified
7 // as a specific type and charge, there is an array of indexes which
8 // allows to avoid to loop on all tracks and have only the neede ones.
10 // authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
11 // M. Vala (email: martin.vala@cern.ch)
17 #include "AliVEvent.h"
18 #include "AliMCEvent.h"
19 #include "AliESDEvent.h"
20 #include "AliAODEvent.h"
21 #include "AliRsnDaughter.h"
24 class AliESDtrackCuts;
26 class AliRsnEvent : public TObject {
29 AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0);
30 AliRsnEvent(const AliRsnEvent& copy);
31 AliRsnEvent& operator= (const AliRsnEvent& copy);
32 virtual ~AliRsnEvent();
34 // basic setters/getters
35 void SetRef(AliVEvent *ref) {fRef = ref;}
36 void SetRefMC(AliVEvent *refmc) {fRefMC = refmc;}
37 void SetLeadingIndex(Int_t i) {fLeading = i;}
38 void SetLocalID(Int_t i) {fLocalID = i;}
39 AliVEvent* GetRef() {return fRef;}
40 AliVEvent* GetRefMC() {return fRefMC;}
41 Int_t GetLeadingIndex() const {return fLeading;}
42 Int_t GetLeadingParticleID() const {return fLeading;}
43 Int_t GetLocalID() const {return fLocalID;}
45 // getters which convert into allowed input types
46 AliESDEvent* GetRefESD() {return dynamic_cast<AliESDEvent*>(fRef);}
47 AliAODEvent* GetRefAOD() {return dynamic_cast<AliAODEvent*>(fRef);}
48 AliMCEvent* GetRefMCESD() {return dynamic_cast<AliMCEvent*>(fRefMC);}
49 AliAODEvent* GetRefMCAOD() {return dynamic_cast<AliAODEvent*>(fRefMC);}
50 Bool_t IsESD() {return (GetRefESD() != 0x0);}
51 Bool_t IsAOD() {return (GetRefAOD() != 0x0);}
55 Int_t GetMultiplicity(AliESDtrackCuts *cuts = 0x0);
57 // setters for a daughter
58 Bool_t SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
59 Bool_t SetDaughterMC(AliRsnDaughter &daughter, Int_t index);
60 AliRsnDaughter GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
61 AliRsnDaughter GetDaughterMC(Int_t i);
62 Int_t GetAbsoluteSum();
63 Bool_t ConvertAbsoluteIndex(Int_t index, Int_t &realIndex, AliRsnDaughter::ERefType &type);
65 // leading particle stuff
66 void SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
67 Int_t SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
68 Double_t GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
69 Bool_t GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
72 static AliRsnEvent *GetCurrentEvent1() {return fgRsnEvent1;}
73 static AliRsnEvent *GetCurrentEvent2() {return fgRsnEvent2;}
74 static void SetCurrentEvent1(AliRsnEvent *event, Int_t id = 0) {fgRsnEvent1 = event; fgRsnEvent1->SetLocalID(id);}
75 static void SetCurrentEvent2(AliRsnEvent *event, Int_t id = 0) {fgRsnEvent2 = event; fgRsnEvent2->SetLocalID(id);}
76 static Bool_t IsCurrentEvent1() {if (fgRsnEvent1 != 0x0) return kTRUE; return kFALSE;}
77 static Bool_t IsCurrentEvent2() {if (fgRsnEvent2 != 0x0) return kTRUE; return kFALSE;}
78 static Bool_t SameEvent() {if (fgRsnEvent1 == fgRsnEvent2) return kTRUE; return kFALSE;}
82 Bool_t SetDaughterESDtrack(AliRsnDaughter &target, Int_t index);
83 Bool_t SetDaughterAODtrack(AliRsnDaughter &target, Int_t index);
84 Bool_t SetDaughterESDv0(AliRsnDaughter &target, Int_t index);
85 Bool_t SetDaughterAODv0(AliRsnDaughter &target, Int_t index);
86 Bool_t SetDaughterESDcascade(AliRsnDaughter &target, Int_t index);
87 Bool_t SetDaughterAODcascade(AliRsnDaughter &target, Int_t index);
88 Bool_t SetMCInfoESD(AliRsnDaughter &target);
89 Bool_t SetMCInfoAOD(AliRsnDaughter &target);
91 AliVEvent *fRef; // pointer to input event
92 AliVEvent *fRefMC; // pointer to reference MC event (if any)
93 Int_t fLeading; // index of leading track
94 Int_t fLocalID; // identification number used locally
96 static AliRsnEvent *fgRsnEvent1; //! pointer to current event #1 (default current event)
97 static AliRsnEvent *fgRsnEvent2; //! pointer to current event #2 (different from the other when doing mixing)
99 ClassDef(AliRsnEvent, 4);