]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnEvent.h
AliRsnCut:
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnEvent.h
index 651681e41c675baf22a4ed9c65ab29b08ae25bae..bdd1fd12f7173958d07b84ba602645239d1520d5 100644 (file)
@@ -1,10 +1,3 @@
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice                               *
- **************************************************************************/
-
-/* $Id$ */
-
 //
 // *** Class AliRsnEvent ***
 //
 #ifndef ALIRSNEVENT_H
 #define ALIRSNEVENT_H
 
-#include <TNamed.h>
-#include <TArrayI.h>
-#include <TClonesArray.h>
-
-#include "AliRsnPID.h"
-#include "AliRsnPIDIndex.h"
+#include "AliVEvent.h"
+#include "AliMCEvent.h"
+#include "AliESDEvent.h"
+#include "AliAODEvent.h"
 #include "AliRsnDaughter.h"
 
-class AliRsnEvent : public TNamed
-{
-  public:
-
-    AliRsnEvent();
-    AliRsnEvent(const AliRsnEvent& copy);
-    AliRsnEvent& operator= (const AliRsnEvent& copy);
-    virtual ~AliRsnEvent();
-
-    // Array management
-    void            Init();
-    void            Clear(Option_t *option = "");
-    AliRsnDaughter* AddTrack(AliRsnDaughter track);
-    AliRsnDaughter* GetTrack(Int_t index);
-    AliRsnDaughter* GetLeadingParticle(Double_t ptMin = 0.0, AliRsnPID::EType type = AliRsnPID::kUnknown, Bool_t realistic = kTRUE);
-    Int_t           GetLastFastTrack(Double_t ptMin, AliRsnPID::EType type = AliRsnPID::kUnknown, Bool_t realistic = kTRUE);
-    TClonesArray*   GetTracks() {return fTracks;}
-    TArrayI*        GetCharged(Char_t sign);
-    TArrayI*        GetTracksArray(AliRsnDaughter::EPIDMethod method, Char_t sign, AliRsnPID::EType type);
-    void            FillPIDArrays();
-    void            SortTracks() {fTracks->Sort();}
-    void            Print(Option_t *option = "") const;
-
-    // Primary vertex
-    Double_t GetPrimaryVertexX() const {return fPVx;}
-    Double_t GetPrimaryVertexY() const {return fPVy;}
-    Double_t GetPrimaryVertexZ() const {return fPVz;}
-    void     GetPrimaryVertex(Double_t &x, Double_t &y, Double_t &z) const {x=fPVx;y=fPVy;z=fPVz;}
-    void     SetPrimaryVertexX(Double_t value) {fPVx = value;}
-    void     SetPrimaryVertexY(Double_t value) {fPVy = value;}
-    void     SetPrimaryVertexZ(Double_t value) {fPVz = value;}
-    void     SetPrimaryVertex(Double_t x, Double_t y, Double_t z) {fPVx=x;fPVy=y;fPVz=z;}
-    void     CorrectByPrimaryVertex();
-
-    // Multiplicity
-    Int_t GetMultiplicity() const;
-    Int_t GetNCharged(Char_t sign);
-
-  private:
-
-    Int_t ChargeIndex(Char_t sign) const;
-    Int_t Fill(TObjArray *array);
-
-    Double_t        fPVx;                 // position of
-    Double_t        fPVy;                 // primary
-    Double_t        fPVz;                 // vertex
-
-    TClonesArray   *fTracks;              // collection of particles
-
-    AliRsnPIDIndex *fNoPID;               // array index only for charged tracks
-    AliRsnPIDIndex *fPerfectPID;          // array index for perfect PID
-    AliRsnPIDIndex *fRealisticPID;        // array index for realistic PID (largest prob)
-
-    ClassDef(AliRsnEvent, 2);
+class AliRsnCutPID;
+class AliESDtrackCuts;
+
+class AliRsnEvent : public TObject {
+public:
+
+   AliRsnEvent(AliVEvent *ref = 0, AliVEvent *refMC = 0);
+   AliRsnEvent(const AliRsnEvent& copy);
+   AliRsnEvent& operator= (const AliRsnEvent& copy);
+   virtual ~AliRsnEvent();
+
+   // basic setters/getters
+   void       SetRef(AliVEvent *ref)       {fRef = ref;}
+   void       SetRefMC(AliVEvent *refmc)   {fRefMC = refmc;}
+   void       SetLeadingIndex(Int_t i)     {fLeading = i;}
+   void       SetLocalID(Int_t i)          {fLocalID = i;}
+   AliVEvent* GetRef()                     {return fRef;}
+   AliVEvent* GetRefMC()                   {return fRefMC;}
+   Int_t      GetLeadingIndex() const      {return fLeading;}
+   Int_t      GetLeadingParticleID() const {return fLeading;}
+   Int_t      GetLocalID() const           {return fLocalID;}
+
+   // getters which convert into allowed input types
+   AliESDEvent* GetRefESD()   {if (fRef  ->IsA() == AliESDEvent::Class()) return static_cast<AliESDEvent*>(fRef)  ; else return 0x0;}
+   AliAODEvent* GetRefAOD()   {if (fRef  ->IsA() == AliAODEvent::Class()) return static_cast<AliAODEvent*>(fRef)  ; else return 0x0;}
+   AliMCEvent*  GetRefMCESD() {if (fRefMC->IsA() == AliMCEvent ::Class()) return static_cast<AliMCEvent*> (fRefMC); else return 0x0;}
+   AliAODEvent* GetRefMCAOD() {if (fRefMC->IsA() == AliAODEvent::Class()) return static_cast<AliAODEvent*>(fRefMC); else return 0x0;}
+   Bool_t       IsESD()       {return (GetRefESD() != 0x0);}
+   Bool_t       IsAOD()       {return (GetRefAOD() != 0x0);}
+
+   // advanced getters
+   Double_t         GetVz();
+   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);
+   Int_t            GetAbsoluteSum();
+   Bool_t           ConvertAbsoluteIndex(Int_t index, Int_t &realIndex, AliRsnDaughter::ERefType &type);
+
+   // leading particle stuff
+   void             SetLeadingParticle(AliRsnDaughter &leading) {if (fLeading >= 0) SetDaughter(leading, fLeading);}
+   Int_t            SelectLeadingParticle(Double_t ptMin = 0.0, AliRsnCutPID *cutPID = 0x0);
+   Double_t         GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
+   Bool_t           GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
+
+   // statig getters
+   static AliRsnEvent    *GetCurrentEvent1()                                 {return fgRsnEvent1;}
+   static AliRsnEvent    *GetCurrentEvent2()                                 {return fgRsnEvent2;}
+   static void            SetCurrentEvent1(AliRsnEvent *event, Int_t id = 0) {fgRsnEvent1 = event; fgRsnEvent1->SetLocalID(id);}
+   static void            SetCurrentEvent2(AliRsnEvent *event, Int_t id = 0) {fgRsnEvent2 = event; fgRsnEvent2->SetLocalID(id);}
+   static Bool_t          IsCurrentEvent1()                                  {if (fgRsnEvent1 != 0x0) return kTRUE; return kFALSE;}
+   static Bool_t          IsCurrentEvent2()                                  {if (fgRsnEvent2 != 0x0) return kTRUE; return kFALSE;}
+   static Bool_t          SameEvent()                                        {if (fgRsnEvent1 == fgRsnEvent2) return kTRUE; return kFALSE;}
+   
+private:
+
+   Bool_t SetDaughterESDtrack(AliRsnDaughter &target, Int_t index);
+   Bool_t SetDaughterAODtrack(AliRsnDaughter &target, Int_t index);
+   Bool_t SetDaughterESDv0(AliRsnDaughter &target, Int_t index);
+   Bool_t SetDaughterAODv0(AliRsnDaughter &target, Int_t index);
+   Bool_t SetDaughterESDcascade(AliRsnDaughter &target, Int_t index);
+   Bool_t SetDaughterAODcascade(AliRsnDaughter &target, Int_t index);
+   Bool_t SetMCInfoESD(AliRsnDaughter &target);
+   Bool_t SetMCInfoAOD(AliRsnDaughter &target);
+
+   AliVEvent   *fRef;         //  pointer to input event
+   AliVEvent   *fRefMC;       //  pointer to reference MC event (if any)
+   Int_t        fLeading;     //  index of leading track
+   Int_t        fLocalID;     //  identification number used locally
+
+   static AliRsnEvent    *fgRsnEvent1;     //! pointer to current event #1 (default current event)
+   static AliRsnEvent    *fgRsnEvent2;     //! pointer to current event #2 (different from the other when doing mixing)
+
+   ClassDef(AliRsnEvent, 4);
 };
 
 #endif