/** @file CbmStsDigi.h ** @author V.Friese ** @since 28.08.2006 ** @version 6 **/ #ifndef CBMSTSDIGI_H #define CBMSTSDIGI_H 1 #include "CbmDefs.h" #include "CbmDigi.h" #include #include /** @class CbmStsDigi ** @brief Data class for a single-channel message in the STS ** ** The CbmStsDigi is the ROOT representation of the smallest information ** unit delivered by the CBM-STS by a single readout channel. It carries ** the channel address, the measurement time and the digitised charge ** as information. **/ class CbmStsDigi : public CbmDigi { public: /** Default constructor **/ CbmStsDigi() : CbmDigi(), fTime(0), fAddress(0), fChannel(0), fCharge(0) { } /** Standard constructor ** @param address Unique element address ** @param time Measurement time [ns] ** @param charge Charge [ADC units] **/ CbmStsDigi(Int_t address, Int_t channel, ULong64_t time, UShort_t charge) : CbmDigi(), fTime(time), fAddress(address), fChannel(channel), fCharge(charge) { } /** Destructor **/ virtual ~CbmStsDigi() { }; /** Unique detector element address (see CbmStsAddress) ** @value Unique address of readout channel **/ virtual Int_t GetAddress() const { return fAddress; } /** @brief Channel number in module ** @value Channel number **/ UShort_t GetChannel() const { return fChannel; } /** Charge ** @value Charge [ADC units] **/ virtual Double_t GetCharge() const { return Double_t(fCharge); } /** System ID ** @return System identifier (EcbmModuleId) **/ virtual Int_t GetSystemId() const { return kSts; } /** System ID (static) ** @return System identifier (EcbmModuleId) **/ static Int_t GetSystem() { return kSts; } /** Time of measurement ** @value Time [ns] **/ virtual Double_t GetTime() const { return Double_t(fTime); } template void serialize(Archive& ar, const unsigned int /*version*/) { ar& fTime; ar& fAddress; ar& fChannel; ar& fCharge; } /** String output **/ virtual std::string ToString() const; private: friend class boost::serialization::access; Long64_t fTime; ///< Time [ns] Int_t fAddress; ///< Unique element address UShort_t fChannel; ///< Channel number UShort_t fCharge; ///< Charge [ADC units] ClassDef(CbmStsDigi, 6); }; #endif