]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCPadArray.h
7743ce87d3d5c5a438604a1aedcd417ffa0d800a
[u/mrichter/AliRoot.git] / HLT / TPCLib / AliHLTTPCPadArray.h
1 // -*- Mode: C++ -*-
2 // @(#) $Id$
3
4 #ifndef ALIHLTTPCPADARRAY_H
5 #define ALIHLTTPCPADARRAY_H
6 /* This file is property of and copyright by the ALICE HLT Project        * 
7  * ALICE Experiment at CERN, All rights reserved.                         *
8  * See cxx source for full Copyright notice                               */
9
10 /** @file   AliHLTTPCPadArray.h
11     @author Kenneth Aamodt
12     @date   
13     @brief  Class containing arrays of TPC Pads.
14 */
15
16 // see below for class documentation
17 // or
18 // refer to README to build package
19 // or
20 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
21
22 #include "AliHLTLogging.h"
23 #include "AliHLTTPCTransform.h"
24 #include "AliHLTTPCClusters.h"
25 #include <vector>
26
27 typedef Int_t AliHLTTPCSignal_t;
28 class AliHLTTPCDigitReader;
29 class AliHLTTPCPad;
30
31 /**
32  * @class AliHLTTPCPadArray
33  * TODO
34  */
35
36 class AliHLTTPCPadArray : public AliHLTLogging {
37
38 public:
39
40   /**
41    * Data exchange structure to propagate the information about
42    * active pads from the component carrying out the selection.
43    * Currently it's the AliHLTTPCClusterFinderComponent, but the code
44    * is encapsulated into AliHLTTPCPad/AliHLTTPCPadArray.
45    *
46    * Data type: @ref AliHLTTPCDefinitions::fgkActivePadsDataType
47    * {ACTIVPAD,TPC }
48    */
49   struct AliHLTTPCActivePads
50   {
51     UInt_t fRow;           //row value
52     UInt_t fPad;           //pad value
53   };
54   typedef struct AliHLTTPCActivePads AliHLTTPCActivePads; //!
55
56
57   /** standard constructor */
58   AliHLTTPCPadArray();
59
60   /** 
61    * Constructor
62    * @param patch   Patch number, either use this constructor or 
63    * use the default constructor and the SetPatch method
64    *
65    */
66   AliHLTTPCPadArray(Int_t patch);
67
68   /** standard destructor */
69   virtual ~AliHLTTPCPadArray();
70
71   /**
72    * Initialize the pad vector for the patch set.
73    *@param mode Switch to keep raw data or not
74    */
75   Int_t InitializeVector(Int_t mode);
76
77   /**
78    * Deinitialize the pad vector for the patch set.
79    */
80   Int_t DeInitializeVector();
81   
82   /**
83    * Loop over all pads setting their data array to -1.
84    */
85   void DataToDefault();
86   
87   /**
88    * Set the patch number.
89    */
90   void SetPatch(Int_t patch);
91
92   /**
93    * Get the patch number.
94    */
95   Int_t GetPatch(){return fPatch;}
96
97   /**
98    * Set the digit reader.
99    */
100   void SetDigitReader(AliHLTTPCDigitReader* digitReader);
101
102   /**
103    * Reads the data, and set it in the Pad objects.
104    */
105   Int_t ReadData(Int_t mode);
106
107   /**
108    * Retuns number of pads in this row.
109    */
110   Int_t GetNumberOfPads(Int_t row) const {return fNumberOfPadsInRow[row];}
111
112   /**
113    * Loop over all pads, checking for clustercandidates.
114    */
115   void FindClusterCandidates();
116   
117   /**
118    *
119    * Loop over all pads looking for clusters, if cluster candidates on two neighbouring
120    * pads have a mean time difference of <match it is said to be a cluster.
121    *
122    */
123   void FindClusters(Int_t match);
124
125   /**
126    * Print the values of the cluster, used for debugging purposes.
127    */
128   void PrintClusters();
129
130   /**
131    * Set the Signal Threshold
132    */
133   void SetSignalThreshold(Int_t i){fSignalThreshold=i;}
134
135   /**
136    * Set the nSigma threshold
137    */
138   void SetNSigmaThreshold(Double_t i){fNSigmaThreshold=i;}
139
140
141   /**
142    * Loop over all pads adding pads with signal to active pads
143    * Returns number of active pads
144    *
145    */
146   Int_t GetActivePads(AliHLTTPCActivePads* activePads, Int_t maxActivePads);
147
148   typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
149
150   vector<AliHLTTPCPadVector> fRowPadVector;                        //! transient
151
152   vector<AliHLTTPCClusters> fClusters;                             //! transient
153
154 private:
155   /** copy constructor prohibited */
156   AliHLTTPCPadArray(const AliHLTTPCPadArray&);
157   /** assignment operator prohibited */
158   AliHLTTPCPadArray& operator=(const AliHLTTPCPadArray&);
159
160   /** The patch number */
161   Int_t fPatch;                                                    //! transient
162
163   Int_t fFirstRow;                                                 //! transient
164
165   Int_t fLastRow;                                                  //! transient
166
167   //TODO: I suggest making the following UInt_t if it is never supposed to be negative. Will do!
168   /* total charge of Cluster threshold*/
169   Int_t fThreshold;                                                //! transient
170
171   //TODO: I suggest making the following UInt_t if it is never supposed to be negative.
172   Int_t fSignalThreshold;                                                //! transient
173
174   //TODO: I suggest making the following UInt_t if it is never supposed to be negative.
175   Double_t fNSigmaThreshold;                                                //! transient
176
177   Int_t* fNumberOfPadsInRow;                                       //! transient
178
179   Int_t fNumberOfRows;                                             //! transient
180
181   AliHLTTPCDigitReader* fDigitReader;                              //! transient
182
183   ClassDef(AliHLTTPCPadArray, 0);
184 };
185 #endif // ALIHLTTPCPADARRAY_H