4 /**************************************************************************
5 * This file is property of and copyright by the ALICE HLT Project *
6 * All rights reserved. *
8 * Primary Authors: Oystein Djuvsland *
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 **************************************************************************/
19 #ifndef ALIHLTPHOSCLUSTERIZER_H
20 #define ALIHLTPHOSCLUSTERIZER_H
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
27 * @file AliHLTPHOSClusterizer.h
28 * @author Oystein Djuvsland
30 * @brief Clusterizer for PHOS HLT
33 // see header file for class documentation
35 // refer to README to build package
37 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
40 #include "AliHLTPHOSRecPointContainerStruct.h"
41 #include "AliHLTPHOSRecPointDataStruct.h"
42 #include "AliHLTPHOSDigitContainerDataStruct.h"
43 #include "AliHLTPHOSDigitDataStruct.h"
44 #include "AliHLTLogging.h"
46 #include "AliPHOSGeometry.h"
48 class AliHLTPHOSDigitReader;
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
56 * @ingroup alihlt_phos
58 //class AliHLTPHOSClusterizer : public AliHLTPHOSBase
59 class AliHLTPHOSClusterizer : public AliHLTLogging
65 AliHLTPHOSClusterizer();
68 virtual ~AliHLTPHOSClusterizer();
70 /** Copy constructor */
71 AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) :
78 fEmcClusteringThreshold(0),
79 fEmcMinEnergyThreshold(0),
82 fDigitContainerPtr(0),
83 fMaxDigitIndexDiff(2*NZROWSMOD),
87 //Copy constructor not implemented
91 AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
97 /** Set digit container */
98 void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
99 { fDigitContainerPtr = digitContainerPtr; }
101 /** Set rec point data buffer */
102 void SetRecPointDataPtr(AliHLTPHOSRecPointDataStruct* recPointDataPtr);
104 /** Set emc clustering threshold */
105 void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
107 /** Set emc min energy threshold */
108 void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
110 /** Set emc time gate */
111 void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
113 /** Starts clusterization of the event */
114 virtual Int_t ClusterizeEvent(AliHLTPHOSDigitHeaderStruct *digitHeader, UInt_t availableSize, UInt_t& totSize);
117 * For a given digit this digit scans for neighbouring digits which
118 * passes the threshold for inclusion in a rec point. If one is found
119 * it is added to the current rec point
120 * @param recPoint pointer to the current rec point
122 virtual Int_t ScanForNeighbourDigits(AliHLTPHOSRecPointDataStruct* recPoint, AliHLTPHOSDigitDataStruct *digit);
125 * Checks if two digits are neighbours
126 * @param d1 first digit
127 * @param d2 second digit
129 virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
134 /** Pointer to the rec point output */
135 AliHLTPHOSRecPointDataStruct* fRecPointDataPtr; //! transient
137 /** Pointer to the digit output */
138 AliHLTPHOSDigitDataStruct* fDigitDataPtr; //! transient
140 /** Pointer to the digit output */
141 AliHLTPHOSDigitDataStruct* fCurrentDigit; //! transient
143 /** Pointer to the digit output */
144 AliHLTPHOSDigitDataStruct* fStartDigit; //! transient
146 /** Pointer to the digit output */
147 AliHLTPHOSDigitDataStruct* fPreviousDigit; //! transient
148 /** Energy threshold for starting a cluster for the calorimeter */
149 Float_t fEmcClusteringThreshold; //COMMENT
151 /** Energy threshold for including a crystal in a cluster */
152 Float_t fEmcMinEnergyThreshold; //COMMENT
154 /** Maximum time difference for inclusion in a rec point */
155 Float_t fEmcTimeGate; //COMMENT
157 /** Counts the digits in a rec point */
158 Int_t fDigitsInCluster; //COMMENT
160 /** Contains the digits from one event */
161 AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
163 /** Maximum difference in index to be a neighbour */
164 Int_t fMaxDigitIndexDiff; //COMMENT
166 /** Current available buffer size */
167 UInt_t fAvailableSize; //COMMENT
169 /** object reading the digit */
170 AliHLTPHOSDigitReader *fDigitReader; //COMMENT
172 ClassDef(AliHLTPHOSClusterizer, 0);