]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWG2/RESONANCES/AliRsnPair.h
fixed sig.segv
[u/mrichter/AliRoot.git] / PWG2 / RESONANCES / AliRsnPair.h
index 874f61245b54f4ca81aa739cc2efcf74fbf8f339..c6689e709fe1e349162ed7139d2765a298633984 100644 (file)
-#ifndef ALIRSNMVPAIR_H
-#define ALIRSNMVPAIR_H
+//
+// *** Class AliRsnPair ***
+//
+// TODO
+//
+// authors: A. Pulvirenti (email: alberto.pulvirenti@ct.infn.it)
+//          M. Vala (email: martin.vala@cern.ch)
+//
 
-#include <TObject.h>
-#include <TH1.h>
-#include <TClonesArray.h>
-#include <TTree.h>
+#ifndef ALIRSNPAIR_H
+#define ALIRSNPAIR_H
+
+#include "TNamed.h"
+#include "TClonesArray.h"
 
 #include "AliRsnDaughter.h"
-#include "AliRsnPairParticle.h"
-#include "AliRsnCutSet.h"
-#include "AliRsnCutMgr.h"
 #include "AliRsnPairDef.h"
-#include "AliRsnPID.h"
+#include "AliRsnMother.h"
+#include "AliRsnCutManager.h"
 
-#include "AliRsnEventBuffer.h"
+class TH1;
+class TH2;
+class TList;
+class TArrayI;
 
 class AliRsnEvent;
-class AliRsnCut;
-
+class AliRsnCutSet;
+class AliRsnFunction;
+class AliRsnValue;
 
-/**
-  @author Martin Vala <Martin.Vala@cern.ch>
-*/
-class AliRsnPair : public TObject
+class AliRsnPair : public TNamed
 {
   public:
-    enum EPairType
-    {
-      kESDNoPID = 0,kESDNoPIDMix,
-      kESDNormal, kESDMix,
-      kMCNoPID,
-      kMCNormal, kMCMix,
-      kMCSignalOnly, kMCBackgroundOnly,
-      kLastIndex
-    };
 
-    AliRsnPair();
-    AliRsnPair ( AliRsnPair::EPairType type , AliRsnPairDef *pairDef,Int_t numOfMix = 0 );
+    AliRsnPair(const char *name = "default", AliRsnPairDef *def = 0);
+    AliRsnPair(const AliRsnPair &copy);
+    AliRsnPair& operator=(const AliRsnPair&);
     ~AliRsnPair();
 
-    TString         GetESDParticleName ( AliRsnPID::EType type );
-    TString         GetPairTypeName ( EPairType type );
-
-    TH1F            *GenerateEffMassHist ( Int_t index = 0 );
-
-    void            ProcessPair ( AliRsnEvent *event,TH1F *hist,Int_t index=0 );
-
-    void            DoCleanUpAfterOneEvent();
-
-    void            AddCutMgr ( AliRsnCutMgr* theValue );
-    AliRsnCutMgr* GetCutMgr ( Int_t index ) { return ( AliRsnCutMgr* ) fCutMgrs.At ( index );}
-    TObjArray*      GetCutMgr () { return &fCutMgrs;}
-    Int_t           GetNumOfCutMgr () { return fCutMgrs.GetEntriesFast();}
-
-    void SetMass ( Double_t theValue ) { fMass[0] = theValue; fMass[1] = theValue;}
-    void SetMass ( Double_t theValue , Int_t index ) { fMass[index] = theValue; }
-    Double_t GetMass ( Int_t index=0 ) const { return fMass[index]; }
-
-    TString GetEffMassHistName ( Int_t index = 0 );
-    TString GetEffMassHistTitle ( Int_t index = 0 );
-
-    void SetNumOfMixEvent ( const Int_t& theValue ) { fNumOfMixEvent = theValue; }
-    Int_t GetNumOfMixEvent() const { return fNumOfMixEvent;}
-
-    void SetIsFilledOnlyInHistRange ( const Bool_t& theValue ) { fIsFilledOnlyInHistRange = theValue; }
-
-    void                    PrepareMixForPair ( AliRsnEvent * event,TTree *tree );
-
-    void SetRsnMVEventBuffer ( AliRsnEventBuffer* theValue ) { fRsnMVEventBuffer = theValue; }
-    AliRsnEventBuffer* GetRsnMVEventBuffer() const { return fRsnMVEventBuffer; }
-
-
+    void    SetOnlyTrue(Bool_t onlyTrue = kTRUE) {fOnlyTrue = onlyTrue;}
+    void    SetCheckDecay(Bool_t check = kTRUE)  {fCheckDecay = check;}
+
+    void    Print(Option_t *option = "") const;
+    void    SetMixed(Bool_t doit = kTRUE) {fIsMixed = doit;}
+    Bool_t  IsMixed() const {return fIsMixed;}
+    
+    AliRsnCutManager* GetCutManager() {return &fCutManager;}
+    AliRsnMother*     GetMother() {return &fMother;}
+    AliRsnPairDef*    GetPairDef() {return fPairDef;}
+    Bool_t            Fill(AliRsnDaughter *d0, AliRsnDaughter *d1, AliRsnEvent *ev1, AliRsnEvent *ev2);
+    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?
+
+    AliRsnPairDef    *fPairDef;         //  pair definition (particles, charges)
+    AliRsnCutManager  fCutManager;      //  collection of all cuts
+    AliRsnMother      fMother;          //  mother candidate (to avoid creating it continuously)
+    AliRsnEvent      *fEvent;           //! pointer to current event
+    
   private:
 
-    AliRsnPairDef          fPairDef;                // pair definition
-    AliRsnPair::EPairType  fPairType;               // pair type
-  
-    AliRsnCutMgr          *fCurrentCutMgr;          // cut manager
-    TObjArray               fCutMgrs;               // array of cuts
-
-    Double_t                fMass[2];               // mass for nopid
-
-    AliRsnPairParticle      fEffMassParticle;
-
-    Int_t                   fNumOfMixEvent;         // number of events to be mix with current one
-    AliRsnEventBuffer      *fRsnMVEventBuffer;      // event buffer for event mixing
-
-    Bool_t                  fIsSignSame;            // flag for same sign
-
-    Bool_t                  fIsFilledOnlyInHistRange; // flag filling histogram
-
-    void                    DoLoopPairESD ( AliRsnEvent *event1, TArrayI *array1,AliRsnEvent *event2, TArrayI *array2 ,TH1F *hist,Int_t index=0 );
-    void                    DoLoopPairMC ( AliRsnEvent *event1, TArrayI*array1,AliRsnEvent *event2, TArrayI*array2 ,TH1F *hist,Int_t index=0 );
-
-    void                    DoESDNoPID ( AliRsnEvent *event,TH1F *hist ,Int_t index=0 );
-    void                    DoESDNoPIDMix ( AliRsnEvent *event,TH1F *hist,Int_t index=0 );
-    void                    DoESDNormal ( AliRsnEvent *event,TH1F *hist,Int_t index=0 );
-    void                    DoESDMix ( AliRsnEvent *event,TH1F *hist,Int_t index=0 );
-
-    void                    DoMCNoPID ( AliRsnEvent *event,TH1F *hist,Int_t index=0 );
-    void                    DoMCNormal ( AliRsnEvent *event,TH1F *hist,Int_t index=0 );
-
-    ClassDef ( AliRsnPair, 1 );
+    ClassDef(AliRsnPair, 2)
 };
 
 #endif
+