]>
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 | ||
a58729a5 | 9 | /// |
10 | /// AliAnalysisMuMu : helper class to digest/plot/massage results from | |
11 | /// AliAnalysisTaskMuMu | |
2f331ac9 | 12 | /// |
13 | /// author : Laurent Aphecetche (Subatech) | |
14 | ||
a58729a5 | 15 | #include "AliAnalysisMuMuBinning.h" |
2f331ac9 | 16 | #include "TNamed.h" |
a58729a5 | 17 | #include <map> |
18 | #include <set> | |
2f331ac9 | 19 | #include <string> |
20 | #include <TString.h> | |
a58729a5 | 21 | #include <vector> |
1afce1ce | 22 | #include "RQ_OBJECT.h" |
2f331ac9 | 23 | |
a58729a5 | 24 | class AliAnalysisMuMuResult; |
25 | class AliAnalysisMuMuSpectra; | |
2f331ac9 | 26 | class AliCounterCollection; |
a58729a5 | 27 | class AliMergeableCollection; |
2f331ac9 | 28 | class TF1; |
a58729a5 | 29 | class TFile; |
2f331ac9 | 30 | class TGraph; |
a58729a5 | 31 | class TH1; |
2f331ac9 | 32 | class TMap; |
2f331ac9 | 33 | |
34 | class AliAnalysisMuMu : public TObject | |
35 | { | |
1afce1ce | 36 | |
37 | RQ_OBJECT("AliAnalysisMuMu") | |
2f331ac9 | 38 | |
1afce1ce | 39 | |
2f331ac9 | 40 | public: |
41 | ||
1afce1ce | 42 | enum EColor |
43 | { | |
2f331ac9 | 44 | kBlue=1500, |
45 | kOrange=1501, | |
46 | kGreen=1502 | |
47 | }; | |
48 | ||
1afce1ce | 49 | AliAnalysisMuMu(const char* filename="LHC12c_muons_AOD000_000179687.saf.root", |
50 | const char* associatedSimFileName=""); | |
51 | ||
2f331ac9 | 52 | virtual ~AliAnalysisMuMu(); |
53 | ||
2754fd07 | 54 | /* Basic checks */ |
55 | void BasicCounts(Bool_t detailTrigger=kFALSE, | |
56 | ULong64_t* totalNmb=0x0, | |
57 | ULong64_t* totalNmsl=0x0, | |
58 | ULong64_t* totalNmul=0x0); | |
a58729a5 | 59 | |
2754fd07 | 60 | static void BasicCountsEvolution(const char* filelist, Bool_t detailTrigger=kFALSE); |
61 | ||
a58729a5 | 62 | void TriggerCountCoverage(const char* triggerList, Bool_t compact=kTRUE, |
63 | Bool_t orderByTriggerCount=kTRUE); | |
64 | ||
65 | ||
2754fd07 | 66 | /** Background evolution functions */ |
67 | static TObjArray* ComputeBackgroundEvolution(const char* filelist, const char* triggerList, | |
a58729a5 | 68 | Double_t ptmin=0.0, |
2754fd07 | 69 | const char* outputfile="background-evolution.root", const char* outputMode="UPDATE"); |
2754fd07 | 70 | |
a58729a5 | 71 | static void PlotBackgroundEvolution(const char* gfile, const char* triggerList, Double_t ymax=100.0, Bool_t fillBoundaries=kFALSE); |
72 | ||
73 | ||
2754fd07 | 74 | /** Fitting */ |
75 | static TMap* ComputeJpsiEvolution(const char* filelist, const char* triggerList, | |
a58729a5 | 76 | const char* outputFile="jpsi-evolution.root"); |
2f331ac9 | 77 | |
2754fd07 | 78 | static void PlotJpsiEvolution(const char* resultFile, const char* triggerList, Bool_t fillBoundaries=kFALSE, |
a58729a5 | 79 | const char* efficiencyFile=0x0, Bool_t simulation=kFALSE); |
80 | ||
81 | ||
82 | AliAnalysisMuMuSpectra* FitParticle(const char* particle, | |
83 | const char* trigger, | |
84 | const char* eventType, | |
85 | const char* pairCut, | |
86 | const char* centrality, | |
87 | const AliAnalysisMuMuBinning& binning); | |
2f331ac9 | 88 | |
1afce1ce | 89 | AliAnalysisMuMuSpectra* CorrectSpectra(const char* type, const char* flavour=""); |
90 | ||
91 | AliAnalysisMuMuSpectra* ComputeYield(const char* type, const char* flavour=""); | |
92 | ||
93 | void CleanAllSpectra(); | |
94 | ||
2754fd07 | 95 | ///------ |
96 | ||
1afce1ce | 97 | // static AliAnalysisMuMuSpectra* ComputeYield(const char* realFile="ds.list.saf.root", |
98 | // const char* simFile="ds.sim.list.saf.root", | |
99 | // const char* type="PSI-Y VS PT"); | |
2f331ac9 | 100 | |
a58729a5 | 101 | static AliAnalysisMuMuSpectra* RABy(const char* realFile="ds.list.saf.root", const char* simFile="ds.sim.list.saf.root", const char* type="", const char* direction="pPb"); |
102 | ||
103 | static TGraph* ResultEvolution(const char* runlist, const char* period="LHC13f", const char* what="Y", | |
104 | Bool_t forceRecomputation=kFALSE); | |
105 | ||
106 | ///------- | |
107 | ||
108 | TGraph* PlotEventSelectionEvolution(const char* trigger1="CINT7-B-NOPF-MUON", const char* event1="PSALL", | |
109 | const char* trigger2="CINT7-B-NOPF-MUON", const char* event2="PSALL", | |
110 | Bool_t drawFills=kFALSE, | |
111 | Bool_t asRejection=kTRUE) const; | |
112 | ||
113 | Bool_t Upgrade(); | |
114 | ||
115 | static Bool_t Upgrade(const char* filename); | |
116 | ||
117 | static void CentralityCheck(const char* filelist); | |
118 | ||
2f331ac9 | 119 | static TObjArray* CompareJpsiPerCMUUWithBackground(const char* jpsiresults="results.root", |
120 | const char* backgroundresults="background.lhc11d.root"); | |
a58729a5 | 121 | |
2f331ac9 | 122 | static TGraph* CompareJpsiPerCMUUWithSimu(const char* realjpsiresults="results.root", |
123 | const char* simjpsiresults="results.sim.root"); | |
a58729a5 | 124 | |
2f331ac9 | 125 | static Bool_t DecodeFileName(const char* filename, TString& period, int& esdpass, int& aodtrain, int& runnumber); |
126 | ||
a58729a5 | 127 | |
2f331ac9 | 128 | static TFile* FileOpen(const char* file); |
129 | ||
a58729a5 | 130 | |
2f331ac9 | 131 | static Bool_t GetCollections(const char* rootfile, |
a58729a5 | 132 | AliMergeableCollection*& mc, |
133 | AliCounterCollection*& cc, | |
134 | AliAnalysisMuMuBinning*& bin, | |
135 | std::set<int>& runnumbers); | |
2f331ac9 | 136 | |
1afce1ce | 137 | AliAnalysisMuMuSpectra* GetSpectra(const char* what, const char* flavour="") const; |
138 | ||
2f331ac9 | 139 | static UInt_t GetSum(AliCounterCollection& cc, const char* triggerList, const char* eventSelection, Int_t runNumber=-1); |
140 | ||
141 | static ULong64_t GetTriggerScalerCount(const char* triggerList, Int_t runNumber); | |
a58729a5 | 142 | |
1afce1ce | 143 | Int_t Jpsi(const char* what="integrated", const char* binningFlavour=""); |
a58729a5 | 144 | |
145 | Bool_t IsSimulation() const; | |
146 | ||
2f331ac9 | 147 | static TObjArray* ReadFileList(const char* filelist); |
148 | ||
149 | static Int_t RunNumberFromFileName(const char* filename); | |
150 | ||
a58729a5 | 151 | TString DimuonTriggerList() const { return fDimuonTriggers; } |
2f331ac9 | 152 | void SetDimuonTriggerList(const char* dimuonTriggerList) { fDimuonTriggers = dimuonTriggerList; } |
2754fd07 | 153 | |
2754fd07 | 154 | TString MuonTriggerList() const { return fMuonTriggers; } |
a58729a5 | 155 | void SetMuonTriggerList(const char* muonTriggerList) { fMuonTriggers = muonTriggerList; } |
156 | ||
2754fd07 | 157 | TString MinbiasTriggerList() const { return fMinbiasTriggers; } |
a58729a5 | 158 | void SetMinbiasTriggerList(const char* minbiasTriggerList) { fMinbiasTriggers = minbiasTriggerList; } |
2754fd07 | 159 | |
a58729a5 | 160 | TString EventSelectionList() const { return fEventSelectionList; } |
2754fd07 | 161 | void SetEventSelectionList(const char* eventSelectionList) { fEventSelectionList = eventSelectionList; } |
2754fd07 | 162 | |
a58729a5 | 163 | TString PairSelectionList() const { return fPairSelectionList; } |
164 | void SetPairSelectionList(const char* pairSelectionList) { fPairSelectionList = pairSelectionList; } | |
165 | ||
166 | TString CentralitySelectionList() const { return fCentralitySelectionList; } | |
167 | void SetCentralitySelectionList(const char* centralitySelectionList) { fCentralitySelectionList = centralitySelectionList; } | |
168 | ||
1afce1ce | 169 | TString FitTypeList() const { return fFitTypeList; } |
170 | void SetFitTypeList(const char* fitTypelist) { fFitTypeList = fitTypelist; } | |
171 | ||
2754fd07 | 172 | static void SetDefaultDimuonTriggerList(const char* dimuonTriggerList) { fgDefaultDimuonTriggers = dimuonTriggerList; } |
173 | static void SetDefaultMuonTriggerList(const char* muonTriggerList) { fgDefaultMuonTriggers = muonTriggerList; } | |
174 | static void SetDefaultMinbiasTriggerList(const char* minbiasTriggerList) { fgDefaultMinbiasTriggers = minbiasTriggerList; } | |
175 | static void SetDefaultEventSelectionList(const char* eventSelectionList) { fgDefaultEventSelectionList = eventSelectionList; } | |
176 | static void SetDefaultPairSelectionList(const char* pairSelectionList) { fgDefaultPairSelectionList = pairSelectionList; } | |
a58729a5 | 177 | static void SetDefaultCentralitySelectionList(const char* centralitySelectionList) { fgDefaultCentralitySelectionList = centralitySelectionList; } |
1afce1ce | 178 | static void SetDefaultFitTypes(const char* fitTypes) { fgDefaultFitTypeList = fitTypes; } |
2f331ac9 | 179 | |
1afce1ce | 180 | static void SetDefaultEventSelectionForSimulations(const char* value) { fgDefaultEventSelectionForSimulations = value; } |
181 | static void SetDefaultDimuonTriggerForSimulations(const char* value) { fgDefaultDimuonTriggerForSimulations = value; } | |
182 | ||
a58729a5 | 183 | AliMergeableCollection* MC() const { return fMergeableCollection; } |
2f331ac9 | 184 | AliCounterCollection* CC() const { return fCounterCollection; } |
a58729a5 | 185 | AliAnalysisMuMuBinning* BIN() const { return fBinning; } |
2f331ac9 | 186 | |
187 | static void SetOCDBPath(const char* ocdbPath) { fgOCDBPath = ocdbPath; } | |
188 | ||
189 | static void SetColorScheme(); | |
a58729a5 | 190 | |
191 | static void SetCompactGraphs(Bool_t value=kTRUE) { fgIsCompactGraphs = value; } | |
192 | ||
193 | static Bool_t CompactGraphs() { return fgIsCompactGraphs; } | |
194 | ||
195 | static void Compact(TGraph& g); | |
196 | ||
197 | void Print(Option_t* opt="") const; | |
198 | ||
199 | void GetMBR(Int_t runNumber, const char* eventSelection, Double_t& value, Double_t& error) const; | |
2754fd07 | 200 | |
a58729a5 | 201 | TGraph* MBREvolution(const char* eventSelection1="PSALLNOTZEROPILEUP", const char* eventSelection2="PSALL") const; |
2754fd07 | 202 | |
a58729a5 | 203 | const std::set<int>& RunNumbers() const { return fRunNumbers; } |
204 | ||
205 | void DrawMinv(const char* type, | |
206 | const char* particle, | |
207 | const char* trigger, | |
208 | const char* eventType, | |
209 | const char* pairCut, | |
1afce1ce | 210 | const char* centrality, |
211 | const char* subresultname="", | |
212 | const char* flavour="") const; | |
a58729a5 | 213 | |
1afce1ce | 214 | void DrawMinv(const char* type="PT", const char* particle="PSI", const char* flavour="", const char* subresultname="") const; |
a58729a5 | 215 | |
1afce1ce | 216 | Bool_t SetCorrectionPerRun(const TGraph& corr, const char* formula=""); |
a58729a5 | 217 | |
218 | void UnsetCorrectionPerRun(); | |
219 | ||
1afce1ce | 220 | void ExecuteCanvasEvent(Int_t event, Int_t px, Int_t py, TObject *sel); |
221 | ||
222 | std::vector<Double_t> GetMCCB2Tails(const AliAnalysisMuMuBinning::Range& bin) const; | |
223 | ||
224 | AliAnalysisMuMu* SIM() const { return fAssociatedSimulation; } | |
225 | ||
226 | AliAnalysisMuMuSpectra* SPECTRA(const char* fullpath) const; | |
227 | ||
228 | void Update(); | |
229 | ||
5597c928 | 230 | private: |
231 | AliAnalysisMuMu(const AliAnalysisMuMu& rhs); // not implemented on purpose | |
232 | AliAnalysisMuMu& operator=(const AliAnalysisMuMu& rhs); // not implemented on purpose | |
233 | ||
a58729a5 | 234 | TFile* ReOpen(const char* filename, const char* mode) const; |
235 | ||
236 | TString First(const TString& list) const; | |
237 | ||
2f331ac9 | 238 | private: |
239 | ||
a58729a5 | 240 | void SetNofInputParticles(AliAnalysisMuMuResult& r); |
2f331ac9 | 241 | |
a58729a5 | 242 | static TString ExpandPathName(const char* file); |
243 | ||
1afce1ce | 244 | |
a58729a5 | 245 | TString fFilename; // file containing the result collections (of objects and counters) from AliAnalysisTaskMuMu |
2f331ac9 | 246 | AliCounterCollection* fCounterCollection; // collection of counters in file |
247 | TString fDimuonTriggers; // list of dimuon triggers to consider | |
248 | TString fMuonTriggers; // list of single muon triggers to consider | |
249 | TString fMinbiasTriggers; // list of minbias triggers to consider | |
2754fd07 | 250 | TString fEventSelectionList; // list of event types to consider |
251 | TString fPairSelectionList; // list of pair cuts to consider | |
a58729a5 | 252 | TString fCentralitySelectionList; // list of centrality cuts to consider |
1afce1ce | 253 | TString fFitTypeList; // list of fit types to perform |
254 | ||
a58729a5 | 255 | AliAnalysisMuMuBinning* fBinning; // binning |
256 | ||
2f331ac9 | 257 | static TString fgOCDBPath; // OCDB to be used (raw:// by default) |
258 | ||
2754fd07 | 259 | static TString fgDefaultMuonTriggers; // default list of single muon triggers |
260 | static TString fgDefaultMinbiasTriggers; // default list of MB triggers | |
261 | static TString fgDefaultDimuonTriggers; // default list of dimuon triggers | |
262 | static TString fgDefaultEventSelectionList; // default list of event selections | |
263 | static TString fgDefaultPairSelectionList; // default list of pair selections | |
a58729a5 | 264 | static TString fgDefaultCentralitySelectionList; // default list of centrality selections |
1afce1ce | 265 | static TString fgDefaultFitTypeList; // default list of fit types |
266 | static TString fgDefaultEventSelectionForSimulations; // default event selection (simulations) | |
267 | static TString fgDefaultDimuonTriggerForSimulations; // default dimuon trigger (simulations) | |
a58729a5 | 268 | |
269 | static Bool_t fgIsCompactGraphs; // whether the graph produced should be compact | |
270 | ||
271 | AliMergeableCollection* fMergeableCollection; // collection of objects in file | |
2754fd07 | 272 | |
a58729a5 | 273 | std::set<int> fRunNumbers; // run numbers |
274 | ||
275 | TGraph* fCorrectionPerRun; // correction factor per run | |
276 | ||
1afce1ce | 277 | AliAnalysisMuMu* fAssociatedSimulation; // associated simulations (if any) |
278 | ||
279 | ClassDef(AliAnalysisMuMu,11) // class to analysis results from AliAnalysisTaskMuMuXXX tasks | |
2f331ac9 | 280 | }; |
281 | ||
282 | #endif |