]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/PHOS/AliHLTPHOSClusterAnalyser.h
New production macros (Yves)
[u/mrichter/AliRoot.git] / HLT / PHOS / AliHLTPHOSClusterAnalyser.h
1 //-*- Mode: C++ -*-
2 // $Id$
3
4  /**************************************************************************
5  * This file is property of and copyright by the ALICE HLT Project        * 
6  * All rights reserved.                                                   *
7  *                                                                        *
8  * Primary Authors: Oystein Djuvsland                                     *
9  *                                                                        *
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  **************************************************************************/
18
19 #ifndef ALIHLTPHOSCLUSTERANALYSER_H
20 #define ALIHLTPHOSCLUSTERANALYSER_H
21
22 /**
23  * Class calculates properties of rec points
24  *
25  * @file   AliHLTPHOSClusterAnalyser.h
26  * @author Oystein Djuvsland
27  * @date
28  * @brief  Cluster analyser for PHOS HLT
29  */
30
31 // see header file for class documentation
32 // or
33 // refer to README to build package
34 // or
35 // visit http://web.ift.uib.no/~kjeks/doc/alice-hlt
36
37 #include "AliHLTPHOSBase.h"
38
39 class AliHLTPHOSPhysicsAnalyzer;
40 class AliHLTPHOSRecPointHeaderStruct;
41 class AliHLTPHOSRecPointDataStruct;
42 class AliHLTPHOSCaloClusterHeaderStruct;
43 class AliHLTPHOSCaloClusterDataStruct;
44 class AliPHOSGeometry;
45
46 /** 
47  * @class AliHLTPHOSClusterAnalyser
48  * ClusterAnalyser for PHOS HLT. Algorithms for center of gravity
49  * and moment calculations are based on classes from the PHOS
50  * offline analysis directory
51  *
52  * @ingroup alihlt_phos
53  */
54 class AliHLTPHOSClusterAnalyser : public AliHLTPHOSBase
55 {
56 public:
57
58   /** Constructor */
59   AliHLTPHOSClusterAnalyser();
60
61   /** Destructor */
62   virtual ~AliHLTPHOSClusterAnalyser();
63   
64   /** Copy constructor */
65   AliHLTPHOSClusterAnalyser(const AliHLTPHOSClusterAnalyser &) : 
66     AliHLTPHOSBase(),
67     fLogWeight(0),
68     fRecPointDataPtr(0),
69     fNRecPoints(0),
70     fCaloClusterDataPtr(0),
71     fCaloClusterHeaderPtr(0),
72     fPHOSGeometry(0),
73     fAnalyzerPtr(0),
74     fDoClusterFit(false),
75     fHaveCPVInfo(false),
76     fDoPID(false),
77     fHaveDistanceToBadChannel(false)
78     
79   {
80     //Copy constructor not implemented
81   }
82   
83   /** Assignment */
84   AliHLTPHOSClusterAnalyser & operator = (const AliHLTPHOSClusterAnalyser)
85     {
86       //Assignment
87       return *this; 
88     }
89   
90   /**
91    * Set the rec point data buffer
92    * @param recPointDataPtr is a pointer to the rec points
93    */
94   void SetRecPointDataPtr(AliHLTPHOSRecPointHeaderStruct *recPointDataPtr);
95
96
97   /** 
98    * Set the calo cluster output buffer
99    * @param caloClusterDataPtr is a pointer to the calo cluster buffer
100    */
101   void SetCaloClusterDataPtr(AliHLTPHOSCaloClusterDataStruct *caloClusterDataPtr);
102
103   /** 
104    * Calculates the center of gravity for the reconstruction points in the container
105    * @return
106    */
107   Int_t CalculateCenterOfGravity();
108
109   /** 
110    * Calculates the moments for the reconstruction points in the container
111    * @return 
112    */
113   Int_t CalculateRecPointMoments();
114
115   /** 
116    * Calculates the moments for a certain cluster
117    * @return 
118    */
119   Int_t CalculateClusterMoments(AliHLTPHOSRecPointDataStruct *recPointPtr, AliHLTPHOSCaloClusterDataStruct* clusterPtr);
120
121   /** 
122    * Deconvolute the clusters in an AliHLTPHOSRecPointContainerStruct
123    * @return
124    */
125   Int_t DeconvoluteClusters();
126
127   /**
128    * Convert the rec points into calo clusters
129    * @return
130    */
131   Int_t CreateClusters(UInt_t availableSize, UInt_t& totSize);
132
133   /**
134    * Fit a cluster
135    * param recPointPtr is a pointer to the rec point to fit
136    * @return 
137    */
138   Int_t FitCluster(AliHLTPHOSRecPointDataStruct* /*recPointPtr*/) { return 0; }
139
140   /**
141    * Get the distance to the nearest CPV rec point
142    * param recPointPtr is the pointer to the emc rec point
143    * @return the distance
144    */
145   Float_t GetCPVDistance(AliHLTPHOSRecPointDataStruct* /*recPointPtr*/) { return 0; };
146
147   /**
148    * Do partice identification
149    * param clusterPtr is the pointer to the emc cluster
150    * @return 
151    */
152   Int_t DoParticleIdentification(AliHLTPHOSCaloClusterDataStruct* /*clusterPtr*/) { return 0; }
153   
154   /**
155    * Get the distance to the neares bad channel
156    * param clusterPtr is a pointer to the calo cluster
157    * @return the distance
158    */
159   Float_t GetDistanceToBadChannel(AliHLTPHOSCaloClusterDataStruct* /*clusterPtr*/) { return 0; }
160
161   /**
162    * Set do cluster fit
163    */
164   void SetDoClusterFit() { fDoClusterFit = true; }
165   
166   /**
167    * Set have cpv info
168    */
169   void SetHaveCPVInfo() { fHaveCPVInfo = true; }
170
171   /** 
172    * Set do PID
173    */
174   void SetDoPID() { fDoPID = true; }
175
176   /**
177    * Set have distance to bad channel
178    */
179   void SetHaveDistanceToBadChannel() { fHaveDistanceToBadChannel = true; }
180
181 private:
182   
183   /** Used for calculation of center of gravity */
184   Float_t fLogWeight;                                       //COMMENT
185   
186   /** Pointer to the rec points */
187   AliHLTPHOSRecPointDataStruct *fRecPointDataPtr;         //! transient
188
189   /** Number of rec points */
190   Int_t fNRecPoints;                                      //COMMENT
191
192   /** Pointer to the cluster buffer */
193   AliHLTPHOSCaloClusterDataStruct *fCaloClusterDataPtr;   //! transient
194
195   /** Pointer to the cluster header */
196   AliHLTPHOSCaloClusterHeaderStruct *fCaloClusterHeaderPtr;   //! transient
197
198   /** Instance of the PHOS geometry */
199   AliPHOSGeometry *fPHOSGeometry;                           //! transient
200
201   //TODO: should not use PhysicsAnalyzer for global coord!
202   /** */
203   AliHLTPHOSPhysicsAnalyzer *fAnalyzerPtr;                  //! transient
204
205   /** Should we do cluster fitting? */
206   Bool_t fDoClusterFit;                                     //COMMENT
207   
208   /** Do we have CPV info? */
209   Bool_t fHaveCPVInfo;                                      //COMMENT
210
211   /** Should we do PID? */ 
212   Bool_t fDoPID;                                            //COMMENT
213
214   /** Do we have distance to bad channel? */
215   Bool_t fHaveDistanceToBadChannel;                         //COMMENT
216   
217   
218 };
219
220 #endif