/** * @file * @author Christian Simon * @since 2017-08-07 */ #ifndef CBMDAQPOINTBUFFER_H #define CBMDAQPOINTBUFFER_H 1 #include #include #include #include "CbmDefs.h" class FairMCPoint; /** * @brief ... * @author Christian Simon * @since 2017-08-07 * @version 1.0 * @details ... */ class CbmDaqPointBuffer { public: /** Destructor **/ ~CbmDaqPointBuffer(); /** Removes all points from the beginning to the current position of the ** iterator (all those accessed by GetNextData before). **/ void Clear(); /** Time of first data for all detectors ** @return time of first data [ns] **/ Double_t GetFirstTime() const; /** Time of first data for a given detector ** @param iDet detector type (e.g. kSTS) ** @return time of first data [ns] */ Double_t GetFirstTime(Int_t iDet) const; /** Time of last data for all detectors ** @return time of last data [ns] **/ Double_t GetLastTime() const; /** Time of last data for a given detector ** @param iDet detector type (e.g. kSTS) ** @return time of last data [ns] */ Double_t GetLastTime(Int_t iDet) const; /** Pointer to next MC point object for a given detector ** @param iDet detector type (ECbmModuleId) ** @return pointer to MC point object **/ FairMCPoint* GetNextData(Int_t iDet); /** Pointer to next MC point object for a given detector ** up to given time ** @param iDet detector type (e.g. kSTS) ** @param time maximal time [ns] ** @return pointer to MC point object **/ FairMCPoint* GetNextData(Int_t iDet, Double_t time); /** Current buffer size ** @return number of objects in buffer */ Int_t GetSize() const; /** Current buffer size for given detector ** @param det Detector system (e.g. kSTS) ** @return number of objects in buffer */ Int_t GetSize(Int_t det) const; /** Insert data into the buffer ** @param point pointer to data object to be inserted **/ void InsertData(Int_t iDet, FairMCPoint* point); /** Access to singleton instance ** @return pointer to instance **/ static CbmDaqPointBuffer* Instance(); /** Print buffer status **/ void PrintStatus() const; /** Status string **/ std::string ToString() const; private: /** Buffer management **/ std::multimap fData[kNofSystems]; /** Pointer to singleton instance **/ static CbmDaqPointBuffer* fgInstance; /** Default constructor ** Declared private to prevent instantiation. **/ CbmDaqPointBuffer(); /** Copy constructor. Defined private to prevent usage. **/ CbmDaqPointBuffer(const CbmDaqPointBuffer&); /** Assignment operator. Defined private to prevent usage. **/ CbmDaqPointBuffer& operator=(const CbmDaqPointBuffer&); }; #endif