AliRoot Core  edcc906 (edcc906)
PrintBadChannels.C
Go to the documentation of this file.
1 
18 (TString file = "$ALICE_ROOT/OCDB/EMCAL/Calib/Pedestals/Run0_999999999_v0_s0.root"
19 // "alien:///alice/data/2014/OCDB/EMCAL/Calib/Pedestals/Run0_999999999_v1_s0.root"
20 )
21 {
22  if(file.Contains("alien:///"))
23  TGrid::Connect("alien://");
24 
25  TFile * f = TFile::Open(file,"READ");
26 
27  AliCDBEntry * cdb = (AliCDBEntry*) f->Get("AliCDBEntry");
28 
30 
31  TObjArray map = caloped->GetDeadMap();
32  Int_t nHisto = map.GetEntries();
33  AliEMCALGeometry * geom = AliEMCALGeometry::GetInstance("EMCAL_COMPLETE12SMV1_DCAL_8SM");
34 
35  printf ("N SM %d, array size %d\n",geom->GetNumberOfSuperModules(),nHisto);
36 
37  Int_t nbadTotal = 0;
38  Int_t nhotTotal = 0;
39  Int_t nwarmTotal = 0;
40  Int_t ndeadTotal = 0;
41 
42  for(Int_t iSM = 0; iSM < geom->GetNumberOfSuperModules(); iSM ++)
43  {
44  if(iSM >=nHisto || !(TH2D*)map[iSM]))
45  {
46  printf("No entry for SM %d, skip it!\n",iSM);
47  continue;
48  }
49 
50  printf(">>> SM %d <<< Entries %d \n",iSM,((TH2D*)map[iSM])->GetEntries());
51 
52  Int_t nbad = 0;
53  Int_t nhot = 0;
54  Int_t nwarm = 0;
55  Int_t ndead = 0;
56 
57  for(Int_t i = 0; i < ((TH2D*)map[iSM])->GetNbinsX() ; i++)
58  {
59  for(Int_t j = 0; j < ((TH2D*)map[iSM])->GetNbinsY() ; j++)
60  {
61  if(((TH2D*)map[iSM])->GetBinContent(i, j)!=AliCaloCalibPedestal::kAlive)
62  {
63  Int_t id = geom->GetAbsCellIdFromCellIndexes(iSM,j,i);
64  printf("\t Bin (%d-%d) Id %d Content: %d \n",i,j,id,((TH2D*)map[iSM])->GetBinContent(i, j));
65  nbad++;
66  }
67 
68  if(((TH2D*)map[iSM])->GetBinContent(i, j)==AliCaloCalibPedestal::kDead ) ndead++;
69  if(((TH2D*)map[iSM])->GetBinContent(i, j)==AliCaloCalibPedestal::kHot ) nhot ++;
70  if(((TH2D*)map[iSM])->GetBinContent(i, j)==AliCaloCalibPedestal::kWarning) nwarm++;
71  }
72  }
73 
74  printf("Summary : --- dead %d --- hot %d --- warm %d --- bad %d\n",ndead,nhot,nwarm,nbad);
75 
76  nbadTotal += nbad ;
77  nhotTotal += nhot ;
78  ndeadTotal += ndead ;
79  nwarmTotal += nwarm ;
80  }
81 
82 
83  printf("All SM summary : --- dead %d --- hot %d --- warm %d --- bad %d\n",ndeadTotal,nhotTotal,nwarmTotal,nbadTotal);
84 
85  printf("Total BAD %d\n", caloped->GetDeadTowerCount());
86 }
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
TFile * Open(const char *filename, Long64_t &nevents)
Int_t GetAbsCellIdFromCellIndexes(Int_t nSupMod, Int_t iphi, Int_t ieta) const
#define TObjArray
Int_t GetNumberOfSuperModules(void) const
TObject * GetObject()
Definition: AliCDBEntry.h:56
pedestal/bad map monitoring and calibration tools
Definition: AliCDBEntry.h:18
TF1 * f
Definition: interpolTest.C:21
static AliEMCALGeometry * GetInstance()
TEveGeoShape * geom
Definition: tpc_tracks.C:10
void PrintBadChannels(TString file="$ALICE_ROOT/OCDB/EMCAL/Calib/Pedestals/Run0_999999999_v0_s0.root")
EMCal geometry, singleton.