]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSDigitMaker.h
Selectiv readout and writing to FXS (oystein)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSDigitMaker.h
1
2 /**************************************************************************
3  * This file is property of and copyright by the ALICE HLT Project        *
4  * All rights reserved.                                                   *
5  *                                                                        *
6  * Primary Authors: Oystein Djuvsland                                     *
7  *                                                                        *
8  * Permission to use, copy, modify and distribute this software and its   *
9  * documentation strictly for non-commercial purposes is hereby granted   *
10  * without fee, provided that the above copyright notice appears in all   *
11  * copies and that both the copyright notice and this permission notice   *
12  * appear in the supporting documentation. The authors make no claims     *
13  * about the suitability of this software for any purpose. It is          *
14  * provided "as is" without express or implied warranty.                  *
15  **************************************************************************/
16 #ifndef ALIHLTPHOSDIGITMAKER_H
17 #define ALIHLTPHOSDIGITMAKER_H
18
19 /**
20  * Class makes digits from information from raw data
21  *
22  * @file   AliHLTPHOSDigitMaker.h
23  * @author Oystein Djuvsland
24  * @date
25  * @brief  Digit maker for PHOS HLT
26  */
27
28 // see below for class documentation
29 // or
30 // refer to README to build package
31 // or
32 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
33
34 #include "AliHLTPHOSBase.h"
35 #include "AliHLTPHOSConstants.h"
36
37 /**
38  * @class AliHLTPHOSDigitMaker
39  * Digit maker for PHOS HLT. Takes input from AliHLTPHOSRawAnalyzer, and 
40  * outputs an AliHLTPHOSDigitDataStruct container, or a TClonesArray of
41  * AliHLTPHOSDigit. Can do software zero suppression
42  * @ingroup alihlt_phos
43  */
44
45 class TClonesArray;
46 class TTree;
47 class AliHLTPHOSValidCellDataStruct;
48 class AliHLTPHOSRcuCellEnergyDataStruct;
49 class AliHLTPHOSDigitContainerDataStruct;
50 class AliHLTPHOSDigitDataStruct;
51 class AliHLTPHOSSharedMemoryInterface; // added by PTH
52        
53 using namespace PhosHLTConst;
54
55 class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
56 {
57 public:
58
59   /** Constructor */
60   AliHLTPHOSDigitMaker();
61
62   /** Destructor */
63   virtual ~AliHLTPHOSDigitMaker();
64
65   /** Copy constructor */  
66   AliHLTPHOSDigitMaker(const AliHLTPHOSDigitMaker &) : 
67     AliHLTPHOSBase(),
68     fCellDataPtr(0),
69     fDigitContainerStructPtr(0),
70     fDigitArrayPtr(0),
71     fDigitStructPtr(0),
72     fDigitCount(0)
73   {
74     //Copy constructor not implemented
75   }
76   
77   /** Assignment */
78   AliHLTPHOSDigitMaker & operator = (const AliHLTPHOSDigitMaker)
79   {
80     //Assignment
81     return *this; 
82   }
83
84  
85   // void SetValidCellData(AliHLTPHOSValidCellDataStruct *data) { fCellDataPtr = data; }
86   //  void SetDigitContainerStruct(AliHLTPHOSDigitContainerStruct *container) 
87   //{ fDigitContainerStructPtr = container; }
88    
89   /**
90    * Sets the AliHLTPHOSDigitDataStruct container 
91    * @param container the digit container
92    */
93   void SetDigitContainerStruct(AliHLTPHOSDigitContainerDataStruct *container) 
94   { fDigitContainerStructPtr = container; }
95
96   /** 
97    * Sets the TClonesArray of AliHLTPHOSDigit 
98    * @param array the array
99    */
100   void SetDigitArray(TClonesArray *array) { fDigitArrayPtr = array; }
101
102   /** 
103    * Sets the digit thresholds
104    * @param filepath is the path to a file containing RMS
105    *                 histograms for both gains
106    * @param nSigmas is the number of sigmas to put the threshold
107    */
108   void SetDigitThresholds(const char* filepath, Int_t nSigmas);
109   
110
111   /**
112    * Sets the number of pre samples
113    * @param n the number of pre samples
114    */
115   //void SetNrPresamples(Int_t n) { fNrPresamples = n; }
116
117   /**
118    * Set the global high gain conversion factory 
119    * @param factor is the conversion factor
120    */
121   void SetGlobalHighGainFactor(Float_t factor);
122
123   /**
124    * Set the global low gain conversion factory 
125    * @param factor is the conversion factor
126    */
127   void SetGlobalLowGainFactor(Float_t factor);
128
129   /**
130    * Make the digits for one event.
131    * @param rcuCellEnergies is the data from the AliHLTPHOSRawAnalyzer
132    * @return the number of digits found
133    */
134   Int_t MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuCellEnergies);
135
136   /** Reset the digit maker */
137   void Reset();
138
139 private:
140
141   /** Pointer to valid cell list */
142   AliHLTPHOSValidCellDataStruct *fCellDataPtr;                   //! transient
143
144   /** Pointer to the digit container */
145   AliHLTPHOSDigitContainerDataStruct *fDigitContainerStructPtr;  //! transient
146
147   /** Pointer to the digit TClonesArray */
148   TClonesArray *fDigitArrayPtr;                                  //! transient
149
150   /** Pointer to a AliHLTPHOSDigitDataStruct */
151   AliHLTPHOSDigitDataStruct *fDigitStructPtr;                    //! transient
152
153   /** Digit count */
154   Int_t fDigitCount;                                             //COMMENT
155
156   /** High gain energy conversion factors */
157   Float_t fHighGainFactors[N_XCOLUMNS_MOD][N_ZROWS_MOD];         //COMMENT
158
159   /** Low gain energy conversion factors */
160   Float_t fLowGainFactors[N_XCOLUMNS_MOD][N_ZROWS_MOD];          //COMMENT
161
162    /** Threshold for making digit ( zero suppression threshold) */
163   Float_t fDigitThresholds[N_XCOLUMNS_MOD][N_ZROWS_MOD][N_GAINS]; //COMMENT
164
165   ClassDef(AliHLTPHOSDigitMaker, 1); 
166 };
167
168
169 #endif
170