Script to get # of dead channels from OCDB
[u/mrichter/AliRoot.git] / FMD / scripts / deadChannels.C
CommitLineData
1fae33a8 1void deadChannels(Int_t runnumber){
2
3 TGrid::Connect("alien://",0,0,"t");
4 AliCDBManager* cdb = AliCDBManager::Instance();
5 //cdb->SetDefaultStorage("alien://Folder=/alice/data/2010/OCDB/SHUTTLE/TestShuttle/TestCDB");
6 cdb->SetDefaultStorage("local:///home/canute/ALICE/AliRoot/OCDB/SHUTTLE/TestShuttle/TestCDB");
7 cdb->SetRun(runnumber);
8
9 AliFMDParameters* pars = AliFMDParameters::Instance();
10 pars->Init();
11 Int_t nDead = 0;
12
13 for(UShort_t det=1;det<=3;det++) {
14 Int_t nRings = (det==1 ? 1 : 2);
15 for (UShort_t ir = 0; ir < nRings; ir++) {
16 Char_t ring = (ir == 0 ? 'I' : 'O');
17 UShort_t nsec = (ir == 0 ? 20 : 40);
18 UShort_t nstr = (ir == 0 ? 512 : 256);
19
20 for(UShort_t sec =0; sec < nsec; sec++) {
21
22 for(UShort_t strip = 0; strip < nstr; strip++) {
23
24 if(pars->IsDead(det,ring,sec,strip)) {
25 std::cout<<Form("FMD%d%c[%d,%d] is dead with gain %f and pedestal %f and noise %f",det,ring,sec,strip,pars->GetPulseGain(det,ring,sec,strip),pars->GetPedestal(det,ring,sec,strip),pars->GetPedestalWidth(det,ring,sec,strip) )<<std::endl;
26 nDead++;
27
28 }
29 // if((sec%2 ==0 && strip%128 == 0) || ((strip+1)%128 == 0 && sec%2!=0))
30 // std::cout<<pars->GetPulseGain(det,ring,sec,strip)<<std::endl;
31 }
32 }
33 }
34 }
35
36 Float_t reldead = (Float_t)nDead / 51200.;
37
38 std::cout<<Form("Found %d dead channels or %f percent",nDead,100*reldead)<<std::endl;
39
40}