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 "AliMCEvent.h"
18 #include "AliESDEvent.h"
19 #include "AliAODEvent.h"
20 #include "AliRsnDaughter.h"
24 class AliESDtrackCuts;
26 class AliRsnEvent : public TObject
30 AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0);
31 AliRsnEvent(const AliRsnEvent& copy);
32 AliRsnEvent& operator= (const AliRsnEvent& copy);
33 virtual ~AliRsnEvent() { /*nothing*/ }
35 // basic setters/getters
36 void SetRef(AliVEvent *ref) {fRef = ref;}
37 void SetRefMC(AliVEvent *refmc) {fRefMC = refmc;}
38 void SetLeadingIndex(Int_t i) {fLeading = i;}
39 AliVEvent* GetRef() {return fRef;}
40 AliVEvent* GetRefMC() {return fRefMC;}
41 Int_t GetLeadingIndex() const {return fLeading;}
43 // getters which convert into allowed input types
44 AliESDEvent* GetRefESD() {return dynamic_cast<AliESDEvent*>(fRef);}
45 AliAODEvent* GetRefAOD() {return dynamic_cast<AliAODEvent*>(fRef);}
46 AliMCEvent* GetRefMCESD() {return dynamic_cast<AliMCEvent*>(fRefMC);}
47 AliAODEvent* GetRefMCAOD() {return dynamic_cast<AliAODEvent*>(fRefMC);}
48 Bool_t IsESD() {return (GetRefESD() != 0x0);}
49 Bool_t IsAOD() {return (GetRefAOD() != 0x0);}
53 Int_t GetMultiplicity(AliESDtrackCuts *cuts = 0x0);
55 // setters for a daughter
56 Bool_t SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
57 Bool_t SetDaughterMC(AliRsnDaughter &daughter, Int_t index);
58 AliRsnDaughter GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
59 AliRsnDaughter GetDaughterMC(Int_t i);
61 // leading particle stuff
62 Int_t SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
63 Int_t GetLeadingParticleID() {return fLeading;}
64 void SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
65 Double_t GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
66 Bool_t GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
70 Int_t SetDaughterESDtrack(AliRsnDaughter &target, Int_t index);
71 Int_t SetDaughterAODtrack(AliRsnDaughter &target, Int_t index);
72 Int_t SetDaughterESDv0 (AliRsnDaughter &target, Int_t index);
73 Int_t SetDaughterAODv0 (AliRsnDaughter &target, Int_t index);
75 AliVEvent *fRef; // pointer to input event
76 AliVEvent *fRefMC; // pointer to reference MC event (if any)
77 Int_t fLeading; // index of leading track
79 ClassDef(AliRsnEvent, 4);