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