fParticles(0x0),
fTracks(0x0),
fIsRead(kFALSE),
- fBufferEvents(kFALSE)
+ fBufferEvents(kFALSE),
+ fBlend(kFALSE),
+ fFirst(0),
+ fLast(0)
{
//constructor
}
fParticles(0x0),
fTracks(0x0),
fIsRead(kFALSE),
- fBufferEvents(kFALSE)
+ fBufferEvents(kFALSE),
+ fBlend(kFALSE),
+ fFirst(0),
+ fLast(0)
{
//ctor with array of directories to read as parameter
}
Int_t AliHBTReader::Next()
{
//moves to next event
- if ( ReadNext() == kTRUE)
- return kTRUE;
+ if ((fNEventsRead > fLast) && (fLast > 0) )
+
+ do
+ {
+ if ( ReadNext() == kTRUE)
+ return kTRUE;
+ }while (fNEventsRead < fFirst);
if (fBlend) Blend();
if (fBufferEvents)
{
if ( ReadsTracks() && fTracksEvent)
- fTracks->SetEvent(fNEventsRead-1,fTracksEvent);
+ fTracks->SetEvent(fNEventsRead-1-fFirst,fTracksEvent);
if ( ReadsParticles() && fParticlesEvent)
- fParticles->SetEvent(fNEventsRead-1,fParticlesEvent);
+ fParticles->SetEvent(fNEventsRead-1-fFirst,fParticlesEvent);
}
return kFALSE;
}
void SetEventBuffering(Bool_t flag){fBufferEvents = flag;}
void SetBlend(Bool_t flag = kTRUE){fBlend=flag;}
virtual Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;}
+ void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;}
protected:
TObjArray* fCuts;//array with particle cuts
Bool_t fBufferEvents;//flag indicating if the data should be bufferred
Bool_t fBlend;// flag indicating if randomly change positions of the particles after reading
+
+ Int_t fFirst;//first event to return (all are before are skipped)
+ Int_t fLast;//last
+
virtual Int_t ReadNext() = 0; //this methods reads next event and put result in fTracksEvent and/or fParticlesEvent
Bool_t Pass(AliHBTParticle*);
Bool_t Pass(Int_t pid);