Warnings corrected.
[u/mrichter/AliRoot.git] / TOF / CheckCalibStatus.C
CommitLineData
fceb731d 1CheckCalibStatus(const Char_t *fileName)
2{
3
4 TFile *file = TFile::Open(fileName);
5 AliCDBEntry *cdbe = (AliCDBEntry *)file->Get("AliCDBEntry");
6 AliTOFChannelOnlineStatusArray *array = (AliTOFChannelOnlineStatusArray *)cdbe->GetObject();
7
7c9539dd 8 TH1F *hStatus = new TH1F("hStatus", "Channel status;index;status", array->GetSize(), 0., array->GetSize(););
9 TH2F *hNoiseMap = new TH2F("hNoiseMap", "Noise map;sector;strip", 72, 0., 18., 91, 0., 91.);
10 TH2F *hEnableMap = new TH2F("hEnableMap", "Enable map;sector;strip", 72, 0., 18., 91, 0., 91.);
11
12 AliTOFcalibHisto calib;
13 calib.LoadCalibHisto();
14
15 Int_t sector, sectorStrip, padx, fea;
16 Float_t hitmapx, hitmapy;
17 for (Int_t i = 0; i < array->GetSize(); i++) {
18 hStatus->SetBinContent(i + 1, array->GetStatus(i));
19 sector = calib.GetCalibMap(AliTOFcalibHisto::kSector, i);
20 sectorStrip = calib.GetCalibMap(AliTOFcalibHisto::kSectorStrip, i);
21 padx = calib.GetCalibMap(AliTOFcalibHisto::kPadX, i);
22 fea = padx / 12;
23 hitmapx = sector + ((Double_t)(3 - fea) + 0.5) / 4.;
24 hitmapy = sectorStrip;
25 if (array->GetHWStatus(i) == AliTOFChannelOnlineStatusArray::kTOFHWOk) hEnableMap->Fill(hitmapx, hitmapy);
26 if (array->GetNoiseStatus(i) == AliTOFChannelOnlineStatusArray::kTOFNoiseBad) hNoiseMap->Fill(hitmapx, hitmapy);
27 }
28
29 TFile *fout = TFile::Open("CheckCalibStatus.root", "RECREATE");
30 hStatus->Write();
31 hNoiseMap->Write();
32 hEnableMap->Write();
33 fout->Close();
fceb731d 34
35}