corrected TRD/TOF MV position
[u/mrichter/AliRoot.git] / TOF / CheckProblematic.C
CommitLineData
8da43270 1CheckProblematic(Int_t run, const Char_t *dbString = "raw://")
2{
3
4 TGrid::Connect("alien");
5 AliCDBManager *cdb = AliCDBManager::Instance();
6 cdb->SetDefaultStorage(dbString);
7 cdb->SetRun(run);
8 AliCDBEntry *cdbe = cdb->Get("TOF/Calib/Problematic");
9 CheckProblematic(cdbe);
10
11}
12
13CheckProblematic(const Char_t *fileName)
14{
15
16 TFile *file = TFile::Open(fileName);
17 AliCDBEntry *cdbe = (AliCDBEntry *)file->Get("AliCDBEntry");
18 CheckProblematic(cdbe);
19}
20
21CheckProblematic(AliCDBEntry *cdbe)
22{
23
24 if (!cdbe) {
25 printf("invalid CDB entry\n");
26 return;
27 }
28
29 TH1C *data = (TH1C *)cdbe->GetObject();
30
31 TH2F *hProblematicMap = new TH2F("hProblematicMap", "Problematic map;sector;strip", 72, 0., 18., 91, 0., 91.);
32
33 AliTOFcalibHisto calib;
34 calib.LoadCalibHisto();
35 calib.LoadCalibStat(); /* temp */
36
37 Int_t sector, sectorStrip, padx, fea;
38 Float_t efficiency, hitmapx, hitmapy;
39 for (Int_t i = 0; i < data->GetNbinsX(); i++) {
40 if (data->GetBinContent(i + 1) == 0) continue;
41 sector = calib.GetCalibMap(AliTOFcalibHisto::kSector, i);
42 sectorStrip = calib.GetCalibMap(AliTOFcalibHisto::kSectorStrip, i);
43 padx = calib.GetCalibMap(AliTOFcalibHisto::kPadX, i);
44 fea = padx / 12;
45 hitmapx = sector + ((Double_t)(3 - fea) + 0.5) / 4.;
46 hitmapy = sectorStrip;
47
48 hProblematicMap->Fill(hitmapx, hitmapy);
49 }
50
51 hProblematicMap->DrawCopy("colz");
52 TFile *fout = TFile::Open("CheckProblematic.root", "RECREATE");
53 hProblematicMap->Write();
54 fout->Close();
55
56}