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 ---
28 // --- AliRoot header files ---
30 #include "AliPHOSRecCpvManager.h"
33 #include "AliPHOSGetter.h"
35 ClassImp(AliPHOSRecCpvManager)
37 //____________________________________________________________________________
39 AliPHOSRecCpvManager::AliPHOSRecCpvManager()
42 fOneGamChisqCut = 3.; // If Chi2/dof > fOneGamChisqCut, split point.
44 fOneGamInitialStep = 0.00005;
46 fOneGamStepMin = 0.0005;
47 fOneGamNumOfIterations = 50;
49 fTwoGamInitialStep = 0.00005;
52 fTwoGamStepMin = 0.00005;
53 fTwoGamNumOfIterations = 50;
55 // fThr0 = 0.0285; // Min. energy of rec. point. If E<fThr0, point deleted.
56 // fSqdCut = 3.; // Min. distance (in cm) between two rec points.
61 SetTitle("Cpv Reconstruction Manager");
64 AliPHOSRecCpvManager::~AliPHOSRecCpvManager(void) {}
66 Float_t AliPHOSRecCpvManager::Dispersion(Float_t Etot, Float_t Ai, Float_t Ei)
68 //"Dispresion" of energy deposition in the cell.
69 // Etot is the total shower energy, Ai is the
70 // calculated cell response,
71 // Ei is the measured cell response.
73 const Float_t Const = 1.5;
74 return Const*Ai*(1.-Ai/Etot);
77 Float_t AliPHOSRecCpvManager::OneGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, Float_t& Gi)
79 //"Chi2" for one cell.
80 // Etot is the total "shower" energy, Ai is the
81 // calculated cell response,
82 // Ei is the measured cell response.
84 const Float_t Const = 1.5;
87 Float_t D = Const*Ai*(1.-Ai/Etot);
90 Gi = dd*(2.- dd*Const*(1.-2.*Ai/Etot));
92 cout<<" OneGamChi2 (Ai,Ei,Etot,&Gi,chi2) "<<Ai<<" "<<Ei<<" "<<Etot<<" "<<Gi<<" "<<da*da/D<<endl<<endl;
98 Float_t AliPHOSRecCpvManager::TwoGamChi2(Float_t Ai, Float_t Ei, Float_t Etot, Float_t& Gi)
101 const Float_t Const = 1.5;
103 Float_t da = Ai - Ei;
104 Float_t D = Const*Ai*(1.-Ai/Etot);
107 Gi = dd*(2.- dd*Const*(1.-2.*Ai/Etot));
113 void AliPHOSRecCpvManager::AG(Float_t Ei, Float_t Xi, Float_t Yi, Float_t& Ai, Float_t& GXi, Float_t& GYi )
115 //Calculates amplitude (Ai) and gradients (GXi, GYi) of CPV pad response.
116 //Integrated response (total "shower energy") is E,
117 //Xi and Yi are the distances along x and y from reference point
118 // to the pad center.
120 AliPHOSGetter * gime = AliPHOSGetter::GetInstance() ;
121 const AliPHOSGeometry* geom = gime->PHOSGeometry();
122 Float_t CelZ = geom->GetPadSizeZ();
123 Float_t CelY = geom->GetPadSizePhi();
125 // // cout<<"CelZ: "<<CelZ<<" CelY: "<<CelY<<endl;
127 Float_t dx = CelZ/2.;
128 Float_t dy = CelY/2.;
130 // // Float_t x = Xi*CelZ;
131 // // Float_t y = Yi*CelZ;
138 Float_t A = Fcml(x+dx,y+dy) - Fcml(x+dx,y-dy) - Fcml(x-dx,y+dy) + Fcml(x-dx,y-dy);
142 Float_t Gx = GradX(x+dx,y+dy) - GradX(x+dx,y-dy) - GradX(x-dx,y+dy) + GradX(x-dx,y-dy);
145 Float_t Gy = GradY(x+dx,y+dy) - GradY(x+dx,y-dy) - GradY(x-dx,y+dy) + GradY(x-dx,y-dy);
150 Float_t AliPHOSRecCpvManager::Fcml(Float_t x, Float_t y)
152 //Cumulative function
154 const Float_t A = 1.0;
155 const Float_t b = 0.70;
157 Float_t Fff = TMath::ATan(x*y/( b*TMath::Sqrt( (b*b) + x*x+y*y)))
158 - TMath::ATan(x*y/(3*b*TMath::Sqrt((3*b)*(3*b) + x*x+y*y)))
159 + TMath::ATan(x*y/(5*b*TMath::Sqrt((5*b)*(5*b) + x*x+y*y)))
160 - TMath::ATan(x*y/(7*b*TMath::Sqrt((7*b)*(7*b) + x*x+y*y)))
161 + TMath::ATan(x*y/(9*b*TMath::Sqrt((9*b)*(9*b) + x*x+y*y)));
163 Float_t Fcml = A*Fff/6.2831853071796;
164 // cout<<" Fcml: "<<Fcml<<endl;
170 Float_t AliPHOSRecCpvManager::GradX(Float_t x, Float_t y)
173 const Float_t A = 1.0;
174 const Float_t b = 0.70;
176 Float_t skv = b*b + x*x + y*y;
178 Float_t Gradient = y*(1.-x*x/skv)* b*TMath::Sqrt(skv)/( b*b*skv+x*x*y*y)
179 - y*(1.-x*x/skv)*3*b*TMath::Sqrt(skv)/((3*b)*(3*b)*skv+x*x*y*y)
180 + y*(1.-x*x/skv)*5*b*TMath::Sqrt(skv)/((5*b)*(5*b)*skv+x*x*y*y)
181 - y*(1.-x*x/skv)*7*b*TMath::Sqrt(skv)/((7*b)*(7*b)*skv+x*x*y*y)
182 + y*(1.-x*x/skv)*9*b*TMath::Sqrt(skv)/((9*b)*(9*b)*skv+x*x*y*y);
184 Float_t Grad = A*Gradient/6.2831853071796;
189 Float_t AliPHOSRecCpvManager::GradY(Float_t x, Float_t y)
192 const Float_t A = 1.0;
193 const Float_t b = 0.70;
195 Float_t skv = b*b + x*x + y*y;
196 Float_t Gradient = x*(1.-y*y/skv)* b*TMath::Sqrt(skv)/( b*b*skv+x*x*y*y)
197 - x*(1.-y*y/skv)*3*b*TMath::Sqrt(skv)/((3*b)*(3*b)*skv+x*x*y*y)
198 + x*(1.-y*y/skv)*5*b*TMath::Sqrt(skv)/((5*b)*(5*b)*skv+x*x*y*y)
199 - x*(1.-y*y/skv)*7*b*TMath::Sqrt(skv)/((7*b)*(7*b)*skv+x*x*y*y)
200 + x*(1.-y*y/skv)*9*b*TMath::Sqrt(skv)/((9*b)*(9*b)*skv+x*x*y*y);
202 Float_t Grad = A*Gradient/6.2831853071796;