+AliFMDAltroMapping::Hardware2Detector(UInt_t ddl, UInt_t board,
+ UInt_t altro, UInt_t chan,
+ UShort_t& det, Char_t& ring,
+ UShort_t& sec, Short_t& str) const
+{
+ // See also Hardware2Detector that requires 3 inputs
+ det = DDL2Detector(ddl);
+ return Channel2StripBase(board, altro, chan, ring, sec, str);
+}
+
+
+//____________________________________________________________________
+Bool_t
+AliFMDAltroMapping::Hardware2Detector(UInt_t ddl, UInt_t addr,
+ UShort_t& det, Char_t& ring,
+ UShort_t& sec, Short_t& str) const
+{
+ // Translate a hardware address to detector coordinates.
+ //
+ // See also Hardware2Detector that accepts 4 inputs
+ UShort_t board, altro, chan;
+ ChannelAddress(addr, board, altro, chan);
+ return Hardware2Detector(ddl,board, altro, chan, det,ring, sec, str);
+}
+#endif
+
+//____________________________________________________________________
+Bool_t
+AliFMDAltroMapping::Hardware2Detector(UShort_t ddl, UShort_t board,
+ UShort_t altro, UShort_t chan,
+ UShort_t timebin, UShort_t preSamples,
+ UShort_t sampleRate,
+ UShort_t& det, Char_t& ring,
+ UShort_t& sec, Short_t& str,
+ UShort_t& sam) const
+{
+ // Full conversion from hardware address, including timebin number,
+ // to detector coordinates and sample number. Note, that this
+ // conversion depends on the oversampling rate and the number of
+ // pre-samples
+ Short_t baseStrip, stripOffset, tdet = DDL2Detector(ddl);
+ if (tdet < 0) return kFALSE;
+ det = tdet;
+ if (!Channel2StripBase(board, altro, chan, ring, sec, baseStrip))
+ return kFALSE;
+ Timebin2Strip(sec, timebin, preSamples, sampleRate, stripOffset, sam);
+#if 0
+ AliFMDDebug(1, ("0x%x/0x%02x/0x%x/0x%x/%04d -> FMD%d%c[%2d,%3d]-%d "
+ "(pre=%d,rate=%d,base=%3d,off=%3d)",
+ ddl,
+ board,
+ altro,
+ chan,
+ timebin,
+ det,
+ ring,
+ sec,
+ str,
+ sam,
+ preSamples,
+ sampleRate,
+ baseStrip,
+ stripOffset));
+#endif
+ str = baseStrip + stripOffset;
+ return kTRUE;
+}
+
+//____________________________________________________________________
+Bool_t
+AliFMDAltroMapping::Hardware2Detector(UShort_t ddl, UShort_t addr,
+ UShort_t timebin, UShort_t preSamples,
+ UShort_t sampleRate,
+ UShort_t& det, Char_t& ring,
+ UShort_t& sec, Short_t& str,
+ UShort_t& sam) const
+{
+ // Translate a hardware address to detector coordinates.
+ //
+ // See also Hardware2Detector that accepts 4 inputs
+ UShort_t board, altro, chan;
+ ChannelAddress(addr, board, altro, chan);
+ return Hardware2Detector(ddl, board, altro, chan,
+ timebin, preSamples, sampleRate,
+ det, ring, sec, str, sam);
+}
+
+
+//____________________________________________________________________
+Short_t
+AliFMDAltroMapping::Sector2Board(Char_t ring, UShort_t sec) const
+{
+ switch (ring) {
+ case 'I':
+ case 'i':
+ return (sec / 10) * 16;
+ case 'O':
+ case 'o':
+ return (sec / 20) * 16 + 1;
+ }
+ return -1;
+}
+
+//_____________________________________________ _______________________
+Bool_t
+AliFMDAltroMapping::Strip2Channel(Char_t ring, UShort_t sec,
+ UShort_t str, UShort_t& board,
+ UShort_t& altro, UShort_t& chan) const