5 /**************************************************************************
\r
6 * This file is property of and copyright by the ALICE HLT Project *
\r
7 * All rights reserved. *
\r
9 * Primary Authors: Oystein Djuvsland *
\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
23 * Class makes digits from information from raw data
\r
25 * @file AliHLTCaloDigitMaker.h
\r
26 * @author Oystein Djuvsland
\r
28 * @brief Digit maker for Calo HLT
\r
31 // see below for class documentation
\r
33 // refer to README to build package
\r
35 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
\r
37 //#include "AliHLTCaloBase.h"
\r
38 #include "AliHLTCaloConstantsHandler.h"
\r
39 #include "AliHLTCaloDigitDataStruct.h"
\r
40 #include "AliHLTCaloChannelDataStruct.h"
\r
41 #include "AliHLTDataTypes.h"
\r
42 #include "AliHLTLogging.h"
\r
43 #include "TString.h"
\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
53 class AliHLTCaloSharedMemoryInterfacev2; // added by PTH
\r
54 class AliHLTCaloChannelDataHeaderStruct;
\r
55 class AliHLTCaloMapper;
\r
56 class AliHLTCaloCoordinate;
\r
59 //using namespace CaloHLTConst;
\r
60 //class AliHLTCaloDigitMaker : public AliHLTCaloBase
\r
64 class AliHLTCaloDigitMaker : AliHLTCaloConstantsHandler, public AliHLTLogging
\r
70 AliHLTCaloDigitMaker(TString det);
\r
73 virtual ~AliHLTCaloDigitMaker();
\r
76 * Sets the pointer to the output
\r
77 * @param digitDataPtr the output pointer
\r
79 void SetDigitDataPtr(AliHLTCaloDigitDataStruct *digitDataPtr)
\r
80 { fDigitStructPtr = digitDataPtr; }
\r
83 * Set the global high gain conversion factory
\r
84 * @param factor is the conversion factor
\r
86 void SetGlobalHighGainFactor(Float_t factor);
\r
89 * Set the global low gain conversion factory
\r
90 * @param factor is the conversion factor
\r
92 void SetGlobalLowGainFactor(Float_t factor);
\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
99 Int_t MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);
\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
107 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);
\r
110 * Set the status of channel
\r
113 * @param bad if it's bad
\r
115 void SetBadChannel(Int_t x, Int_t z, Bool_t bad = true);
\r
118 * Set the ADC to energy (GeV) gain
\r
121 * @param ratio - High/Low ratio
\r
122 * @param gain is the gain
\r
124 void SetGain(Int_t x, Int_t z, Float_t ratio, Float_t gain);
\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
131 void SetTimeWindow(Float_t min, Float_t max) { fMinTime = min; fMaxTime = max; }
\r
133 /** Reset the channel book */
\r
136 /** Set the mapper */
\r
137 void SetMapper(AliHLTCaloMapper *mapper) { fMapperPtr = mapper; }
\r
141 AliHLTCaloDigitMaker();
\r
145 * @param channelData is the channel data
\r
146 * @param coordinates is the coordinates of the channel, including gain and module
\r
148 void AddDigit(AliHLTCaloChannelDataStruct* channelData, AliHLTCaloCoordinate &coord);
\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
157 bool UseDigit(AliHLTCaloCoordinate &coord, AliHLTCaloChannelDataStruct *channel);
\r
159 /** Pointer to shared memory interface */
\r
160 AliHLTCaloSharedMemoryInterfacev2* fShmPtr; //! transient
\r
162 /** Pointer to the AliHLTCaloDigitDataStruct */
\r
163 AliHLTCaloDigitDataStruct *fDigitStructPtr; //! transient
\r
166 Int_t fDigitCount; //COMMENT
\r
169 AliHLTCaloMapper* fMapperPtr; //COMMENT
\r
171 /** High gain energy conversion factors */
\r
172 Float_t **fHighGainFactors; //! transient
\r
174 /** Low gain energy conversion factors */
\r
175 Float_t **fLowGainFactors; //!transient
\r
177 /** Bad channel mask */
\r
178 Bool_t ***fBadChannelMask; //! transient
\r
180 /** Channel book keeping variable */
\r
181 AliHLTCaloDigitDataStruct ***fChannelBook; //! transient
\r
183 /** Maximum energy we allow in a channel */
\r
184 Float_t fMaxEnergy; //COMMENT
\r
186 /** Minimum accepted time */
\r
187 Float_t fMinTime; //COMMENT
\r
189 /** Maximum accepted time */
\r
190 Float_t fMaxTime; //COMMENT
\r
192 /** Assignment operator and copy constructor not implemented */
\r
193 AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);
\r
194 AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);
\r
196 ClassDef(AliHLTCaloDigitMaker, 0);
\r