]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PWG/muondep/AliAnalysisMuMuResult.h
change way to check the origin of local maxima, add histogram depending on n overlaps...
[u/mrichter/AliRoot.git] / PWG / muondep / AliAnalysisMuMuResult.h
1 #ifndef ALIANALYSISMUMURESULT_H
2 #define ALIANALYSISMUMURESULT_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 // $Id$
8
9 ///
10 /// AliAnalysisMuMuResult : helper class to store results from
11 /// AliAnalysisTaskMuMu
12 ///
13 /// author : Laurent Aphecetche (Subatech)
14
15 #include "TNamed.h"
16 #include <TString.h>
17
18 class TH1;
19 class THashList;
20 class TMap;
21
22 class AliAnalysisMuMuResult : public TNamed
23 {
24   
25 public:
26   
27   AliAnalysisMuMuResult(const char* name="", const char* title="");
28   AliAnalysisMuMuResult(const AliAnalysisMuMuResult& rhs);
29   AliAnalysisMuMuResult& operator=(const AliAnalysisMuMuResult& rhs);
30   
31   virtual ~AliAnalysisMuMuResult();
32
33   void AdoptSubResult(AliAnalysisMuMuResult* r);
34
35   virtual TObject* Clone(const char* newname = "") const;
36   
37   void Set(const char* name, Double_t value, Double_t errorStat, Double_t rms=0.0);
38   
39   Bool_t HasValue(const char* name, const char* subResultName="") const;
40   
41   Double_t GetValue(const char* name, const char* subResultName="") const;
42   
43   Double_t GetErrorStat(const char* name, const char* subResultName="") const;
44
45   Double_t GetRMS(const char* name, const char* subResultName="") const;
46   
47   void Print(Option_t* opt="") const;
48   
49   AliAnalysisMuMuResult* SubResult(const char* subResultName) const;
50   
51   TObjArray* SubResults() const { return fSubResults; }
52   
53   Long64_t Merge(TCollection* list);
54
55   AliAnalysisMuMuResult* Mother() const { return fMother; }
56   
57   THashList* Keys() const;
58   
59   Double_t Weight() const { return fWeight; }
60   
61   void SetWeight(Double_t w) { fWeight=w; }
62
63   static Double_t ErrorAB(Double_t a, Double_t aerr, Double_t b, Double_t berr);
64   
65   static Double_t ErrorABC(Double_t a, Double_t aerr, Double_t b, Double_t berr, Double_t c, Double_t cerror);
66
67   static Double_t ErrorABCD(Double_t a, Double_t aerr, Double_t b, Double_t berr, Double_t c, Double_t cerror,
68                             Double_t d, Double_t derror);
69
70   static Double_t ErrorABCDE(Double_t a, Double_t aerr, Double_t b, Double_t berr, Double_t c, Double_t cerror,
71                              Double_t d, Double_t derror, Double_t e, Double_t eerror);
72
73   void PrintValue(const char* key, const char* opt, Double_t value, Double_t errorStat, Double_t rms=0.0) const;
74
75   void SetAlias(const char* alias) { fAlias = alias; }
76   
77   TString Alias() const { if ( fAlias.Length()>0) return fAlias; else return GetName(); }
78   
79   void Include(const char* subResultsList);
80
81   void Exclude(const char* subResultsList);
82
83   Bool_t IsIncluded(const TString& alias) const;
84   
85   void Scale(Double_t value);
86   
87 private:
88   
89   enum EIndex
90   {
91     kValue=0,
92     kErrorStat=1,
93     kRMS=2
94   };
95   
96   void PrintParticle(const char* particle, const char* opt) const;
97
98   TList* SubResultsToBeIncluded() const;
99   
100   TString GetSubResultNameList() const;
101
102   Int_t NofIncludedSubResults(const char* name) const;
103   
104 private:
105   TObjArray* fSubResults; // TObjArray of AliAnalysisMuMuResult*
106   TMap* fMap; // internal parameter map
107   AliAnalysisMuMuResult* fMother; // mother result
108   mutable THashList* fKeys; //! keys we have in our internal map (or the one of our subresults)
109   Double_t fWeight; // weight of this result (default 1.0)
110   TString fAlias; // alias name
111   mutable TList* fSubResultsToBeIncluded; // inclusion list
112   
113   ClassDef(AliAnalysisMuMuResult,11) // a class to some results (counts, yields, AccxEff, R_AB, etc...)
114 };
115
116 #endif