]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/src/AliL3FileHandler.h
Moved to the latest version of the HLT code in Bergen.
[u/mrichter/AliRoot.git] / HLT / src / AliL3FileHandler.h
1 // @(#) $Id$
2
3 #ifndef ALIL3FILEHANDLER_H
4 #define ALIL3FILEHANDLER_H
5
6 #include "AliL3MemHandler.h"
7
8 class TClonesArray;
9
10 #include <AliSimDigits.h>
11 #include <AliTPCParam.h>
12 #ifdef use_newio
13 #include <AliRunLoader.h>
14 #endif
15
16 #include <TObject.h>
17 #include <TFile.h>
18 #include <TTree.h>
19
20 class AliL3SpacePointData;
21 class AliL3DigitRowData;
22 class AliL3TrackSegmentData;
23 class AliL3TrackArray;
24
25 class AliL3FileHandler:public AliL3MemHandler{
26
27  protected:
28 #ifdef use_newio
29   AliRunLoader *fInAli;
30 #else
31   TFile *fInAli;
32 #endif
33   AliTPCParam *fParam;
34   virtual Bool_t SetAliInput();
35   AliSimDigits *fDigits;
36
37   TTree *fDigitsTree;
38   FILE *fMC;//!
39   
40   Bool_t fIndexCreated;   //is index created
41   Int_t  fIndex[36][159]; //stores index over digitstree 
42                           //for faster access w/o ASVVERSION
43   Bool_t fUseStaticIndex; //take static index
44   static Bool_t fStaticIndexCreated;   //global index created
45   static Int_t  fStaticIndex[36][159]; //global index
46
47   Bool_t GetDigitsTree(Int_t event);
48   Bool_t CreateIndex();  //create the index
49
50  public:
51   AliL3FileHandler(Bool_t b=kFALSE);
52   ~AliL3FileHandler();
53
54   void FreeDigitsTree();
55   static void CleanStaticIndex();
56   static Int_t SaveStaticIndex(Char_t *prefix=0,Int_t event=0);
57   static Int_t LoadStaticIndex(Char_t *prefix=0,Int_t event=0);
58
59   Bool_t SetAliInput(Char_t *name);
60   Bool_t SetAliInput(TFile *file);
61 #ifdef use_newio
62   Bool_t SetAliInput(AliRunLoader *runLoader);
63 #else
64 #endif
65   void CloseAliInput(); 
66   Bool_t IsDigit(Int_t event);
67   
68   Bool_t SetMCOutput(Char_t *name);
69   Bool_t SetMCOutput(FILE *file);
70   void CloseMCOutput();
71
72   //Digit IO
73   Bool_t AliDigits2Binary(Int_t event=0,Bool_t altro=kFALSE);
74   AliL3DigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event=0); //Allocates Memory
75   AliL3DigitRowData *AliAltroDigits2Memory(UInt_t & nrow,Int_t event=0,Bool_t eventmerge=kFALSE); 
76   //Allocates Memory
77   Bool_t AliDigits2CompBinary(Int_t event=0,Bool_t altro=kFALSE);  
78   void AliDigits2RootFile(AliL3DigitRowData *rowPt,Char_t *new_digitsfile);
79
80   //Point IO
81   Bool_t AliPoints2Binary(Int_t eventn=0);
82   AliL3SpacePointData *AliPoints2Memory(UInt_t & npoint,Int_t eventn=0);//Allocates Memory
83
84   ClassDef(AliL3FileHandler,1)   //Filehandler class
85 };
86
87 #endif