1 void MakePHOSflat(const Char_t *run = "167915")
4 //Fills PHOS flattening parameters into OADB
5 //Each run-dependent object contains list of 3 objects:
6 //Flattening for TPC, V0A, V0C
7 //Input histograms are read from the file Pi0Flow_*.root
8 // which is the output of the analysis task AliAnalysisTaskPi0Flow
9 // Produced root file should go to
10 //"$ALICE_ROOT/OADB/PHOS/PHOSflat.root"
14 gSystem->Load("libANALYSIS");
15 gSystem->Load("libANALYSISalice");
16 gSystem->Load("libPWGGAPHOSTasks");
19 TFile * f = TFile::Open(Form("Pi0Flow_%s.root",run)) ;
20 TList * l = (TList*)f->Get("PHOSPi0Flow") ;
21 TH2F *h1 = (TH2F*)l->FindObject("phiRP") ;
22 TH2F *h2 = (TH2F*)l->FindObject("phiRPV0A") ;
23 TH2F *h3 = (TH2F*)l->FindObject("phiRPV0C") ;
25 TF1 * flat = new TF1("flat2","[0]*(1.+2.*[1]*cos(x)+2.*[2]*sin(x)+2.*[3]*cos(2.*x)+2.*[4]*sin(2.*x)+2.*[5]*cos(3.*x)+2.*[6]*sin(3.*x)+2.*[7]*cos(4.*x)+2.*[8]*sin(4.*x))",0.,5.) ;
27 TH2D * hTPC = new TH2D("hTPC","TPC EP",20,0.,100.,8,0.,8.) ;
28 TH2D * hV0A = new TH2D("hV0A","V0A EP",20,0.,100.,8,0.,8.) ;
29 TH2D * hV0C = new TH2D("hV0C","V0C EP",20,0.,100.,8,0.,8.) ;
31 Int_t nCent = h1->GetNbinsY();
32 for(Int_t i=1; i<=nCent; i++){
33 TH1D * h1D = h1->ProjectionX("a",i,i) ;
34 if (h1D->Integral() > 0) {
37 for(Int_t j=1; j<9; j++)
38 hTPC->SetBinContent(i,j,flat->GetParameter(j)) ;
42 h1D = h2->ProjectionX("a",i,i) ;
43 if (h1D->Integral() > 0) {
46 for(Int_t j=1; j<9; j++)
47 hV0A->SetBinContent(i,j,flat->GetParameter(j)) ;
51 h1D = h3->ProjectionX("a",i,i) ;
52 if (h1D->Integral() > 0) {
55 for(Int_t j=1; j<9; j++)
56 hV0C->SetBinContent(i,j,flat->GetParameter(j)) ;
61 AliOADBContainer calibContainer("phosFlat");
63 AliPHOSEPFlattener * tpc = new AliPHOSEPFlattener("TPC") ;
64 tpc->SetParameterization(hTPC) ;
65 AliPHOSEPFlattener * v0a = new AliPHOSEPFlattener("V0A") ;
66 v0a->SetParameterization(hV0A) ;
67 AliPHOSEPFlattener * v0c = new AliPHOSEPFlattener("V0C") ;
68 v0c->SetParameterization(hV0C) ;
72 TObjArray * lhc11h = new TObjArray(3);
73 lhc11h->SetName("PHOSflat_LHC11h");
74 lhc11h->AddAt(tpc,0) ; //pass 3 reconstruction
75 lhc11h->AddAt(v0a,1) ; //pass 3 reconstruction
76 lhc11h->AddAt(v0c,2) ; //pass 3 reconstruction
77 calibContainer.AppendObject(lhc11h,167693,170593) ;
79 calibContainer.WriteToFile("PHOSCflat.root");