First implementation of EMCAL trigger QA from Nicola Arbor
[u/mrichter/AliRoot.git] / TOF / CheckEnabledChannels.C
CommitLineData
b96f0fec 1CheckEnabledChannels(Int_t run, Bool_t checkROEff = kTRUE, const Char_t *dbString = "raw://")
8da43270 2{
3
4 /* init */
5 AliCDBManager *cdb = AliCDBManager::Instance();
6 cdb->SetDefaultStorage(dbString);
7 cdb->SetRun(run);
8 AliTOFcalib calib;
9 calib.Init();
10
11 TH2F *hEnabledMap = new TH2F("hEnabledMap", "Enabled channel map;sector;strip", 72, 0., 18., 91, 0., 91.);
4bb3ae29 12 TH1F *hEnabledFlag = new TH1F("hEnabledFlag", "Enabled channel flag;index;flag", 157248, 0., 157248.);
8da43270 13
14 AliTOFcalibHisto calibhisto;
15 calibhisto.LoadCalibHisto();
16 calibhisto.LoadCalibStat(); /* temp */
17
18 Int_t sector, sectorStrip, padx, fea;
19 Float_t hitmapx, hitmapy;
20 /* loop over channels */
21 for (Int_t ich = 0; ich < 157248; ich++) {
b96f0fec 22 if (!calib.IsChannelEnabled(ich, checkROEff)) continue;
8da43270 23 sector = calibhisto.GetCalibMap(AliTOFcalibHisto::kSector, ich);
24 sectorStrip = calibhisto.GetCalibMap(AliTOFcalibHisto::kSectorStrip, ich);
25 padx = calibhisto.GetCalibMap(AliTOFcalibHisto::kPadX, ich);
26 fea = padx / 12;
27 hitmapx = sector + ((Double_t)(3 - fea) + 0.5) / 4.;
28 hitmapy = sectorStrip;
29 hEnabledMap->Fill(hitmapx, hitmapy);
4bb3ae29 30 hEnabledFlag->SetBinContent(ich + 1, 1);
8da43270 31 }
32
33 hEnabledMap->DrawCopy("colz");
34 TFile *fileout = TFile::Open("CheckEnabledChannels.root", "RECREATE");
35 hEnabledMap->Write();
4bb3ae29 36 hEnabledFlag->Write();
8da43270 37 fileout->Close();
38
39}