1 void UpdateEventplaneOADB(TString oadbname, const char* updatename, Int_t runBegin = 0, Int_t runEnd = 0)
4 Bool_t newcont = kFALSE;
6 if (!runBegin || !runEnd) newcont = kTRUE;
9 if (oadbname.Length() > 0.) oadb = TFile::Open(oadbname, "READ");
10 TFile* in = TFile::Open(updatename);
12 AliOADBContainer* cont = 0;
13 if (oadb) cont = (AliOADBContainer*)oadb->Get("FMDphidist");
15 if (newcont) cont = new AliOADBContainer("FMDphidist");
16 else Fatal("Something is wrong. There is no container, but you supplied a runrange...\n");
19 TList* list = (TList*)in->Get("Forward");
20 TList* eplist = (TList*)list->FindObject("fmdEventPlaneFinder");
21 TH1D* hist = (TH1D*) eplist->FindObject("hPhiDist");
24 hist->SetName(Form("%d-%d", runBegin, runEnd));
25 cont->AppendObject(hist, runBegin, runEnd);
28 hist->SetName("Default");
29 cont->AddDefaultObject(hist);
32 TFile* out = TFile::Open("new_fmdEPoadb.root", "RECREATE");
35 cont->WriteToFile("new_fmdEPoadb.root");
37 Printf("Wrote new OADB object to file new_%s, please check that everything is OK and replace the old file", oadbname);
39 out = TFile::Open("new_fmdEPoadb.root");