1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 //_________________________________________________________________________
18 // Class for the management by the CPV reconstruction.
20 //*-- Author : Boris Polichtchouk (IHEP, Protvino) 6 Mar 2001
22 // --- ROOT system ---
24 // --- Standard library ---
26 // --- AliRoot header files ---
28 #include "AliPHOSRecCpvManager.h"
31 #include "AliPHOSGetter.h"
33 ClassImp(AliPHOSRecCpvManager)
35 //____________________________________________________________________________
37 AliPHOSRecCpvManager::AliPHOSRecCpvManager()
40 fOneGamChisqCut = 3.; // If Chi2/dof > fOneGamChisqCut, split point.
42 fOneGamInitialStep = 0.00005;
44 fOneGamStepMin = 0.0005;
45 fOneGamNumOfIterations = 50;
47 fTwoGamInitialStep = 0.00005;
50 fTwoGamStepMin = 0.00005;
51 fTwoGamNumOfIterations = 50;
53 // fThr0 = 0.0285; // Min. energy of rec. point. If E<fThr0, point deleted.
54 // fSqdCut = 3.; // Min. distance (in cm) between two rec points.
59 SetTitle("Cpv Reconstruction Manager");
62 AliPHOSRecCpvManager::~AliPHOSRecCpvManager(void) {}
64 Float_t AliPHOSRecCpvManager::Dispersion(Float_t Etot, Float_t Ai, Float_t Ei)
66 //"Dispresion" of energy deposition in the cell.
67 // Etot is the total shower energy, Ai is the
68 // calculated cell response,
69 // Ei is the measured cell response.
71 const Float_t Const = 1.5;
72 return Const*Ai*(1.-Ai/Etot);
75 Float_t AliPHOSRecCpvManager::OneGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, Float_t& Gi)
77 //"Chi2" for one cell.
78 // Etot is the total "shower" energy, Ai is the
79 // calculated cell response,
80 // Ei is the measured cell response.
82 const Float_t Const = 1.5;
85 Float_t D = Const*Ai*(1.-Ai/Etot);
88 Gi = dd*(2.- dd*Const*(1.-2.*Ai/Etot));
90 Info("OneGamChi2", " OneGamChi2 (Ai,Ei,Etot,&Gi,chi2) %f %f %f %f %f", Ai, Ei, Etot, Gi, da*da/D );
96 Float_t AliPHOSRecCpvManager::TwoGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, Float_t& Gi)
99 const Float_t Const = 1.5;
101 Float_t da = Ai - Ei;
102 Float_t D = Const*Ai*(1.-Ai/Etot);
105 Gi = dd*(2.- dd*Const*(1.-2.*Ai/Etot));
111 void AliPHOSRecCpvManager::AG(Float_t Ei, Float_t Xi, Float_t Yi, Float_t& Ai, Float_t& GXi, Float_t& GYi )
113 //Calculates amplitude (Ai) and gradients (GXi, GYi) of CPV pad response.
114 //Integrated response (total "shower energy") is E,
115 //Xi and Yi are the distances along x and y from reference point
116 // to the pad center.
118 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
119 const AliPHOSGeometry* geom = gime->PHOSGeometry();
120 Float_t CelZ = geom->GetPadSizeZ();
121 Float_t CelY = geom->GetPadSizePhi();
123 // // Info("AG", "CelZ: %f CelY: %f", CelZ, CelY) ;
125 Float_t dx = CelZ/2.;
126 Float_t dy = CelY/2.;
128 // // Float_t x = Xi*CelZ;
129 // // Float_t y = Yi*CelZ;
136 Float_t A = Fcml(x+dx,y+dy) - Fcml(x+dx,y-dy) - Fcml(x-dx,y+dy) + Fcml(x-dx,y-dy);
140 Float_t Gx = GradX(x+dx,y+dy) - GradX(x+dx,y-dy) - GradX(x-dx,y+dy) + GradX(x-dx,y-dy);
143 Float_t Gy = GradY(x+dx,y+dy) - GradY(x+dx,y-dy) - GradY(x-dx,y+dy) + GradY(x-dx,y-dy);
148 Float_t AliPHOSRecCpvManager::Fcml(Float_t x, Float_t y)
150 //Cumulative function
152 const Float_t A = 1.0;
153 const Float_t b = 0.70;
155 Float_t Fff = TMath::ATan(x*y/( b*TMath::Sqrt( (b*b) + x*x+y*y)))
156 - TMath::ATan(x*y/(3*b*TMath::Sqrt((3*b)*(3*b) + x*x+y*y)))
157 + TMath::ATan(x*y/(5*b*TMath::Sqrt((5*b)*(5*b) + x*x+y*y)))
158 - TMath::ATan(x*y/(7*b*TMath::Sqrt((7*b)*(7*b) + x*x+y*y)))
159 + TMath::ATan(x*y/(9*b*TMath::Sqrt((9*b)*(9*b) + x*x+y*y)));
161 Float_t Fcml = A*Fff/6.2831853071796;
162 // Info("Fcml", "Fcml: %f", Fcml) ;
168 Float_t AliPHOSRecCpvManager::GradX(Float_t x, Float_t y)
171 const Float_t A = 1.0;
172 const Float_t b = 0.70;
174 Float_t skv = b*b + x*x + y*y;
176 Float_t Gradient = y*(1.-x*x/skv)* b*TMath::Sqrt(skv)/( b*b*skv+x*x*y*y)
177 - y*(1.-x*x/skv)*3*b*TMath::Sqrt(skv)/((3*b)*(3*b)*skv+x*x*y*y)
178 + y*(1.-x*x/skv)*5*b*TMath::Sqrt(skv)/((5*b)*(5*b)*skv+x*x*y*y)
179 - y*(1.-x*x/skv)*7*b*TMath::Sqrt(skv)/((7*b)*(7*b)*skv+x*x*y*y)
180 + y*(1.-x*x/skv)*9*b*TMath::Sqrt(skv)/((9*b)*(9*b)*skv+x*x*y*y);
182 Float_t Grad = A*Gradient/6.2831853071796;
187 Float_t AliPHOSRecCpvManager::GradY(Float_t x, Float_t y)
190 const Float_t A = 1.0;
191 const Float_t b = 0.70;
193 Float_t skv = b*b + x*x + y*y;
194 Float_t Gradient = x*(1.-y*y/skv)* b*TMath::Sqrt(skv)/( b*b*skv+x*x*y*y)
195 - x*(1.-y*y/skv)*3*b*TMath::Sqrt(skv)/((3*b)*(3*b)*skv+x*x*y*y)
196 + x*(1.-y*y/skv)*5*b*TMath::Sqrt(skv)/((5*b)*(5*b)*skv+x*x*y*y)
197 - x*(1.-y*y/skv)*7*b*TMath::Sqrt(skv)/((7*b)*(7*b)*skv+x*x*y*y)
198 + x*(1.-y*y/skv)*9*b*TMath::Sqrt(skv)/((9*b)*(9*b)*skv+x*x*y*y);
200 Float_t Grad = A*Gradient/6.2831853071796;