]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - 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
index 3ee2278a32640faecfd7114ac28fa6a5308e400c..93ba8c80dbfc0e46b0bfc61bd581c505527eb01c 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 "AliESDEvent.h"
+#include "AliAODEvent.h"
 #include "AliRsnDaughter.h"
 
-class AliRsnEvent : public TNamed
+class AliVEvent;
+class AliMCEvent;
+class AliRsnCutPID;
+
+class AliRsnEvent : public TObject
 {
   public:
 
-    AliRsnEvent();
+    AliRsnEvent(AliVEvent *ref = 0, AliMCEvent *refMC = 0);
     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(Int_t arraySizeDefault = 1000);
-    void            SortTracks() {fTracks->Sort();}
-    void            Print(Option_t *option = "") const;
-    void            MakeComputations();
-
-    // 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;}
-    Double_t GetVz() const {return GetPrimaryVertexZ();}
-    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 {return fMult;}
-    Int_t GetNCharged(Char_t sign);
+    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);}
     
-    // Mean phi
-    Double_t GetPhiMean() const {return fPhiMean;}
+    Double_t         GetVz();
+    Int_t            GetMultiplicity();
+    
+    Bool_t           SetDaughter(AliRsnDaughter &daughter, Int_t index, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
+    AliRsnDaughter   GetDaughter(Int_t i, AliRsnDaughter::ERefType type = AliRsnDaughter::kTrack);
+    
+    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);}
+    Double_t         GetAverageMomentum(Int_t &count, AliRsnCutPID *cutPID = 0x0);
+    Bool_t           GetAngleDistr(Double_t &angleMean, Double_t &angleRMS, AliRsnDaughter reference);
 
   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
-    Double_t        fPhiMean;             // mean "phi" coord of all tracks
-    Int_t           fMult;                // track multiplicity
-
-    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)
+    AliVEvent       *fRef;         // pointer to input event
+    AliMCEvent      *fRefMC;       // pointer to reference MC event (if any)
+    Int_t            fLeading;     // index of leading track
 
-    ClassDef(AliRsnEvent, 2);
+    ClassDef(AliRsnEvent, 3);
 };
 
 #endif