]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCZeroSuppressionComponent.h
bug fix for several input blocks
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCZeroSuppressionComponent.h
1 // XEmacs -*-C++-*-
2 // @(#) $Id: AliHLTTPCClusterFinderComponent.h 23318 2008-01-14 12:43:28Z hristov $
3
4 #ifndef ALIHLTTPCZEROSUPPRESSIONCOMPONENT_H
5 #define ALIHLTTPCZEROSUPPRESSIONCOMPONENT_H
6
7 //* This file is property of and copyright by the ALICE HLT Project        * 
8 //* ALICE Experiment at CERN, All rights reserved.                         *
9 //* See cxx source for full Copyright notice                               *
10
11 /** @file   AliHLTTPCZeroSuppressionComponent.h
12     @author Kenneth Aamodt
13     @date   
14     @brief  Component for ZeroSuppression
15 */
16
17 #include "AliHLTProcessor.h"
18 #include "AliHLTTPCPad.h"
19 #include "AliHLTDataTypes.h"
20
21 class AliHLTTPCDigitReader;
22
23 /**
24  * @class AliHLTTPCZeroSuppressionComponent
25  * Implementation of the zero suppression component.
26  * The component implements the interface methods of the @ref AliHLTProcessor.
27  * It reads the data pad by pad and zerosuppress the data. The output is unpacked which is 
28  * sent to the clulsterfinder.
29  * 
30  * The component has the following component arguments:
31  * - adc-threshold   ADC count threshold for zero suppression.
32  *
33  * - rms-threshold   RMS threshold for zero suppression.
34  *          
35  * - first-timebin   The first timebin for zero suppression
36  *
37  * - last-timebin    The last timebin for zero suppression
38  *
39  * - occupancy-limit Minimum number of timebins with signal
40  *
41  * - sort-pads Flag to switch on pad sorting(needed by the SORTED clusterfinder)
42  *
43  * @ingroup alihlt_tpc_components
44  */
45 class AliHLTTPCZeroSuppressionComponent : public AliHLTProcessor
46     {
47     public:
48         /** constructor */
49         AliHLTTPCZeroSuppressionComponent();
50         /** destructor */
51         virtual ~AliHLTTPCZeroSuppressionComponent();
52
53         // Public functions to implement AliHLTComponent's interface.
54         // These functions are required for the registration process
55
56   /** interface function, see AliHLTComponent for description */
57   const char* GetComponentID();
58   /** interface function, see AliHLTComponent for description */
59   void GetInputDataTypes( vector<AliHLTComponentDataType>& list);
60   /** interface function, see AliHLTComponent for description */
61   AliHLTComponentDataType GetOutputDataType();
62   /** interface function, see AliHLTComponent for description */
63   int GetOutputDataTypes(AliHLTComponentDataTypeList& tgtList);
64   /** interface function, see AliHLTComponent for description */
65   virtual void GetOutputDataSize( unsigned long& constBase, double& inputMultiplier );
66   /** interface function, see AliHLTComponent for description */
67   AliHLTComponent* Spawn();
68
69       Int_t DeInitializePadArray();
70       void InitializePadArray();
71     protected:
72         
73         // Protected functions to implement AliHLTComponent's interface.
74         // These functions provide initialization as well as the actual processing
75         // capabilities of the component. 
76
77         int DoInit( int argc, const char** argv );
78         int DoDeinit();
79         int DoEvent( const AliHLTComponentEventData& evtData, const AliHLTComponentBlockData* blocks, 
80                      AliHLTComponentTriggerData& trigData, AliHLTUInt8_t* outputPtr, 
81                      AliHLTUInt32_t& size, vector<AliHLTComponentBlockData>& outputBlocks );
82         using AliHLTProcessor::DoEvent;
83
84     private:
85
86       /** copy constructor prohibited */
87       AliHLTTPCZeroSuppressionComponent(const AliHLTTPCZeroSuppressionComponent&);
88         
89       /** assignment operator prohibited */
90       AliHLTTPCZeroSuppressionComponent& operator=(const AliHLTTPCZeroSuppressionComponent&);
91         
92       /** the reader object for data decoding */
93       AliHLTTPCDigitReader* fDigitReader;                              //!transient
94
95       /** Vector of pointers to pad objects */
96       typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
97       
98       /** 2D vector of pointers to pad objects (vector of vectors)*/
99       vector<AliHLTTPCPadVector> fRowPadVector;                        //! transient
100       
101       /** Array containing number of pads in the different rows */
102       Int_t* fNumberOfPadsInRow;                                      //! transient
103       
104       /** Number of rows the patch has */
105       Int_t fNumberOfRows;                                            //! transient
106
107       /** Current patch number */
108       UInt_t fCurrentPatch;                                            //! transient
109
110       /** First row in patch */
111       UInt_t fFirstRow;                                                //! transient
112
113       /** Last row in patch */
114       UInt_t fLastRow;                                                 //! transient
115       
116       /** First timebin to include in zerosuppression */
117       Int_t fStartTimeBin;                                             //! transient
118
119       /** Lasr timebin to include in zerosuppression */
120       Int_t fEndTimeBin;                                               //! transient
121
122       /** Number of timebins */
123       Int_t fNTimeBins;                                                //! transient
124
125       /** Number of RMS the signal has to be larger than */
126       Double_t fNRMSThreshold;                                         //! transient
127
128       /** Signal threshold (signal has to be greater than average + this number) */
129       Int_t fSignalThreshold;                                          //! transient
130
131       /** Minimum number of signals to do zerosuppression */
132       Int_t fMinimumNumberOfSignals;                                   //! transient
133
134       /** OldRCUFormat flag */
135       UInt_t fOldRCUFormat;                                            //! transient
136
137       /** Sort pads flag */
138       Bool_t fSortPads;                                                //! transient
139
140       /** Flag to check if the 2d vector is initialized */
141       Bool_t fVectorInitialized;                                       //! transient
142
143       /** Value below average (useful for noisy pads to get the tails of a signal) */
144       Int_t fValueBelowAverage;                                        //! transient
145
146       /** Number of timebins to look left(decreasing time direction) for tails */
147       Int_t fLeftTimeBin;                                              //! transient
148
149       /** Number of timebins to look right(increasing time direction) for tails */
150       Int_t fRightTimeBin;                                             //! transient
151
152       /** Flag to switch on active pads selection */
153       Bool_t fGetActivePads;                                           //! transient
154
155       /** Flag to switch off data being sent to output */
156       Bool_t fSkipSendingZSData;
157
158       /** Flag to switch off hw list being sent to output */
159       Bool_t fSendHWList;
160
161       /** Vector of active pad hardware addresses */
162       vector<AliHLTUInt16_t> fHwAddressList;                  //! transient
163
164       ClassDef(AliHLTTPCZeroSuppressionComponent, 0)  
165     };
166 #endif