]>
Commit | Line | Data |
---|---|---|
a58729a5 | 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> | |
a58729a5 | 17 | |
18 | class TH1; | |
19 | class THashList; | |
a58729a5 | 20 | class TMap; |
21 | ||
22 | class AliAnalysisMuMuResult : public TNamed | |
23 | { | |
24 | ||
25 | public: | |
26 | ||
81190958 | 27 | AliAnalysisMuMuResult(const char* name="", const char* title=""); |
a58729a5 | 28 | AliAnalysisMuMuResult(const AliAnalysisMuMuResult& rhs); |
1afce1ce | 29 | AliAnalysisMuMuResult& operator=(const AliAnalysisMuMuResult& rhs); |
a58729a5 | 30 | |
31 | virtual ~AliAnalysisMuMuResult(); | |
32 | ||
81190958 | 33 | void AdoptSubResult(AliAnalysisMuMuResult* r); |
34 | ||
a58729a5 | 35 | virtual TObject* Clone(const char* newname = "") const; |
36 | ||
81190958 | 37 | void Set(const char* name, Double_t value, Double_t errorStat, Double_t rms=0.0); |
a58729a5 | 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 | ||
81190958 | 45 | Double_t GetRMS(const char* name, const char* subResultName="") const; |
a58729a5 | 46 | |
47 | void Print(Option_t* opt="") const; | |
48 | ||
1afce1ce | 49 | AliAnalysisMuMuResult* SubResult(const char* subResultName) const; |
50 | ||
a58729a5 | 51 | TObjArray* SubResults() const { return fSubResults; } |
52 | ||
a58729a5 | 53 | Long64_t Merge(TCollection* list); |
54 | ||
55 | AliAnalysisMuMuResult* Mother() const { return fMother; } | |
56 | ||
57 | THashList* Keys() const; | |
58 | ||
81190958 | 59 | Double_t Weight() const { return fWeight; } |
a58729a5 | 60 | |
61 | void SetWeight(Double_t w) { fWeight=w; } | |
1afce1ce | 62 | |
1afce1ce | 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 | ||
81190958 | 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; | |
1afce1ce | 74 | |
75 | void SetAlias(const char* alias) { fAlias = alias; } | |
76 | ||
77 | TString Alias() const { if ( fAlias.Length()>0) return fAlias; else return GetName(); } | |
a58729a5 | 78 | |
81190958 | 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 | ||
a58729a5 | 87 | private: |
88 | ||
89 | enum EIndex | |
90 | { | |
91 | kValue=0, | |
81190958 | 92 | kErrorStat=1, |
93 | kRMS=2 | |
a58729a5 | 94 | }; |
95 | ||
a58729a5 | 96 | void PrintParticle(const char* particle, const char* opt) const; |
a58729a5 | 97 | |
81190958 | 98 | TList* SubResultsToBeIncluded() const; |
99 | ||
100 | TString GetSubResultNameList() const; | |
101 | ||
102 | Int_t NofIncludedSubResults(const char* name) const; | |
103 | ||
a58729a5 | 104 | private: |
a58729a5 | 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) | |
1afce1ce | 110 | TString fAlias; // alias name |
81190958 | 111 | mutable TList* fSubResultsToBeIncluded; // inclusion list |
a58729a5 | 112 | |
81190958 | 113 | ClassDef(AliAnalysisMuMuResult,11) // a class to some results (counts, yields, AccxEff, R_AB, etc...) |
a58729a5 | 114 | }; |
115 | ||
116 | #endif |