+//____________________________________________________________________
+void
+AliFMDAltroMapping::Print(Option_t* option) const
+{
+ TString opt(option);
+ opt.ToLower();
+ UInt_t ddl, board, chip, chan, addr;
+ UShort_t det, sec, str;
+ Char_t rng;
+
+ if (opt.Contains("hw") || opt.Contains("hardware")) {
+ std::cout << " DDL | Board | Chip | Chan | Address | Detector\n"
+ << "=====+=======+======+======+=========+==============="
+ << std::endl;
+ for (ddl = 0; ddl <= 2; ddl++) {
+ Int_t boards[] = { 0, 16, (ddl == 0 ? 32 : 1), 17, 32};
+ Int_t* ptr = boards;
+ while ((board = *(ptr++)) < 32) {
+ for (chip = 0; chip <= 2; chip++) {
+ UInt_t nchan = (chip == 1 ? 8 : 16);
+ for (chan = 0; chan < nchan; chan++) {
+ Hardware2Detector(ddl, board, chip, chan, det, rng, sec, str);
+ addr = ((board & 0x1f) << 7) | ((chip & 0x7) << 4) | (chan & 0xf);
+ std::cout << " "
+ << std::setw(3) << ddl << " | "
+ << std::setfill('0') << std::hex << " 0x"
+ << std::setw(2) << board << " | 0x"
+ << std::setw(1) << chip << " | 0x"
+ << std::setw(1) << chan << " | 0x"
+ << std::setw(3) << addr << " | "
+ << std::setfill(' ') << std::dec << " FMD"
+ << std::setw(1) << det << rng << "["
+ << std::setw(2) << sec << "," << std::setw(3) << str
+ << "]" << std::endl;
+ } // for chan ...
+ if (chip == 2 && *ptr >= 32) continue;
+ std::cout << " + + + + + "
+ << std::endl;
+ } // for chip ...
+ } // while board
+ std::cout << "-----+-------+------+------+---------+---------------"
+ << std::endl;
+ } // for ddl ...
+ } // if hw
+ if (opt.Contains("det")) {
+ std::cout << " Detector | DDL | Board | Chip | Chan | Address\n"
+ << "===============+=====+=======+======+======+========"
+ << std::endl;
+ for (det = 1; det <= 3; det++) {
+ Char_t rings[] = { 'I', (det == 1 ? '\0' : 'O'),'\0' };
+ Char_t* ptr = rings;
+ while ((rng = *(ptr++)) != '\0') {
+ UShort_t nsec = (rng == 'I' ? 20 : 40);
+ UShort_t nstr = (rng == 'I' ? 512 : 256);
+ for (sec = 0; sec < nsec; sec++) {
+ for (str = 0; str < nstr; str += 128) {
+ ddl = board = chip = chan;
+ Detector2Hardware(det,rng,sec,str,ddl,board,chip,chan);
+ addr = ((board & 0x1f) << 7) | ((chip & 0x7) << 4) | (chan & 0xf);
+ std::cout << std::setfill(' ') << std::dec << " FMD"
+ << std::setw(1) << det << rng << "["
+ << std::setw(2) << sec << ","
+ << std::setw(3) << str << "] | "
+ << std::setw(3) << ddl << " | 0x"
+ << std::setfill('0') << std::hex
+ << std::setw(2) << board << " | 0x"
+ << std::setw(1) << chip << " | 0x"
+ << std::setw(1) << chan << " | 0x"
+ << std::setw(3) << addr << std::endl;
+ } // for str ...
+ } // for sec ...
+ if (*ptr == '\0') continue;
+ std::cout << " + + + + + "
+ << std::endl;
+ } // while rng ...
+ std::cout << "---------------+-----+-------+------+------+--------"
+ << std::endl;
+
+ } // for det ...
+ } // if det
+}
+