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
39 #include "AliHLTPHOSBase.h"
40 #include "AliPHOSLoader.h"
42 #include "AliHLTPHOSRecPointContainerStruct.h"
43 #include "AliHLTPHOSRecPointDataStruct.h"
44 #include "AliHLTPHOSDigitContainerDataStruct.h"
45 #include "AliHLTPHOSDigitDataStruct.h"
47 #include "AliPHOSGeometry.h"
51 class AliPHOSRecoParamEmc;
52 class AliPHOSRecoParam;
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
60 * @ingroup alihlt_phos
62 class AliHLTPHOSClusterizer : public AliHLTPHOSBase
68 AliHLTPHOSClusterizer();
71 virtual ~AliHLTPHOSClusterizer();
73 /** Copy constructor */
74 AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) :
78 fEmcClusteringThreshold(0),
79 fEmcMinEnergyThreshold(0),
82 fDigitContainerPtr(0),
83 fMaxDigitIndexDiff(2*NZROWSMOD)
85 //Copy constructor not implemented
89 AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
95 /** Set digit container */
96 void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
97 { fDigitContainerPtr = digitContainerPtr; }
99 /** Set rec point data buffer */
100 void SetRecPointDataPtr(AliHLTPHOSRecPointDataStruct* recPointDataPtr);
102 /** Set reco parameters */
103 void SetRecoParameters(AliPHOSRecoParam* recoPars);
105 /** Set emc clustering threshold */
106 void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
108 /** Set emc min energy threshold */
109 void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
111 /** Set emc time gate */
112 void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
114 /** Starts clusterization of the event */
115 virtual Int_t ClusterizeEvent(UInt_t availableSize, UInt_t& totSize);
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
124 virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
127 * Checks if two digits are neighbours
128 * @param d1 first digit
129 * @param d2 second digit
131 virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
136 /** Pointer to the rec point output */
137 AliHLTPHOSRecPointDataStruct* fRecPointDataPtr; //! transient
139 /** Pointer to the digit output */
140 AliHLTPHOSDigitDataStruct* fDigitDataPtr; //! transient
142 /** Energy threshold for starting a cluster for the calorimeter */
143 Float_t fEmcClusteringThreshold; //COMMENT
145 /** Energy threshold for including a crystal in a cluster */
146 Float_t fEmcMinEnergyThreshold; //COMMENT
148 /** Maximum time difference for inclusion in a rec point */
149 Float_t fEmcTimeGate; //COMMENT
151 /** Counts the digits in a rec point */
152 Int_t fDigitsInCluster; //COMMENT
154 /** Contains the digits from one event */
155 AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
157 /** Maximum difference in index to be a neighbour */
158 Int_t fMaxDigitIndexDiff; //COMMENT
160 ClassDef(AliHLTPHOSClusterizer, 0);