Added reference from vertex to candidate (Andrea)
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.h
CommitLineData
e9a88722 1#ifndef ALIPHOSCLUSTERIZERV1_H
d15a28e7 2#define ALIPHOSCLUSTERIZERV1_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6ad0bfa0 6/* $Id$ */
7
702ab87e 8/* History of cvs commits:
9 *
a28333c5 10 * $Log: AliPHOSClusterizerv1.h,v $
11 * Revision 1.54 2007/10/01 20:24:08 kharlov
12 * Memory leaks fixed
13 *
e68222ce 14 * Revision 1.53 2007/08/28 12:55:07 policheh
15 * Loaders removed from the reconstruction code (C.Cheshkov)
16 *
9a2cdbdf 17 * Revision 1.52 2007/08/07 14:16:00 kharlov
18 * Quality assurance added (Yves Schutz)
19 *
ddd1a39c 20 * Revision 1.51 2007/04/11 11:55:45 policheh
21 * SetDistancesToBadChannels() added.
22 *
af0b0570 23 * Revision 1.50 2007/03/28 19:18:15 kharlov
24 * RecPoints recalculation in TSM removed
25 *
8c1fb709 26 * Revision 1.49 2007/03/06 06:51:27 kharlov
27 * Calculation of cluster properties dep. on vertex posponed to TrackSegmentMaker
28 *
a978bcea 29 * Revision 1.48 2006/08/30 16:12:52 kharlov
30 * Reconstruction of raw data from beam test 2006 (B.Polichtchouk)
31 *
02e48b45 32 * Revision 1.47 2006/08/25 16:56:30 kharlov
33 * Compliance with Effective C++
34 *
0378398c 35 * Revision 1.46 2006/08/01 12:20:17 cvetan
36 * 1. Adding a possibility to read and reconstruct an old rcu formatted raw data. This is controlled by an option of AliReconstruction and AliPHOSReconstructor. 2. In case of raw data processing (without galice.root) create the default AliPHOSGeometry object. Most likely this should be moved to the CDB
37 *
f5eaa851 38 * Revision 1.45 2006/04/29 20:26:46 hristov
39 * Separate EMC and CPV calibration (Yu.Kharlov)
40 *
e95226ae 41 * Revision 1.44 2005/09/02 14:32:07 kharlov
42 * Calibration of raw data
43 *
44ae287e 44 * Revision 1.43 2005/05/28 14:19:04 schutz
45 * Compilation warnings fixed by T.P.
46 *
702ab87e 47 */
48
b2a60966 49//_________________________________________________________________________
50// Implementation version 1 of the clusterization algorithm
baef0810 51// Performs clusterization (collects neighbouring active cells) and
52// unfolding of the clusters with several local maxima.
53// results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
54// PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
b2a60966 55//
88cb7938 56//*-- Author: Yves Schutz (SUBATECH)
d15a28e7 57
58// --- ROOT system ---
ba898748 59class TClonesArray ;
a978bcea 60class TVector3 ;
d15a28e7 61// --- Standard library ---
62
63// --- AliRoot header files ---
64
65#include "AliPHOSClusterizer.h"
9a1398dd 66class AliPHOSEmcRecPoint ;
67class AliPHOSDigit ;
68class AliPHOSDigitizer ;
69class AliPHOSGeometry ;
d15a28e7 70
71class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
72
73public:
74
0378398c 75 AliPHOSClusterizerv1() ;
9a2cdbdf 76 AliPHOSClusterizerv1(AliPHOSGeometry *geom);
9688c1dd 77 virtual ~AliPHOSClusterizerv1() ;
d15a28e7 78
1f96ab2a 79 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
9a1398dd 80 // Checks if digits are in neighbour cells
3758d9fc 81
baef0810 82 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
83 numb[1] = fNumberOfCpvClusters ; }
9a1398dd 84
85 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
86 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
87 virtual Float_t GetEmcLogWeight()const { return fW0;}
9688c1dd 88 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
9a1398dd 89 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
90 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
91 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
9a2cdbdf 92 // virtual const char * GetRecPointsBranch() const{ return GetName() ;}
9a1398dd 93
9a2cdbdf 94 virtual void Digits2Clusters(Option_t *option);
9a1398dd 95
702ab87e 96 void Print(const Option_t * = "")const ;
9a1398dd 97
d72dfbc3 98 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
9a1398dd 99 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
100 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
fbf811ec 101 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
ed4205d8 102 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
9a1398dd 103 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
104 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
ba898748 105 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
106 //Switch to "on flyght" mode, without writing to TreeR and file
5d0435dd 107 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
a978bcea 108 static Double_t ShowerShape(Double_t x, Double_t z) ; // Shape of EM shower used in unfolding;
9a1398dd 109 //class member function (not object member function)
7b7c1533 110 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
ba898748 111 // Chi^2 of the fit. Should be static to be passed to MINUIT
9a2cdbdf 112 // void Unload() ;
88cb7938 113 virtual const char * Version() const { return "clu-v1"; }
9a1398dd 114
1f96ab2a 115protected:
116
88cb7938 117 void WriteRecPoints() ;
1f96ab2a 118 virtual void MakeClusters( ) ;
119 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
120 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
ba898748 121 void CleanDigits(TClonesArray * digits) ;
af0b0570 122 void SetDistancesToBadChannels();
02e48b45 123
d15a28e7 124private:
9a2cdbdf 125 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
126 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
7b7c1533 127
a0636361 128 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
baef0810 129 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
fbf811ec 130 void Init() ;
131 void InitParameters() ;
9a1398dd 132
9a1398dd 133 virtual void MakeUnfolding() ;
9a1398dd 134 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
a0636361 135 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
9a1398dd 136 void PrintRecPoints(Option_t * option) ;
137
138private:
139
92f521a9 140 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
02e48b45 141 Int_t fEmcCrystals ; // number of EMC cristals in PHOS
3758d9fc 142
9a1398dd 143 Bool_t fToUnfold ; // To perform unfolding
ba898748 144 Bool_t fWrite ; // Write RecPoints to TreeR
02e48b45 145
146 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
9688c1dd 147 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
7b7c1533 148
ba898748 149 Float_t fEmcClusteringThreshold ; // minimum energy to start EMC cluster
150 Float_t fCpvClusteringThreshold ; // minimum energy to start CPV cluster
9a1398dd 151 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
b2a60966 152 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
9a1398dd 153 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
d72dfbc3 154 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
9a2cdbdf 155 // Int_t fRecPointsInRun ; //! Total number of recpoints in one run
9688c1dd 156 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
f5eaa851 157
a978bcea 158
a28333c5 159 ClassDef(AliPHOSClusterizerv1,6) // Clusterizer implementation version 1
d15a28e7 160
161};
162
163#endif // AliPHOSCLUSTERIZERV1_H