]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/CALO/AliHLTCaloDigitMaker.h
- PHOS will now use the CALO digit maker, PHOS digit maker soon to be removed
[u/mrichter/AliRoot.git] / HLT / CALO / AliHLTCaloDigitMaker.h
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
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
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
51 class TH2F;\r
52 class AliHLTCaloSharedMemoryInterfacev2; // added by PTH\r
53 class AliHLTCaloChannelDataHeaderStruct;\r
54 class AliHLTCaloMapper;\r
55 class TString;\r
56 \r
57 //using namespace CaloHLTConst;\r
58 //class AliHLTCaloDigitMaker : public AliHLTCaloBase\r
59 \r
60 \r
61 \r
62 class AliHLTCaloDigitMaker : AliHLTCaloConstantsHandler\r
63 {\r
64 \r
65 public:\r
66 \r
67   /** Constructor */\r
68   AliHLTCaloDigitMaker(TString det);\r
69 \r
70   /** Destructor */\r
71   virtual ~AliHLTCaloDigitMaker();\r
72 \r
73   /**\r
74    * Sets the pointer to the output\r
75    * @param digitDataPtr the output pointer\r
76    */\r
77   void SetDigitDataPtr(AliHLTCaloDigitDataStruct *digitDataPtr) \r
78   { fDigitStructPtr = digitDataPtr; }\r
79 \r
80   /**\r
81    * Set the global high gain conversion factory \r
82    * @param factor is the conversion factor\r
83    */\r
84   void SetGlobalHighGainFactor(Float_t factor);\r
85 \r
86   /**\r
87    * Set the global low gain conversion factory \r
88    * @param factor is the conversion factor\r
89    */\r
90   void SetGlobalLowGainFactor(Float_t factor);\r
91 \r
92   /**\r
93    * Make the digits for one event.\r
94    * @param channelDataHeader is the data header from the AliHLTCaloRawAnalyzer\r
95    * @return the number of digits found\r
96    */\r
97   Int_t MakeDigits(AliHLTCaloChannelDataHeaderStruct* channelDataHeader, AliHLTUInt32_t availableSize);\r
98 \r
99   /**\r
100    * Set the mask for dead channels\r
101    * @param badChannelHGHist is a pointer to a high gain bad channel histogram\r
102    * @param badChannelLGHist is a pointer to a low gain bad channel histogram\r
103    * @param qCut is the cut \r
104    */\r
105   void SetBadChannelMask(TH2F* badChannelHGHist, TH2F* badChannelLGHist, Float_t qCut);\r
106 \r
107   /** Reset the channel book */\r
108   void Reset();\r
109 \r
110 private:\r
111   \r
112   AliHLTCaloDigitMaker();\r
113   \r
114   /**\r
115    * Add a new digit\r
116    * @param channelData is the channel data\r
117    * @param coordinates is the coordinates of the channel, including gain and module\r
118    */\r
119   void AddDigit(AliHLTCaloChannelDataStruct* channelData, UShort_t* channelCoordinates, Float_t* localCoordinates);\r
120 \r
121   /**\r
122    * Check if we already have this crystal. If so, keep the high gain as long as it \r
123    * is not in overflow. \r
124    * @param channelCoordinates is a array of coordinates for the channel.\r
125    * @param channel is a pointer to a struct containing channel information\r
126    * @return true if we should use the digit. \r
127    */\r
128   bool UseDigit(UShort_t *channelCoordinates, AliHLTCaloChannelDataStruct *channel);\r
129 \r
130   /** Pointer to shared memory interface */\r
131   AliHLTCaloSharedMemoryInterfacev2* fShmPtr;                    //! transient\r
132 \r
133   /** Pointer to the AliHLTCaloDigitDataStruct */\r
134   AliHLTCaloDigitDataStruct *fDigitStructPtr;                    //! transient\r
135 \r
136   /** Digit count */\r
137   Int_t fDigitCount;                                             //COMMENT\r
138 \r
139   /** Mapper */\r
140   AliHLTCaloMapper* fMapperPtr;                                  //COMMENT\r
141 \r
142   /** High gain energy conversion factors */\r
143   Float_t **fHighGainFactors;                                    //! transient\r
144 \r
145   /** Low gain energy conversion factors */\r
146   Float_t **fLowGainFactors;                                     //!transient\r
147 \r
148   /** Bad channel mask */\r
149   Float_t ***fBadChannelMask;                                    //! transient\r
150 \r
151   /** Channel book keeping variable */\r
152   AliHLTCaloDigitDataStruct ***fChannelBook;                     //! transient\r
153 \r
154   /** Assignment operator and copy constructor not implemented */\r
155   AliHLTCaloDigitMaker(const AliHLTCaloDigitMaker &);\r
156   AliHLTCaloDigitMaker & operator = (const AliHLTCaloDigitMaker &);\r
157 \r
158   ClassDef(AliHLTCaloDigitMaker, 0); \r
159 \r
160 };\r
161 \r
162 #endif\r
163  \r