Update timestamps for new AMANDA simulation (17/02/2015)
[u/mrichter/AliRoot.git] / VZERO / MakeVZEROEqualizationFactorsFor2010pp.C
CommitLineData
8a0ecff2 1void MakeVZEROEqualizationFactorsFor2010pp(const char *cdburi = "local://$ALICE_ROOT/OCDB")
2{
3 AliCDBManager *man = AliCDBManager::Instance();
4 man->SetDefaultStorage(cdburi);
5
6 TFile *finput = TFile::Open("../PWGCF/EBYE/BalanceFunctions/VZEROEqualization/pp/CalibrationVZERO.root");
7 const char *periods[4] = {"b","c","d","e"};
8
9 for(Int_t i = 0; i < 4; ++i) {
10 TList *list = (TList*)finput->Get(Form("LHC10%s",periods[i]));
11 TH2F *histo = (TH2F*)list->FindObject("gHistVZEROChannelGainEqualizationMap");
12 for(Int_t j = 1; j <= histo->GetNbinsX(); ++j) {
13 TString str = histo->GetXaxis()->GetBinLabel(j);
14 Int_t runN = str.Atoi();
15 Double_t sum = 0.;
16 for(Int_t k = 0; k < 64; ++k) {
17 sum += histo->GetBinContent(j,k+1);
18 }
19 if (sum < 1e-6) continue;
20 Double_t factors[66];
21 factors[0] = factors[65] = 0.;
22 for(Int_t k = 0; k < 64; ++k) {
23 factors[k+1] = histo->GetBinContent(j,k+1)/sum*64.;
24 }
25
26 TH1F *eqFactors = new TH1F("VZEROEqualizationFactors","VZERO Equalization Factors for 2010 p-p data",64,-0.5,63.5);
27 eqFactors->SetContent(factors);
28
29 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
30 md->SetResponsible("Brigitte Cheynis");
31 md->SetBeamPeriod(0);
32 md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
33 md->SetComment("Entry for VZERO Equalization Factors object (2010 p-p)");
34 md->PrintMetaData();
35
36 AliCDBStorage *storLoc = man->GetDefaultStorage();
37 AliCDBId id("VZERO/Calib/EqualizationFactors",runN,runN);
38
39 storLoc->Put(eqFactors, id, md);
40
41 delete eqFactors;
42 // storLoc->Delete();
43 // delete md;
44 }
45 }
46}