]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/CALO/AliHLTCaloDigitMaker.h
- adding possibility to cut on time in the digit maker
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloDigitMaker.h
CommitLineData
ef44ec64 1//-*- Mode: C++ -*-\r
2// $Id$\r
3\r
4\r
5/**************************************************************************\r
6 * This file is property of and copyright by the ALICE HLT Project *\r
7 * All rights reserved. *\r
8 * *\r
9 * Primary Authors: Oystein Djuvsland *\r
10 * *\r
11 * Permission to use, copy, modify and distribute this software and its *\r
12 * documentation strictly for non-commercial purposes is hereby granted *\r
13 * without fee, provided that the above copyright notice appears in all *\r
14 * copies and that both the copyright notice and this permission notice *\r
15 * appear in the supporting documentation. The authors make no claims *\r
16 * about the suitability of this software for any purpose. It is *\r
17 * provided "as is" without express or implied warranty. *\r
18 **************************************************************************/\r
19#ifndef ALIHLTCALODIGITMAKER_H\r
20#define ALIHLTCALODIGITMAKER_H\r
21\r
22/**\r
23 * Class makes digits from information from raw data\r
24 *\r
25 * @file AliHLTCaloDigitMaker.h\r
26 * @author Oystein Djuvsland\r
27 * @date\r
28 * @brief Digit maker for Calo HLT\r
29 */\r
30\r
31// see below for class documentation\r
32// or\r
33// refer to README to build package\r
34// or\r
35// visit http://web.ift.uib.no/~kjeks/doc/alice-hlt\r
36\r
37//#include "AliHLTCaloBase.h"\r
4f4b7ba4 38#include "AliHLTCaloConstantsHandler.h"\r
ef44ec64 39#include "AliHLTCaloDigitDataStruct.h"\r
40#include "AliHLTCaloChannelDataStruct.h"\r
41#include "AliHLTDataTypes.h"\r
42#include "TString.h"\r
ef44ec64 43\r
44/**\r
45 * @class AliHLTCaloDigitMaker\r
46 * Digit maker for CALO HLT. Takes input from AliHLTCaloRawAnalyzer, and \r
47 * outputs a block of AliHLTCaloDigitDataStruct container\r
48 * @ingroup alihlt_calo\r
49 */\r
50\r
51class TH2F;\r
52class AliHLTCaloSharedMemoryInterfacev2; // added by PTH\r
53class AliHLTCaloChannelDataHeaderStruct;\r
54class AliHLTCaloMapper;\r
f137c3c5 55class AliHLTCaloCoordinate;\r
ef44ec64 56class TString;\r
57\r
58//using namespace CaloHLTConst;\r
59//class AliHLTCaloDigitMaker : public AliHLTCaloBase\r
60\r
61\r
62\r
4f4b7ba4 63class AliHLTCaloDigitMaker : AliHLTCaloConstantsHandler\r
ef44ec64 64{\r
65\r
66public:\r
67\r
68 /** Constructor */\r
69 AliHLTCaloDigitMaker(TString det);\r
70\r
71 /** Destructor */\r
72 virtual ~AliHLTCaloDigitMaker();\r
73\r
ef44ec64 74 /**\r
75 * Sets the pointer to the output\r
37616445 76 * @param digitDataPtr the output pointer\r
ef44ec64 77 */\r
78 void SetDigitDataPtr(AliHLTCaloDigitDataStruct *digitDataPtr) \r
79 { fDigitStructPtr = digitDataPtr; }\r
80\r
81 /**\r
82 * Set the global high gain conversion factory \r
83 * @param factor is the conversion factor\r
84 */\r
85 void SetGlobalHighGainFactor(Float_t factor);\r
86\r
87 /**\r
88 * Set the global low gain conversion factory \r
89 * @param factor is the conversion factor\r
90 */\r
91 void SetGlobalLowGainFactor(Float_t factor);\r
92\r
93 /**\r
94 * Make the digits for one event.\r
95 * @param channelDataHeader is the data header from the AliHLTCaloRawAnalyzer\r
96 * @return the number of digits found\r
97 */\r
98 Int_t MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);\r
99\r
ef44ec64 100 /**\r
101 * Set the mask for dead channels\r
102 * @param badChannelHGHist is a pointer to a high gain bad channel histogram\r
103 * @param badChannelLGHist is a pointer to a low gain bad channel histogram\r
104 * @param qCut is the cut \r
105 */\r
106 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);\r
107\r
c1e4a18c 108 /** \r
109 * Set the status of channel \r
110 * @param x is x\r
111 * @param z is z\r
112 * @param bad if it's bad\r
113 */\r
114 void SetBadChannel(Int_t x, Int_t z, Bool_t bad = true);\r
115 \r
116 /** \r
117 * Set the ADC to energy (GeV) gain \r
118 * @param x is x\r
119 * @param z is z\r
120 * @param ratio - High/Low ratio\r
121 * @param gain is the gain\r
122 */\r
123 void SetGain(Int_t x, Int_t z, Float_t ratio, Float_t gain);\r
124 \r
7173b37b 125 /**\r
126 * Set the time window for which we accept energy signals\r
127 * @param min is the minumum time\r
128 * @param max is the maximum time\r
129 */\r
130 void SetTimeWindow(Float_t min, Float_t max) { fMinTime = min; fMaxTime = max; }\r
131 \r
37616445 132 /** Reset the channel book */\r
ef44ec64 133 void Reset();\r
134\r
f137c3c5 135 /** Set the mapper */\r
136 void SetMapper(AliHLTCaloMapper *mapper) { fMapperPtr = mapper; }\r
137\r
ef44ec64 138private:\r
139 \r
140 AliHLTCaloDigitMaker();\r
141 \r
142 /**\r
143 * Add a new digit\r
144 * @param channelData is the channel data\r
145 * @param coordinates is the coordinates of the channel, including gain and module\r
146 */\r
f137c3c5 147 void AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord);\r
ef44ec64 148\r
149 /**\r
150 * Check if we already have this crystal. If so, keep the high gain as long as it \r
151 * is not in overflow. \r
152 * @param channelCoordinates is a array of coordinates for the channel.\r
153 * @param channel is a pointer to a struct containing channel information\r
154 * @return true if we should use the digit. \r
155 */\r
f137c3c5 156 bool UseDigit(AliHLTCaloCoordinate &coord, AliHLTCaloChannelDataStruct *channel);\r
ef44ec64 157\r
ef44ec64 158 /** Pointer to shared memory interface */\r
159 AliHLTCaloSharedMemoryInterfacev2* fShmPtr; //! transient\r
160\r
161 /** Pointer to the AliHLTCaloDigitDataStruct */\r
162 AliHLTCaloDigitDataStruct *fDigitStructPtr; //! transient\r
163\r
164 /** Digit count */\r
165 Int_t fDigitCount; //COMMENT\r
166\r
ef44ec64 167 /** Mapper */\r
168 AliHLTCaloMapper* fMapperPtr; //COMMENT\r
169\r
170 /** High gain energy conversion factors */\r
171 Float_t **fHighGainFactors; //! transient\r
172\r
173 /** Low gain energy conversion factors */\r
174 Float_t **fLowGainFactors; //!transient\r
175\r
176 /** Bad channel mask */\r
c1e4a18c 177 Bool_t ***fBadChannelMask; //! transient\r
ef44ec64 178\r
179 /** Channel book keeping variable */\r
180 AliHLTCaloDigitDataStruct ***fChannelBook; //! transient\r
181\r
f137c3c5 182 /** Maximum energy we allow in a channel */\r
183 Float_t fMaxEnergy; //COMMENT\r
7173b37b 184 \r
185 /** Minimum accepted time */\r
186 Float_t fMinTime; //COMMENT\r
187 \r
188 /** Maximum accepted time */ \r
189 Float_t fMaxTime; //COMMENT\r
f137c3c5 190\r
37616445 191 /** Assignment operator and copy constructor not implemented */\r
c375e15d 192 AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);\r
37616445 193 AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);\r
ef44ec64 194\r
195 ClassDef(AliHLTCaloDigitMaker, 0); \r
196\r
197};\r
198\r
ef44ec64 199#endif\r
200 \r