15 #ifndef FairRingSorter_H_
16 #define FairRingSorter_H_
34 , fLowerBoundPointer(0, 0)
47 virtual double GetBufferSize() {
return fCellWidth * fRingBuffer.size(); }
48 virtual std::vector<FairTimeStamp*>
GetOutputData() {
return fOutputData; }
53 virtual void print(std::ostream& out = std::cout)
55 out <<
"RingSorter: Size " << fRingBuffer.size() <<
" CellWidth: " << fCellWidth <<
"\n";
56 out <<
"LowerBoundPointer at index: " << fLowerBoundPointer.first <<
" Time: " << fLowerBoundPointer.second
59 for (
unsigned int i = 0; i < fRingBuffer.size(); i++) {
60 out << fRingBuffer[i].size() <<
" |";
66 int CalcIndex(
double val);
67 std::vector<std::multimap<double, FairTimeStamp*>> fRingBuffer;
68 std::vector<FairTimeStamp*> fOutputData;
69 std::pair<int, double> fLowerBoundPointer;
virtual void print(std::ostream &out=std::cout)
virtual void WriteOutElement(int index)
writes out the entry at the index and clears it
virtual void WriteOutElements(int index)
writes out the entries from LowerBoundPointer up to index
virtual void AddElement(FairTimeStamp *digi, double timestamp)
FairRingSorter(int size=100, double width=10)
virtual void DeleteOutputData()
virtual double GetBufferSize()
virtual FairTimeStamp * CreateElement(FairTimeStamp *data)
virtual ~FairRingSorter()
virtual std::vector< FairTimeStamp * > GetOutputData()
virtual void WriteOutAll()
virtual void SetLowerBound(double timestampOfHitToWrite)