AliRoot Core  edcc906 (edcc906)
FullMapping.C
Go to the documentation of this file.
1 #include <iomanip>
2 
3 void
5 {
6  AliGeomManager::LoadGeometry("geometry.root");
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 
virtual void InitTransformations(Bool_t force=kFALSE)
Short_t DDL2Detector(UInt_t ddl) const
This class is a singleton that handles various parameters of the FMD detectors. This class reads from...
AliFMDAltroMapping * GetAltroMap() const
Singleton object of FMD geometry descriptions and parameters. This class is a singleton that handles ...
Bool_t Channel2StripBase(UShort_t board, UShort_t altro, UShort_t chan, Char_t &ring, UShort_t &sec, Short_t &str) const
Class that encodes a map to/from ALTRO hardware address to FMD detector coordinates.
static AliFMDParameters * Instance()
void Detector2XYZ(UShort_t detector, Char_t ring, UShort_t sector, UShort_t strip, Double_t &x, Double_t &y, Double_t &z) const
virtual void Init()
void SetRun(Int_t run)
void SetDefaultStorage(const char *dbString)
void FullMapping()
Definition: FullMapping.C:4
static AliCDBManager * Instance(TMap *entryCache=NULL, Int_t run=-1)
TEveGeoShape * geom
Definition: tpc_tracks.C:10
static AliFMDGeometry * Instance()
static void LoadGeometry(const char *geomFileName=NULL)
UShort_t Init(Bool_t forceReInit=kFALSE, UInt_t what=kAll)