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 **************************************************************************/
18 //_________________________________________________________________________
19 // Class for the management by the CPV reconstruction.
21 //*-- Author : Boris Polichtchouk (IHEP, Protvino) 6 Mar 2001
23 // --- ROOT system ---
27 // --- Standard library ---
29 // --- AliRoot header files ---
31 #include "AliPHOSRecCpvManager.h"
32 #include "AliPHOSGeometry.h"
33 #include "AliPHOSLoader.h"
35 ClassImp(AliPHOSRecCpvManager)
37 //____________________________________________________________________________
38 AliPHOSRecCpvManager::AliPHOSRecCpvManager() :
40 fOneGamInitialStep(0.00005),
42 fOneGamStepMin(0.0005),
43 fOneGamNumOfIterations(50),
44 fTwoGamInitialStep(0.00005),
47 fTwoGamStepMin(0.00005),
48 fTwoGamNumOfIterations(50),
53 SetTitle("Cpv Reconstruction Manager");
56 AliPHOSRecCpvManager::~AliPHOSRecCpvManager(void)
61 Float_t AliPHOSRecCpvManager::Dispersion(Float_t etot, Float_t ai) const
63 //"Dispresion" of energy deposition in the cell.
64 // etot is the total shower energy, ai is the
65 // calculated cell response,
66 // ei is the measured cell response.
68 const Float_t kConst = 1.5;
69 return kConst*ai*(1.-ai/etot);
72 Float_t AliPHOSRecCpvManager::OneGamChi2(Float_t ai, Float_t ei, Float_t etot, Float_t& Gi) const
74 //"Chi2" for one cell.
75 // etot is the total "shower" energy, ai is the
76 // calculated cell response,
77 // ei is the measured cell response.
79 const Float_t kConst = 1.5;
82 Float_t d = kConst*ai*(1.-ai/etot);
85 Gi = dd*(2.- dd*kConst*(1.-2.*ai/etot));
87 Info("OneGamChi2", " OneGamChi2 (ai,ei,etot,&Gi,chi2) %f %f %f %f %f", ai, ei, etot, Gi, da*da/d );
93 Float_t AliPHOSRecCpvManager::TwoGamChi2(Float_t ai, Float_t ei, Float_t etot, Float_t& gi) const
97 const Float_t kConst = 1.5;
100 Float_t d = kConst*ai*(1.-ai/etot);
103 gi = dd*(2.- dd*kConst*(1.-2.*ai/etot));
109 void AliPHOSRecCpvManager::AG(Float_t ei, Float_t xi, Float_t yi, Float_t& ai, Float_t& gxi, Float_t& gyi )
111 //Calculates amplitude (ai) and gradients (gxi, gyi) of CPV pad response.
112 //Integrated response (total "shower energy") is e,
113 //xi and yi are the distances along x and y from reference point
114 // to the pad center.
116 AliPHOSGeometry * geom = AliPHOSLoader::GetPHOSGeometry();
118 Float_t celZ = geom->GetPadSizeZ();
119 Float_t celY = geom->GetPadSizePhi();
121 // // Info("AG", "celZ: %f celY: %f", celZ, celY) ;
123 Float_t dx = celZ/2.;
124 Float_t dy = celY/2.;
126 // // Float_t x = xi*celZ;
127 // // Float_t y = yi*celZ;
134 Float_t a = Fcml(x+dx,y+dy) - Fcml(x+dx,y-dy) - Fcml(x-dx,y+dy) + Fcml(x-dx,y-dy);
138 Float_t gx = GradX(x+dx,y+dy) - GradX(x+dx,y-dy) - GradX(x-dx,y+dy) + GradX(x-dx,y-dy);
141 Float_t gy = GradY(x+dx,y+dy) - GradY(x+dx,y-dy) - GradY(x-dx,y+dy) + GradY(x-dx,y-dy);
146 Float_t AliPHOSRecCpvManager::Fcml(Float_t x, Float_t y)
148 //Cumulative function
150 const Float_t ka = 1.0;
151 const Float_t kb = 0.70;
153 Float_t fff = TMath::ATan(x*y/( kb*TMath::Sqrt( (kb*kb) + x*x+y*y)))
154 - TMath::ATan(x*y/(3*kb*TMath::Sqrt((3*kb)*(3*kb) + x*x+y*y)))
155 + TMath::ATan(x*y/(5*kb*TMath::Sqrt((5*kb)*(5*kb) + x*x+y*y)))
156 - TMath::ATan(x*y/(7*kb*TMath::Sqrt((7*kb)*(7*kb) + x*x+y*y)))
157 + TMath::ATan(x*y/(9*kb*TMath::Sqrt((9*kb)*(9*kb) + x*x+y*y)));
159 Float_t fcml = ka*fff/TMath::TwoPi();
160 // Info("Fcml", "fcml: %f", fcml) ;
166 Float_t AliPHOSRecCpvManager::GradX(Float_t x, Float_t y)
168 // Put a comment here
170 const Float_t ka = 1.0;
171 const Float_t kb = 0.70;
173 Float_t skv = kb*kb + x*x + y*y;
175 Float_t gradient = y*(1.-x*x/skv)* kb*TMath::Sqrt(skv)/( kb*kb*skv+x*x*y*y)
176 - y*(1.-x*x/skv)*3*kb*TMath::Sqrt(skv)/((3*kb)*(3*kb)*skv+x*x*y*y)
177 + y*(1.-x*x/skv)*5*kb*TMath::Sqrt(skv)/((5*kb)*(5*kb)*skv+x*x*y*y)
178 - y*(1.-x*x/skv)*7*kb*TMath::Sqrt(skv)/((7*kb)*(7*kb)*skv+x*x*y*y)
179 + y*(1.-x*x/skv)*9*kb*TMath::Sqrt(skv)/((9*kb)*(9*kb)*skv+x*x*y*y);
181 Float_t grad = ka*gradient/TMath::TwoPi();
186 Float_t AliPHOSRecCpvManager::GradY(Float_t x, Float_t y)
188 // Put a comment here
190 const Float_t ka = 1.0;
191 const Float_t kb = 0.70;
193 Float_t skv = kb*kb + x*x + y*y;
194 Float_t gradient = x*(1.-y*y/skv)* kb*TMath::Sqrt(skv)/( kb*kb*skv+x*x*y*y)
195 - x*(1.-y*y/skv)*3*kb*TMath::Sqrt(skv)/((3*kb)*(3*kb)*skv+x*x*y*y)
196 + x*(1.-y*y/skv)*5*kb*TMath::Sqrt(skv)/((5*kb)*(5*kb)*skv+x*x*y*y)
197 - x*(1.-y*y/skv)*7*kb*TMath::Sqrt(skv)/((7*kb)*(7*kb)*skv+x*x*y*y)
198 + x*(1.-y*y/skv)*9*kb*TMath::Sqrt(skv)/((9*kb)*(9*kb)*skv+x*x*y*y);
200 Float_t grad = ka*gradient/TMath::TwoPi();