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