]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HBTAN/AliHBTEventBuffer.cxx
Using TMath instead of math.h
[u/mrichter/AliRoot.git] / HBTAN / AliHBTEventBuffer.cxx
1 #include "AliHBTEventBuffer.h"
2
3 ClassImp(AliHBTEventBuffer)
4
5 //______________________________________________________
6 ////////////////////////////////////////////////////////
7 //
8 // class AliHBTEventBuffer
9 //
10 // FIFO type event buffer
11
12 AliHBTEventBuffer::AliHBTEventBuffer():
13  fSize(-1),fEvents(),fIter(&fEvents)
14 {
15   //ctor
16 }
17 /***********************************************************/
18 AliHBTEventBuffer::AliHBTEventBuffer(Int_t size):
19  fSize(size),fEvents(),fIter(&fEvents)
20 {
21   //ctor
22 }
23
24 AliHBTEvent* AliHBTEventBuffer::Push(AliHBTEvent* event)
25 {
26   //adds a new event, and returns old of do not fit in size
27   if (fSize == 0) return event;
28   
29   AliHBTEvent* ret = 0x0;
30   
31   if (fSize == fEvents.GetSize()) 
32     ret = dynamic_cast<AliHBTEvent*>(fEvents.Remove(fEvents.Last()));
33   if (event) fEvents.AddFirst(event);
34   return ret;
35 }
36