/*! \file \version $Id: TAGdatFbus.icc,v 1.3 2003/06/22 10:40:02 mueller Exp $ \brief Implementation (inline) of TATOFdatFbus */ //------------------------------------------+----------------------------------- //! Default constructor (optionally with values) inline TATOFdatFbusHit::TATOFdatFbusHit(Int_t i_addr, Int_t i_combo, Float_t f_cal) : fiAddr((Short_t)i_addr), fiRaw((Short_t)i_combo), ffCal(f_cal) {} //------------------------------------------+----------------------------------- //! Destructor. inline TATOFdatFbusHit::~TATOFdatFbusHit() {} //------------------------------------------+----------------------------------- //! Returns packed hardware address of item. inline Int_t TATOFdatFbusHit::Address() const { return fiAddr; } //------------------------------------------+----------------------------------- //! Returns geographical address part of item. inline Int_t TATOFdatFbusHit::GeoAddr() const { return (fiAddr>>7) & 0x001f; } //------------------------------------------+----------------------------------- //! Returns channel address part of item. inline Int_t TATOFdatFbusHit::ChaAddr() const { return fiAddr & 0x007f; } //------------------------------------------+----------------------------------- //! Returns raw converter reading in combo (range,value) format. inline Int_t TATOFdatFbusHit::RawCombo() const { return fiRaw; } //------------------------------------------+----------------------------------- //! Returns range flag of raw converter reading (true if high range). inline Bool_t TATOFdatFbusHit::RawRange() const { return fiRaw & 0x1000; } //------------------------------------------+----------------------------------- //! Returns raw converter reading. inline Int_t TATOFdatFbusHit::RawValue() const { return fiRaw & 0x0fff; } //------------------------------------------+----------------------------------- //! Returns raw converter reading in scaled format (*8 if high range). inline Int_t TATOFdatFbusHit::RawScaled() const { Int_t i_val = RawValue(); if (RawRange()) i_val <<= 3; return i_val; } //------------------------------------------+----------------------------------- //! Returns calibrated converter reading. inline Float_t TATOFdatFbusHit::CalValue() const { return ffCal; } //############################################################################## //------------------------------------------+----------------------------------- //! Returns number of available data items. inline Int_t TATOFdatFbus::NHit() const { return (Int_t) fHit.size(); } //------------------------------------------+----------------------------------- //! Returns number of drop raw data items. inline Int_t TATOFdatFbus::NDrop() const { return fiNDrop; } //------------------------------------------+----------------------------------- //! Read-only access to \a i_ind 'th packed raw data item. inline const TATOFdatFbusHit& TATOFdatFbus::Hit(Int_t i_ind) const { return fHit[i_ind]; } //------------------------------------------+----------------------------------- //! Returns packed hardware address. inline Int_t TATOFdatFbus::PackAddress(Int_t i_g, Int_t i_c) { return (i_g<<7) | i_c; // concatenate i_g (shifted by 7 bits) and i_c - ALF } //------------------------------------------+----------------------------------- //! Extract the geographical address from a packed hardware address. inline Int_t TATOFdatFbus::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 TATOFdatFbus::ChaFromAddress(Int_t i_addr) { return i_addr & 0x007f; // return bits 07:00 } //------------------------------------------+----------------------------------- //! Returns packed converter reading in combo format (range, value). inline Int_t TATOFdatFbus::PackCombo(Bool_t b_ran, Int_t i_val) { Int_t i_combo = i_val; if (b_ran) i_combo |= 0x1000; return i_combo; } //------------------------------------------+----------------------------------- //! Extract range flag from a combo format reading. inline Bool_t TATOFdatFbus::RangeFromCombo(Int_t i_combo) { return i_combo & 0x1000; } //------------------------------------------+----------------------------------- //! Extract value part from a combo format reading. inline Int_t TATOFdatFbus::ValueFromCombo(Int_t i_combo) { return i_combo & 0x0fff; }