]> git.uio.no Git - u/mrichter/AliRoot.git/blob - FMD/scripts/FullMapping.C
Script to get # of dead channels from OCDB
[u/mrichter/AliRoot.git] / FMD / scripts / FullMapping.C
1 #include <iomanip>
2
3 void
4 FullMapping()
5 {
6   AliGeomManager::LoadGeometry("geometry.root");
7   AliCDBManager*    cdb   = AliCDBManager::Instance();
8   AliFMDParameters* param = AliFMDParameters::Instance();
9   AliFMDGeometry*   geom  = AliFMDGeometry::Instance();
10   cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
11   cdb->SetRun(0);
12   param->Init();
13   geom->Init();
14   geom->InitTransformations();
15   AliFMDAltroMapping* map = param->GetAltroMap();
16
17   std::ostream& out = cerr;
18   
19   out << "  DDL | Board | Altro | Channel |"
20       << " Detector | Ring | Sector | Base-Strip |  Phi |"
21       << "    X    |    Y    |    Z    " << std::endl;
22   for (UShort_t ddl = 0; ddl < 3; ddl++) { 
23     out << "------+-------+-------+---------+"
24         << "----------+------+--------+------------+------+"
25         << "---------+---------+---------" << std::endl;
26     for (UShort_t ib = 0; ib < 4; ib++) { 
27       if (ddl == 0 && (ib == 1 || ib == 3)) continue;
28       UShort_t board = ib + (ib < 0x2 ? 0 : 0x10-2);
29       for (UShort_t altro = 0; altro < 3; altro++) { 
30         UShort_t nCh = (altro == 1 ? 8 : 16);
31         for (UShort_t chan = 0; chan < nCh; chan++) { 
32           UShort_t det, sec;
33           Short_t baseStr;
34           Char_t  ring;
35           det = map->DDL2Detector(ddl);
36           if (!map->Channel2StripBase(board, altro, chan, ring, sec, baseStr))
37             continue;
38           
39           Double_t x, y, z;
40           geom->Detector2XYZ(det, ring, sec, baseStr, x, y, z);
41
42           Double_t phi = TMath::ATan2(y,x) * 180 / TMath::Pi();
43           if (phi < 0) phi += 360;
44           
45           out << " " << std::setprecision(4)
46               << std::setw(4)  << (3072) + ddl << " | " 
47               << std::setw(5)  << board   << " | " 
48               << std::setw(5)  << altro   << " | " 
49               << std::setw(7)  << chan    << " | " 
50               << std::setw(8)  << det     << " | " 
51               << std::setw(4)  << ring    << " | " 
52               << std::setw(6)  << sec     << " | " 
53               << std::setw(10) << baseStr << " | " 
54               << std::setw(4)  << phi     << " | " 
55               << std::setw(7)  << x       << " | " 
56               << std::setw(7)  << y       << " | " 
57               << std::setw(7)  << z       << std::endl;
58         } // Chan
59       } // Altro
60     } // Board 
61   } // DDL
62 }
63
64   
65     
66       
67         
68           
69           
70           
71           
72