]> git.uio.no Git - u/mrichter/AliRoot.git/blame - HLT/PHOS/AliHLTPHOSClusterizer.h
blabalbal
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSClusterizer.h
CommitLineData
ab38011b 1/**************************************************************************
2 * This file is property of and copyright by the ALICE HLT Project *
3 * All rights reserved. *
4 * *
1804b020 5 * Primary Authors: Oystein Djuvsland *
ab38011b 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 **************************************************************************/
2ef3c547 15
91b95d47 16#ifndef ALIHLTPHOSCLUSTERIZER_H
17#define ALIHLTPHOSCLUSTERIZER_H
aac22523 18
2374af72 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
9cc0deb1 36#include "AliHLTPHOSBase.h"
9cc0deb1 37#include "AliPHOSGetter.h"
ab38011b 38
1804b020 39#include "AliHLTPHOSRecPointContainerStruct.h"
40#include "AliHLTPHOSRecPointDataStruct.h"
41#include "AliHLTPHOSDigitContainerDataStruct.h"
42#include "AliHLTPHOSDigitDataStruct.h"
ab38011b 43
1804b020 44#include "AliPHOSGeometry.h"
ab38011b 45
46class TClonesArray;
47class AliPHOSDigit;
48class AliPHOSRecoParamEmc;
2ef3c547 49
2374af72 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 AliPHOSGetter
55 *
56 * @ingroup alihlt_phos
57 */
9cc0deb1 58class AliHLTPHOSClusterizer : public AliHLTPHOSBase
aac22523 59{
60
9cc0deb1 61public:
62
2374af72 63 /** Constructor */
9cc0deb1 64 AliHLTPHOSClusterizer();
aac22523 65
2374af72 66 /** Destructor */
aac22523 67 virtual ~AliHLTPHOSClusterizer();
aac22523 68
2374af72 69 /*
9cc0deb1 70 AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &);
71 AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer &) {return *this;}
2374af72 72 */
9cc0deb1 73
14ff16ed 74 /** Set digit container */
75 void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
76 { fDigitContainerPtr = digitContainerPtr; }
77
2374af72 78 /** Set rec point container */
9cc0deb1 79 void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *RecPointContainerPtr)
80 { fRecPointContainerPtr = RecPointContainerPtr; }
81
2374af72 82 /** Set reco parameters */
ab38011b 83 void SetRecoParameters(AliPHOSRecoParamEmc* recoPars);
9cc0deb1 84
2374af72 85 /** Set emc clustering threshold */
9cc0deb1 86 void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
2374af72 87
88 /** Set emc min energy threshold */
9cc0deb1 89 void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
2374af72 90
91 /** Set emc time gate */
9cc0deb1 92 void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
2374af72 93
94 /** Set log weight */
9cc0deb1 95 void SetLogWeight(Float_t weight) { fLogWeight = weight; }
96
2374af72 97 /**
98 * Set offline mode
99 * @param getter pointer to an instance of AliPHOSGetter
100 */
ab38011b 101 void SetOfflineMode(AliPHOSGetter* getter);
9cc0deb1 102
2374af72 103 /** Starts clusterization of the event */
9cc0deb1 104 virtual Int_t ClusterizeEvent();
2374af72 105
106 /**
107 * Gets an event, for offline mode
108 * @param evtNr event number to get
109 */
ab38011b 110 virtual Int_t GetEvent(Int_t evtNr);
aac22523 111
2374af72 112 /** Get number of events */
9cc0deb1 113 Int_t GetNEvents();
aac22523 114
2374af72 115 /**
116 * For a given digit this digit scans for neighbouring digits which
117 * passes the threshold for inclusion in a rec point. If one is found
118 * it is added to the current rec point
119 * @param digIndex index of the digit in the digit container
120 * @param recPoint pointer to the current rec point
121 */
ab38011b 122 virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
2374af72 123
124 /**
125 * Checks if two digits are neighbours
126 * @param d1 first digit
127 * @param d2 second digit
128 */
ab38011b 129 virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
2374af72 130
131 /** Calculates the center of gravity of a rec point */
9cc0deb1 132 virtual void CalculateCenterOfGravity();
133
134private:
2374af72 135 /** Energy threshold for starting a cluster for the calorimeter */
136 Float_t fEmcClusteringThreshold; //COMMENT
137
138 /** Energy threshold for including a crystal in a cluster */
139 Float_t fEmcMinEnergyThreshold; //COMMENT
140
141 /** Maximum time difference for inclusion in a rec point */
142 Float_t fEmcTimeGate; //COMMENT
143
144 /** Variable used in calculation of the center of gravity for a rec point */
145 Float_t fLogWeight; //COMMENT
146
147 /** Counts the digits in a rec point */
148 Int_t fDigitsInCluster; //COMMENT
aac22523 149
2374af72 150 /** Online mode flag */
151 Bool_t fOnlineMode; //COMMENT
ab38011b 152
2374af72 153 /** Array of digits from one event, used in offline mode */
154 TClonesArray *fDigitArrayPtr; //! transient
155
156 /** Array of reconstruction points from one event, used in offline mode */
157 TObjArray *fEmcRecPointsPtr; //! transient
158
159 /** Pointer to digit */
160 AliPHOSDigit *fDigitPtr; //! transient
161
162 /** Contains the digits from one event */
163 AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
164
165 /** Contains the reconstruction points from one event */
166 AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr; //! transient
aac22523 167
2374af72 168 /** Instance of the PHOS geometry class */
169 AliPHOSGeometry *fPHOSGeometry; //! transient
9cc0deb1 170
2374af72 171 /** Instance of the PHOS getter, used in offline mode */
172 AliPHOSGetter *fGetterPtr; //! transient
9cc0deb1 173
aac22523 174 ClassDef(AliHLTPHOSClusterizer, 1);
175};
176
177#endif