+//____________________________________________________________________
+void
+AliFMDAltroMapping::Print(Option_t* option) const
+{
+ //
+ // Print map to standard out
+ //
+ // Parameters:
+ // option Option string (hw, or det)
+ //
+ TString opt(option);
+ opt.ToLower();
+ UShort_t ddl, board, chip, chan, addr;
+ UShort_t det, sec;
+ Short_t strBase;
+ 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;
+ det = DDL2Detector(ddl);
+ while ((board = *(ptr++)) < 32) {
+ for (chip = 0; chip <= 2; chip++) {
+ UShort_t nchan = (chip == 1 ? 8 : 16);
+ for (chan = 0; chan < nchan; chan++) {
+ Channel2StripBase(board, chip, chan, rng, sec, strBase);
+ addr = ChannelAddress(board, chip, chan);
+ 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) << strBase << "]" << 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;
+ ddl = Detector2DDL(det);
+ 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 (strBase = 0; strBase < nstr; strBase += 128) {
+ Strip2Channel(rng, sec, strBase, board, chip, chan);
+ addr = ChannelAddress(board, chip, chan);
+ std::cout << std::setfill(' ') << std::dec << " FMD"
+ << std::setw(1) << det << rng << "["
+ << std::setw(2) << sec << ","
+ << std::setw(3) << strBase << "] | "
+ << 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
+}
+