]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnPair.h
Attempt to make the HV filtering more robust
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPair.h
index 71f04fbe82f9fde42363f6bef25f61d24eb686c5..926d7465fffa8d43e4818a027f0ffba40c714498 100644 (file)
 #ifndef ALIRSNPAIR_H
 #define ALIRSNPAIR_H
 
-#include "TClonesArray.h"
+#include "TNamed.h"
 
-#include "AliRsnDaughter.h"
 #include "AliRsnPairDef.h"
-#include "AliRsnPairParticle.h"
+#include "AliRsnCutManager.h"
+#include "AliRsnMother.h"
 
-class TH1;
-class TH2;
 class TList;
-class TArrayI;
 
-class AliRsnEvent;
-class AliRsnCutMgr;
-class AliRsnPIDIndex;
-class AliRsnFunction;
-
-class AliRsnPair : public TObject
-{
-  public:
-
-    enum EPairType {
-      kNoPID = 0,    kNoPIDMix,
-      kRealisticPID, kRealisticPIDMix,
-      kPerfectPID,   kPerfectPIDMix,
-      kPairTypes
-    };
-
-    AliRsnPair(EPairType type = kRealisticPID, AliRsnPairDef *def = 0);
-    AliRsnPair(const AliRsnPair &copy);
-    AliRsnPair& operator=(const AliRsnPair&);
-    ~AliRsnPair();
-
-    void    SetOnlyTrue(Bool_t onlyTrue = kTRUE) {fOnlyTrue = onlyTrue;}
-
-    void    Print(Option_t *option = "") const;
-    void    LoopPair(AliRsnPIDIndex*const pidIndex1, AliRsnEvent*const ev1, AliRsnPIDIndex*const pidIndex2 = 0, AliRsnEvent* ev2 = 0);
-    void    LoopPair(TArrayI *a1, TArrayI *a2, AliRsnEvent *ev1, AliRsnEvent *ev2 = 0);
-    void    SetCutMgr(AliRsnCutMgr* const mgr) { fCutMgr = mgr; }
-    void    AddFunction(AliRsnFunction*const fcn);
-    TList*  GenerateHistograms(TString prefix = "", TList *list=0);
-
-    Bool_t  IsMixed() const {return fIsMixed;}
-    Bool_t  IsPairEqual() const {
-      if (fPIDMethod == AliRsnDaughter::kNoPID) return (fPairDef->IsLikeSign());
-      else return (fPairDef->IsLikeSign() && fPairDef->HasEqualTypes());
-    }
-
-    TString GetPairTypeName(EPairType type) const;
-    TString GetPairName() const;
-    TString GetPairHistName(AliRsnFunction *const fcn, TString text = "") const;
-    TString GetPairHistTitle(AliRsnFunction *const fcn, TString text = "") const;
-
-  private:
-
-    void     SetUp(EPairType type);
-    void     SetAllFlags(AliRsnDaughter::EPIDMethod pid, Bool_t mix) {fPIDMethod = pid; fIsMixed = mix;}
-
-    Bool_t   CutPass(AliRsnDaughter *d);
-    Bool_t   CutPass(AliRsnPairParticle *p);
-    Bool_t   CutPass(AliRsnEvent *e);
-
-    Bool_t                      fOnlyTrue;       // select true pairs only?
-    Bool_t                      fIsMixed;        // doing event-mixing ?
-    EPairType                   fPairType;       // pair type (PID + mixing or not)
-    AliRsnDaughter::EPIDMethod  fPIDMethod;      // pid type variable for single track
-
-    AliRsnPairDef              *fPairDef;        // pair definition (particles, charges)
-    AliRsnCutMgr               *fCutMgr;         // cut manager
-    TClonesArray                fFunctions;      // functions
-    AliRsnDaughter              fTrack1;         // track #1 (external loop)
-    AliRsnDaughter              fTrack2;         // track #2 (internal loop)
-    AliRsnPairParticle          fPairParticle;   // track pair
-
-    ClassDef(AliRsnPair, 2)
+class AliRsnPair : public TNamed {
+public:
+
+   AliRsnPair(const char *name = "default", AliRsnPairDef *def = 0);
+   AliRsnPair(const AliRsnPair &copy);
+   AliRsnPair& operator=(const AliRsnPair&);
+   ~AliRsnPair();
+   
+   // getters
+   Bool_t            IsOnlyTrue()   const {return fOnlyTrue;}
+   Bool_t            IsCheckDecay() const {return fCheckDecay;}
+   Bool_t            IsMixed()      const {return fIsMixed;}
+   Int_t             GetCount()     const {return fCount;}
+   AliRsnPairDef*    GetPairDef()         {return fPairDef;}
+   AliRsnCutManager* GetCutManager()      {return &fCutManager;}
+   AliRsnMother*     GetMother()          {return &fMother;}
+   
+   // shortcuts to data-member getters
+   AliRsnCutSet*     GetCommonDaughterCuts() {return fCutManager.GetCommonDaughterCuts();}
+   AliRsnCutSet*     GetDaughter1Cuts()      {return fCutManager.GetDaughter1Cuts();}
+   AliRsnCutSet*     GetDaughter2Cuts()      {return fCutManager.GetDaughter2Cuts();}
+   AliRsnCutSet*     GetMotherCuts()         {return fCutManager.GetMotherCuts();}
+                     
+   // setters (not for all members)
+   void              SetOnlyTrue(Bool_t onlyTrue = kTRUE) {fOnlyTrue = onlyTrue;}
+   void              SetCheckDecay(Bool_t check = kTRUE)  {fCheckDecay = check;}
+   void              SetMixed(Bool_t doit = kTRUE)        {fIsMixed = doit;}
+   void              SetCount(Int_t count)                {fCount = count;}
+   void              ResetCount()                         {fCount = 0;}
+
+   // methods
+   Bool_t            Fill(AliRsnDaughter *d0, AliRsnDaughter *d1, Bool_t refFirst = kTRUE);
+   virtual void      Print(Option_t *option = "") const;
+   virtual void      Compute();
+   virtual void      Init(const char *prefix, TList *list);
+
+protected:
+
+   Bool_t            fOnlyTrue;        //  select true pairs only?
+   Bool_t            fCheckDecay;      //  is the decay channel correct in a true pair?
+   Bool_t            fIsMixed;         //  is this an event-mixing?
+   Int_t             fCount;           //  counter incremented for each added pair
+
+   AliRsnPairDef    *fPairDef;         //  pair definition (particles, charges)
+   AliRsnCutManager  fCutManager;      //  collection of all cuts
+   AliRsnMother      fMother;          //  mother candidate (to avoid creating it continuously)
+
+private:
+
+   ClassDef(AliRsnPair, 2)
 };
 
 #endif
+