5 /**************************************************************************
6 * This file is property of and copyright by the ALICE HLT Project *
7 * All rights reserved. *
9 * Primary Authors: Oystein Djuvsland *
11 * Permission to use, copy, modify and distribute this software and its *
12 * documentation strictly for non-commercial purposes is hereby granted *
13 * without fee, provided that the above copyright notice appears in all *
14 * copies and that both the copyright notice and this permission notice *
15 * appear in the supporting documentation. The authors make no claims *
16 * about the suitability of this software for any purpose. It is *
17 * provided "as is" without express or implied warranty. *
18 **************************************************************************/
19 #ifndef ALIHLTCALODIGITMAKER_H
20 #define ALIHLTCALODIGITMAKER_H
23 * Class makes digits from information from raw data
25 * @file AliHLTCaloDigitMaker.h
26 * @author Oystein Djuvsland
28 * @brief Digit maker for Calo HLT
31 // see below for class documentation
33 // refer to README to build package
35 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
37 //#include "AliHLTCaloBase.h"
38 #include "AliHLTCaloConstantsHandler.h"
39 #include "AliHLTCaloDigitDataStruct.h"
40 #include "AliHLTCaloChannelDataStruct.h"
41 #include "AliHLTDataTypes.h"
42 #include "AliHLTLogging.h"
46 * @class AliHLTCaloDigitMaker
47 * Digit maker for CALO HLT. Takes input from AliHLTCaloRawAnalyzer, and
48 * outputs a block of AliHLTCaloDigitDataStruct container
49 * @ingroup alihlt_calo
53 class AliHLTCaloSharedMemoryInterfacev2; // added by PTH
54 struct AliHLTCaloChannelDataHeaderStruct;
55 class AliHLTCaloMapper;
56 class AliHLTCaloCoordinate;
59 //using namespace CaloHLTConst;
60 //class AliHLTCaloDigitMaker : public AliHLTCaloBase
64 class AliHLTCaloDigitMaker : AliHLTCaloConstantsHandler, public AliHLTLogging
70 AliHLTCaloDigitMaker(TString det);
73 virtual ~AliHLTCaloDigitMaker();
76 * Sets the pointer to the output
77 * @param digitDataPtr the output pointer
79 void SetDigitDataPtr(AliHLTCaloDigitDataStruct *digitDataPtr)
80 { fDigitStructPtr = digitDataPtr; }
83 * Set the global high gain conversion factory
84 * @param factor is the conversion factor
86 void SetGlobalHighGainFactor(Float_t factor);
89 * Set the global low gain conversion factory
90 * @param factor is the conversion factor
92 void SetGlobalLowGainFactor(Float_t factor);
95 * Make the digits for one event.
96 * @param channelDataHeader is the data header from the AliHLTCaloRawAnalyzer
97 * @return the number of digits found
99 Int_t MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);
102 * Set the mask for dead channels
103 * @param badChannelHGHist is a pointer to a high gain bad channel histogram
104 * @param badChannelLGHist is a pointer to a low gain bad channel histogram
105 * @param qCut is the cut
107 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);
110 * Set the status of channel
113 * @param bad if it's bad
115 void SetBadChannel(Int_t x, Int_t z, Bool_t bad = true);
118 * Set the ADC to energy (GeV) gain
121 * @param ratio - High/Low ratio
122 * @param gain is the gain
124 void SetGain(Int_t x, Int_t z, Float_t ratio, Float_t gain);
127 * Set the time window for which we accept energy signals
128 * @param min is the minumum time
129 * @param max is the maximum time
131 void SetTimeWindow(Float_t min, Float_t max) { fMinTime = min; fMaxTime = max; }
133 /** Reset the channel book */
136 /** Set the mapper */
137 void SetMapper(AliHLTCaloMapper *mapper) { fMapperPtr = mapper; }
141 AliHLTCaloDigitMaker();
145 * @param channelData is the channel data
146 * @param coordinates is the coordinates of the channel, including gain and module
148 void AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord);
151 * Check if we already have this crystal. If so, keep the high gain as long as it
152 * is not in overflow.
153 * @param channelCoordinates is a array of coordinates for the channel.
154 * @param channel is a pointer to a struct containing channel information
155 * @return true if we should use the digit.
157 bool UseDigit(AliHLTCaloCoordinate &coord, AliHLTCaloChannelDataStruct *channel);
159 /** Pointer to shared memory interface */
160 AliHLTCaloSharedMemoryInterfacev2* fShmPtr; //! transient
162 /** Pointer to the AliHLTCaloDigitDataStruct */
163 AliHLTCaloDigitDataStruct *fDigitStructPtr; //! transient
166 Int_t fDigitCount; //COMMENT
169 AliHLTCaloMapper* fMapperPtr; //COMMENT
171 /** High gain energy conversion factors */
172 Float_t **fHighGainFactors; //! transient
174 /** Low gain energy conversion factors */
175 Float_t **fLowGainFactors; //!transient
177 /** Bad channel mask */
178 Bool_t ***fBadChannelMask; //! transient
180 /** Channel book keeping variable */
181 AliHLTCaloDigitDataStruct ***fChannelBook; //! transient
183 /** Maximum energy we allow in a channel */
184 Float_t fMaxEnergy; //COMMENT
186 /** Minimum accepted time */
187 Float_t fMinTime; //COMMENT
189 /** Maximum accepted time */
190 Float_t fMaxTime; //COMMENT
192 /** Assignment operator and copy constructor not implemented */
193 AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);
194 AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);
196 ClassDef(AliHLTCaloDigitMaker, 0);