]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSClusterizer.h
- fixes due to new PHOS mapping
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSClusterizer.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4 /**************************************************************************
5  * This file is property of and copyright by the ALICE HLT Project        * 
6  * All rights reserved.                                                   *
7  *                                                                        *
8  * Primary Authors: Oystein Djuvsland                                     *
9  *                                                                        *
10  * Permission to use, copy, modify and distribute this software and its   *
11  * documentation strictly for non-commercial purposes is hereby granted   *
12  * without fee, provided that the above copyright notice appears in all   *
13  * copies and that both the copyright notice and this permission notice   *
14  * appear in the supporting documentation. The authors make no claims     *
15  * about the suitability of this software for any purpose. It is          * 
16  * provided "as is" without express or implied warranty.                  *
17  **************************************************************************/
18
19 #ifndef ALIHLTPHOSCLUSTERIZER_H
20 #define ALIHLTPHOSCLUSTERIZER_H
21
22
23 /**
24  * Class does clusterization in for PHOS on an event basis. It is intended 
25  * for use in HLT, but can also be used offline
26  *
27  * @file   AliHLTPHOSClusterizer.h
28  * @author Oystein Djuvsland
29  * @date
30  * @brief  Clusterizer for PHOS HLT
31  */
32
33 // see header file for class documentation
34 // or
35 // refer to README to build package
36 // or
37 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
38
39 #include "AliHLTPHOSBase.h"
40 #include "AliPHOSLoader.h"
41
42 #include "AliHLTPHOSRecPointContainerStruct.h"
43 #include "AliHLTPHOSRecPointDataStruct.h"
44 #include "AliHLTPHOSDigitContainerDataStruct.h"
45 #include "AliHLTPHOSDigitDataStruct.h"
46
47 #include "AliPHOSGeometry.h"
48
49 class TClonesArray;
50 class AliPHOSDigit;
51 class AliPHOSRecoParamEmc;
52 class AliPHOSRecoParam;
53
54 /** 
55  * @class AliHLTPHOSClusterizer
56  * Clusterizer for PHOS HLT. The clusterizer takes digits as input, either
57  * in the form of a container of AliHLTPHOSDigitDataStruct or a
58  * TClonesArray of AliPHOSDigit through an instance of a AliPHOSLoader
59  *
60  * @ingroup alihlt_phos
61  */
62 class AliHLTPHOSClusterizer : public AliHLTPHOSBase
63 {
64   
65 public:
66   
67   /** Constructor */
68   AliHLTPHOSClusterizer();    
69   
70   /** Destructor */
71   virtual ~AliHLTPHOSClusterizer();
72
73   /** Copy constructor */  
74   AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) : 
75     AliHLTPHOSBase(),
76     fRecPointDataPtr(0),
77     fDigitDataPtr(0),
78     fEmcClusteringThreshold(0),
79     fEmcMinEnergyThreshold(0),
80     fEmcTimeGate(0),
81     fDigitsInCluster(0),
82     fDigitContainerPtr(0),
83     fMaxDigitIndexDiff(2*NZROWSMOD)
84   {
85     //Copy constructor not implemented
86   }
87   
88   /** Assignment */
89   AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
90   {
91     //Assignment
92     return *this; 
93   }
94   
95   /** Set digit container */
96   void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
97   { fDigitContainerPtr = digitContainerPtr; }
98
99   /** Set rec point data buffer */
100   void SetRecPointDataPtr(AliHLTPHOSRecPointDataStruct* recPointDataPtr);
101
102   /** Set reco parameters */
103   void SetRecoParameters(AliPHOSRecoParam* recoPars);
104
105   /** Set emc clustering threshold */
106   void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
107
108   /** Set emc min energy threshold */
109   void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
110
111   /** Set emc time gate */
112   void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
113   
114   /** Starts clusterization of the event */ 
115   virtual Int_t ClusterizeEvent(UInt_t availableSize, UInt_t& totSize);
116   
117   /**
118    * For a given digit this digit scans for neighbouring digits which 
119    * passes the threshold for inclusion in a rec point. If one is found 
120    * it is added to the current rec point
121    * @param digIndex index of the digit in the digit container
122    * @param recPoint pointer to the current rec point
123    */
124   virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
125
126   /**
127    * Checks if two digits are neighbours
128    * @param d1 first digit
129    * @param d2 second digit
130    */
131   virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
132
133
134 protected:
135
136   /** Pointer to the rec point output */
137   AliHLTPHOSRecPointDataStruct* fRecPointDataPtr;              //! transient
138
139   /** Pointer to the digit output */
140   AliHLTPHOSDigitDataStruct* fDigitDataPtr;                    //! transient
141
142   /** Energy threshold for starting a cluster for the calorimeter */
143   Float_t fEmcClusteringThreshold;                             //COMMENT
144
145   /** Energy threshold for including a crystal in a cluster */
146   Float_t fEmcMinEnergyThreshold;                              //COMMENT
147
148   /** Maximum time difference for inclusion in a rec point */
149   Float_t fEmcTimeGate;                                        //COMMENT
150
151   /** Counts the digits in a rec point */
152   Int_t fDigitsInCluster;                                      //COMMENT
153
154   /** Contains the digits from one event */
155   AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr;      //! transient
156
157   /** Maximum difference in index to be a neighbour */
158   Int_t fMaxDigitIndexDiff;                                    //COMMENT
159
160   ClassDef(AliHLTPHOSClusterizer, 0);
161 };
162
163 #endif