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