]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG2/RESONANCES/AliRsnEvent.h
Major upgrade to the package, in order to speed-up the execution and remove some...
[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 "AliESDEvent.h"
18 #include "AliAODEvent.h"
19 #include "AliRsnDaughter.h"
20
21 class AliVEvent;
22 class AliMCEvent;
23 class AliRsnCutPID;
24
25 class AliRsnEvent : public TObject
26 {
27   public:
28
29     AliRsnEvent(AliVEvent *ref = 0, AliMCEvent *refMC = 0);
30     AliRsnEvent(const AliRsnEvent& copy);
31     AliRsnEvent& operator= (const AliRsnEvent& copy);
32     virtual ~AliRsnEvent();
33
34     void             SetRef(AliVEvent * const event, AliMCEvent * const mc = 0) {fRef = event; fRefMC = mc;}
35     AliVEvent*       GetRef() const {return fRef;}
36     AliMCEvent*      GetRefMC() const {return fRefMC;}
37     AliESDEvent*     GetRefESD() const {return dynamic_cast<AliESDEvent*>(fRef);}
38     AliAODEvent*     GetRefAOD() const {return dynamic_cast<AliAODEvent*>(fRef);}
39     Bool_t           IsESD() const {return (GetRefESD() != 0x0);}
40     Bool_t           IsAOD() const {return (GetRefAOD() != 0x0);}
41     
42     Double_t         GetVz();
43     Int_t            GetMultiplicity();
44     
45     Bool_t           SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
46     AliRsnDaughter   GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
47     
48     Int_t            SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
49     Int_t            GetLeadingParticleID() {return fLeading;}
50     void             SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
51     Double_t         GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
52     Bool_t           GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
53
54   private:
55
56     AliVEvent       *fRef;         // pointer to input event
57     AliMCEvent      *fRefMC;       // pointer to reference MC event (if any)
58     Int_t            fLeading;     // index of leading track
59
60     ClassDef(AliRsnEvent, 3);
61 };
62
63 #endif