Additional protection in case we have more clusters than the size of the array
[u/mrichter/AliRoot.git] / ZDC / AliZDCReco.cxx
CommitLineData
1450a7cd 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
803d1ab0 16/* $Id$ */
1450a7cd 17
18////////////////////////////////////////////////
19// RecPoints classes for set ZDC //
93f80a6f 20// This class reconstructs the space //
21// points from digits //
22// for the ZDC calorimeter //
1450a7cd 23////////////////////////////////////////////////
24
25
26#include "AliZDCReco.h"
27
28ClassImp(AliZDCReco)
29
cc2abffd 30
31//_____________________________________________________________________________
32AliZDCReco::AliZDCReco() :
33
34 TObject(),
646f1679 35 //
73bc3a3f 36 fNDetSpecNSideA(0),
37 fNDetSpecPSideA(0),
38 fNDetSpecNSideC(0),
39 fNDetSpecPSideC(0),
40 fNTrueSpectators(0),
41 fNTrueSpecSideA(0),
42 fNTrueSpecSideC(0),
43 fNParticipants(0),
44 fNPartSideA(0),
45 fNPartSideC(0),
46 fImpParameter(0),
47 fImpParSideA(0),
48 fImpParSideC(0)
cc2abffd 49
50{
51 //
52 // Default constructor
53 //
c35ed519 54 for(Int_t i=0; i<10; i++){
55 fZN1EnTow[i] = fZP1EnTow[i] = fZN2EnTow[i] = fZP2EnTow[i] = 0.;
56 if(i<2){
57 fZN1Energy[i] = fZP1Energy[i] = fZN2Energy[i] = fZP2Energy[i] = 0.;
58 fZEM1signal[i] = fZEM2signal[i] = 0.;
59 fPMRef1[i] = fPMRef2[i] = 0.;
60 }
84d6255e 61 }
cc2abffd 62}
63
64
1450a7cd 65//_____________________________________________________________________________
73bc3a3f 66AliZDCReco::AliZDCReco(
67 Float_t* ezn1, Float_t* ezp1, Float_t* ezn2, Float_t* ezp2,
68 Float_t* ezn1tow, Float_t* ezp1tow, Float_t* ezn2tow, Float_t* ezp2tow,
69 Float_t* ezem1, Float_t* ezem2, Float_t* ref1, Float_t* ref2,
70 //
71 Int_t detspnSideA, Int_t detsppSideA, Int_t detspnSideC, Int_t detsppSideC,
72 Int_t trsp, Int_t trspSideA,Int_t trspSideC,
73 Int_t npart, Int_t npartSideA, Int_t npartSideC,
74 Float_t b, Float_t bSideA, Float_t bSideC) :
cc2abffd 75
76 TObject(),
646f1679 77 //
73bc3a3f 78 fNDetSpecNSideA(detspnSideA),
79 fNDetSpecPSideA(detsppSideA),
80 fNDetSpecNSideC(detspnSideC),
81 fNDetSpecPSideC(detsppSideC),
82 fNTrueSpectators(trsp),
83 fNTrueSpecSideA(trspSideA),
84 fNTrueSpecSideC(trspSideC),
85 fNParticipants(npart),
86 fNPartSideA(npartSideA),
87 fNPartSideC(npartSideC),
88 fImpParameter(b),
89 fImpParSideA(bSideA),
90 fImpParSideC(bSideC)
cc2abffd 91
1450a7cd 92{
93f80a6f 93 //
cc2abffd 94 // Constructor
93f80a6f 95 //
c35ed519 96 for(Int_t j=0; j<10; j++){
646f1679 97 fZN1EnTow[j] = ezn1tow[j];
98 fZP1EnTow[j] = ezp1tow[j];
99 fZN2EnTow[j] = ezn2tow[j];
100 fZP2EnTow[j] = ezp2tow[j];
c35ed519 101 if(j<2){
102 fZN1Energy[j] = ezn1[j];
103 fZP1Energy[j] = ezp1[j];
104 fZN2Energy[j] = ezn2[j];
105 fZP2Energy[j] = ezp2[j];
106 fZEM1signal[j] = ezem1[j];
107 fZEM2signal[j] = ezem2[j];
108 fPMRef1[j] = ref1[j];
109 fPMRef2[j] = ref2[j];
110 }
646f1679 111 }
1450a7cd 112
113}
93f80a6f 114
115//______________________________________________________________________________
cc2abffd 116AliZDCReco::AliZDCReco(const AliZDCReco &oldreco) :
a718c993 117TObject(),
73bc3a3f 118fNDetSpecNSideA(oldreco.GetNDetSpecNSideA()),
119fNDetSpecPSideA(oldreco.GetNDetSpecPSideA()),
120fNDetSpecNSideC(oldreco.GetNDetSpecNSideC()),
121fNDetSpecPSideC(oldreco.GetNDetSpecPSideC()),
122fNTrueSpectators(oldreco.GetNTrueSpectators()),
123fNTrueSpecSideA(oldreco.GetNTrueSpecSideA()),
124fNTrueSpecSideC(oldreco.GetNTrueSpecSideC()),
125fNParticipants(oldreco.GetNParticipants()),
126fNPartSideA(oldreco.GetNPartSideA()),
127fNPartSideC(oldreco.GetNPartSideC()),
128fImpParameter(oldreco.GetImpParameter()),
129fImpParSideA(oldreco.GetImpParSideA()),
130fImpParSideC(oldreco.GetImpParSideC())
cc2abffd 131{
132 // Copy constructor
133
c35ed519 134 fZN1Energy[0] = oldreco.GetZN1HREnergy();
135 fZP1Energy[0] = oldreco.GetZP1HREnergy();
136 fZN2Energy[0] = oldreco.GetZN2HREnergy();
137 fZP2Energy[0] = oldreco.GetZP2HREnergy();
138 //
139 fZN1Energy[1] = oldreco.GetZN1LREnergy();
140 fZP1Energy[1] = oldreco.GetZP1LREnergy();
141 fZN2Energy[1] = oldreco.GetZN2LREnergy();
142 fZP2Energy[1] = oldreco.GetZP2LREnergy();
646f1679 143 //
144 for(Int_t i=0; i<5; i++){
c35ed519 145 fZN1EnTow[i] = oldreco.GetZN1HREnTow(i);
146 fZP1EnTow[i] = oldreco.GetZP1HREnTow(i);
147 fZN2EnTow[i] = oldreco.GetZN2HREnTow(i);
148 fZP2EnTow[i] = oldreco.GetZP2HREnTow(i);
149 fZN1EnTow[i+5] = oldreco.GetZN1LREnTow(i);
150 fZP1EnTow[i+5] = oldreco.GetZP1LREnTow(i);
151 fZN2EnTow[i+5] = oldreco.GetZN2LREnTow(i);
152 fZP2EnTow[i+5] = oldreco.GetZP2LREnTow(i);
646f1679 153 }
c35ed519 154 fZEM1signal[0] = oldreco.GetZEM1HRsignal();
155 fZEM1signal[1] = oldreco.GetZEM1LRsignal();
156 fZEM2signal[0] = oldreco.GetZEM2HRsignal();
157 fZEM2signal[1] = oldreco.GetZEM2LRsignal();
158 fPMRef1[0] = oldreco.GetPMRef1HRsignal();
159 fPMRef1[1] = oldreco.GetPMRef1LRsignal();
160 fPMRef2[0] = oldreco.GetPMRef2HRsignal();
161 fPMRef2[1] = oldreco.GetPMRef2LRsignal();
cc2abffd 162}
163
164//______________________________________________________________________________
93f80a6f 165void AliZDCReco::Print(Option_t *) const {
166 //
167 // Printing Reconstruction Parameters
168 //
73bc3a3f 169 printf(" ****************** AliZDCReco object ******************\n"
170 " --------------- side A ---------------\n"
171 " E_{ZN} = %f TeV, E_{ZP} = %f TeV, "
172 " E_{ZEM1} = %f TeV, E_{ZEM2} = %f TeV\n "
173 " N_{spec n}^{DET} = %d, N_{spec p}^{DET} = %d,"
174 " N_{part} = %d, b = %1.4f fm\n"
175 " --------------- side C ---------------\n"
176 " E_{ZN} = %f TeV, E_{ZP} = %f TeV\n "
177 " N_{spec n}^{DET} = %d, N_{spec p}^{DET} = %d,"
178 " N_{part} = %d, b = %1.4f fm\n"
179 " *******************************************************\n",
4e1fc320 180 fZN2Energy[0]/1000., fZP2Energy[0]/1000.,
73bc3a3f 181 fZEM1signal[0]/1000.,fZEM2signal[0]/1000.,
182 fNDetSpecNSideA,fNDetSpecPSideA, fNPartSideA,fImpParSideA,
183 fZN1Energy[0]/1000.,fZP1Energy[0]/1000.,
184 fNDetSpecNSideC,fNDetSpecPSideC,fNPartSideC,fImpParSideC);
185
93f80a6f 186}