]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/TPCLib/AliHLTTPCFileHandler.h
Update master to aliroot
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCFileHandler.h
CommitLineData
82a39a68 1// $Id$
4aa41877 2// Original: AliHLTFileHandler.h,v 1.19 2004/06/11 16:06:33 loizides
a6c02c85 3
4#ifndef ALIHLTTPCFILEHANDLER_H
5#define ALIHLTTPCFILEHANDLER_H
297174de 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 *
5578cf60 9
82a39a68 10/// @file AliHLTTPCFileHandler.h
11/// @author U. Frankenfeld, A. Vestbo, C. Loizides, maintained by
12/// Matthias Richter
13/// @date
14/// @brief file input for the TPC tracking code before migration to the
15/// HLT component framework
16///
5578cf60 17
a6c02c85 18#include "AliHLTTPCMemHandler.h"
19
20class TClonesArray;
21
95d48915 22class AliSimDigits;
23class AliTPCParam;
a6c02c85 24#include <AliRunLoader.h>
a6c02c85 25
95d48915 26class TObject;
27class TFile;
28class TTree;
a6c02c85 29
82a39a68 30struct AliHLTTPCSpacePointData;
31struct AliHLTTPCDigitRowData;
32struct AliHLTTPCTrackSegmentData;
a6c02c85 33class AliHLTTPCTrackArray;
34
95d48915 35/**
297174de 36 * @class AliHLTTPCFileHandler
95d48915 37 * This is the input interface class for the TPC tracking code before conversion to
38 * the HLT component framework.
39 *
297174de 40 * @ingroup alihlt_tpc
95d48915 41 */
5578cf60 42class AliHLTTPCFileHandler:public AliHLTTPCMemHandler {
a6c02c85 43
a6c02c85 44 public:
600e6a1b 45 /** standard constructor */
a6c02c85 46 AliHLTTPCFileHandler(Bool_t b=kFALSE);
600e6a1b 47 /** destructor */
95d48915 48 virtual ~AliHLTTPCFileHandler();
a6c02c85 49
50 void FreeDigitsTree();
51 static void CleanStaticIndex();
52 static Int_t SaveStaticIndex(Char_t *prefix=0,Int_t event=0);
53 static Int_t LoadStaticIndex(Char_t *prefix=0,Int_t event=0);
54
55 Bool_t SetAliInput(Char_t *name);
a6c02c85 56 Bool_t SetAliInput(AliRunLoader *runLoader);
a6c02c85 57 void CloseAliInput();
58 Bool_t IsDigit(Int_t event);
59
60 Bool_t SetMCOutput(Char_t *name);
61 Bool_t SetMCOutput(FILE *file);
62 void CloseMCOutput();
63
64 //Digit IO
5578cf60 65
66 /**
67 * Write AliDigits from AliRoot file to binary file.
68 * @param event event no
69 * @param altro use @ref AliDigits2Memory if kFALSE and @ref
70 * AliDigits2Memory if kTRUE
71 *
72 * Calls the @ref AliHLTTPCMemHandler::Memory2BinaryFile to write the file.
73 */
e4ba5bf1 74
5578cf60 75 Bool_t AliDigits2BinaryFile(Int_t event=0,Bool_t altro=kFALSE);
76
77 /**
78 * Convert AliDigits from AliRoot file to HLT Digit data in memory.
79 * Read and convert/write digits to memory buffer. If no target buffer available,
80 * an appropriate buffer is allocated.<br>
81 * If the variable pTgtSize is prvided, the total size of the result array is
82 * returned. \b Note: the total size differs as the @ref AliHLTTPCDigitRowData
83 * structs are variable in size depending on the no of digits for that particular
84 * row.
85 * @param nrow [OUT] number of rows
86 * @param event the event no
87 * @param tgtBuffer target buffer (optional)
88 * @param pTgtSize size of target buffer (optional)
89 * @return pointer to array, size in nrow <br>
90 * NULL in case of failure, required size in pTgtSize
91 */
5d2abf3b 92 //TODO: Check that the following change works. It should, but just double check.
93 AliHLTTPCDigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event, Byte_t* tgtBuffer, UInt_t* pTgtSize=NULL);
94
95 AliHLTTPCDigitRowData *AliDigits2Memory(UInt_t & nrow,Int_t event=0)
96 {
97 return AliDigits2Memory(nrow, event, NULL, NULL);
98 }
5578cf60 99
100 /**
c5123824 101 * Convert and filter AliDigits from AliRoot file to HLT Digit data in memory.
5578cf60 102 * This functions is the same as @ref AliDigits2Memory but in addition it
103 * filters out single timebins, which is noise. The timebins which
104 * are removed are timebins which have the 4 zero neighbours;
105 * (pad-1,time),(pad+1,time),(pad,time-1),(pad,time+1).
106 *
c5123824 107 * This is legacy code, the two functions contain big portions of identical code
5578cf60 108 * will be merged.
109 * See @ref AliDigits2Memory for detailed description.
110 */
a6c02c85 111 AliHLTTPCDigitRowData *AliAltroDigits2Memory(UInt_t & nrow,Int_t event=0,Bool_t eventmerge=kFALSE);
5578cf60 112
c5123824 113 /**
114 * Convert AliDigits from AliRoot file to Altro data format in memory.
115 */
116 int AliDigits2Altro(Int_t event, Byte_t* tgtBuffer, UInt_t size);
117
5578cf60 118 /**
119 * Write AliDigits from AliRoot file to binary file.
120 * @param event event no
121 * @param altro use @ref AliDigits2Memory if kFALSE and @ref
122 * AliDigits2Memory if kTRUE
123 *
124 * \b Note: pretty much the same as @ref AliDigits2BinaryFile.
125 * Calls the @ref AliHLTTPCMemHandler::Memory2CompBinary to write the file.
126 */
a6c02c85 127 Bool_t AliDigits2CompBinary(Int_t event=0,Bool_t altro=kFALSE);
5578cf60 128
a6c02c85 129 //Point IO
e4ba5bf1 130
a6c02c85 131 Bool_t AliPoints2Binary(Int_t eventn=0);
e4ba5bf1 132 // Is this really still used : JMT 2013-03-03 - corresponding IO removed in TPC
133 // AliHLTTPCSpacePointData *AliPoints2Memory(UInt_t & npoint,Int_t eventn=0);//Allocates Memory
a6c02c85 134
2a083ac4 135 protected:
136 AliRunLoader *fInAli;//!
137 Bool_t fUseRunLoader; //use runloader
138
139 AliTPCParam *fParam;//!
140 AliSimDigits *fDigits;//!
141
142 TTree *fDigitsTree;//!
143 FILE *fMC;//!
0ba35c53 144
2a083ac4 145 Bool_t fIndexCreated; //is index created
0ba35c53 146 Int_t fIndex[fgkNSlice][fgkNRow]; //stores index over digitstree
2a083ac4 147 //for faster access w/o ASVVERSION
148 Bool_t fUseStaticIndex; //take static index
149 static Bool_t fgStaticIndexCreated; //global index created
0ba35c53 150 static Int_t fgStaticIndex[fgkNSlice][fgkNRow]; //global index
2a083ac4 151
152 virtual Bool_t SetAliInput();
153 Bool_t GetDigitsTree(Int_t event);
154 Bool_t CreateIndex(); //create the index
155
5578cf60 156 private:
157 /** copy constructor prohibited */
158 AliHLTTPCFileHandler(const AliHLTTPCFileHandler&);
159 /** assignment operator prohibited */
160 AliHLTTPCFileHandler& operator=(const AliHLTTPCFileHandler&);
161
22240104 162 ClassDef(AliHLTTPCFileHandler,0) //HLT TPC Filehandler IO class
a6c02c85 163};
164
165#endif