18 #if !defined(__CINT__) 19 #include <TControlBar.h> 43 TControlBar *menu =
new TControlBar(
"vertical",
"EMCAL CDB");
44 menu->AddButton(
"Help to run EMCAL CDB",
"Help()",
45 "Explains how to use EMCAL CDS menus");
46 menu->AddButton(
"Equal CC",
"SetCC(0)",
47 "Set equal calibration coefficients");
48 menu->AddButton(
"Random De-calibration",
"SetCC(1)",
49 "Set random decalibration calibration coefficients");
50 menu->AddButton(
"Gaussian De-calibration",
"SetCC(2)",
51 "Set gausian decalibration calibration coefficients");
52 menu->AddButton(
"Read equal CC",
"GetCC(0)",
53 "Read initial equal calibration coefficients");
54 menu->AddButton(
"Read random CC",
"GetCC(1)",
55 "Read random decalibration calibration coefficients");
56 menu->AddButton(
"Read gaussian CC",
"GetCC(2)",
57 "Read gausian decalibration calibration coefficients");
65 "\nSet calibration parameters and write them into ALICE CDB. Press button \"Equal CC\" " 66 " to create equal pedestals and gain factors. Press button \"Decalibrate\" to create random" 67 "pedestals and gain factors to imitate decalibrated detector\n" 90 TString objFormat =
"";
94 DBFolder =
"local://InitCalibDB";
97 objFormat =
"EMCAL initial gain factors and pedestals";
101 DBFolder =
"local://DeCalibDB";
104 objFormat =
"EMCAL random pedestals and ADC gain factors (12x48x24)";
108 DBFolder =
"local://DeCalibDB";
111 objFormat =
"EMCAL random pedestals and gausian ADC gain factors (12x48x24)";
116 Float_t fADCpedestal = 0.000;
117 Float_t fADCchannel = 0.0162;
118 Float_t rDecalibration = 0.02 * fADCchannel;
124 for(Int_t supermodule=0; supermodule < nSMod; supermodule++)
130 for(Int_t column=0; column< nCol; column++)
132 for(Int_t row=0; row< nRow; row++)
143 cc = rn.Uniform(0.00140,0.00160);
148 cc = rn.Gaus(fADCchannel, rDecalibration);
149 ped = rn.Uniform(0.0045,0.0055);
155 cout<<
"Set SM: "<<supermodule<<
" col "<<column<<
" row "<<row
156 <<
" cc "<< cc <<
" ped "<<ped<<endl;
168 AliCDBId id(
"EMCAL/Calib/Data",firstRun,lastRun);
172 loc->
Put(calibda,
id, &md);
188 DBFolder =
"local://InitCalibDB";
190 else if (flag == 1 || flag == 2)
193 DBFolder =
"local:///data/r22b/ALICE/PROD/CALIBRATION_May_2007/PI0/DeCalibDB";
194 TString HOST(gSystem->Getenv(
"HOST"));
195 if(HOST.Contains(
"pc")) {
196 DBFolder =
"local:///eliza5/alice/pavlinov/PROD/CALIBRATION_May_2007/PI0/10GEV/DECALIB/DeCalibDB";
204 ->Get(
"EMCAL/Calib/Data",runNumber)->GetObject());
209 TH2F *hPed[nSMod], *hGain[nSMod], *hGainOnline[nSMod];
210 TH1F *hCCSum =
new TH1F(
"hCCSum",
" CC summary (in MeV) ", 200, 0.0, 20.);
211 TH1F *hCCOnSum =
new TH1F(
"hCCSumOn",
" CC online summary (in MeV) ", 200, 0.0, 20.);
212 TH1F *hPedSum =
new TH1F(
"hPedSum",
" pedestal summary (in MeV) ", 100, 4., 6.);
214 TCanvas *cPed =0, *cGain =0, *cGainOn =0;
215 TCanvas *cPed2=0, *cGain2=0, *cGainOn2=0;
216 TCanvas *cPed3=0, *cGain3=0, *cGainOn3=0;
217 TCanvas *cPed4=0, *cGain4=0, *cGainOn4=0;
221 cPed =
new TCanvas(
"cPed" ,
"Pedestals Mod 0-5" , 10,10,400,800);
222 cGain =
new TCanvas(
"cGain",
"Gain factors Mod 0-5", 410,10,400,800);
223 cGainOn =
new TCanvas(
"cGainOn",
"Gain online factors Mod 0-5", 410,10,400,800);
226 cGainOn ->Divide(2,3);
228 cPed2 =
new TCanvas(
"cPed2",
"Pedestals SMod 6-11", 10,10,400,800);
229 cGain2 =
new TCanvas(
"cGain2",
"Gain factors SMod 6-11", 410,10,400,800);
230 cGainOn2 =
new TCanvas(
"cGainOn2",
"Gain online factors SMod 6-11", 410,10,400,800);
232 cGain2 ->Divide(2,3);
233 cGainOn2->Divide(2,3);
235 cPed3 =
new TCanvas(
"cPed3",
"Pedestals SMod 12-17", 10,10,400,800);
236 cGain3 =
new TCanvas(
"cGain3",
"Gain factors SMod 12-17", 410,10,400,800);
237 cGainOn3 =
new TCanvas(
"cGainOn3",
"Gain online factors SMod 7-17", 410,10,400,800);
239 cGain3 ->Divide(2,3);
240 cGainOn3->Divide(2,3);
242 cPed4 =
new TCanvas(
"cPed4",
"Pedestals SMod 18-21", 10,10,400,400);
243 cGain4 =
new TCanvas(
"cGain4",
"Gain factors SMod 18-21", 410,10,400,800);
244 cGainOn4 =
new TCanvas(
"cGainOn4",
"Gain online factors SMod 18-21", 410,10,400,400);
246 cGain4 ->Divide(2,2);
247 cGainOn4->Divide(2,2);
250 TCanvas *cSum =
new TCanvas(
"cSum" ,
"summary" , 10,10,600,800);
255 for (Int_t supermodule=0; supermodule<nSMod; supermodule++)
265 TString namePed=
"hPed";
266 namePed+=supermodule;
267 TString titlePed=
"Pedestals in supermodule ";
268 titlePed+=supermodule;
269 hPed[supermodule] =
new TH2F(namePed.Data(),titlePed.Data(),
270 nCol,1.,1.*nCol,nRow,1.,1.*nRow);
272 TString nameGain=
"hGain";
273 TString nameGainOnline=
"hGainOnline";
274 nameGain+=supermodule;
275 nameGainOnline+=supermodule;
277 TString titleGain=
"Gain factors in supermodule ";
278 titleGain+=supermodule;
280 TString titleGainOnline=
"Gain online factors in supermodule ";
281 titleGainOnline+=supermodule;
283 hGain [supermodule] =
new TH2F(nameGain.Data(),titleGain.Data(),
284 nCol,1.,1.*nCol,nRow,1.,1.*nRow);
285 hGainOnline[supermodule] =
new TH2F(nameGainOnline.Data(),titleGainOnline.Data(),
286 nCol,1.,1.*nCol,nRow,1.,1.*nRow);
288 for (Int_t column=0; column<nCol; column++)
290 for (Int_t row=0; row<nRow; row++)
297 hPed [supermodule]->SetBinContent(column+1,row+1,ped*1.e+3);
298 hGain [supermodule]->SetBinContent(column+1,row+1,gain*1.e+3);
299 hGainOnline[supermodule]->SetBinContent(column+1,row+1,gain*1.e+3);
301 hPedSum ->Fill(ped *1.e+3);
302 hCCSum ->Fill(gain *1.e+3);
303 hCCOnSum->Fill(gainOn*1.e+3);
309 cout<<
" Fill cc for SM "<< supermodule <<
" nCC "<< nCC << endl;
315 cPed ->cd(supermodule+1);
316 hPed[supermodule]->Draw(
"lego2");
317 cGain->cd(supermodule+1);
318 hGain[supermodule]->Draw(
"lego2");
319 cGainOn->cd(supermodule+1);
320 hGainOnline[supermodule]->Draw(
"lego2");
322 else if(supermodule < 12)
324 cPed2 ->cd(supermodule-5);
325 hPed[supermodule]->Draw(
"lego2");
326 cGain2->cd(supermodule-5);
327 hGain[supermodule]->Draw(
"lego2");
328 cGainOn2->cd(supermodule-5);
329 hGainOnline[supermodule]->Draw(
"lego2");
331 else if(supermodule < 18)
333 cPed3 ->cd(supermodule-11);
334 hPed[supermodule]->Draw(
"lego2");
335 cGain3->cd(supermodule-11);
336 hGain[supermodule]->Draw(
"lego2");
337 cGainOn3->cd(supermodule-11);
338 hGainOnline[supermodule]->Draw(
"lego2");
342 cPed4 ->cd(supermodule-17);
343 hPed[supermodule]->Draw(
"lego2");
344 cGain4->cd(supermodule-17);
345 hGain[supermodule]->Draw(
"lego2");
346 cGainOn4->cd(supermodule-17);
347 hGainOnline[supermodule]->Draw(
"lego2");
351 cout <<
" Get "<<nCC<<
" calibration coeffs"<<endl;
356 hCCSum->SetLineWidth(2);
357 hCCSum->GetFunction(
"gaus")->SetLineColor(2);
361 hPedSum->SetLineWidth(2);
367 cPed ->Print(
"pedestals_SM_0_6.eps");
368 cGain ->Print(
"gains_SM_0_5.eps");
369 cPed2 ->Print(
"pedestals_SM_6_11.eps");
370 cGain2 ->Print(
"gains_SM_6_11.eps");
void SetADCchannel(Int_t module, Int_t column, Int_t row, Float_t value)
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Bool_t Put(TObject *object, AliCDBId &id, AliCDBMetaData *metaData, const char *mirrors="", AliCDBManager::DataType type=AliCDBManager::kPrivate)
static const int fgkEMCALRows
Number of rows per module for EMCAL.
Cell energy calibration factors container class.
void SetADCpedestal(Int_t module, Int_t column, Int_t row, Float_t value)
AliCDBStorage * GetStorage(const char *dbString)
Float_t GetADCchannelOnline(Int_t module, Int_t column, Int_t row) const
static const int fgkEMCALCols
Number of columns per module for EMCAL.
Float_t GetADCchannel(Int_t module, Int_t column, Int_t row) const
static const int fgkEMCALModules
Number of modules, 12 for EMCal + 8 for DCAL.
Float_t GetADCpedestal(Int_t module, Int_t column, Int_t row) const
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
void SetADCchannelOnline(Int_t module, Int_t column, Int_t row, Float_t value)