client server connection improved, interrupt handler for monitor process added
[u/mrichter/AliRoot.git] / HBTAN / AliHBTReader.h
CommitLineData
1b446896 1#ifndef ALIHBTREADER_H
2#define ALIHBTREADER_H
3
2de2e2c6 4#include <TNamed.h>
bed069a4 5#include <TObjArray.h>
1b446896 6
7//Reader Base class (reads particles and tracks and
0fdcc83d 8//puts it to the AliHBTRun objects
1b446896 9//Piotr.Skowronski@cern.ch
10
11class AliHBTRun;
12class AliHBTEvent;
13class AliHBTParticleCut;
1b446896 14class AliHBTParticle;
0fdcc83d 15class TString;
bfb09ece 16class TH1I;
88cb7938 17
2de2e2c6 18class AliHBTReader: public TNamed
1b446896 19{
20 public:
21 AliHBTReader();
0fdcc83d 22 AliHBTReader(TObjArray*);
1b446896 23 virtual ~AliHBTReader();
1b446896 24
bed069a4 25 virtual Int_t Next();
26 virtual void Rewind() = 0;
1b446896 27
bed069a4 28 virtual Bool_t ReadsTracks() const = 0;
29 virtual Bool_t ReadsParticles() const = 0;
4e7d5d5f 30
bed069a4 31 void AddParticleCut(AliHBTParticleCut* cut);
32
33 virtual Int_t Read(AliHBTRun* particles, AliHBTRun *tracks);
34
efaf00f8 35 virtual AliHBTEvent* GetParticleEvent() {return fParticlesEvent;}//can not be const because position randomizer overloads it
36 virtual AliHBTEvent* GetTrackEvent() {return fTracksEvent;}//
bed069a4 37
38 virtual AliHBTEvent* GetParticleEvent(Int_t);
39 virtual AliHBTEvent* GetTrackEvent(Int_t);
40
41 virtual Int_t GetNumberOfPartEvents();
42 virtual Int_t GetNumberOfTrackEvents();
43
44 void SetDirs(TObjArray* dirs){fDirs = dirs;} //sets array directories names
45 void SetEventBuffering(Bool_t flag){fBufferEvents = flag;}
fe1a3526 46 void SetBlend(Bool_t flag = kTRUE){fBlend=flag;}
bed069a4 47 virtual Int_t GetNumberOfDirs() const {return (fDirs)?fDirs->GetEntries():0;}
4f36d7b8 48 void ReadEventsFromTo(Int_t first,Int_t last){fFirst = first; fLast = last;}
f5de2f09 49 virtual TH1I* GetTrackCounter() const {return fTrackCounter;}
50 virtual void WriteTrackCounter() const;
1b446896 51 protected:
52
bed069a4 53 TObjArray* fCuts;//array with particle cuts
54 TObjArray* fDirs;//arry with directories to read data from
55
56 Int_t fCurrentEvent;//! number of current event in current directory
57 Int_t fCurrentDir;//! number of current directory
58
59 Int_t fNEventsRead;//!total
60
61 AliHBTEvent* fTracksEvent; //! tracks read from current event
62 AliHBTEvent* fParticlesEvent; //! particles read from current event
63
64 AliHBTRun* fParticles; //!simulated particles
65 AliHBTRun* fTracks; //!reconstructed tracks (particles)
66
67 Bool_t fIsRead;//!flag indicating if the data are already read
68 Bool_t fBufferEvents;//flag indicating if the data should be bufferred
69
fe1a3526 70 Bool_t fBlend;// flag indicating if randomly change positions of the particles after reading
4f36d7b8 71
72 Int_t fFirst;//first event to return (all are before are skipped)
73 Int_t fLast;//last
bfb09ece 74
75 TH1I* fTrackCounter; //histogram with number of tracks read
4f36d7b8 76
bed069a4 77 virtual Int_t ReadNext() = 0; //this methods reads next event and put result in fTracksEvent and/or fParticlesEvent
1b446896 78 Bool_t Pass(AliHBTParticle*);
79 Bool_t Pass(Int_t pid);
fe1a3526 80 void Blend();
81
0fdcc83d 82 TString& GetDirName(Int_t);
1b446896 83
84 private:
85
86 public:
f5de2f09 87 ClassDef(AliHBTReader,4)//version 2 - TNamed as parental class
fe1a3526 88 //version 3 - Blending added
1b446896 89};
90
91#endif