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 "TString.h"
\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
52 class AliHLTCaloSharedMemoryInterfacev2; // added by PTH
\r
53 class AliHLTCaloChannelDataHeaderStruct;
\r
54 class AliHLTCaloMapper;
\r
57 //using namespace CaloHLTConst;
\r
58 //class AliHLTCaloDigitMaker : public AliHLTCaloBase
\r
62 class AliHLTCaloDigitMaker : AliHLTCaloConstantsHandler
\r
68 AliHLTCaloDigitMaker(TString det);
\r
71 virtual ~AliHLTCaloDigitMaker();
\r
73 // /** Copy constructor */
\r
74 // AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &) :
\r
75 // // AliHLTCaloBase(),
\r
77 // fDigitStructPtr(0),
\r
81 // fHighGainFactors(0),
\r
82 // fLowGainFactors(0),
\r
83 // fBadChannelMask(0),
\r
86 // //Copy constructor not implemented
\r
90 AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker)
\r
97 * Sets the pointer to the output
\r
98 * @param the output pointer
\r
100 void SetDigitDataPtr(AliHLTCaloDigitDataStruct *digitDataPtr)
\r
101 { fDigitStructPtr = digitDataPtr; }
\r
104 * Set the global high gain conversion factory
\r
105 * @param factor is the conversion factor
\r
107 void SetGlobalHighGainFactor(Float_t factor);
\r
110 * Set the global low gain conversion factory
\r
111 * @param factor is the conversion factor
\r
113 void SetGlobalLowGainFactor(Float_t factor);
\r
116 * Make the digits for one event.
\r
117 * @param channelDataHeader is the data header from the AliHLTCaloRawAnalyzer
\r
118 * @return the number of digits found
\r
120 Int_t MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);
\r
124 * Set the mask for dead channels
\r
125 * @param badChannelHGHist is a pointer to a high gain bad channel histogram
\r
126 * @param badChannelLGHist is a pointer to a low gain bad channel histogram
\r
127 * @param qCut is the cut
\r
129 void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);
\r
132 * Set ordering of gains or not
\r
134 void SetOrdered(bool val) { fOrdered = val; }
\r
140 AliHLTCaloDigitMaker();
\r
144 * @param channelData is the channel data
\r
145 * @param coordinates is the coordinates of the channel, including gain and module
\r
147 void AddDigit(AliHLTCaloChannelDataStruct* channelData, UShort_t* channelCoordinates, Float_t* localCoordinates);
\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
156 bool UseDigit(UShort_t *channelCoordinates, 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
168 /** Are the gains ordered? */
\r
169 bool fOrdered; //COMMENT
\r
172 AliHLTCaloMapper* fMapperPtr; //COMMENT
\r
174 /** High gain energy conversion factors */
\r
175 Float_t **fHighGainFactors; //! transient
\r
177 /** Low gain energy conversion factors */
\r
178 Float_t **fLowGainFactors; //!transient
\r
180 /** Bad channel mask */
\r
181 Float_t ***fBadChannelMask; //! transient
\r
183 /** Channel book keeping variable */
\r
184 AliHLTCaloDigitDataStruct ***fChannelBook; //! transient
\r
187 AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);
\r
188 // AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);
\r
190 ClassDef(AliHLTCaloDigitMaker, 0);
\r