2 // Original: AliHLTFileHandler.h,v 1.19 2004/06/11 16:06:33 loizides
4 #ifndef ALIHLTTPCFILEHANDLER_H
5 #define ALIHLTTPCFILEHANDLER_H
6 /* This file is property of and copyright by the ALICE HLT Project *
7 * ALICE Experiment at CERN, All rights reserved. *
8 * See cxx source for full Copyright notice */
10 /** @file AliHLTTPCFileHandler.h
11 @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by
14 @brief file input for the TPC tracking code before migration to the
15 HLT component framework
17 // see below for class documentation
19 // refer to README to build package
21 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
23 #include "AliHLTTPCMemHandler.h"
29 #include <AliRunLoader.h>
35 class AliHLTTPCSpacePointData;
36 class AliHLTTPCDigitRowData;
37 class AliHLTTPCTrackSegmentData;
38 class AliHLTTPCTrackArray;
41 * class AliHLTTPCFileHandler
42 * This is the input interface class for the TPC tracking code before conversion to
43 * the HLT component framework.
46 class AliHLTTPCFileHandler:public AliHLTTPCMemHandler {
49 /** standard constructor */
50 AliHLTTPCFileHandler(Bool_t b=kFALSE);
52 virtual ~AliHLTTPCFileHandler();
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);
59 Bool_t SetAliInput(Char_t *name);
60 Bool_t SetAliInput(AliRunLoader *runLoader);
62 Bool_t IsDigit(Int_t event);
64 Bool_t SetMCOutput(Char_t *name);
65 Bool_t SetMCOutput(FILE *file);
71 * Write AliDigits from AliRoot file to binary file.
72 * @param event event no
73 * @param altro use @ref AliDigits2Memory if kFALSE and @ref
74 * AliDigits2Memory if kTRUE
76 * Calls the @ref AliHLTTPCMemHandler::Memory2BinaryFile to write the file.
78 Bool_t AliDigits2BinaryFile(Int_t event=0,Bool_t altro=kFALSE);
81 * Convert AliDigits from AliRoot file to HLT Digit data in memory.
82 * Read and convert/write digits to memory buffer. If no target buffer available,
83 * an appropriate buffer is allocated.<br>
84 * If the variable pTgtSize is prvided, the total size of the result array is
85 * returned. \b Note: the total size differs as the @ref AliHLTTPCDigitRowData
86 * structs are variable in size depending on the no of digits for that particular
88 * @param nrow [OUT] number of rows
89 * @param event the event no
90 * @param tgtBuffer target buffer (optional)
91 * @param pTgtSize size of target buffer (optional)
92 * @return pointer to array, size in nrow <br>
93 * NULL in case of failure, required size in pTgtSize
95 //TODO: Check that the following change works. It should, but just double check.
96 AliHLTTPCDigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event, Byte_t* tgtBuffer, UInt_t* pTgtSize=NULL);
98 AliHLTTPCDigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event=0)
100 return AliDigits2Memory(nrow, event, NULL, NULL);
104 * Convert and filter AliDigits from AliRoot file to HLT Digit data in memory.
105 * This functions is the same as @ref AliDigits2Memory but in addition it
106 * filters out single timebins, which is noise. The timebins which
107 * are removed are timebins which have the 4 zero neighbours;
108 * (pad-1,time),(pad+1,time),(pad,time-1),(pad,time+1).
110 * This is legacy code, the two functions contain big portions of identical code
112 * See @ref AliDigits2Memory for detailed description.
114 AliHLTTPCDigitRowData *AliAltroDigits2Memory(UInt_t & nrow,Int_t event=0,Bool_t eventmerge=kFALSE);
117 * Convert AliDigits from AliRoot file to Altro data format in memory.
119 int AliDigits2Altro(Int_t event, Byte_t* tgtBuffer, UInt_t size);
122 * Write AliDigits from AliRoot file to binary file.
123 * @param event event no
124 * @param altro use @ref AliDigits2Memory if kFALSE and @ref
125 * AliDigits2Memory if kTRUE
127 * \b Note: pretty much the same as @ref AliDigits2BinaryFile.
128 * Calls the @ref AliHLTTPCMemHandler::Memory2CompBinary to write the file.
130 Bool_t AliDigits2CompBinary(Int_t event=0,Bool_t altro=kFALSE);
133 * Write the data stored in rowPt, into a new AliROOT file.
134 * The data is stored in the AliROOT format
135 * This is specially a nice thing if you have modified data, and wants to run it
136 * through the offline reconstruction chain.
137 * The arguments is a pointer to the data, and the name of the new AliROOT file.
138 * Remember to pass the original AliROOT file (the one that contains the original
139 * simulated data) to this object, in order to retrieve the MC id's of the digits.
141 void AliDigits2RootFile(AliHLTTPCDigitRowData *rowPt,Char_t *newDigitsfile);
144 Bool_t AliPoints2Binary(Int_t eventn=0);
145 AliHLTTPCSpacePointData *AliPoints2Memory(UInt_t & npoint,Int_t eventn=0);//Allocates Memory
148 AliRunLoader *fInAli;//!
149 Bool_t fUseRunLoader; //use runloader
151 AliTPCParam *fParam;//!
152 AliSimDigits *fDigits;//!
154 TTree *fDigitsTree;//!
157 Bool_t fIndexCreated; //is index created
158 Int_t fIndex[fgkNSlice][fgkNRow]; //stores index over digitstree
159 //for faster access w/o ASVVERSION
160 Bool_t fUseStaticIndex; //take static index
161 static Bool_t fgStaticIndexCreated; //global index created
162 static Int_t fgStaticIndex[fgkNSlice][fgkNRow]; //global index
164 virtual Bool_t SetAliInput();
165 Bool_t GetDigitsTree(Int_t event);
166 Bool_t CreateIndex(); //create the index
169 /** copy constructor prohibited */
170 AliHLTTPCFileHandler(const AliHLTTPCFileHandler&);
171 /** assignment operator prohibited */
172 AliHLTTPCFileHandler& operator=(const AliHLTTPCFileHandler&);
174 ClassDef(AliHLTTPCFileHandler,2) //HLT TPC Filehandler IO class