]>
Commit | Line | Data |
---|---|---|
2f331ac9 | 1 | #ifndef ALIANALYSISMUMU_H |
2 | #define ALIANALYSISMUMU_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 | /// AliAnalysisMuMu : helper class to digest results from | |
11 | /// AliAnalysisTaskMuMu(fromAOD or fromESD) | |
12 | /// | |
13 | /// author : Laurent Aphecetche (Subatech) | |
14 | ||
15 | #include "TNamed.h" | |
16 | #include <string> | |
17 | #include <TString.h> | |
18 | ||
19 | class TH1; | |
20 | class AliHistogramCollection; | |
21 | class AliCounterCollection; | |
22 | class TF1; | |
23 | class TGraph; | |
24 | class TMap; | |
25 | class TFile; | |
26 | ||
27 | class AliAnalysisMuMu : public TObject | |
28 | { | |
29 | ||
30 | public: | |
31 | ||
32 | enum EColor { | |
33 | kBlue=1500, | |
34 | kOrange=1501, | |
35 | kGreen=1502 | |
36 | }; | |
37 | ||
38 | AliAnalysisMuMu(const char* filename="LHC12c_muons_AOD000_000179687.saf.root"); | |
39 | virtual ~AliAnalysisMuMu(); | |
40 | ||
41 | class Result : public TNamed | |
42 | { | |
43 | ||
44 | public: | |
45 | ||
46 | enum EFitType | |
47 | { | |
48 | kJpsi=(1<<0), | |
49 | kJpsiPrime=(1<<1), | |
50 | kUpsilon=(1<<2), | |
51 | kPbPb2010=(1<<3), | |
52 | kPbPb2011=(1<<4), | |
53 | kpp2011=(1<<5), | |
54 | kMatchAny=(1<<6) | |
55 | }; | |
56 | ||
57 | Result(TRootIOCtor* /*io*/) : | |
2754fd07 | 58 | TNamed("",""), |
59 | fTriggerName(), | |
60 | fEventSelection(), | |
61 | fPairSelection(), | |
62 | fCentralitySelection(), | |
63 | fNofRuns(), | |
64 | fNofTriggers(), | |
65 | fHC(0x0), fRebin(0), | |
2f331ac9 | 66 | fFitTotal(0x0), |
67 | fMinv(0x0), fMinvLS(0), | |
68 | fFitType(0), fMap(0x0) | |
69 | { | |
70 | } | |
71 | ||
2754fd07 | 72 | Result(const char* triggerClass, |
73 | const char* eventSelection, | |
74 | const char* pairSelection, | |
75 | const char* centSelection, | |
76 | Int_t ntriggers, AliHistogramCollection* hc, Int_t nrebin=1, UInt_t fitType=(kJpsi | kJpsiPrime)) : | |
77 | TNamed("",""), fTriggerName(triggerClass), | |
78 | fEventSelection(eventSelection), | |
79 | fPairSelection(pairSelection), | |
80 | fCentralitySelection(centSelection), | |
81 | fNofRuns(1), | |
82 | fNofTriggers(ntriggers), fHC(hc), fRebin(nrebin), | |
2f331ac9 | 83 | fFitTotal(0x0), |
84 | fMinv(0x0), fMinvLS(0), | |
85 | fFitType(fitType), fMap(0x0) | |
86 | { | |
87 | if (hc) Fit(nrebin); | |
88 | } | |
2754fd07 | 89 | |
2f331ac9 | 90 | virtual ~Result(); |
2754fd07 | 91 | |
92 | const char* GetName() const { return fTriggerName.Data(); } | |
2f331ac9 | 93 | |
94 | AliHistogramCollection* HC() const { return fHC; } | |
95 | ||
2754fd07 | 96 | const char* TriggerClass() const { return GetName(); } |
97 | ||
98 | const char* EventSelection() const { return fEventSelection.Data(); } | |
99 | const char* PairSelection() const { return fPairSelection.Data(); } | |
100 | const char* CentralitySelection() const { return fCentralitySelection.Data(); } | |
2f331ac9 | 101 | |
102 | Int_t NofTriggers() const { return fNofTriggers; } | |
103 | ||
104 | Double_t NofJpsi() const { return GetValue("NofJpsi"); } | |
105 | ||
106 | Double_t ErrorOnNofJpsi() const { return GetError("NofJpsi"); } | |
107 | ||
108 | Double_t MeanJpsi() const { return GetValue("MeanJpsi"); } | |
109 | ||
110 | Double_t ErrorOnMeanJpsi() const { return GetError("MeanJpsi"); } | |
111 | ||
112 | Double_t SigmaJpsi() const { return GetValue("SigmaJpsi"); } | |
113 | ||
114 | Double_t ErrorOnSigmaJpsi() const { return GetError("SigmaJpsi"); } | |
115 | ||
116 | Double_t NofJpsiPrime() const { return GetValue("NofJpsiPrime"); } | |
117 | ||
118 | Double_t ErrorOnNofJpsiPrime() const { return GetError("NofJpsiPrime"); } | |
119 | ||
120 | Double_t MeanJpsiPrime() const { return GetValue("MeanJpsiPrime"); } | |
121 | ||
122 | Double_t ErrorOnMeanJpsiPrime() const { return GetError("MeanJpsiPrime"); } | |
123 | ||
124 | Double_t SigmaJpsiPrime() const { return GetValue("SigmaJpsiPrime"); } | |
125 | ||
126 | Double_t ErrorOnSigmaJpsiPrime() const { return GetError("SigmaJpsiPrime"); } | |
127 | ||
128 | Double_t NofUpsilon() const { return GetValue("NofUpsilon"); } | |
129 | ||
130 | Double_t ErrorOnNofUpsilon() const { return GetError("NofUpsilon"); } | |
131 | ||
132 | Double_t MeanUpsilon() const { return GetValue("MeanUpsilon"); } | |
133 | ||
134 | Double_t ErrorOnMeanUpsilon() const { return GetError("MeanUpsilon"); } | |
135 | ||
136 | Double_t SigmaUpsilon() const { return GetValue("SigmaUpsilon"); } | |
137 | ||
138 | Double_t ErrorOnSigmaUpsilon() const { return GetError("SigmaUpsilon"); } | |
139 | ||
140 | void Set(const char* name, double value, double error); | |
141 | ||
142 | void Print(Option_t* opt="") const; | |
143 | ||
144 | void Fit(Int_t rebin=1); | |
145 | ||
146 | void FitJpsiJpsiPrimeCB(TH1& h); | |
147 | ||
148 | void FitJpsiJpsiPrimeCustom(TH1& h); | |
149 | ||
150 | void FitJpsi(TH1& h); | |
151 | ||
152 | void FitJpsiCBE(TH1& h); | |
153 | ||
154 | void FitJpsiECBE(TH1& h); | |
155 | ||
156 | void FitJpsiPCBE(TH1& h); | |
157 | ||
158 | void FitUpsilon(TH1& h); | |
159 | ||
160 | void FitJpsiGCBE(TH1& h); | |
161 | ||
162 | Bool_t HasValue(const char* name) const; | |
163 | Double_t GetValue(const char* name) const; | |
164 | Double_t GetError(const char* name) const; | |
165 | ||
166 | TH1* Minv() const { return fMinv; } | |
167 | TH1* MinvLS() const { return fMinvLS; } | |
168 | ||
169 | UInt_t FitType() const { return fFitType; } | |
170 | ||
2754fd07 | 171 | Int_t NofRuns() const { return fNofRuns; } |
172 | ||
173 | void SetNofRuns(int n) { fNofRuns=n; } | |
174 | ||
2f331ac9 | 175 | private: |
176 | Result(const Result&); | |
177 | Result& operator=(const Result&); | |
178 | TMap* Map() const; | |
179 | ||
180 | private: | |
181 | TString fTriggerName; | |
2754fd07 | 182 | TString fEventSelection; |
183 | TString fPairSelection; | |
184 | TString fCentralitySelection; | |
185 | Int_t fNofRuns; | |
2f331ac9 | 186 | Int_t fNofTriggers; |
187 | AliHistogramCollection* fHC; | |
188 | Int_t fRebin; | |
189 | TF1* fFitTotal; | |
190 | TH1* fMinv; | |
191 | TH1* fMinvLS; | |
192 | UInt_t fFitType; | |
193 | ||
194 | mutable TMap* fMap; // map of results (string,TObjArray) each TObjArray = (value,error) = (TParameter<double>, TParameter<double>) | |
195 | ||
2754fd07 | 196 | ClassDef(AliAnalysisMuMu::Result,7) |
2f331ac9 | 197 | }; |
198 | ||
2754fd07 | 199 | /* Basic checks */ |
200 | void BasicCounts(Bool_t detailTrigger=kFALSE, | |
201 | ULong64_t* totalNmb=0x0, | |
202 | ULong64_t* totalNmsl=0x0, | |
203 | ULong64_t* totalNmul=0x0); | |
2f331ac9 | 204 | |
2754fd07 | 205 | static void BasicCountsEvolution(const char* filelist, Bool_t detailTrigger=kFALSE); |
206 | ||
207 | void TriggerCountCoverage(const char* triggerList, Bool_t compact=kTRUE); | |
208 | ||
209 | ||
210 | /** Background evolution functions */ | |
211 | static TObjArray* ComputeBackgroundEvolution(const char* filelist, const char* triggerList, | |
212 | const char* outputfile="background-evolution.root", const char* outputMode="UPDATE"); | |
213 | ||
214 | static void PlotBackgroundEvolution(const char* gfile, const char* triggerList); | |
215 | ||
2f331ac9 | 216 | |
2754fd07 | 217 | /** Fitting */ |
218 | static TMap* ComputeJpsiEvolution(const char* filelist, const char* triggerList, | |
219 | const char* outputFile="jpsi-evolution.root", const char* outputMode="UPDATE", | |
220 | Bool_t simulation=kFALSE); | |
2f331ac9 | 221 | |
2754fd07 | 222 | static void PlotJpsiEvolution(const char* resultFile, const char* triggerList, Bool_t fillBoundaries=kFALSE, |
223 | const char* efficiencyFile=0x0); | |
2f331ac9 | 224 | |
2754fd07 | 225 | ///------ |
226 | ||
2f331ac9 | 227 | static void CentralityCheck(const char* filelist); |
228 | ||
229 | static TObjArray* CompareJpsiPerCMUUWithBackground(const char* jpsiresults="results.root", | |
230 | const char* backgroundresults="background.lhc11d.root"); | |
231 | ||
232 | static TGraph* CompareJpsiPerCMUUWithSimu(const char* realjpsiresults="results.root", | |
233 | const char* simjpsiresults="results.sim.root"); | |
234 | ||
235 | static Bool_t DecodeFileName(const char* filename, TString& period, int& esdpass, int& aodtrain, int& runnumber); | |
236 | ||
237 | ||
238 | static TFile* FileOpen(const char* file); | |
239 | ||
240 | ||
241 | static Bool_t GetCollections(const char* rootfile, | |
242 | AliHistogramCollection*& hc, | |
243 | AliCounterCollection*& cc); | |
244 | ||
245 | static Result* GetResult(const AliHistogramCollection& hc, | |
246 | AliCounterCollection& cc, | |
247 | const char* base, | |
248 | const char* selection, | |
2f331ac9 | 249 | const char* paircut, |
250 | const char* centrality, | |
251 | UInt_t fitType, | |
252 | Int_t nrebin=1); | |
253 | ||
254 | static UInt_t GetSum(AliCounterCollection& cc, const char* triggerList, const char* eventSelection, Int_t runNumber=-1); | |
255 | ||
256 | static ULong64_t GetTriggerScalerCount(const char* triggerList, Int_t runNumber); | |
257 | ||
2f331ac9 | 258 | TObjArray* Jpsi(Bool_t simulation=kFALSE); |
259 | ||
2f331ac9 | 260 | static TObjArray* ReadFileList(const char* filelist); |
261 | ||
262 | static Int_t RunNumberFromFileName(const char* filename); | |
263 | ||
264 | static void SinglePtPlot(const char* rootfile); | |
265 | ||
266 | void SetDimuonTriggerList(const char* dimuonTriggerList) { fDimuonTriggers = dimuonTriggerList; } | |
267 | void SetMuonTriggerList(const char* muonTriggerList) { fMuonTriggers = muonTriggerList; } | |
268 | void SetMinbiasTriggerList(const char* minbiasTriggerList) { fMinbiasTriggers = minbiasTriggerList; } | |
2754fd07 | 269 | |
270 | TString DimuonTriggerList() const { return fDimuonTriggers; } | |
271 | TString MuonTriggerList() const { return fMuonTriggers; } | |
272 | TString MinbiasTriggerList() const { return fMinbiasTriggers; } | |
273 | ||
274 | void SetEventSelectionList(const char* eventSelectionList) { fEventSelectionList = eventSelectionList; } | |
275 | void SetPairSelectionList(const char* pairSelectionList) { fPairSelectionList = pairSelectionList; } | |
276 | ||
277 | static void SetDefaultDimuonTriggerList(const char* dimuonTriggerList) { fgDefaultDimuonTriggers = dimuonTriggerList; } | |
278 | static void SetDefaultMuonTriggerList(const char* muonTriggerList) { fgDefaultMuonTriggers = muonTriggerList; } | |
279 | static void SetDefaultMinbiasTriggerList(const char* minbiasTriggerList) { fgDefaultMinbiasTriggers = minbiasTriggerList; } | |
280 | static void SetDefaultEventSelectionList(const char* eventSelectionList) { fgDefaultEventSelectionList = eventSelectionList; } | |
281 | static void SetDefaultPairSelectionList(const char* pairSelectionList) { fgDefaultPairSelectionList = pairSelectionList; } | |
282 | ||
2f331ac9 | 283 | |
284 | AliHistogramCollection* HC() const { return fHistogramCollection; } | |
285 | AliCounterCollection* CC() const { return fCounterCollection; } | |
286 | ||
287 | static void SetOCDBPath(const char* ocdbPath) { fgOCDBPath = ocdbPath; } | |
288 | ||
289 | static void SetColorScheme(); | |
2754fd07 | 290 | |
291 | static void DrawFill(Int_t run1, Int_t run2, double ymin, double ymax, const char* label); | |
292 | ||
5597c928 | 293 | private: |
294 | AliAnalysisMuMu(const AliAnalysisMuMu& rhs); // not implemented on purpose | |
295 | AliAnalysisMuMu& operator=(const AliAnalysisMuMu& rhs); // not implemented on purpose | |
296 | ||
2f331ac9 | 297 | private: |
298 | ||
299 | static TString ExpandPathName(const char* file); | |
300 | ||
301 | TString fFilename; // file containing the result collections (of histograms and counters) from AliAnalysisTaskMuMu | |
302 | AliHistogramCollection* fHistogramCollection; // collection of histograms in file | |
303 | AliCounterCollection* fCounterCollection; // collection of counters in file | |
304 | TString fDimuonTriggers; // list of dimuon triggers to consider | |
305 | TString fMuonTriggers; // list of single muon triggers to consider | |
306 | TString fMinbiasTriggers; // list of minbias triggers to consider | |
2754fd07 | 307 | TString fEventSelectionList; // list of event types to consider |
308 | TString fPairSelectionList; // list of pair cuts to consider | |
2f331ac9 | 309 | |
310 | static TString fgOCDBPath; // OCDB to be used (raw:// by default) | |
311 | ||
2754fd07 | 312 | static TString fgDefaultMuonTriggers; // default list of single muon triggers |
313 | static TString fgDefaultMinbiasTriggers; // default list of MB triggers | |
314 | static TString fgDefaultDimuonTriggers; // default list of dimuon triggers | |
315 | static TString fgDefaultEventSelectionList; // default list of event selections | |
316 | static TString fgDefaultPairSelectionList; // default list of pair selections | |
317 | ||
318 | ClassDef(AliAnalysisMuMu,3) // class to analysis results from AliAnalysisTaskMuMuXXX tasks | |
2f331ac9 | 319 | }; |
320 | ||
321 | #endif |