26 #include "StEStructBuffer.h"
27 #include "StEStructPool/EventMaker/StEStructEvent.h"
28 #include "StEStructMaxB.h"
31 StEStructBuffer::StEStructBuffer(){
33 mnumEvents=mnumDeleted=mnumInput=0;
35 for(
int i=0;i<=MAXBUFFERSIZE;i++)mEvent[i]=NULL;
41 StEStructBuffer::~StEStructBuffer(){
43 for(
int i=0;i<=mnumEvents;i++)
delete mEvent[i];
51 if(mnumEvents==MAXBUFFERSIZE-1){
52 if(mEvent[mnumEvents]){
53 delete mEvent[mnumEvents];
54 mEvent[mnumEvents]=NULL;
61 for(
int i=mnumEvents;i>0;i--)mEvent[i]=mEvent[i-1];
71 if(mnumMixed==_MAXEBYEBUFFER_)
return NULL;
73 while(mEvent[mcurEvent]) {
74 if(abs(mult - mEvent[mcurEvent]->Ntrack()) <= DELTANMAX)
break;
76 if(mcurEvent>MAXBUFFERSIZE) cout <<
" *** ERROR ***: BUFFER OVERFLOW" << endl;
79 return mEvent[mcurEvent];
84 void StEStructBuffer::Print(){
85 for(
int i=0;i<=MAXBUFFERSIZE;i++) {
86 if (mEvent[i]) cout << i <<
": " << mEvent[i]->Ntrack() <<
"\t";
87 else cout << i <<
": NULL" <<
"\t";