]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - PHOS/AliPHOSClusterizerv1.h
Bug fix for CPV-EMC distance
[u/mrichter/AliRoot.git] / PHOS / AliPHOSClusterizerv1.h
... / ...
CommitLineData
1#ifndef ALIPHOSCLUSTERIZERV1_H
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
6/* $Id$ */
7
8/* History of cvs commits:
9 *
10 * $Log$
11 * Revision 1.50 2007/03/28 19:18:15 kharlov
12 * RecPoints recalculation in TSM removed
13 *
14 * Revision 1.49 2007/03/06 06:51:27 kharlov
15 * Calculation of cluster properties dep. on vertex posponed to TrackSegmentMaker
16 *
17 * Revision 1.48 2006/08/30 16:12:52 kharlov
18 * Reconstruction of raw data from beam test 2006 (B.Polichtchouk)
19 *
20 * Revision 1.47 2006/08/25 16:56:30 kharlov
21 * Compliance with Effective C++
22 *
23 * Revision 1.46 2006/08/01 12:20:17 cvetan
24 * 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
25 *
26 * Revision 1.45 2006/04/29 20:26:46 hristov
27 * Separate EMC and CPV calibration (Yu.Kharlov)
28 *
29 * Revision 1.44 2005/09/02 14:32:07 kharlov
30 * Calibration of raw data
31 *
32 * Revision 1.43 2005/05/28 14:19:04 schutz
33 * Compilation warnings fixed by T.P.
34 *
35 */
36
37//_________________________________________________________________________
38// Implementation version 1 of the clusterization algorithm
39// Performs clusterization (collects neighbouring active cells) and
40// unfolding of the clusters with several local maxima.
41// results are stored in TreeR#, branches PHOSEmcRP (EMC recPoints),
42// PHOSCpvRP (CPV RecPoints) and AliPHOSClusterizer
43//
44//*-- Author: Yves Schutz (SUBATECH)
45
46// --- ROOT system ---
47class TClonesArray ;
48class TVector3 ;
49// --- Standard library ---
50
51// --- AliRoot header files ---
52
53#include "AliPHOSClusterizer.h"
54class AliPHOSEmcRecPoint ;
55class AliPHOSDigit ;
56class AliPHOSDigitizer ;
57class AliPHOSGeometry ;
58class AliPHOSCalibData ;
59
60class AliPHOSClusterizerv1 : public AliPHOSClusterizer {
61
62public:
63
64 AliPHOSClusterizerv1() ;
65 AliPHOSClusterizerv1(const TString alirunFileNameFile, const TString eventFolderName = AliConfig::GetDefaultEventFolderName());
66 AliPHOSClusterizerv1(const AliPHOSClusterizerv1 & clu) ;
67 virtual ~AliPHOSClusterizerv1() ;
68
69 virtual Int_t AreNeighbours(AliPHOSDigit * d1, AliPHOSDigit * d2)const ;
70 // Checks if digits are in neighbour cells
71
72 virtual Float_t CalibrateCPV(Int_t amp, Int_t absId) ; // Tranforms CPV Amp to energy
73 virtual Float_t CalibrateEMC(Float_t amp, Int_t absId) ; // Tranforms EMC Amp to energy
74
75 virtual void GetNumberOfClustersFound(int * numb )const{ numb[0] = fNumberOfEmcClusters ;
76 numb[1] = fNumberOfCpvClusters ; }
77
78 virtual Float_t GetEmcClusteringThreshold()const{ return fEmcClusteringThreshold;}
79 virtual Float_t GetEmcLocalMaxCut()const { return fEmcLocMaxCut;}
80 virtual Float_t GetEmcLogWeight()const { return fW0;}
81 virtual Float_t GetEmcTimeGate() const { return fEmcTimeGate ; }
82 virtual Float_t GetCpvClusteringThreshold()const{ return fCpvClusteringThreshold; }
83 virtual Float_t GetCpvLocalMaxCut()const { return fCpvLocMaxCut;}
84 virtual Float_t GetCpvLogWeight()const { return fW0CPV;}
85 virtual const char * GetRecPointsBranch() const{ return GetName() ;}
86 virtual Int_t GetRecPointsInRun() const {return fRecPointsInRun ;}
87
88 virtual void Exec(Option_t *option); // Does the job
89
90 void Print(const Option_t * = "")const ;
91
92 void SetEmcMinE(Float_t e){fEmcMinE = e ;}
93 void SetCpvMinE(Float_t e){fCpvMinE = e ;}
94 virtual void SetEmcClusteringThreshold(Float_t cluth) { fEmcClusteringThreshold = cluth ; }
95 virtual void SetEmcLocalMaxCut(Float_t cut) { fEmcLocMaxCut = cut ; }
96 virtual void SetEmcLogWeight(Float_t w) { fW0 = w ; }
97 virtual void SetEmcTimeGate(Float_t gate) { fEmcTimeGate = gate ;}
98 virtual void SetCpvClusteringThreshold(Float_t cluth) { fCpvClusteringThreshold = cluth ; }
99 virtual void SetCpvLocalMaxCut(Float_t cut) { fCpvLocMaxCut = cut ; }
100 virtual void SetCpvLogWeight(Float_t w) { fW0CPV = w ; }
101 virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;}
102 //Switch to "on flyght" mode, without writing to TreeR and file
103 void SetWriting(Bool_t toWrite = kFALSE){fWrite = toWrite;}
104 static Double_t ShowerShape(Double_t x, Double_t z) ; // Shape of EM shower used in unfolding;
105 //class member function (not object member function)
106 static void UnfoldingChiSquare(Int_t & nPar, Double_t * Grad, Double_t & fret, Double_t * x, Int_t iflag) ;
107 // Chi^2 of the fit. Should be static to be passed to MINUIT
108 void Unload() ;
109 virtual const char * Version() const { return "clu-v1"; }
110
111 virtual void SetOldRCUFormat(Bool_t rcuFormat = kFALSE)
112 { fIsOldRCUFormat = rcuFormat; };
113
114protected:
115
116 void WriteRecPoints() ;
117 virtual void MakeClusters( ) ;
118 virtual Bool_t IsInEmc (AliPHOSDigit * digit)const ; // Tells if id digit is in EMC
119 virtual Bool_t IsInCpv (AliPHOSDigit * digit)const ; // Tells if id digit is in CPV
120 void CleanDigits(TClonesArray * digits) ;
121 void GetCalibrationParameters(void);
122 void SetDistancesToBadChannels();
123
124 AliPHOSClusterizerv1 & operator = (const AliPHOSClusterizerv1 & obj);
125
126private:
127
128 const TString BranchName() const ;
129
130 Bool_t FindFit(AliPHOSEmcRecPoint * emcRP, AliPHOSDigit ** MaxAt, Float_t * maxAtEnergy,
131 Int_t NPar, Float_t * FitParametres) const; //Used in UnfoldClusters, calls TMinuit
132 void Init() ;
133 void InitParameters() ;
134
135 virtual void MakeUnfolding() ;
136 void UnfoldCluster(AliPHOSEmcRecPoint * iniEmc,Int_t Nmax,
137 AliPHOSDigit ** maxAt,Float_t * maxAtEnergy ) ; //Unfolds cluster using TMinuit package
138 void PrintRecPoints(Option_t * option) ;
139
140private:
141
142 Bool_t fDefaultInit; //! Says if the task was created by defaut ctor (only parameters are initialized)
143 Int_t fEmcCrystals ; // number of EMC cristals in PHOS
144
145 Bool_t fToUnfold ; // To perform unfolding
146 Bool_t fWrite ; // Write RecPoints to TreeR
147
148 Int_t fNumberOfEmcClusters ; // number of EMC clusters found
149 Int_t fNumberOfCpvClusters ; // number of CPV clusters found
150
151 //Calibration parameters
152 AliPHOSCalibData * fCalibData ; //! Calibration database if aval.
153 Float_t fADCchanelEmc ; // width of one ADC channel in GeV
154 Float_t fADCpedestalEmc ; //
155 Float_t fADCchanelCpv ; // width of one ADC channel in CPV 'popugais'
156 Float_t fADCpedestalCpv ; //
157
158 Float_t fEmcClusteringThreshold ; // minimum energy to start EMC cluster
159 Float_t fCpvClusteringThreshold ; // minimum energy to start CPV cluster
160 Float_t fEmcMinE ; // minimum energy of digit to be included into cluster
161 Float_t fCpvMinE ; // minimum energy of digit to be included into cluster
162 Float_t fEmcLocMaxCut ; // minimum energy difference to distinguish local maxima in a cluster
163 Float_t fW0 ; // logarithmic weight for the cluster center of gravity calculation
164 Float_t fCpvLocMaxCut ; // minimum energy difference to distinguish local maxima in a CPV cluster
165 Float_t fW0CPV ; // logarithmic weight for the CPV cluster center of gravity calculation
166 Int_t fRecPointsInRun ; //! Total number of recpoints in one run
167 Float_t fEmcTimeGate ; // Maximum time difference between the digits in ont EMC cluster
168
169 Bool_t fIsOldRCUFormat; // assume old RCU raw data format
170
171 ClassDef(AliPHOSClusterizerv1,4) // Clusterizer implementation version 1
172
173};
174
175#endif // AliPHOSCLUSTERIZERV1_H