]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnEvent.h
Block of updates on RSN package:
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnEvent.h
1 //
2 // *** Class AliRsnEvent ***
3 //
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.
9 //
10 // authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
11 //          M. Vala (email: martin.vala@cern.ch)
12 //
13
14 #ifndef ALIRSNEVENT_H
15 #define ALIRSNEVENT_H
16
17 #include "AliMCEvent.h"
18 #include "AliESDEvent.h"
19 #include "AliAODEvent.h"
20 #include "AliRsnDaughter.h"
21
22 class AliVEvent;
23 class AliRsnCutPID;
24 class AliESDtrackCuts;
25
26 class AliRsnEvent : public TObject
27 {
28   public:
29
30     AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0);
31     AliRsnEvent(const AliRsnEvent& copy);
32     AliRsnEvent& operator= (const AliRsnEvent& copy);
33     virtual ~AliRsnEvent() { /*nothing*/ }
34     
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;}
42     
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);}
50     
51     // advanced getters
52     Double_t         GetVz();
53     Int_t            GetMultiplicity(AliESDtrackCuts *cuts = 0x0);
54     
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);
60     
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);
67
68   private:
69   
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);
74
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
78
79     ClassDef(AliRsnEvent, 4);
80 };
81
82 #endif