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