Major commit related to steering of the reco parameters: AliDAQ and trigger classes...
[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"
8b035d03 37#include "AliPHOSLoader.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;
7e88424f 48class AliPHOSRecoParam;
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
8b035d03 54 * TClonesArray of AliPHOSDigit through an instance of a AliPHOSLoader
2374af72 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();
9cc0deb1 68
25b7f84c 69 /** Copy constructor */
70 AliHLTPHOSClusterizer(const AliHLTPHOSClusterizer &) :
71 AliHLTPHOSBase(),
72 fEmcClusteringThreshold(0),
73 fEmcMinEnergyThreshold(0),
74 fEmcTimeGate(0),
75 fLogWeight(0),
76 fDigitsInCluster(0),
77 fOnlineMode(true),
78 fDigitArrayPtr(0),
79 fEmcRecPointsPtr(0),
80 fDigitPtr(0),
81 fDigitContainerPtr(0),
82 fRecPointContainerPtr(0),
83 fPHOSGeometry(0),
84 fGetterPtr(0)
85 {
86 //Copy constructor not implemented
87 }
88
89 /** Assignment */
90 AliHLTPHOSClusterizer & operator = (const AliHLTPHOSClusterizer)
91 {
92 //Assignment
93 return *this;
94 }
95
14ff16ed 96 /** Set digit container */
97 void SetDigitContainer(AliHLTPHOSDigitContainerDataStruct* digitContainerPtr)
98 { fDigitContainerPtr = digitContainerPtr; }
99
2374af72 100 /** Set rec point container */
25b7f84c 101 void SetRecPointContainer(AliHLTPHOSRecPointContainerStruct *recPointContainerPtr);
102
9cc0deb1 103
2374af72 104 /** Set reco parameters */
7e88424f 105 void SetRecoParameters(AliPHOSRecoParam* recoPars);
9cc0deb1 106
2374af72 107 /** Set emc clustering threshold */
9cc0deb1 108 void SetEmcClusteringThreshold(Float_t threshold) { fEmcClusteringThreshold = threshold; }
2374af72 109
110 /** Set emc min energy threshold */
9cc0deb1 111 void SetEmcMinEnergyThreshold(Float_t threshold) { fEmcMinEnergyThreshold = threshold; }
2374af72 112
113 /** Set emc time gate */
9cc0deb1 114 void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate; }
2374af72 115
116 /** Set log weight */
9cc0deb1 117 void SetLogWeight(Float_t weight) { fLogWeight = weight; }
118
2374af72 119 /**
120 * Set offline mode
121 * @param getter pointer to an instance of AliPHOSGetter
122 */
8b035d03 123 void SetOfflineMode(AliPHOSLoader* getter);
9cc0deb1 124
2374af72 125 /** Starts clusterization of the event */
9cc0deb1 126 virtual Int_t ClusterizeEvent();
2374af72 127
128 /**
129 * Gets an event, for offline mode
130 * @param evtNr event number to get
131 */
ab38011b 132 virtual Int_t GetEvent(Int_t evtNr);
aac22523 133
2374af72 134 /** Get number of events */
9cc0deb1 135 Int_t GetNEvents();
aac22523 136
2374af72 137 /**
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
143 */
ab38011b 144 virtual void ScanForNeighbourDigits(Int_t digIndex, AliHLTPHOSRecPointDataStruct* recPoint);
2374af72 145
146 /**
147 * Checks if two digits are neighbours
148 * @param d1 first digit
149 * @param d2 second digit
150 */
ab38011b 151 virtual Int_t AreNeighbours(AliHLTPHOSDigitDataStruct* d1, AliHLTPHOSDigitDataStruct* d2);
2374af72 152
153 /** Calculates the center of gravity of a rec point */
9cc0deb1 154 virtual void CalculateCenterOfGravity();
155
156private:
2374af72 157 /** Energy threshold for starting a cluster for the calorimeter */
158 Float_t fEmcClusteringThreshold; //COMMENT
159
160 /** Energy threshold for including a crystal in a cluster */
161 Float_t fEmcMinEnergyThreshold; //COMMENT
162
163 /** Maximum time difference for inclusion in a rec point */
164 Float_t fEmcTimeGate; //COMMENT
165
166 /** Variable used in calculation of the center of gravity for a rec point */
167 Float_t fLogWeight; //COMMENT
168
169 /** Counts the digits in a rec point */
170 Int_t fDigitsInCluster; //COMMENT
aac22523 171
2374af72 172 /** Online mode flag */
173 Bool_t fOnlineMode; //COMMENT
ab38011b 174
2374af72 175 /** Array of digits from one event, used in offline mode */
176 TClonesArray *fDigitArrayPtr; //! transient
177
178 /** Array of reconstruction points from one event, used in offline mode */
179 TObjArray *fEmcRecPointsPtr; //! transient
180
181 /** Pointer to digit */
182 AliPHOSDigit *fDigitPtr; //! transient
183
184 /** Contains the digits from one event */
185 AliHLTPHOSDigitContainerDataStruct *fDigitContainerPtr; //! transient
186
187 /** Contains the reconstruction points from one event */
188 AliHLTPHOSRecPointContainerStruct *fRecPointContainerPtr; //! transient
aac22523 189
2374af72 190 /** Instance of the PHOS geometry class */
191 AliPHOSGeometry *fPHOSGeometry; //! transient
9cc0deb1 192
2374af72 193 /** Instance of the PHOS getter, used in offline mode */
8b035d03 194 AliPHOSLoader *fGetterPtr; //! transient
9cc0deb1 195
aac22523 196 ClassDef(AliHLTPHOSClusterizer, 1);
197};
198
199#endif