]>
Commit | Line | Data |
---|---|---|
5ec1c2f5 | 1 | void TriggerStudyResults(const char * filename = "outTrigger/collection_136854.xml/trigger_study.root", TString trigger = "C0SM1-A-NOPF-ALL") { |
a82dc581 | 2 | |
3 | TFile * f = new TFile (filename); | |
4 | ||
5 | ||
6 | LoadLibs(); | |
7 | ||
8 | // Draw trigger venn diagram | |
5ec1c2f5 | 9 | // hTrigStat_All_C0OM2-A-NOPF-ALL |
10 | TString vennName = "hTrigStat_All"; | |
11 | if (trigger != "") vennName = vennName+"_"+trigger; | |
12 | cout << "Venn name: " << vennName.Data() << endl; | |
13 | ||
14 | TH1 * hVenn = (TH1*) f->Get(vennName); | |
52d405b5 | 15 | hVenn->Draw(); |
a82dc581 | 16 | Int_t colors[] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15}; |
17 | TPie * pie = new TPie(hVenn); | |
18 | Int_t nbin = hVenn->GetNbinsX(); | |
19 | for(Int_t ibin = 0; ibin < nbin; ibin++){ | |
20 | pie->SetEntryLabel(ibin, Form("%s, %d (%1.2f%%)", pie->GetEntryLabel(ibin), (int) pie->GetEntryVal(ibin), pie->GetEntryVal(ibin)/hVenn->GetEntries()*100)); | |
21 | } | |
22 | ||
23 | pie->SortSlices(1,1); // Sort slices and merge the empty ones | |
24 | pie->SortSlices(0,0); // Sort in increasing order. Sorting in increasing order directly leads to segfault | |
25 | pie->SetRadius(.31); | |
26 | pie->SetX(.53); | |
27 | pie->SetY(.34); | |
28 | pie->SetLabelsOffset(.01); | |
29 | pie->SetLabelFormat("");//#splitline{%val (%perc)}{%txt}"); | |
30 | pie->SetFillColors(colors); | |
52d405b5 | 31 | // pie->SetTextSize(0.01); |
a82dc581 | 32 | pie->Draw(""); |
33 | ||
5ec1c2f5 | 34 | pie->MakeLegend(0.224832, 0.66958, 0.833893, 0.97028, trigger.Data()); |
a82dc581 | 35 | cout << pie << endl; |
36 | ||
37 | // Make a table of trigger efficiencies for all histos results | |
a82dc581 | 38 | AliLatexTable table(2,"cc"); |
39 | // table.InsertCustomRow("\\multicolumn{c}{2}{Integrated efficiency}"); | |
52d405b5 | 40 | table.InsertCustomRow(Form("Trigger Name & Efficiency (%s)\\\\",trigger.Data())); |
a82dc581 | 41 | table.InsertHline(); |
42 | TList * l = gDirectory->GetListOfKeys(); | |
43 | TIterator * iter = l->MakeIterator(); | |
44 | TKey * key = 0; | |
52d405b5 | 45 | TH1F * hall = (TH1F*) gDirectory->Get("hTracklets_all"); // FIXME: get the normalization for a given trigger? |
a82dc581 | 46 | while (key = (TKey*) iter->Next()){ |
47 | TString name = key->GetName(); | |
48 | if(!name.Contains("Tracklets")) continue; | |
52d405b5 | 49 | if(!name.Contains(trigger)) continue; |
a82dc581 | 50 | if(name.Contains("all")) continue; |
51 | TH1F * h = (TH1F*) gDirectory->Get(name); | |
52 | TString label = name(name.Index("_")+1, name.Index("_",name.Index("_")+1)-name.Index("_")-1); | |
53 | table.SetNextCol(label); | |
54 | table.SetNextCol(h->GetEntries()/hall->GetEntries()); | |
55 | table.InsertRow(); | |
56 | } | |
57 | cout << "Integrated trigger efficiency" << endl; | |
58 | table.PrintTable("ASCII"); | |
59 | } | |
60 | ||
61 | LoadLibs() { | |
62 | ||
63 | gSystem->Load("libVMC"); | |
64 | gSystem->Load("libTree"); | |
65 | gSystem->Load("libSTEERBase"); | |
66 | gSystem->Load("libESD"); | |
67 | gSystem->Load("libAOD"); | |
68 | gSystem->Load("libANALYSIS"); | |
69 | gSystem->Load("libANALYSISalice"); | |
70 | gSystem->Load("libCORRFW"); | |
71 | gSystem->Load("libMinuit"); | |
72 | gSystem->Load("libPWG2Spectra"); | |
73 | gSystem->Load("libPWG0base"); | |
74 | ||
75 | gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/PWG0/multPbPb")); | |
76 | gROOT->ProcessLine(gSystem->ExpandPathName(".include $ALICE_ROOT/PWG1/background")); | |
77 | // Load helper classes | |
78 | // TODO: replace this by a list of TOBJStrings | |
79 | TString taskName("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisTaskMultPbTracks.cxx+"); | |
80 | TString histoManName("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisMultPbTrackHistoManager.cxx+"); | |
81 | TString centrName("$ALICE_ROOT/PWG0/multPbPb/AliAnalysisMultPbCentralitySelector.cxx+"); | |
82 | TString listName("$ALICE_ROOT/PWG1/background/AliHistoListWrapper.cxx+"); | |
83 | ||
84 | gSystem->ExpandPathName(taskName); | |
85 | gSystem->ExpandPathName(histoManName); | |
86 | gSystem->ExpandPathName(centrName); | |
87 | gSystem->ExpandPathName(listName); | |
88 | ||
89 | Bool_t debug=0; | |
90 | gROOT->LoadMacro(listName +(debug?"+g":"")); | |
91 | gROOT->LoadMacro(histoManName+(debug?"+g":"")); | |
92 | gROOT->LoadMacro(centrName +(debug?"+g":"")); | |
93 | gROOT->LoadMacro(taskName +(debug?"+g":"")); | |
94 | ||
95 | // Histo fitter | |
96 | gROOT->LoadMacro("/Users/mfloris/Work/ALICE/ANALYSIS/HistoFitter/fcn.cxx+g"); | |
97 | gROOT->LoadMacro("/Users/mfloris/Work/ALICE/ANALYSIS/HistoFitter/AliHistoFitter.cxx+g"); | |
98 | ||
99 | ||
100 | } |