/*! \file \version $Id: TAGdatFbus.cxx,v 1.3 2003/06/22 10:40:24 mueller Exp $ \brief Implementation of TATOFdatFbus. */ #include "TString.h" #include "TATOFdatFbus.h" /*! \class TATOFdatFbus TATOFdatFbus.h "TATOFdatFbus.h" \brief Represents MBS FastBus data. ** */ ClassImp(TATOFdatFbus); //------------------------------------------+----------------------------------- //! Default constructor. TATOFdatFbus::TATOFdatFbus() : fiNDrop(0) {} //------------------------------------------+----------------------------------- //! Destructor. TATOFdatFbus::~TATOFdatFbus() {} /*------------------------------------------+---------------------------------*/ //! Add data of one region. void TATOFdatFbus::AddHit(Int_t i_addr, Int_t i_combo, Float_t f_cal) { fHit.push_back(TATOFdatFbusHit(i_addr, i_combo, f_cal)); return; } /*------------------------------------------+---------------------------------*/ //! Set statistics counter. void TATOFdatFbus::SetCounter(Int_t i_ndrop) { fiNDrop = i_ndrop; return; } /*------------------------------------------+---------------------------------*/ //! Clear. void TATOFdatFbus::Clear(Option_t*) { fiNDrop = 0; fHit.clear(); return; } /*------------------------------------------+---------------------------------*/ //! ostream insertion. void TATOFdatFbus::ToStream(ostream& os, Option_t* option) const { Int_t i_nitem = NHit(); os << "TATOFdatFbus" << Form(" nitem=%4d ndrop=%4d", i_nitem, NDrop()) << endl; if (i_nitem == 0) return; os << "geo cha r raw cal" << endl; for (Int_t i = 0; i < i_nitem; i++) { const TATOFdatFbusHit& item = Hit(i); char c_range = (item.RawRange()) ? 'h' : 'l'; os << Form("%3d %3d", item.GeoAddr(), item.ChaAddr()) << Form(" %c %4d", c_range, item.RawValue()) << Form(" %9.3f", item.CalValue()) << endl; } return; }