L1phase shift corrected
[u/mrichter/AliRoot.git] / PHOS / AliPHOSRecEmcManager.cxx
CommitLineData
cbd576a6 1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
090026bf 16/* $Id$ */
cbd576a6 17
18//_________________________________________________________________________
19// Class for the management by the Emc reconstruction.
386aef34 20////
cbd576a6 21//*-- Author : Boris Polichtchouk (IHEP, Protvino) 6 Mar 2001
22//
23// --- ROOT system ---
24
090026bf 25#include <TMath.h>
26
cbd576a6 27// --- Standard library ---
28
cbd576a6 29// --- AliRoot header files ---
30
31#include "AliPHOSRecEmcManager.h"
cbd576a6 32
33ClassImp(AliPHOSRecEmcManager)
34
35//____________________________________________________________________________
36
3f7dbdb7 37AliPHOSRecEmcManager::AliPHOSRecEmcManager():
38 fOneGamChisqCut(1.3f),
39 fOneGamInitialStep(0.00005f),
40 fOneGamChisqMin(1.f),
41 fOneGamStepMin(0.0005f),
42 fOneGamNumOfIterations(50),
43 fTwoGamInitialStep(0.00005f),
44 fTwoGamChisqMin(1.f),
45 fTwoGamEmin(0.1f),
46 fTwoGamStepMin(0.00005),
47 fTwoGamNumOfIterations(50),
48 fThr0(0.f),
49 fSqdCut(0.f)
cbd576a6 50{
386aef34 51 // default ctor
cbd576a6 52 SetTitle("Emc Reconstruction Manager");
cbd576a6 53}
54
55AliPHOSRecEmcManager::~AliPHOSRecEmcManager(void) {}
56
90cceaf6 57Float_t AliPHOSRecEmcManager::Dispersion(Float_t ei) const
cbd576a6 58{
59 //"Dispresion" of energy deposition in the cell.
386aef34 60 // eTot is the total shower energy, ai is the
cbd576a6 61 // calculated cell response,
386aef34 62 // ei is the measured cell response.
cbd576a6 63
386aef34 64 return ei;
cbd576a6 65}
66
8789edd0 67Float_t AliPHOSRecEmcManager::OneGamChi2(Float_t ai, Float_t ei, Float_t, Float_t& gi) const
cbd576a6 68{
69 // Chi2 used in OneGam (one-gamma fitting).
386aef34 70 // gi is d(Chi2)/d(ai).
cbd576a6 71
386aef34 72 Float_t da = ai - ei;
73 Float_t d = ei; // we assume that sigma(E) = sqrt(E)
74 gi = 2.*(ai-ei)/d;
cbd576a6 75
386aef34 76 return da*da/d;
cbd576a6 77
78}
79
8789edd0 80Float_t AliPHOSRecEmcManager::TwoGamChi2(Float_t ai, Float_t ei, Float_t, Float_t& gi) const
cbd576a6 81{
386aef34 82 // calculates chi^2
83 Float_t da = ai - ei;
84 Float_t d = ei; // we assume that sigma(E) = sqrt(E)
85 gi = 2.*(ai-ei)/d;
cbd576a6 86
386aef34 87 return da*da/d;
cbd576a6 88
89}
90
386aef34 91void AliPHOSRecEmcManager::AG(Float_t ei, Float_t xi, Float_t yi, Float_t& ai, Float_t& gxi, Float_t& gyi )
cbd576a6 92{
386aef34 93 //Calculates amplitude (ai) and gradients (gxi, gyi) of CPV pad response.
cbd576a6 94 //Integrated response (total "shower energy") is E,
386aef34 95 //xi and yi are the distances along x and y from reference point
cbd576a6 96 // to the pad center.
97 //Shape of the shower is from PHOS TDR.
98
99
386aef34 100 Float_t r = TMath::Sqrt(xi*xi + yi*yi);
cbd576a6 101 Float_t r4 = r*r*r*r ;
102 Float_t r295 = TMath::Power(r, 2.95) ;
386aef34 103 Float_t shape = ei*TMath::Exp( -r4 * (1. / (2.32 + 0.26 * r4) + 0.0316 / (1 + 0.0652 * r295) ) ) ;
104 ai = shape;
cbd576a6 105
106
386aef34 107 //d(shape)/d(xi)
108 gxi = (-(TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
109 ((-0.006077944*xi*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),
cbd576a6 110 0.4750000000000001))/
386aef34 111 TMath::Power(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475),2) -
112 (1.04*xi*(TMath::Power(xi,2) + TMath::Power(yi,2)))/
113 TMath::Power(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2),2))) -
114 4*xi*(TMath::Power(xi,2) + TMath::Power(yi,2))*
115 (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) +
116 1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))))/
117 TMath::Power(TMath::E(),TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
118 (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) +
119 1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))));
cbd576a6 120
386aef34 121 gxi = gxi*ei;
cbd576a6 122
386aef34 123 //d(shape)/d(yi)
124 gyi = (-(TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
125 ((-0.006077944*yi*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),
cbd576a6 126 0.4750000000000001))/
386aef34 127 TMath::Power(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475),2) -
128 (1.04*yi*(TMath::Power(xi,2) + TMath::Power(yi,2)))/
129 TMath::Power(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2),2))) -
130 4*yi*(TMath::Power(xi,2) + TMath::Power(yi,2))*
131 (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) +
132 1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))))/
133 TMath::Power(TMath::E(),TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2)*
134 (0.0316/(1 + 0.0652*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),1.475)) +
135 1./(2.32 + 0.26*TMath::Power(TMath::Power(xi,2) + TMath::Power(yi,2),2))));
136
137
138 gyi = gyi*ei;
cbd576a6 139
140}
141
142
143
144
145
146
147