1 void mkOCDB(const Bool_t toGRID=kFALSE, const Bool_t debug=kFALSE)
3 // This script reads PHOS-EMC calibration object from OCDB raw://,
4 // then reads corrections to gains O(1) from local://OCDB_corr
5 // and create the new OCDB object with the new gains as a product of old gains
6 // and gain corrections.
7 // The new calibration object is written either to local://OCDB_new
9 // Gain corrections were found by equalizing the mean cell energy
10 // from the reconstructed data LHC10h by B.Polishchuk
12 // Yuri Kharlov. 7-Feb-2011
15 AliCDBManager::Instance()->SetDefaultStorage("raw://");
17 AliCDBManager::Instance()->SetRun(182724); //LHC12c
18 AliPHOSCalibData db1(182724);
20 TFile fgains("Calibration_pass1.root") ;
23 sprintf(key,"Mass_mod%d",module) ;
24 TH2D * h=(TH2D*)fgains.Get(key) ;
28 for(Int_t module=3; module<4; module++) {
30 for(Int_t ix=48; ix<64; ix++) {
31 for(Int_t iz=28; iz<56; iz++) {
33 Float_t cc_i = db1.GetADCchannelEmc(module+1,iz+1,ix+1);
34 Float_t corr = h->GetBinContent(ix+1,iz+1) ;
35 printf("ix=%d, iz=%d, corr=%f \n",ix,iz,corr) ;
36 printf(" old=%f \n",db1.GetADCchannelEmc(module+1,iz+1,ix+1));
38 db1.SetADCchannelEmc(module+1,iz+1,ix+1,cc_i*corr);
39 printf(" new=%f \n",db1.GetADCchannelEmc(module+1,iz+1,ix+1));
45 //Writing new calibration coefficients (CCs) to OCDB
47 AliCDBManager* cdb = AliCDBManager::Instance();
48 cdb->SetDefaultStorage("local://OCDB");
50 AliCDBMetaData *md= new AliCDBMetaData();
51 md->SetResponsible("Dmitri Peressounko");
52 md->SetComment("PHOS gains calculated from pi0 peak position (LHC12c). Corrected for HV adjustment. Widht 3.8-4.8 MeV");
53 AliCDBId id("PHOS/Calib/EmcGainPedestals",177295,AliCDBRunRange::Infinity());
54 // cdb->Put(&db1,id, md);
55 db1.WriteEmc(177295,AliCDBRunRange::Infinity(),md);