removed .so from loadlibs
[u/mrichter/AliRoot.git] / STEER / AliESDZDC.cxx
CommitLineData
d5ebf00e 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// Implementation of Class AliESDZDC
19// This is a class that summarizes the ZDC data
20// for the ESD
21// Origin: Christian Klein-Boesing, CERN, Christian.Klein-Boesing@cern.ch
22//-------------------------------------------------------------------------
23
24
25
26#include "AliESDZDC.h"
27
28ClassImp(AliESDZDC)
29
30//______________________________________________________________________________
31AliESDZDC::AliESDZDC() :
32 TObject(),
33 fZDCN1Energy(0),
34 fZDCP1Energy(0),
35 fZDCN2Energy(0),
36 fZDCP2Energy(0),
f6536de8 37 fZDCEMEnergy(0),
38 fZDCEMEnergy1(0),
2b6cdc43 39 fZDCParticipants(0),
5f0ec064 40 fZDCPartSideA(0),
41 fZDCPartSideC(0),
42 fImpactParameter(0),
43 fImpactParamSideA(0),
44 fImpactParamSideC(0),
45 fESDQuality(0)
d5ebf00e 46{
89291556 47 for(Int_t i=0; i<5; i++){
a85132e7 48 fZN1TowerEnergy[i] = fZN2TowerEnergy[i] = 0.;
49 fZP1TowerEnergy[i] = fZP2TowerEnergy[i] = 0.;
50 fZN1TowerEnergyLR[i] = fZN2TowerEnergyLR[i] = 0.;
51 fZP1TowerEnergyLR[i] = fZP2TowerEnergyLR[i] = 0.;
52 }
89291556 53 for(Int_t i=0; i<2; i++){
54 fZNACentrCoord[i] = fZNCCentrCoord[i] = 0.;
55 }
54c6a92c 56 for(Int_t i=0; i<32; i++) fVMEScaler[i]=0;
d5ebf00e 57}
58
2b6cdc43 59//______________________________________________________________________________
d5ebf00e 60AliESDZDC::AliESDZDC(const AliESDZDC& zdc) :
61 TObject(zdc),
62 fZDCN1Energy(zdc.fZDCN1Energy),
63 fZDCP1Energy(zdc.fZDCP1Energy),
64 fZDCN2Energy(zdc.fZDCN2Energy),
65 fZDCP2Energy(zdc.fZDCP2Energy),
f6536de8 66 fZDCEMEnergy(zdc.fZDCEMEnergy),
67 fZDCEMEnergy1(zdc.fZDCEMEnergy1),
2b6cdc43 68 fZDCParticipants(zdc.fZDCParticipants),
5f0ec064 69 fZDCPartSideA(zdc.fZDCPartSideA),
70 fZDCPartSideC(zdc.fZDCPartSideC),
71 fImpactParameter(zdc.fImpactParameter),
8c755c03 72 fImpactParamSideA(zdc.fImpactParamSideA),
73 fImpactParamSideC(zdc.fImpactParamSideC),
5f0ec064 74 fESDQuality(zdc.fESDQuality)
d5ebf00e 75{
76 // copy constructor
89291556 77 for(Int_t i=0; i<5; i++){
a85132e7 78 fZN1TowerEnergy[i] = zdc.fZN1TowerEnergy[i];
79 fZN2TowerEnergy[i] = zdc.fZN2TowerEnergy[i];
80 fZP1TowerEnergy[i] = zdc.fZP1TowerEnergy[i];
81 fZP2TowerEnergy[i] = zdc.fZP2TowerEnergy[i];
82 fZN1TowerEnergyLR[i] = zdc.fZN1TowerEnergyLR[i];
83 fZN2TowerEnergyLR[i] = zdc.fZN2TowerEnergyLR[i];
84 fZP1TowerEnergyLR[i] = zdc.fZP1TowerEnergyLR[i];
85 fZP2TowerEnergyLR[i] = zdc.fZP2TowerEnergyLR[i];
86 }
89291556 87 for(Int_t i=0; i<2; i++){
88 fZNACentrCoord[i] = zdc.fZNACentrCoord[i];
89 fZNCCentrCoord[i] = zdc.fZNCCentrCoord[i];
90 }
54c6a92c 91 for(Int_t i=0; i<32; i++) fVMEScaler[i] = zdc.fVMEScaler[i];
d5ebf00e 92}
93
2b6cdc43 94//______________________________________________________________________________
d5ebf00e 95AliESDZDC& AliESDZDC::operator=(const AliESDZDC&zdc)
96{
97 // assigment operator
98 if(this!=&zdc) {
99 TObject::operator=(zdc);
100 fZDCN1Energy = zdc.fZDCN1Energy;
101 fZDCP1Energy = zdc.fZDCP1Energy;
102 fZDCN2Energy = zdc.fZDCN2Energy;
103 fZDCP2Energy = zdc.fZDCP2Energy;
f6536de8 104 fZDCEMEnergy = zdc.fZDCEMEnergy;
105 fZDCEMEnergy1 = zdc.fZDCEMEnergy1;
a85132e7 106 for(Int_t i=0; i<5; i++){
7b4458a2 107 fZN1TowerEnergy[i] = zdc.fZN1TowerEnergy[i];
108 fZN2TowerEnergy[i] = zdc.fZN2TowerEnergy[i];
a85132e7 109 fZP1TowerEnergy[i] = zdc.fZP1TowerEnergy[i];
110 fZP2TowerEnergy[i] = zdc.fZP2TowerEnergy[i];
111 fZN1TowerEnergyLR[i] = zdc.fZN1TowerEnergyLR[i];
112 fZN2TowerEnergyLR[i] = zdc.fZN2TowerEnergyLR[i];
113 fZP1TowerEnergyLR[i] = zdc.fZP1TowerEnergyLR[i];
114 fZP2TowerEnergyLR[i] = zdc.fZP2TowerEnergyLR[i];
7b4458a2 115 }
5f0ec064 116 //
117 fZDCParticipants = zdc.fZDCParticipants;
118 fZDCPartSideA = zdc.fZDCPartSideA;
119 fZDCPartSideC = zdc.fZDCPartSideC;
120 fImpactParameter = zdc.fImpactParameter;
121 fImpactParamSideA = zdc.fImpactParamSideA;
122 fImpactParamSideC = zdc.fImpactParamSideC;
123 //
89291556 124 for(Int_t i=0; i<2; i++){
125 fZNACentrCoord[i] = zdc.fZNACentrCoord[i];
126 fZNCCentrCoord[i] = zdc.fZNCCentrCoord[i];
127 }
5f0ec064 128 //
129 fESDQuality = zdc.fESDQuality;
54c6a92c 130 for(Int_t i=0; i<32; i++) fVMEScaler[i] = zdc.fVMEScaler[i];
d5ebf00e 131 }
132 return *this;
133}
134
2b6cdc43 135//______________________________________________________________________________
732a24fe 136void AliESDZDC::Copy(TObject &obj) const {
137
138 // this overwrites the virtual TOBject::Copy()
139 // to allow run time copying without casting
140 // in AliESDEvent
141
142 if(this==&obj)return;
143 AliESDZDC *robj = dynamic_cast<AliESDZDC*>(&obj);
144 if(!robj)return; // not an AliESDZDC
145 *robj = *this;
146
147}
148
d5ebf00e 149
150//______________________________________________________________________________
151void AliESDZDC::Reset()
152{
153 // reset all data members
154 fZDCN1Energy=0;
155 fZDCP1Energy=0;
156 fZDCN2Energy=0;
157 fZDCP2Energy=0;
f6536de8 158 fZDCEMEnergy=0;
159 fZDCEMEnergy1=0;
89291556 160 for(Int_t i=0; i<5; i++){
a85132e7 161 fZN1TowerEnergy[i] = fZN2TowerEnergy[i] = 0.;
162 fZP1TowerEnergy[i] = fZP2TowerEnergy[i] = 0.;
163 fZN1TowerEnergyLR[i] = fZN2TowerEnergyLR[i] = 0.;
164 fZP1TowerEnergyLR[i] = fZP2TowerEnergyLR[i] = 0.;
165 }
5f0ec064 166 fZDCParticipants=0;
167 fZDCPartSideA=0;
168 fZDCPartSideC=0;
169 fImpactParameter=0;
170 fImpactParamSideA=0;
171 fImpactParamSideC=0;
89291556 172 for(Int_t i=0; i<2; i++){
173 fZNACentrCoord[i] = fZNCCentrCoord[i] = 0.;
174 }
5f0ec064 175 fESDQuality=0;
54c6a92c 176 for(Int_t i=0; i<32; i++) fVMEScaler[i] = 0;
d5ebf00e 177}
178
179//______________________________________________________________________________
180void AliESDZDC::Print(const Option_t *) const
181{
a85132e7 182 // Print ESD for the ZDC
5f0ec064 183 printf("\n \t E_{ZNC} = %f TeV, E_{ZPC} = %f TeV, E_{ZNA} = %f TeV, E_{ZPA} = %f TeV,"
184 " E_{ZEM} = %f GeV, Npart = %d, b = %1.2f fm\n",
185 fZDCN1Energy/1000.,fZDCP1Energy/1000.,fZDCN2Energy/1000.,fZDCP2Energy/1000.,
186 fZDCEMEnergy+fZDCEMEnergy1, fZDCParticipants,fImpactParameter);
54c6a92c 187 //
188 printf(" ### fVMEScaler: \n");
189 for(Int_t i=0; i<32; i++) printf("\t datum %d: %d \n",i,fVMEScaler[i]);
190 printf("\n");
d5ebf00e 191}
192
d1d3e36b 193//______________________________________________________________________________
b19cc8d0 194const Double_t * AliESDZDC::GetZNCCentroidInPbPb(Float_t beamEne)
d1d3e36b 195{
196 // Provide coordinates of centroid over ZN (side C) front face
b19cc8d0 197 const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75};
198 const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75};
48486c12 199 Float_t numX=0., numY=0., den=0.;
b19cc8d0 200 Float_t c, w;
201 const Float_t alpha=0.395;
5f0ec064 202 //
b19cc8d0 203 for(Int_t i=0; i<4; i++)
204 if(fZN1TowerEnergy[i+1]>0.) {
205 w = TMath::Power(fZN1TowerEnergy[i+1], alpha);
206 numX += x[i]*w;
207 numY += y[i]*w;
208 den += w;
209 }
48486c12 210 if(den!=0){
b19cc8d0 211 Float_t nSpecn = fZDCN1Energy/beamEne;
e955aeff 212 c = 1.89358-0.71262/(nSpecn+0.71789);
5f0ec064 213 fZNCCentrCoord[0] = c*numX/den;
214 fZNCCentrCoord[1] = c*numY/den;
b19cc8d0 215 } else {
216 fZNCCentrCoord[0] = fZNCCentrCoord[1] = 0;
d1d3e36b 217 }
89291556 218 return fZNCCentrCoord;
d1d3e36b 219}
7b4458a2 220
d1d3e36b 221//______________________________________________________________________________
b19cc8d0 222const Double_t * AliESDZDC::GetZNACentroidInPbPb(Float_t beamEne)
d1d3e36b 223{
224 // Provide coordinates of centroid over ZN (side A) front face
b19cc8d0 225 const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75};
226 const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75};
48486c12 227 Float_t numX=0., numY=0., den=0.;
b19cc8d0 228 Float_t c, w;
229 const Float_t alpha=0.395;
230
231 for(Int_t i=0; i<4; i++)
232 if(fZN2TowerEnergy[i+1]>0.) {
233 w = TMath::Power(fZN2TowerEnergy[i+1], alpha);
234 numX += x[i]*w;
235 numY += y[i]*w;
236 den += w;
237 }
ce099621 238 //
48486c12 239 if(den!=0){
b19cc8d0 240 Float_t nSpecn = fZDCN2Energy/beamEne;
e955aeff 241 c = 1.89358-0.71262/(nSpecn+0.71789);
5f0ec064 242 fZNACentrCoord[0] = c*numX/den;
243 fZNACentrCoord[1] = c*numY/den;
b19cc8d0 244 } else {
245 fZNACentrCoord[0] = fZNACentrCoord[1] = 0;
246 }
247 return fZNACentrCoord;
248}
249
250//______________________________________________________________________________
251const Double_t * AliESDZDC::GetZNCCentroidInpp()
252{
253 // Provide coordinates of centroid over ZN (side C) front face
254 const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75};
255 const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75};
256 Float_t numX=0., numY=0., den=0.;
257 const Float_t alpha=0.5;
258 Float_t w;
259 //
260 for(Int_t i=0; i<4; i++)
261 if(fZN1TowerEnergy[i+1]>0.) {
262 w = TMath::Power(fZN1TowerEnergy[i+1], alpha);
263 numX += x[i]*w;
264 numY += y[i]*w;
265 den += w;
266 }
267
268 if(den!=0){
269 fZNCCentrCoord[0] = numX/den;
270 fZNCCentrCoord[1] = numY/den;
271 } else {
272 fZNCCentrCoord[0] = fZNCCentrCoord[1] = 0;
273 }
274 return fZNCCentrCoord;
275}
276
277//______________________________________________________________________________
278const Double_t * AliESDZDC::GetZNACentroidInpp()
279{
280 // Provide coordinates of centroid over ZN (side A) front face
281 const Float_t x[4] = {-1.75, 1.75, -1.75, 1.75};
282 const Float_t y[4] = {-1.75, -1.75, 1.75, 1.75};
283 Float_t numX=0., numY=0., den=0.;
284 const Float_t alpha=0.395;
285 Float_t w;
286
287 for(Int_t i=0; i<4; i++)
288 if(fZN2TowerEnergy[i+1]>0.) {
289 w = TMath::Power(fZN2TowerEnergy[i+1], alpha);
290 numX += x[i]*w;
291 numY += y[i]*w;
292 den += w;
293 }
294 //
295 if(den!=0){
296 fZNACentrCoord[0] = numX/den;
297 fZNACentrCoord[1] = numY/den;
298 } else {
299 fZNACentrCoord[0] = fZNACentrCoord[1] = 0;
ce099621 300 }
b19cc8d0 301
89291556 302 return fZNACentrCoord;
d1d3e36b 303}