1 /**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
5 * Primary Authors: Oystein Djuvsland *
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 **************************************************************************/
16 #ifndef ALIHLTPHOSCLUSTERIZER_H
17 #define ALIHLTPHOSCLUSTERIZER_H
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
24 * @file AliHLTPHOSClusterizer.h
25 * @author Oystein Djuvsland
27 * @brief Clusterizer for PHOS HLT
30 // see header file for class documentation
32 // refer to README to build package
34 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
36 #include "AliHLTPHOSBase.h"
37 #include "AliPHOSLoader.h"
39 #include "AliHLTPHOSRecPointContainerStruct.h"
40 #include "AliHLTPHOSRecPointDataStruct.h"
41 #include "AliHLTPHOSDigitContainerDataStruct.h"
42 #include "AliHLTPHOSDigitDataStruct.h"
44 #include "AliPHOSGeometry.h"
48 class AliPHOSRecoParam;
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
64 AliHLTPHOSClusterizer();
67 virtual ~AliHLTPHOSClusterizer();
69 /** Copy constructor */
70 AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) :
72 fEmcClusteringThreshold(0),
73 fEmcMinEnergyThreshold(0),
81 fDigitContainerPtr(0),
82 fRecPointContainerPtr(0),
86 //Copy constructor not implemented
90 AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
96 /** Set digit container */
97 void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
98 { fDigitContainerPtr = digitContainerPtr; }
100 /** Set rec point container */
101 void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *recPointContainerPtr);
104 /** Set reco parameters */
105 void SetRecoParameters(AliPHOSRecoParam* recoPars);
107 /** Set emc clustering threshold */
108 void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
110 /** Set emc min energy threshold */
111 void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
113 /** Set emc time gate */
114 void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
116 /** Set log weight */
117 void SetLogWeight(Float_t weight) { fLogWeight = weight; }
121 * @param getter pointer to an instance of AliPHOSGetter
123 void SetOfflineMode(AliPHOSLoader* getter);
125 /** Starts clusterization of the event */
126 virtual Int_t ClusterizeEvent();
129 * Gets an event, for offline mode
130 * @param evtNr event number to get
132 virtual Int_t GetEvent(Int_t evtNr);
134 /** Get number of events */
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
144 virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
147 * Checks if two digits are neighbours
148 * @param d1 first digit
149 * @param d2 second digit
151 virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
153 /** Calculates the center of gravity of a rec point */
154 virtual void CalculateCenterOfGravity();
157 /** Energy threshold for starting a cluster for the calorimeter */
158 Float_t fEmcClusteringThreshold; //COMMENT
160 /** Energy threshold for including a crystal in a cluster */
161 Float_t fEmcMinEnergyThreshold; //COMMENT
163 /** Maximum time difference for inclusion in a rec point */
164 Float_t fEmcTimeGate; //COMMENT
166 /** Variable used in calculation of the center of gravity for a rec point */
167 Float_t fLogWeight; //COMMENT
169 /** Counts the digits in a rec point */
170 Int_t fDigitsInCluster; //COMMENT
172 /** Online mode flag */
173 Bool_t fOnlineMode; //COMMENT
175 /** Array of digits from one event, used in offline mode */
176 TClonesArray *fDigitArrayPtr; //! transient
178 /** Array of reconstruction points from one event, used in offline mode */
179 TObjArray *fEmcRecPointsPtr; //! transient
181 /** Pointer to digit */
182 AliPHOSDigit *fDigitPtr; //! transient
184 /** Contains the digits from one event */
185 AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
187 /** Contains the reconstruction points from one event */
188 AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr; //! transient
190 /** Instance of the PHOS geometry class */
191 AliPHOSGeometry *fPHOSGeometry; //! transient
193 /** Instance of the PHOS getter, used in offline mode */
194 AliPHOSLoader *fGetterPtr; //! transient
196 ClassDef(AliHLTPHOSClusterizer, 1);