]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnEvent.h
Block of updates on RSN package:
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnEvent.h
index cf95e5a2132c3e37810272d0754a0d54b715cb17..331ffa160c769c0ff5b420e81a937775fa31ad6e 100644 (file)
 #ifndef ALIRSNEVENT_H
 #define ALIRSNEVENT_H
 
+#include "AliMCEvent.h"
 #include "AliESDEvent.h"
 #include "AliAODEvent.h"
 #include "AliRsnDaughter.h"
 
 class AliVEvent;
-class AliMCEvent;
 class AliRsnCutPID;
+class AliESDtrackCuts;
 
 class AliRsnEvent : public TObject
 {
   public:
 
-    AliRsnEvent(AliVEvent *ref = 0, AliMCEvent *refMC = 0);
+    AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0);
     AliRsnEvent(const AliRsnEvent& copy);
     AliRsnEvent& operator= (const AliRsnEvent& copy);
-    virtual ~AliRsnEvent();
-
-    void             SetRef(AliVEvent * const event, AliMCEvent * const mc = 0) {fRef = event; fRefMC = mc;}
-    AliVEvent*       GetRef() const {return fRef;}
-    AliMCEvent*      GetRefMC() const {return fRefMC;}
-    AliESDEvent*     GetRefESD() const {return dynamic_cast<AliESDEvent*>(fRef);}
-    AliAODEvent*     GetRefAOD() const {return dynamic_cast<AliAODEvent*>(fRef);}
-    Bool_t           IsESD() const {return (GetRefESD() != 0x0);}
-    Bool_t           IsAOD() const {return (GetRefAOD() != 0x0);}
+    virtual ~AliRsnEvent() { /*nothing*/ }
+    
+    // basic setters/getters
+    void       SetRef(AliVEvent *ref) {fRef = ref;}
+    void       SetRefMC(AliVEvent *refmc) {fRefMC = refmc;}
+    void       SetLeadingIndex(Int_t i) {fLeading = i;}
+    AliVEvent* GetRef() {return fRef;}
+    AliVEvent* GetRefMC() {return fRefMC;}
+    Int_t      GetLeadingIndex() const {return fLeading;}
+    
+    // getters which convert into allowed input types
+    AliESDEvent* GetRefESD()   {return dynamic_cast<AliESDEvent*>(fRef);}
+    AliAODEvent* GetRefAOD()   {return dynamic_cast<AliAODEvent*>(fRef);}
+    AliMCEvent*  GetRefMCESD() {return dynamic_cast<AliMCEvent*>(fRefMC);}
+    AliAODEvent* GetRefMCAOD() {return dynamic_cast<AliAODEvent*>(fRefMC);}
+    Bool_t       IsESD()       {return (GetRefESD() != 0x0);}
+    Bool_t       IsAOD()       {return (GetRefAOD() != 0x0);}
     
+    // advanced getters
     Double_t         GetVz();
-    Int_t            GetMultiplicity();
+    Int_t            GetMultiplicity(AliESDtrackCuts *cuts = 0x0);
     
+    // setters for a daughter
     Bool_t           SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
     Bool_t           SetDaughterMC(AliRsnDaughter &daughter, Int_t index);
     AliRsnDaughter   GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
     AliRsnDaughter   GetDaughterMC(Int_t i);
     
+    // leading particle stuff
     Int_t            SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
     Int_t            GetLeadingParticleID() {return fLeading;}
     void             SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
@@ -54,12 +66,17 @@ class AliRsnEvent : public TObject
     Bool_t           GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
 
   private:
+  
+    Int_t SetDaughterESDtrack(AliRsnDaughter &target, Int_t index);
+    Int_t SetDaughterAODtrack(AliRsnDaughter &target, Int_t index);
+    Int_t SetDaughterESDv0   (AliRsnDaughter &target, Int_t index);
+    Int_t SetDaughterAODv0   (AliRsnDaughter &target, Int_t index);
 
-    AliVEvent       *fRef;         // pointer to input event
-    AliMCEvent      *fRefMC;       // pointer to reference MC event (if any)
-    Int_t            fLeading;     // index of leading track
+    AliVEvent       *fRef;      // pointer to input event
+    AliVEvent       *fRefMC;    // pointer to reference MC event (if any)
+    Int_t            fLeading;  // index of leading track
 
-    ClassDef(AliRsnEvent, 3);
+    ClassDef(AliRsnEvent, 4);
 };
 
 #endif