]> git.uio.no Git - u/mrichter/AliRoot.git/blob - AD/macros/MakeADPMGainsEntry.C
Update master to aliroot
[u/mrichter/AliRoot.git] / AD / macros / MakeADPMGainsEntry.C
1 void MakeADPMGainsEntry(const char *outputCDB = "local://$ALICE_ROOT/../AliRoot/OCDB")
2 {
3
4   AliCDBManager *man = AliCDBManager::Instance();
5   man->SetDefaultStorage(outputCDB);
6
7   // Creation of the PM gains OCDB object
8   Double_t a[16] = {1012, 1203, 1021, 1083, 835, 1067, 1163, 1050,
9                     1033, 1026, 1121, 1135, 1050, 1312, 957, 1013};
10   Double_t b[16] = {7.32, 8.91, 6.05, 6.57, 5.34, 6.64, 8.25, 6.44,
11                     7.24, 6.77, 6.85, 7.67, 4.86, 7.38, 5.48 ,7.13};
12
13   TH2F *gains = new TH2F("ADPMGains", "AD PM gain factors", 16, -0.5, 15.5, 2, -0.5, 1.5);
14   for(Int_t channel = 0; channel < 16; ++channel) {
15     gains->SetBinContent(channel+1,1,a[channel]);
16     gains->SetBinContent(channel+1,2,b[channel]);
17   }
18         
19   AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
20   md->SetResponsible("Michal Broz");
21   md->SetBeamPeriod(0);
22   md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
23   md->SetComment("PM gain factors channel by channel");
24   md->AddDateToComment();
25   md->PrintMetaData();
26
27   AliCDBId id("AD/Calib/PMGains", 0, AliCDBRunRange::Infinity());
28   man->Put(gains, id, md);
29
30   delete md;
31
32 }