X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=PWG2%2FRESONANCES%2FAliRsnPair.h;h=926d7465fffa8d43e4818a027f0ffba40c714498;hb=b37b954695b5c13427ef10ffb58e6d3e2127a39e;hp=8323a2cccd8a2c9621f86718644e02a72965b646;hpb=aec0ec32a633e38b7d531ea77860e12c35039ec7;p=u%2Fmrichter%2FAliRoot.git diff --git a/PWG2/RESONANCES/AliRsnPair.h b/PWG2/RESONANCES/AliRsnPair.h index 8323a2cccd8..926d7465fff 100644 --- a/PWG2/RESONANCES/AliRsnPair.h +++ b/PWG2/RESONANCES/AliRsnPair.h @@ -10,94 +10,65 @@ #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" - -class AliRsnFunction; - -class AliRsnPair : public TObject -{ - public: - - enum EPairType - { - kNoPID = 0, kNoPIDMix, - kRealisticPID, kRealisticPIDMix, - kPerfectPID, kPerfectPIDMix, - kTruePairs, - kPairTypes - }; - - enum EOutputType - { - kInvMass = 0, - kInvMassResolution, - kOutputTypes - }; - - - AliRsnPair (EPairType type = kRealisticPID, AliRsnPairDef *def = 0, Int_t mixNum = 1); - ~AliRsnPair(); - - void Init(); - void Print(); - void ProcessPair(AliRsnEventBuffer *buf); - void SetCutMgr(AliRsnCutMgr* theValue) { fCutMgr = theValue; } - void AddFunction(AliRsnFunction *fcn); - TList* GenerateHistograms(TString prefix = ""); - void GenerateHistograms(TString prefix, TList *tgt); - - TString GetPairTypeName(EPairType type); - TString GetPairName(); - TString GetPairHistName(AliRsnFunction *fcn, TString text = ""); - TString GetPairHistTitle(AliRsnFunction *fcn, TString text=""); - - private: - - AliRsnPair (const AliRsnPair ©) : TObject(copy), - fIsMixed(kFALSE),fUseMC(kFALSE),fIsLikeSign(kFALSE),fMixNum(1), - fPairDef(0x0),fPairType(kPairTypes),fTypePID(AliRsnDaughter::kRealistic), - fCutMgr(0x0),fFunctions("AliRsnFunction",0) {} - AliRsnPair& operator=(const AliRsnPair&) {return *this;} - - 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); - - void FillHistogram(EOutputType type,AliRsnPairParticle*pairPart); - void FillEffMass(EOutputType type,AliRsnPairParticle*pairPart); - void FillResolution(EOutputType type,AliRsnPairParticle*pairPart); - - TString GetOutputTypeName(EOutputType type); - TString GetOutputTypeTitle(EOutputType type); - - 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 - - // 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) +#include "AliRsnCutManager.h" +#include "AliRsnMother.h" + +class TList; + +class AliRsnPair : public TNamed { +public: + + AliRsnPair(const char *name = "default", AliRsnPairDef *def = 0); + AliRsnPair(const AliRsnPair ©); + 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 +