//------------------------------------------+----------------------------------- //! Default constructor. inline TATOFparMapAddr::TATOFparMapAddr() : fiSlat(0), fiType(0) {} //------------------------------------------+----------------------------------- //! Set all attributes inline void TATOFparMapAddr::SetData(Int_t i_slat, Int_t i_type) { fiSlat = i_slat; fiType = i_type; return; } //------------------------------------------+----------------------------------- //! Returns slat number associated with hardware address. inline Int_t TATOFparMapAddr::Slat() const { return fiSlat; } //------------------------------------------+----------------------------------- //! Returns value type associated with hardware address. inline Int_t TATOFparMapAddr::Type() const { return fiType; } //############################################################################## //------------------------------------------+----------------------------------- //! Default constructor. inline TATOFparMapSlat::TATOFparMapSlat() : fiType(0), fiPackId(0), fiSlatId(0), fiAddrAdct(0), fiAddrAdcb(0), fiAddrTdct(0), fiAddrTdcb(0), fiThisLeft(0), fiThisRight(0), fiOtherLeft(0), fiOtherRight(0) {} //------------------------------------------+----------------------------------- //! Set all attributes. inline void TATOFparMapSlat::SetData(Int_t i_type, Int_t i_packid, Int_t i_slatid, Int_t i_adct, Int_t i_adcb, Int_t i_tdct, Int_t i_tdcb, Int_t i_thisleft, Int_t i_thisright, Int_t i_otherleft, Int_t i_otherright) { fiType = i_type; fiPackId = i_packid; fiSlatId = i_slatid; fiAddrAdct = i_adct; fiAddrAdcb = i_adcb; fiAddrTdct = i_tdct; fiAddrTdcb = i_tdcb; fiThisLeft = i_thisleft; fiThisRight = i_thisright; fiOtherLeft = i_otherleft; fiOtherRight = i_otherright; return; } //------------------------------------------+----------------------------------- //! Returns slat type. inline Int_t TATOFparMapSlat::Type() const { return fiType; } //------------------------------------------+----------------------------------- //! Returns the 8pack number. inline Int_t TATOFparMapSlat::PackId() const { return fiPackId; } //------------------------------------------+----------------------------------- //! Returns the slat position in the 8pack number. inline Int_t TATOFparMapSlat::SlatId() const { return fiSlatId; } //------------------------------------------+----------------------------------- //! Returns hardware address of the top ADC. inline Int_t TATOFparMapSlat::AddressAdct() const { return fiAddrAdct; } //------------------------------------------+----------------------------------- //! Returns hardware address of the bot ADC. inline Int_t TATOFparMapSlat::AddressAdcb() const { return fiAddrAdcb; } //------------------------------------------+----------------------------------- //! Returns hardware address of the top TDC. inline Int_t TATOFparMapSlat::AddressTdct() const { return fiAddrTdct; } //------------------------------------------+----------------------------------- //! Returns hardware address of the bot TDC. inline Int_t TATOFparMapSlat::AddressTdcb() const { return fiAddrTdcb; } //------------------------------------------+----------------------------------- //! Returns slat number of left neighbor in plane. inline Int_t TATOFparMapSlat::NeighborThisLeft() const { return fiThisLeft; } //------------------------------------------+----------------------------------- //! Returns slat number of right neighbor in plane. inline Int_t TATOFparMapSlat::NeighborThisRight() const { return fiThisRight; } //------------------------------------------+----------------------------------- //! Returns slat number of left neighbor in other plane. inline Int_t TATOFparMapSlat::NeighborOtherLeft() const { return fiOtherLeft; } //------------------------------------------+----------------------------------- //! Returns slat number of right neighbor in other plane. inline Int_t TATOFparMapSlat::NeighborOtherRight() const { return fiOtherRight; } //############################################################################## //------------------------------------------+----------------------------------- //! Returns the highest effective hardware address. inline Int_t TATOFparMap::MaxAddress() const { return (Int_t) fAddrInfo.size()-1; } //------------------------------------------+----------------------------------- //! Returns the highest mapped slat number. inline Int_t TATOFparMap::MaxSlat() const { return (Int_t) fSlatInfo.size()-1; } //------------------------------------------+----------------------------------- //! Access mapping info. inline const TATOFparMapAddr& TATOFparMap::AddrInfo(Int_t i_addr) const { printf("i_addr=%d - slat=%d\n",i_addr,fAddrInfo[i_addr].Slat());// test return fAddrInfo[i_addr]; } //------------------------------------------+----------------------------------- //! Access slat info. inline const TATOFparMapSlat& TATOFparMap::SlatInfo(Int_t i_slat) const { return fSlatInfo[i_slat]; } //------------------------------------------+----------------------------------- //! Returns packed hardware address. inline Int_t TATOFparMap::PackAddress(Int_t i_g, Int_t i_c) { return (i_g<<7) | i_c; // i_g increased by 7 bits + i_c } //------------------------------------------+----------------------------------- //! Extract the geographical address from a packed hardware address. inline Int_t TATOFparMap::GeoFromAddress(Int_t i_addr) { return (i_addr>>7) & 0x001f; // return bits 11:07 } //------------------------------------------+----------------------------------- //! Extract the channel number from a packed hardware address. inline Int_t TATOFparMap::ChaFromAddress(Int_t i_addr) { return i_addr & 0x007f; // return bits 07:00 }