]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/TPCLib/AliHLTTPCPadArray.h
incremented library version
[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    */
74   Int_t InitializeVector();
75
76   /**
77    * Deinitialize the pad vector for the patch set.
78    */
79   Int_t DeInitializeVector();
80   
81   /**
82    * Loop over all pads setting their data array to -1.
83    */
84   void DataToDefault();
85   
86   /**
87    * Set the patch number.
88    */
89   void SetPatch(Int_t patch);
90
91   /**
92    * Get the patch number.
93    */
94   Int_t GetPatch(){return fPatch;}
95
96   /**
97    * Set the digit reader.
98    */
99   void SetDigitReader(AliHLTTPCDigitReader* digitReader);
100
101   /**
102    * Reads the data, and set it in the Pad objects.
103    */
104   Int_t ReadData();
105
106   /**
107    * Retuns number of pads in this row.
108    */
109   Int_t GetNumberOfPads(Int_t row) const {return fNumberOfPadsInRow[row];}
110
111   /**
112    * Loop over all pads, checking for clustercandidates.
113    */
114   void FindClusterCandidates();
115   
116   /**
117    *
118    * Loop over all pads looking for clusters, if cluster candidates on two neighbouring
119    * pads have a mean time difference of <match it is said to be a cluster.
120    *
121    */
122   void FindClusters(Int_t match);
123
124   /**
125    * Print the values of the cluster, used for debugging purposes.
126    */
127   void PrintClusters();
128
129   /**
130    * Set the Signal Threshold
131    */
132   void SetSignalThreshold(Int_t i){fSignalThreshold=i;}
133
134   /**
135    * Set the nSigma threshold
136    */
137   void SetNSigmaThreshold(Double_t i){fNSigmaThreshold=i;}
138
139
140   /**
141    * Loop over all pads adding pads with signal to active pads
142    * Returns number of active pads
143    *
144    */
145   Int_t GetActivePads(AliHLTTPCActivePads* activePads, Int_t maxActivePads);
146
147   typedef vector<AliHLTTPCPad*> AliHLTTPCPadVector;
148
149   vector<AliHLTTPCPadVector> fRowPadVector;                        //! transient
150
151   vector<AliHLTTPCClusters> fClusters;                             //! transient
152
153 private:
154   /** copy constructor prohibited */
155   AliHLTTPCPadArray(const AliHLTTPCPadArray&);
156   /** assignment operator prohibited */
157   AliHLTTPCPadArray& operator=(const AliHLTTPCPadArray&);
158
159   /** The patch number */
160   Int_t fPatch;                                                    //! transient
161
162   Int_t fFirstRow;                                                 //! transient
163
164   Int_t fLastRow;                                                  //! transient
165
166   //TODO: I suggest making the following UInt_t if it is never supposed to be negative. Will do!
167   /* total charge of Cluster threshold*/
168   Int_t fThreshold;                                                //! transient
169
170   //TODO: I suggest making the following UInt_t if it is never supposed to be negative.
171   Int_t fSignalThreshold;                                                //! transient
172
173   //TODO: I suggest making the following UInt_t if it is never supposed to be negative.
174   Double_t fNSigmaThreshold;                                                //! transient
175
176   Int_t* fNumberOfPadsInRow;                                       //! transient
177
178   Int_t fNumberOfRows;                                             //! transient
179
180   AliHLTTPCDigitReader* fDigitReader;                              //! transient
181
182   ClassDef(AliHLTTPCPadArray, 0);
183 };
184 #endif // ALIHLTTPCPADARRAY_H