]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSDigitMaker.h
Fixing memory leaks (Christian)
[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 AliHLTPHOSDigit;
46 class TClonesArray;
47 class TTree;
48 class AliHLTPHOSValidCellDataStruct;
49 class AliHLTPHOSRcuCellEnergyDataStruct;
50 class AliHLTPHOSDigitContainerDataStruct;
51 class AliHLTPHOSDigitDataStruct;
52 class AliHLTPHOSSharedMemoryInterface; // added by PTH
53        
54 using namespace PhosHLTConst;
55
56 class AliHLTPHOSDigitMaker : public AliHLTPHOSBase
57 {
58 public:
59
60   /** Constructor */
61   AliHLTPHOSDigitMaker();
62
63   /** Destructor */
64   virtual ~AliHLTPHOSDigitMaker();
65  
66   // void SetValidCellData(AliHLTPHOSValidCellDataStruct *data) { fCellDataPtr = data; }
67   //  void SetDigitContainerStruct(AliHLTPHOSDigitContainerStruct *container) 
68   //{ fDigitContainerStructPtr = container; }
69    
70   /**
71    * Sets the AliHLTPHOSDigitDataStruct container 
72    * @param container the digit container
73    */
74   void SetDigitContainerStruct(AliHLTPHOSDigitContainerDataStruct *container) 
75   { fDigitContainerStructPtr = container; }
76
77   /** 
78    * Sets the TClonesArray of AliHLTPHOSDigit 
79    * @param array the array
80    */
81   void SetDigitArray(TClonesArray *array) { fDigitArrayPtr = array; }
82
83   /** 
84    * Sets the digit threshold 
85    * @param threshold the threshold
86    */
87   void SetDigitThreshold(Int_t threshold) { fDigitThreshold = threshold; }
88
89   /**
90    * Sets the number of pre samples
91    * @param n the number of pre samples
92    */
93   void SetNrPresamples(Int_t n) { fNrPresamples = n; }
94
95   /**
96    * Make the digits for one event.
97    * @param rcuCellEnergies is the data from the AliHLTPHOSRawAnalyzer
98    * @return the number of digits found
99    */
100   Int_t MakeDigits(AliHLTPHOSRcuCellEnergyDataStruct* rcuCellEnergies);
101
102   /** Reset the digit maker */
103   void Reset();
104
105 private:
106
107   /** Pointer to valid cell list */
108   AliHLTPHOSValidCellDataStruct *fCellDataPtr;                   //! transient
109
110   /** Pointer to the digit container */
111   AliHLTPHOSDigitContainerDataStruct *fDigitContainerStructPtr;  //! transient
112
113   /** Pointer to the digit TClonesArray */
114   TClonesArray *fDigitArrayPtr;                                  //! transient
115
116   /** Pointer to a AliHLTPHOSDigit */
117   AliHLTPHOSDigit *fDigitPtr;                                    //! transient
118
119   /** Pointer to a AliHLTPHOSDigitDataStruct */
120   AliHLTPHOSDigitDataStruct *fDigitStructPtr;                    //! transient
121
122   /** Digit count */
123   Int_t fDigitCount; 
124
125   /** Number of presamples */
126   Int_t fNrPresamples; 
127
128   /** Threshold for making digit ( zero suppression threshold) */
129   Float_t fDigitThreshold; 
130   AliHLTPHOSSharedMemoryInterface *fShmPtr; //added by PTH
131   ClassDef(AliHLTPHOSDigitMaker, 1); 
132 };
133
134
135 #endif
136