]> 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 d1ac9bbf681483c4795721e5e5d5ee470b824fef..926d7465fffa8d43e4818a027f0ffba40c714498 100644 (file)
 #ifndef ALIRSNPAIR_H
 #define ALIRSNPAIR_H
 
-#include "TH1.h"
-#include "TH2.h"
-#include "TList.h"
+#include "TNamed.h"
 
-#include "AliRsnDaughter.h"
 #include "AliRsnPairDef.h"
-#include "AliRsnEventBuffer.h"
-#include "AliRsnEvent.h"
-#include "AliRsnCutMgr.h"
-#include "AliRsnHistoDef.h"
+#include "AliRsnCutManager.h"
+#include "AliRsnMother.h"
 
-class AliRsnFunction;
+class TList;
 
-class AliRsnPair : public TObject
-{
-  public:
+class AliRsnPair : public TNamed {
+public:
 
-    enum EPairType
-    {
-      kNoPID = 0,    kNoPIDMix,
-      kRealisticPID, kRealisticPIDMix,
-      kPerfectPID,   kPerfectPIDMix,
-      kTruePairs,
-      kPairTypes
-    };
+   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;}
 
-    AliRsnPair(EPairType type = kRealisticPID, AliRsnPairDef *def = 0, 
-               Int_t mixNum = 1, Double_t mixVzCut = 1.0, Int_t mixMultCut = 10);
-    ~AliRsnPair();
+   // 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);
 
-    void    Init();
-    void    Print();
-    void    ProcessPair(AliRsnEventBuffer *buf);
-    void    SetCutMgr(AliRsnCutMgr* theValue) { fCutMgr = theValue; }
-    void    SetMixingCut(AliRsnCutSet* theValue) { fMixingCut = theValue; }
-    void    AddFunction(AliRsnFunction *fcn);
-    TList*  GenerateHistograms(TString prefix = "");
-    void    GenerateHistograms(TString prefix, TList *tgt);
+protected:
 
-    TString GetPairTypeName(EPairType type);
-    TString GetPairName();
-    TString GetPairHistName(AliRsnFunction *fcn, TString text = "");
-    TString GetPairHistTitle(AliRsnFunction *fcn, TString text="");
+   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
 
-  private:
+   AliRsnPairDef    *fPairDef;         //  pair definition (particles, charges)
+   AliRsnCutManager  fCutManager;      //  collection of all cuts
+   AliRsnMother      fMother;          //  mother candidate (to avoid creating it continuously)
 
-    AliRsnPair (const AliRsnPair &copy) : TObject(copy),
-      fIsMixed(kFALSE),fUseMC(kFALSE),fIsLikeSign(kFALSE),fMixNum(1),fMixingCut(0x0),
-      fPairDef(0x0),fPairType(kPairTypes),fTypePID(AliRsnDaughter::kRealistic),
-      fCutMgr(0x0),fFunctions("AliRsnFunction",0) {}
-    AliRsnPair& operator=(const AliRsnPair&) {return *this;}
+private:
 
-    void           SetUp(EPairType type);  // sets up all flags
-    void           SetAllFlags(AliRsnDaughter::EPIDMethod pidType,Bool_t isMix, Bool_t useMC);
-    AliRsnEvent*   FindEventByEventCut(AliRsnEventBuffer *buf,Int_t & num);
-    void           LoopPair(AliRsnEvent *ev1,TArrayI *a1,AliRsnEvent *ev2,TArrayI *a2);
-
-    Bool_t         CutPass(AliRsnDaughter *d);
-    Bool_t         CutPass(AliRsnPairParticle *p);
-    Bool_t         CutPass(AliRsnEvent *e);
-    
-    // flags & integer data
-    Bool_t         fIsMixed;                 // doing event-mixing ?
-    Bool_t         fUseMC;                   // using MC inv. mass ?
-    Bool_t         fIsLikeSign;              // is a like-sign pair ?
-    Int_t          fMixNum;                  // number of mixed events
-    AliRsnCutSet  *fMixingCut;               // cut for event mixing
-    
-    // work management
-    AliRsnPairDef              *fPairDef;                // pair definition (particles, charges)
-    EPairType                   fPairType;               // pair type (PID + mixing or not)
-    AliRsnDaughter::EPIDMethod  fTypePID;                // pid type variable for single track
-    AliRsnCutMgr               *fCutMgr;                 // cut manager
-    TClonesArray                fFunctions;              // functions
-
-    ClassDef (AliRsnPair, 1)
+   ClassDef(AliRsnPair, 2)
 };
 
 #endif
+