Introduction of VZERO event-plane selection task that can be used in order to flatten...
[u/mrichter/AliRoot.git] / PWGPP / VZERO / FillVZEROEPOADB.C
1 #if !defined(__CINT__) || defined(__MAKECINT__)
2 #include "TFile.h"
3 #include "TString.h"
4 #include "TProfile.h"
5 #include "TList.h"
6 #include "TSystem.h"
7
8 #include "AliOADBContainer.h"
9 #include "AliAnalysisManager.h"
10 #endif
11
12 void FillVZEROEPOADB()
13 {
14   gSystem->Load("libCore.so");  
15   gSystem->Load("libTree.so");
16   gSystem->Load("libGeom.so");
17   gSystem->Load("libVMC.so");
18   gSystem->Load("libPhysics.so");
19   gSystem->Load("libMinuit");
20   gSystem->Load("libSTEERBase");
21   gSystem->Load("libESD");
22   gSystem->Load("libAOD");
23   gSystem->Load("libANALYSIS");
24   gSystem->Load("libANALYSISalice");   
25   gSystem->Load("libOADB");
26
27   AliOADBContainer * oadbCont = new AliOADBContainer("vzeroEP");
28
29   TList *defaultList = new TList;
30   defaultList->SetName("Default");
31   TList *inputList = NULL;
32   TProfile *profHisto = NULL;
33   TFile fInputDefault("VZERO.EPFlatenning.PS.LHC11h_000170162_p1_muon_.root");
34   inputList = (TList*)fInputDefault.Get("coutput");
35   for(Int_t i = 0; i < 8; ++i) {
36     profHisto = (TProfile*)inputList->FindObject(Form("fX2_%d",i))->Clone(Form("fX2_%d",i));
37     profHisto->SetDirectory(0);
38     defaultList->Add(profHisto);
39     profHisto = (TProfile*)inputList->FindObject(Form("fY2_%d",i))->Clone(Form("fY2_%d",i));
40     profHisto->SetDirectory(0);
41     defaultList->Add(profHisto);
42     profHisto = (TProfile*)inputList->FindObject(Form("fX2Y2_%d",i))->Clone(Form("fX2Y2_%d",i));
43     profHisto->SetDirectory(0);
44     defaultList->Add(profHisto);
45     profHisto = (TProfile*)inputList->FindObject(Form("fCos8Psi_%d",i))->Clone(Form("fCos8Psi_%d",i));
46     profHisto->SetDirectory(0);
47     defaultList->Add(profHisto);
48   }
49   fInputDefault.Close();
50   oadbCont->AddDefaultObject(defaultList);
51
52
53   TList *list1 = new TList;
54   TFile fInput1("VZERO.EPFlatenning.PS.LHC11h_000169683_p1_muon_ESDs.root");
55   inputList = (TList*)fInput1.Get("coutput");
56   for(Int_t i = 0; i < 8; ++i) {
57     profHisto = (TProfile*)inputList->FindObject(Form("fX2_%d",i))->Clone(Form("fX2_%d",i));
58     profHisto->SetDirectory(0);
59     list1->Add(profHisto);
60     profHisto = (TProfile*)inputList->FindObject(Form("fY2_%d",i))->Clone(Form("fY2_%d",i));
61     profHisto->SetDirectory(0);
62     list1->Add(profHisto);
63     profHisto = (TProfile*)inputList->FindObject(Form("fX2Y2_%d",i))->Clone(Form("fX2Y2_%d",i));
64     profHisto->SetDirectory(0);
65     list1->Add(profHisto);
66     profHisto = (TProfile*)inputList->FindObject(Form("fCos8Psi_%d",i))->Clone(Form("fCos8Psi_%d",i));
67     profHisto->SetDirectory(0);
68     list1->Add(profHisto);
69   }
70   oadbCont->AppendObject(list1, 169683, 169683);
71
72
73   TString oadbFileName = Form("%s/COMMON/EVENTPLANE/data/vzero.root", AliAnalysisManager::GetOADBPath());
74   oadbCont->WriteToFile(oadbFileName.Data());
75 }