14bdf14d885ca00729dd3b63217b0d98ddb0a743
[u/mrichter/AliRoot.git] / HBTAN / AliHBTReaderInternal.h
1 #ifndef ALIHBTREADERINTERNAL_H
2 #define ALIHBTREADERINTERNAL_H
3 //_________________________________________________________________________
4 ///////////////////////////////////////////////////////////////////////////
5 //                                                                       //
6 // class AliHBTReaderInternal                                            //
7 //                                                                       //
8 // Multi file reader for Internal Data Format                            //
9 //                                                                       //
10 // This reader reads data created by itself                              //
11 //   (method AliHBTReaderInternal::Write)                                //
12 //                                                                       //
13 // Piotr.Skowronski@cern.ch                                              //
14 // more info: http://alisoft.cern.ch/people/skowron/analyzer/index.html  //
15 //                                                                       //
16 ///////////////////////////////////////////////////////////////////////////
17
18 #include "AliHBTReader.h"
19 #include <TString.h>
20
21 class TFile;
22 class TTree;
23 class TBranch;
24 class TClonesArray;
25
26 class AliHBTReaderInternal: public AliHBTReader
27 {
28   public:
29     AliHBTReaderInternal();
30     AliHBTReaderInternal(const char *filename);
31     AliHBTReaderInternal(TObjArray* dirs, const char *filename);
32     AliHBTReaderInternal(const AliHBTReaderInternal& in);
33     
34     virtual ~AliHBTReaderInternal();
35     
36     AliHBTReaderInternal& operator=(const AliHBTReaderInternal& in);
37     
38     void          Rewind();
39     
40     Bool_t        ReadsTracks() const {return kTRUE;}
41     Bool_t        ReadsParticles() const {return kTRUE;}
42     
43     static Int_t Write(AliHBTReader* reader,const char* outfile = "data.root", Bool_t multcheck = kFALSE);//reads tracks from runs and writes them to file
44     
45   protected:
46     
47     TString       fFileName;//name of the file with tracks
48     TBranch*      fPartBranch;//!branch with particles
49     TBranch*      fTrackBranch;//!branch with tracks
50     TTree*        fTree;//!tree
51     TFile*        fFile;//!file
52     TClonesArray* fPartBuffer;//!buffer array that tree is read to
53     TClonesArray* fTrackBuffer;//!
54         
55     Int_t         ReadNext();//reads next event
56     Int_t         OpenNextFile();//opens file to be read for given event 
57     static Bool_t FindIndex(TClonesArray* arr,Int_t idx);
58     
59     ClassDef(AliHBTReaderInternal,2)
60 };
61 #endif