]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/CALO/AliHLTCaloDigitMaker.h
- adding new clusterizer class. Basic algorithm that uses a NxN matrix centered aroun...
[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
b6d0e92f 42#include "AliHLTLogging.h"\r
ef44ec64 43#include "TString.h"\r
ef44ec64 44\r
45/**\r
46 * @class AliHLTCaloDigitMaker\r
47 * Digit maker for CALO HLT. Takes input from AliHLTCaloRawAnalyzer, and \r
48 * outputs a block of AliHLTCaloDigitDataStruct container\r
49 * @ingroup alihlt_calo\r
50 */\r
51\r
52class TH2F;\r
53class AliHLTCaloSharedMemoryInterfacev2; // added by PTH\r
54class AliHLTCaloChannelDataHeaderStruct;\r
55class AliHLTCaloMapper;\r
f137c3c5 56class AliHLTCaloCoordinate;\r
ef44ec64 57class TString;\r
58\r
59//using namespace CaloHLTConst;\r
60//class AliHLTCaloDigitMaker : public AliHLTCaloBase\r
61\r
62\r
63\r
b6d0e92f 64class AliHLTCaloDigitMaker : AliHLTCaloConstantsHandler, public AliHLTLogging\r
ef44ec64 65{\r
66\r
67public:\r
68\r
69 /** Constructor */\r
70 AliHLTCaloDigitMaker(TString det);\r
71\r
72 /** Destructor */\r
73 virtual ~AliHLTCaloDigitMaker();\r
74\r
ef44ec64 75 /**\r
76 * Sets the pointer to the output\r
37616445 77 * @param digitDataPtr the output pointer\r
ef44ec64 78 */\r
79 void SetDigitDataPtr(AliHLTCaloDigitDataStruct *digitDataPtr) \r
80 { fDigitStructPtr = digitDataPtr; }\r
81\r
82 /**\r
83 * Set the global high gain conversion factory \r
84 * @param factor is the conversion factor\r
85 */\r
86 void SetGlobalHighGainFactor(Float_t factor);\r
87\r
88 /**\r
89 * Set the global low gain conversion factory \r
90 * @param factor is the conversion factor\r
91 */\r
92 void SetGlobalLowGainFactor(Float_t factor);\r
93\r
94 /**\r
95 * Make the digits for one event.\r
96 * @param channelDataHeader is the data header from the AliHLTCaloRawAnalyzer\r
97 * @return the number of digits found\r
98 */\r
99 Int_t MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);\r
100\r
ef44ec64 101 /**\r
102 * Set the mask for dead channels\r
103 * @param badChannelHGHist is a pointer to a high gain bad channel histogram\r
104 * @param badChannelLGHist is a pointer to a low gain bad channel histogram\r
105 * @param qCut is the cut \r
106 */\r
107 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);\r
108\r
c1e4a18c 109 /** \r
110 * Set the status of channel \r
111 * @param x is x\r
112 * @param z is z\r
113 * @param bad if it's bad\r
114 */\r
115 void SetBadChannel(Int_t x, Int_t z, Bool_t bad = true);\r
116 \r
117 /** \r
118 * Set the ADC to energy (GeV) gain \r
119 * @param x is x\r
120 * @param z is z\r
121 * @param ratio - High/Low ratio\r
122 * @param gain is the gain\r
123 */\r
124 void SetGain(Int_t x, Int_t z, Float_t ratio, Float_t gain);\r
125 \r
7173b37b 126 /**\r
127 * Set the time window for which we accept energy signals\r
128 * @param min is the minumum time\r
129 * @param max is the maximum time\r
130 */\r
131 void SetTimeWindow(Float_t min, Float_t max) { fMinTime = min; fMaxTime = max; }\r
132 \r
37616445 133 /** Reset the channel book */\r
ef44ec64 134 void Reset();\r
135\r
f137c3c5 136 /** Set the mapper */\r
137 void SetMapper(AliHLTCaloMapper *mapper) { fMapperPtr = mapper; }\r
138\r
ef44ec64 139private:\r
140 \r
141 AliHLTCaloDigitMaker();\r
142 \r
143 /**\r
144 * Add a new digit\r
145 * @param channelData is the channel data\r
146 * @param coordinates is the coordinates of the channel, including gain and module\r
147 */\r
f137c3c5 148 void AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord);\r
ef44ec64 149\r
150 /**\r
151 * Check if we already have this crystal. If so, keep the high gain as long as it \r
152 * is not in overflow. \r
153 * @param channelCoordinates is a array of coordinates for the channel.\r
154 * @param channel is a pointer to a struct containing channel information\r
155 * @return true if we should use the digit. \r
156 */\r
f137c3c5 157 bool UseDigit(AliHLTCaloCoordinate &coord, AliHLTCaloChannelDataStruct *channel);\r
ef44ec64 158\r
ef44ec64 159 /** Pointer to shared memory interface */\r
160 AliHLTCaloSharedMemoryInterfacev2* fShmPtr; //! transient\r
161\r
162 /** Pointer to the AliHLTCaloDigitDataStruct */\r
163 AliHLTCaloDigitDataStruct *fDigitStructPtr; //! transient\r
164\r
165 /** Digit count */\r
166 Int_t fDigitCount; //COMMENT\r
167\r
ef44ec64 168 /** Mapper */\r
169 AliHLTCaloMapper* fMapperPtr; //COMMENT\r
170\r
171 /** High gain energy conversion factors */\r
172 Float_t **fHighGainFactors; //! transient\r
173\r
174 /** Low gain energy conversion factors */\r
175 Float_t **fLowGainFactors; //!transient\r
176\r
177 /** Bad channel mask */\r
c1e4a18c 178 Bool_t ***fBadChannelMask; //! transient\r
ef44ec64 179\r
180 /** Channel book keeping variable */\r
181 AliHLTCaloDigitDataStruct ***fChannelBook; //! transient\r
182\r
f137c3c5 183 /** Maximum energy we allow in a channel */\r
184 Float_t fMaxEnergy; //COMMENT\r
7173b37b 185 \r
186 /** Minimum accepted time */\r
187 Float_t fMinTime; //COMMENT\r
188 \r
189 /** Maximum accepted time */ \r
190 Float_t fMaxTime; //COMMENT\r
f137c3c5 191\r
37616445 192 /** Assignment operator and copy constructor not implemented */\r
c375e15d 193 AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);\r
37616445 194 AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);\r
ef44ec64 195\r
196 ClassDef(AliHLTCaloDigitMaker, 0); \r
197\r
198};\r
199\r
ef44ec64 200#endif\r
201 \r