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