]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSClusterizer.h
Major commit related to steering of the reco parameters: AliDAQ and trigger classes...
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSClusterizer.h
1 /**************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project        * 
3  * All rights reserved.                                                   *
4  *                                                                        *
5  * Primary Authors: Oystein Djuvsland                                     *
6  *                                                                        *
7  * Permission to use, copy, modify and distribute this software and its   *
8  * documentation strictly for non-commercial purposes is hereby granted   *
9  * without fee, provided that the above copyright notice appears in all   *
10  * copies and that both the copyright notice and this permission notice   *
11  * appear in the supporting documentation. The authors make no claims     *
12  * about the suitability of this software for any purpose. It is          * 
13  * provided "as is" without express or implied warranty.                  *
14  **************************************************************************/
15
16 #ifndef ALIHLTPHOSCLUSTERIZER_H
17 #define ALIHLTPHOSCLUSTERIZER_H
18
19
20 /**
21  * Class does clusterization in for PHOS on an event basis. It is intended 
22  * for use in HLT, but can also be used offline
23  *
24  * @file   AliHLTPHOSClusterizer.h
25  * @author Oystein Djuvsland
26  * @date
27  * @brief  Clusterizer for PHOS HLT
28  */
29
30 // see header file for class documentation
31 // or
32 // refer to README to build package
33 // or
34 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
35
36 #include "AliHLTPHOSBase.h"
37 #include "AliPHOSLoader.h"
38
39 #include "AliHLTPHOSRecPointContainerStruct.h"
40 #include "AliHLTPHOSRecPointDataStruct.h"
41 #include "AliHLTPHOSDigitContainerDataStruct.h"
42 #include "AliHLTPHOSDigitDataStruct.h"
43
44 #include "AliPHOSGeometry.h"
45
46 class TClonesArray;
47 class AliPHOSDigit;
48 class AliPHOSRecoParam;
49
50 /** 
51  * @class AliHLTPHOSClusterizer
52  * Clusterizer for PHOS HLT. The clusterizer takes digits as input, either
53  * in the form of a container of AliHLTPHOSDigitDataStruct or a
54  * TClonesArray of AliPHOSDigit through an instance of a AliPHOSLoader
55  *
56  * @ingroup alihlt_phos
57  */
58 class AliHLTPHOSClusterizer : public AliHLTPHOSBase
59 {
60   
61 public:
62   
63   /** Constructor */
64   AliHLTPHOSClusterizer();    
65   
66   /** Destructor */
67   virtual ~AliHLTPHOSClusterizer();
68
69   /** Copy constructor */  
70   AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) : 
71     AliHLTPHOSBase(),
72     fEmcClusteringThreshold(0),
73     fEmcMinEnergyThreshold(0),
74     fEmcTimeGate(0),
75     fLogWeight(0),
76     fDigitsInCluster(0),
77     fOnlineMode(true),
78     fDigitArrayPtr(0),
79     fEmcRecPointsPtr(0),
80     fDigitPtr(0),
81     fDigitContainerPtr(0),
82     fRecPointContainerPtr(0),
83     fPHOSGeometry(0),
84     fGetterPtr(0)
85   {
86     //Copy constructor not implemented
87   }
88   
89   /** Assignment */
90   AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
91   {
92     //Assignment
93     return *this; 
94   }
95   
96   /** Set digit container */
97   void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
98   { fDigitContainerPtr = digitContainerPtr; }
99
100   /** Set rec point container */
101   void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *recPointContainerPtr);
102
103
104   /** Set reco parameters */
105   void SetRecoParameters(AliPHOSRecoParam* recoPars);
106
107   /** Set emc clustering threshold */
108   void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
109
110   /** Set emc min energy threshold */
111   void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
112
113   /** Set emc time gate */
114   void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
115
116   /** Set log weight */
117   void SetLogWeight(Float_t weight) { fLogWeight = weight; }  
118     
119   /** 
120    * Set offline mode
121    * @param getter pointer to an instance of AliPHOSGetter
122    */
123   void SetOfflineMode(AliPHOSLoader* getter); 
124   
125   /** Starts clusterization of the event */ 
126   virtual Int_t ClusterizeEvent();
127
128   /** 
129    * Gets an event, for offline mode
130    * @param evtNr event number to get
131    */
132   virtual Int_t GetEvent(Int_t evtNr);
133   
134   /** Get number of events */
135   Int_t GetNEvents();
136
137   /**
138    * For a given digit this digit scans for neighbouring digits which 
139    * passes the threshold for inclusion in a rec point. If one is found 
140    * it is added to the current rec point
141    * @param digIndex index of the digit in the digit container
142    * @param recPoint pointer to the current rec point
143    */
144   virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
145
146   /**
147    * Checks if two digits are neighbours
148    * @param d1 first digit
149    * @param d2 second digit
150    */
151   virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
152
153   /** Calculates the center of gravity of a rec point */
154   virtual void CalculateCenterOfGravity();
155
156 private:
157   /** Energy threshold for starting a cluster for the calorimeter */
158   Float_t fEmcClusteringThreshold;                             //COMMENT
159
160   /** Energy threshold for including a crystal in a cluster */
161   Float_t fEmcMinEnergyThreshold;                              //COMMENT
162
163   /** Maximum time difference for inclusion in a rec point */
164   Float_t fEmcTimeGate;                                        //COMMENT
165
166   /** Variable used in calculation of the center of gravity for a rec point */
167   Float_t fLogWeight;                                          //COMMENT
168
169   /** Counts the digits in a rec point */
170   Int_t fDigitsInCluster;                                      //COMMENT
171
172   /** Online mode flag */
173   Bool_t fOnlineMode;                                          //COMMENT
174   
175   /** Array of digits from one event, used in offline mode */
176   TClonesArray *fDigitArrayPtr;                                //! transient
177
178   /** Array of reconstruction points from one event, used in offline mode */ 
179   TObjArray *fEmcRecPointsPtr;                                 //! transient
180
181   /** Pointer to digit */
182   AliPHOSDigit *fDigitPtr;                                     //! transient
183
184   /** Contains the digits from one event */
185   AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr;      //! transient
186
187   /** Contains the reconstruction points from one event */
188   AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr;    //! transient
189
190   /** Instance of the PHOS geometry class */
191   AliPHOSGeometry *fPHOSGeometry;                              //! transient
192   
193   /** Instance of the PHOS getter, used in offline mode */    
194   AliPHOSLoader *fGetterPtr;                                   //! transient
195   
196   ClassDef(AliHLTPHOSClusterizer, 1);
197 };
198
199 #endif