Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 2007-2009, 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 : // Plane Efficiency class for ITS
17 : // It is used for chip by chip efficiency of the SPD,
18 : // evaluated by tracks
19 : // (Inherits from AliITSPlaneEff)
20 : // Author: G.E. Bruno
21 : // giuseppe.bruno@ba.infn.it
22 : //
23 : ///////////////////////////////////////////////////////////////////////////
24 :
25 : /* $Id$ */
26 :
27 : #include <TMath.h>
28 : #include <TH1F.h>
29 : #include <TFile.h>
30 : #include <TTree.h>
31 : #include <TROOT.h>
32 : #include "AliITSPlaneEffSPD.h"
33 : #include "AliLog.h"
34 : #include "AliCDBStorage.h"
35 : #include "AliCDBEntry.h"
36 : #include "AliCDBManager.h"
37 : //#include "AliCDBRunRange.h"
38 : #include "AliITSsegmentationSPD.h"
39 : #include "AliITSCalibrationSPD.h"
40 :
41 118 : ClassImp(AliITSPlaneEffSPD)
42 : //______________________________________________________________________
43 : AliITSPlaneEffSPD::AliITSPlaneEffSPD():
44 0 : AliITSPlaneEff(),
45 0 : fHisResX(0),
46 0 : fHisResZ(0),
47 0 : fHisResXZ(0),
48 0 : fHisClusterSize(0),
49 0 : fHisResXclu(0),
50 0 : fHisResZclu(0),
51 0 : fHisResXchip(0),
52 0 : fHisResZchip(0),
53 0 : fProfResXvsPhi(0),
54 0 : fProfResZvsDip(0),
55 0 : fProfResXvsPhiclu(0),
56 0 : fProfResZvsDipclu(0),
57 0 : fHisTrackErrX(0),
58 0 : fHisTrackErrZ(0),
59 0 : fHisClusErrX(0),
60 0 : fHisClusErrZ(0),
61 0 : fHisTrackXFOtrue(0),
62 0 : fHisTrackZFOtrue(0),
63 0 : fHisTrackXFOfalse(0),
64 0 : fHisTrackZFOfalse(0),
65 0 : fHisTrackXZFOtrue(0),
66 0 : fHisTrackXZFOfalse(0){
67 0 : for (UInt_t i=0; i<kNModule*kNChip*(kNClockPhase+1); i++){
68 0 : fFound[i]=0;
69 0 : fTried[i]=0;
70 : }
71 : // default constructor
72 0 : AliDebug(1,Form("Calling default constructor"));
73 0 : }
74 : //______________________________________________________________________
75 0 : AliITSPlaneEffSPD::~AliITSPlaneEffSPD(){
76 : // destructor
77 : // Inputs:
78 : // none.
79 : // Outputs:
80 : // none.
81 : // Return:
82 : // none.
83 0 : DeleteHistos();
84 0 : }
85 : //______________________________________________________________________
86 0 : AliITSPlaneEffSPD::AliITSPlaneEffSPD(const AliITSPlaneEffSPD &s) : AliITSPlaneEff(s),
87 : //fHis(s.fHis),
88 0 : fHisResX(0),
89 0 : fHisResZ(0),
90 0 : fHisResXZ(0),
91 0 : fHisClusterSize(0),
92 0 : fHisResXclu(0),
93 0 : fHisResZclu(0),
94 0 : fHisResXchip(0),
95 0 : fHisResZchip(0),
96 0 : fProfResXvsPhi(0),
97 0 : fProfResZvsDip(0),
98 0 : fProfResXvsPhiclu(0),
99 0 : fProfResZvsDipclu(0),
100 0 : fHisTrackErrX(0),
101 0 : fHisTrackErrZ(0),
102 0 : fHisClusErrX(0),
103 0 : fHisClusErrZ(0),
104 0 : fHisTrackXFOtrue(0),
105 0 : fHisTrackZFOtrue(0),
106 0 : fHisTrackXFOfalse(0),
107 0 : fHisTrackZFOfalse(0),
108 0 : fHisTrackXZFOtrue(0),
109 0 : fHisTrackXZFOfalse(0)
110 0 : {
111 : // Copy Constructor
112 : // Inputs:
113 : // AliITSPlaneEffSPD &s The original class for which
114 : // this class is a copy of
115 : // Outputs:
116 : // none.
117 : // Return:
118 :
119 0 : for (UInt_t i=0; i<kNModule*kNChip*(kNClockPhase+1); i++){
120 0 : fFound[i]=s.fFound[i];
121 0 : fTried[i]=s.fTried[i];
122 : }
123 0 : if(fHis) {
124 0 : InitHistos();
125 0 : for(Int_t i=0; i<kNHisto; i++) {
126 0 : s.fHisResX[i]->Copy(*fHisResX[i]);
127 0 : s.fHisResZ[i]->Copy(*fHisResZ[i]);
128 0 : s.fHisResXZ[i]->Copy(*fHisResXZ[i]);
129 0 : s.fHisClusterSize[i]->Copy(*fHisClusterSize[i]);
130 0 : for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
131 0 : s.fHisResXclu[i][clu]->Copy(*fHisResXclu[i][clu]);
132 0 : s.fHisResZclu[i][clu]->Copy(*fHisResZclu[i][clu]);
133 0 : s.fProfResXvsPhiclu[i][clu]->Copy(*fProfResXvsPhiclu[i][clu]);
134 0 : s.fProfResZvsDipclu[i][clu]->Copy(*fProfResZvsDipclu[i][clu]);
135 : }
136 0 : for(Int_t chip=0; chip<kNChip; chip++) {
137 0 : s.fHisResXchip[i][chip]->Copy(*fHisResXchip[i][chip]);
138 0 : s.fHisResZchip[i][chip]->Copy(*fHisResZchip[i][chip]);
139 : }
140 0 : s.fProfResXvsPhi[i]->Copy(*fProfResXvsPhi[i]);
141 0 : s.fProfResZvsDip[i]->Copy(*fProfResZvsDip[i]);
142 0 : s.fHisTrackErrX[i]->Copy(*fHisTrackErrX[i]);
143 0 : s.fHisTrackErrZ[i]->Copy(*fHisTrackErrZ[i]);
144 0 : s.fHisClusErrX[i]->Copy(*fHisClusErrX[i]);
145 0 : s.fHisClusErrZ[i]->Copy(*fHisClusErrZ[i]);
146 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
147 0 : s.fHisTrackXFOtrue[i][phas]->Copy(*fHisTrackXFOtrue[i][phas]);
148 0 : s.fHisTrackZFOtrue[i][phas]->Copy(*fHisTrackXFOtrue[i][phas]);
149 0 : s.fHisTrackXFOfalse[i][phas]->Copy(*fHisTrackXFOtrue[i][phas]);
150 0 : s.fHisTrackZFOfalse[i][phas]->Copy(*fHisTrackXFOtrue[i][phas]);
151 0 : s.fHisTrackXZFOtrue[i][phas]->Copy(*fHisTrackXFOtrue[i][phas]);
152 0 : s.fHisTrackXZFOfalse[i][phas]->Copy(*fHisTrackXFOtrue[i][phas]);
153 : }
154 : }
155 0 : }
156 0 : }
157 : //_________________________________________________________________________
158 : AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator+=(const AliITSPlaneEffSPD &add){
159 : // Add-to-me operator
160 : // Inputs:
161 : // const AliITSPlaneEffSPD &add simulation class to be added
162 : // Outputs:
163 : // none.
164 : // Return:
165 : // none
166 0 : for (UInt_t i=0; i<kNModule*kNChip*(kNClockPhase+1); i++){
167 0 : fFound[i] += add.fFound[i];
168 0 : fTried[i] += add.fTried[i];
169 : }
170 0 : if(fHis && add.fHis) {
171 0 : for(Int_t i=0; i<kNHisto; i++) {
172 0 : fHisResX[i]->Add(add.fHisResX[i]);
173 0 : fHisResZ[i]->Add(add.fHisResZ[i]);
174 0 : fHisResXZ[i]->Add(add.fHisResXZ[i]);
175 0 : fHisClusterSize[i]->Add(add.fHisClusterSize[i]);
176 0 : for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
177 0 : fHisResXclu[i][clu]->Add(add.fHisResXclu[i][clu]);
178 0 : fHisResZclu[i][clu]->Add(add.fHisResZclu[i][clu]);
179 0 : fProfResXvsPhiclu[i][clu]->Add(add.fProfResXvsPhiclu[i][clu]);
180 0 : fProfResZvsDipclu[i][clu]->Add(add.fProfResZvsDipclu[i][clu]);
181 : }
182 0 : for(Int_t chip=0; chip<kNChip; chip++) {
183 0 : fHisResXchip[i][chip]->Add(add.fHisResXchip[i][chip]);
184 0 : fHisResZchip[i][chip]->Add(add.fHisResZchip[i][chip]);
185 : }
186 0 : fProfResXvsPhi[i]->Add(add.fProfResXvsPhi[i]);
187 0 : fProfResZvsDip[i]->Add(add.fProfResZvsDip[i]);
188 0 : fHisTrackErrX[i]->Add(add.fHisTrackErrX[i]);
189 0 : fHisTrackErrZ[i]->Add(add.fHisTrackErrZ[i]);
190 0 : fHisClusErrX[i]->Add(add.fHisClusErrX[i]);
191 0 : fHisClusErrZ[i]->Add(add.fHisClusErrZ[i]);
192 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
193 0 : fHisTrackXFOtrue[i][phas]->Add(add.fHisTrackXFOtrue[i][phas]);
194 0 : fHisTrackZFOtrue[i][phas]->Add(add.fHisTrackXFOtrue[i][phas]);
195 0 : fHisTrackXFOfalse[i][phas]->Add(add.fHisTrackXFOtrue[i][phas]);
196 0 : fHisTrackZFOfalse[i][phas]->Add(add.fHisTrackXFOtrue[i][phas]);
197 0 : fHisTrackXZFOtrue[i][phas]->Add(add.fHisTrackXFOtrue[i][phas]);
198 0 : fHisTrackXZFOfalse[i][phas]->Add(add.fHisTrackXFOtrue[i][phas]);
199 : }
200 : }
201 0 : }
202 0 : return *this;
203 : }
204 : //______________________________________________________________________
205 : AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator=(const
206 : AliITSPlaneEffSPD &s){
207 : // Assignment operator
208 : // Inputs:
209 : // AliITSPlaneEffSPD &s The original class for which
210 : // this class is a copy of
211 : // Outputs:
212 : // none.
213 : // Return:
214 :
215 0 : if(this==&s) return *this;
216 0 : this->~AliITSPlaneEffSPD();
217 0 : new(this) AliITSPlaneEffSPD();
218 0 : s.Copy(*this);
219 0 : return *this;
220 0 : }
221 : //______________________________________________________________________
222 : void AliITSPlaneEffSPD::Copy(TObject &obj) const {
223 : // protected method. copy this to obj
224 0 : AliITSPlaneEff::Copy(obj);
225 0 : AliITSPlaneEffSPD& target = (AliITSPlaneEffSPD &) obj;
226 0 : for(Int_t i=0;i<kNModule*kNChip*(kNClockPhase+1);i++) {
227 0 : target.fFound[i] = fFound[i];
228 0 : target.fTried[i] = fTried[i];
229 : }
230 0 : CopyHistos(target);
231 : return;
232 0 : }
233 : //_______________________________________________________________________
234 : void AliITSPlaneEffSPD::CopyHistos(AliITSPlaneEffSPD &target) const {
235 : // protected method: copy histos from this to target
236 0 : target.fHis = fHis; // this is redundant only in some cases. Leave as it is.
237 0 : if(fHis) {
238 0 : target.fHisResX=new TH1F*[kNHisto];
239 0 : target.fHisResZ=new TH1F*[kNHisto];
240 0 : target.fHisResXZ=new TH2F*[kNHisto];
241 0 : target.fHisClusterSize=new TH2I*[kNHisto];
242 0 : target.fHisResXclu=new TH1F**[kNHisto];
243 0 : target.fHisResZclu=new TH1F**[kNHisto];
244 0 : target.fHisResXchip=new TH1F**[kNHisto];
245 0 : target.fHisResZchip=new TH1F**[kNHisto];
246 0 : target.fProfResXvsPhi=new TProfile*[kNHisto];
247 0 : target.fProfResZvsDip=new TProfile*[kNHisto];
248 0 : target.fProfResXvsPhiclu=new TProfile**[kNHisto];
249 0 : target.fProfResZvsDipclu=new TProfile**[kNHisto];
250 0 : target.fHisTrackErrX=new TH1F*[kNHisto];
251 0 : target.fHisTrackErrZ=new TH1F*[kNHisto];
252 0 : target.fHisClusErrX=new TH1F*[kNHisto];
253 0 : target.fHisClusErrZ=new TH1F*[kNHisto];
254 0 : target.fHisTrackXFOtrue=new TH1F**[kNHisto];
255 0 : target.fHisTrackZFOtrue=new TH1F**[kNHisto];
256 0 : target.fHisTrackXFOfalse=new TH1F**[kNHisto];
257 0 : target.fHisTrackZFOfalse=new TH1F**[kNHisto];
258 0 : target.fHisTrackXZFOtrue=new TH2F**[kNHisto];
259 0 : target.fHisTrackXZFOfalse=new TH2F**[kNHisto];
260 0 : for(Int_t i=0; i<kNHisto; i++) {
261 0 : target.fHisResX[i] = new TH1F(*fHisResX[i]);
262 0 : target.fHisResZ[i] = new TH1F(*fHisResZ[i]);
263 0 : target.fHisResXZ[i] = new TH2F(*fHisResXZ[i]);
264 0 : target.fHisClusterSize[i] = new TH2I(*fHisClusterSize[i]);
265 0 : target.fHisResXclu[i]=new TH1F*[kNclu];
266 0 : target.fHisResZclu[i]=new TH1F*[kNclu];
267 0 : target.fProfResXvsPhiclu[i]=new TProfile*[kNclu];
268 0 : target.fProfResZvsDipclu[i]=new TProfile*[kNclu];
269 0 : for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
270 0 : target.fHisResXclu[i][clu] = new TH1F(*fHisResXclu[i][clu]);
271 0 : target.fHisResZclu[i][clu] = new TH1F(*fHisResZclu[i][clu]);
272 0 : target.fProfResXvsPhiclu[i][clu] = new TProfile(*fProfResXvsPhiclu[i][clu]);
273 0 : target.fProfResZvsDipclu[i][clu] = new TProfile(*fProfResZvsDipclu[i][clu]);
274 : }
275 0 : target.fHisResXchip[i]=new TH1F*[kNChip];
276 0 : target.fHisResZchip[i]=new TH1F*[kNChip];
277 0 : for(Int_t chip=0; chip<kNChip; chip++) {
278 0 : target.fHisResXchip[i][chip] = new TH1F(*fHisResXchip[i][chip]);
279 0 : target.fHisResZchip[i][chip] = new TH1F(*fHisResZchip[i][chip]);
280 : }
281 0 : target.fProfResXvsPhi[i] = new TProfile(*fProfResXvsPhi[i]);
282 0 : target.fProfResZvsDip[i] = new TProfile(*fProfResZvsDip[i]);
283 0 : target.fHisTrackErrX[i] = new TH1F(*fHisTrackErrX[i]);
284 0 : target.fHisTrackErrZ[i] = new TH1F(*fHisTrackErrZ[i]);
285 0 : target.fHisClusErrX[i] = new TH1F(*fHisClusErrX[i]);
286 0 : target.fHisClusErrZ[i] = new TH1F(*fHisClusErrZ[i]);
287 :
288 0 : target.fHisTrackXFOtrue[i]=new TH1F*[kNClockPhase];
289 0 : target.fHisTrackZFOtrue[i]=new TH1F*[kNClockPhase];
290 0 : target.fHisTrackXFOfalse[i]=new TH1F*[kNClockPhase];
291 0 : target.fHisTrackZFOfalse[i]=new TH1F*[kNClockPhase];
292 0 : target.fHisTrackXZFOtrue[i]=new TH2F*[kNClockPhase];
293 0 : target.fHisTrackXZFOfalse[i]=new TH2F*[kNClockPhase];
294 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
295 0 : target.fHisTrackXFOtrue[i][phas]=new TH1F(*fHisTrackXFOtrue[i][phas]);
296 0 : target.fHisTrackZFOtrue[i][phas]=new TH1F(*fHisTrackZFOtrue[i][phas]);
297 0 : target.fHisTrackXFOfalse[i][phas]=new TH1F(*fHisTrackXFOfalse[i][phas]);
298 0 : target.fHisTrackZFOfalse[i][phas]=new TH1F(*fHisTrackZFOfalse[i][phas]);
299 0 : target.fHisTrackXZFOtrue[i][phas]=new TH2F(*fHisTrackXZFOtrue[i][phas]);
300 0 : target.fHisTrackXZFOfalse[i][phas]=new TH2F(*fHisTrackXZFOfalse[i][phas]);
301 : }
302 : }
303 0 : }
304 0 : return;
305 0 : }
306 :
307 : //_______________________________________________________________________
308 : Int_t AliITSPlaneEffSPD::GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr,
309 : UInt_t im, UInt_t ic) const {
310 :
311 : // Estimate the number of tracks still to be collected to attain a
312 : // given efficiency eff, with relative error RelErr
313 : // Inputs:
314 : // eff -> Expected efficiency (e.g. those from actual estimate)
315 : // RelErr -> tollerance [0,1]
316 : // im -> module number [0,239]
317 : // ic -> chip number [0,4]
318 : // Outputs: none
319 : // Return: the estimated n. of tracks
320 : //
321 0 : if (im>=kNModule || ic>=kNChip)
322 0 : {AliError("GetMissingTracksForGivenEff: you asked for a non existing chip");
323 0 : return -1;}
324 : else {
325 0 : UInt_t key=GetKey(im,ic);
326 0 : if(key<kNModule*kNChip) return GetNTracksForGivenEff(eff,RelErr)-fTried[key];
327 0 : else return -1;
328 : }
329 0 : }
330 : //_________________________________________________________________________
331 : Double_t AliITSPlaneEffSPD::PlaneEff(const UInt_t im,const UInt_t ic, const Bool_t fo, const UInt_t bcm4) const {
332 : // Compute the efficiency for a basic block,
333 : // Inputs:
334 : // im -> module number [0,239]
335 : // ic -> chip number [0,4]
336 : // fo -> boolean, true in case of Fast Or studies
337 : // bcm4 -> for Fast Or: bunch crossing % 4
338 0 : if (im>=kNModule || ic>=kNChip)
339 0 : {AliError("PlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;}
340 0 : if(fo && bcm4>=kNClockPhase)
341 0 : {AliError("PlaneEff(Uint_t,Uint_t): you asked for Fast Or in a wrong phase"); return -1.;}
342 : Int_t nf=-1;
343 : Int_t nt=-1;
344 0 : if(fo) {
345 0 : AliWarning("PlaneEff: you asked for FO efficiency");
346 0 : UInt_t key=GetKey(im,ic,fo,bcm4);
347 0 : if(key<kNModule*kNChip*(kNClockPhase+1)) {
348 0 : nf=fFound[key];
349 0 : nt=fTried[key];
350 0 : }
351 0 : } else {
352 0 : UInt_t key=GetKey(im,ic);
353 0 : if (key<kNModule*kNChip) {
354 0 : nf=fFound[key];
355 0 : nt=fTried[key];
356 0 : }
357 : }
358 0 : return AliITSPlaneEff::PlaneEff(nf,nt);
359 0 : }
360 : //_________________________________________________________________________
361 : Double_t AliITSPlaneEffSPD::ErrPlaneEff(const UInt_t im,const UInt_t ic, const Bool_t fo, const UInt_t bcm4) const {
362 : // Compute the statistical error on efficiency for a basic block,
363 : // using binomial statistics
364 : // Inputs:
365 : // im -> module number [0,239]
366 : // ic -> chip number [0,4]
367 : // fo -> boolean, true in case of Fast Or studies
368 : // bcm4 -> for Fast Or: bunch crossing % 4
369 0 : if (im>=kNModule || ic>=kNChip)
370 0 : {AliError("ErrPlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;}
371 0 : if(fo && bcm4>=kNClockPhase)
372 0 : {AliError("PlaneEff(Uint_t,Uint_t): you asked for Fast Or in a wrong phase"); return -1.;}
373 : Int_t nf=-1;
374 : Int_t nt=-1;
375 0 : if(fo) {
376 0 : AliWarning("ErrPlaneEff: you asked for FO efficiency");
377 0 : UInt_t key=GetKey(im,ic,fo,bcm4);
378 0 : if(key<kNModule*kNChip*(kNClockPhase+1)) {
379 0 : nf=fFound[key];
380 0 : nt=fTried[key];
381 0 : }
382 0 : } else {
383 0 : UInt_t key=GetKey(im,ic);
384 0 : if (key<kNModule*kNChip) {
385 0 : nf=fFound[key];
386 0 : nt=fTried[key];
387 0 : }
388 : }
389 0 : return AliITSPlaneEff::ErrPlaneEff(nf,nt);
390 0 : }
391 : //_________________________________________________________________________
392 : Bool_t AliITSPlaneEffSPD::UpDatePlaneEff(const Bool_t Kfound,
393 : const UInt_t im, const UInt_t ic, const Bool_t fo, const UInt_t bcm4) {
394 : // Update efficiency for a basic block
395 0 : if (im>=kNModule || ic>=kNChip)
396 0 : {AliError("UpDatePlaneEff: you asked for a non existing chip"); return kFALSE;}
397 0 : if(fo && bcm4>=kNClockPhase)
398 0 : {AliError("UpDatePlaneEff: you asked for Fast Or in a wrong phase"); return kFALSE;}
399 0 : if (!fo) {
400 0 : UInt_t key=GetKey(im,ic);
401 0 : if(key<kNModule*kNChip) {
402 0 : fTried[key]++;
403 0 : if(Kfound) fFound[key]++;
404 0 : return kTRUE;
405 : }
406 0 : }
407 : else {
408 0 : UInt_t key=GetKey(im,ic,fo,bcm4);
409 0 : if(key<kNModule*kNChip*(kNClockPhase+1)) {
410 0 : fTried[key]++;
411 0 : if(Kfound) fFound[key]++;
412 0 : return kTRUE;
413 : }
414 0 : }
415 0 : return kFALSE;
416 0 : }
417 : //_________________________________________________________________________
418 : UInt_t AliITSPlaneEffSPD::GetChipFromCol(const UInt_t col) const {
419 : // get chip given the column
420 0 : if(col>=kNCol*kNChip)
421 0 : {AliDebug(1,Form("GetChipFromCol: you asked for a non existing column %d",col)); return 10;}
422 0 : return col/kNCol;
423 0 : }
424 : //__________________________________________________________________________
425 : UInt_t AliITSPlaneEffSPD::GetKey(const UInt_t mod, const UInt_t chip, const Bool_t FO, const UInt_t BCm4) const {
426 : // get key given a basic block
427 : UInt_t key=99999;
428 0 : if(mod>=kNModule || chip>=kNChip)
429 0 : {AliDebug(1,"GetKey: you asked for a non existing block"); return 99999;}
430 0 : key = mod*kNChip+chip;
431 0 : if(FO) {
432 0 : if(BCm4>= kNClockPhase) {AliDebug(1,"GetKey: you have asked Fast OR and a non exisiting BC modulo 4"); return 99999;}
433 0 : key += kNModule*kNChip*(BCm4+1);
434 0 : }
435 0 : return key;
436 0 : }
437 : //__________________________________________________________________________
438 : UInt_t AliITSPlaneEffSPD::SwitchChipKeyNumbering(UInt_t key) const {
439 :
440 : // methods to switch from offline chip key numbering
441 : // to online Raw Stream chip numbering and viceversa.
442 : // Used for Fast-Or studies.
443 : // Implemented by valerio.altini@ba.infn.it
444 :
445 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
446 0 : {AliDebug(1,"SwitchChipKeyNumbering: you asked for a non existing key"); return 99999;}
447 0 : UInt_t mod=9999,chip=9999,phase=9999;
448 0 : GetModAndChipFromKey(key,mod,chip);
449 0 : if(mod<kNModuleLy1) chip = kNChip-(chip+1);
450 0 : if(IsForFO(key))phase = GetBCm4FromKey(key);
451 :
452 0 : return GetKey(mod,chip,IsForFO(key),phase);
453 :
454 0 : }
455 : //__________________________________________________________________________
456 : UInt_t AliITSPlaneEffSPD::GetModFromKey(const UInt_t key) const {
457 : // get mod. from key
458 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
459 0 : {AliError("GetModFromKey: you asked for a non existing key"); return 9999;}
460 0 : return (key%(kNModule*kNChip))/kNChip;
461 0 : }
462 : //__________________________________________________________________________
463 : UInt_t AliITSPlaneEffSPD::GetChipFromKey(const UInt_t key) const {
464 : // retrieves chip from key
465 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
466 0 : {AliError("GetChipFromKey: you asked for a non existing key"); return 999;}
467 0 : return ((key%(kNModule*kNChip))%(kNModule*kNChip))%kNChip;
468 0 : }
469 : //__________________________________________________________________________
470 : UInt_t AliITSPlaneEffSPD::GetBCm4FromKey(const UInt_t key) const {
471 : // retrieves the "Bunch Crossing modulo 4" (for Fast Or studies)
472 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
473 0 : {AliError("GetBCm4FromKey: you asked for a non existing key"); return 999;}
474 0 : if(key<kNModule*kNChip)
475 0 : {AliDebug(1,"GetBCm4FromKey: key is below 1200, why are you asking for FO related stuff"); return 999;}
476 :
477 0 : return key/(kNModule*kNChip) - 1 ;
478 0 : }
479 : //__________________________________________________________________________
480 : Bool_t AliITSPlaneEffSPD::IsForFO(const UInt_t key) const {
481 0 : if(key>=kNModule*kNChip) return kTRUE;
482 0 : else return kFALSE;
483 0 : }
484 : //__________________________________________________________________________
485 : void AliITSPlaneEffSPD::GetModAndChipFromKey(const UInt_t key,UInt_t& mod,UInt_t& chip) const {
486 : // get module and chip from a key
487 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
488 0 : {AliError("GetModAndChipFromKey: you asked for a non existing key");
489 0 : mod=9999;
490 0 : chip=999;
491 0 : return;}
492 0 : mod=GetModFromKey(key);
493 0 : chip=GetChipFromKey(key);
494 0 : return;
495 0 : }
496 : //____________________________________________________________________________
497 : Double_t AliITSPlaneEffSPD::LivePlaneEff(UInt_t key) const {
498 : // returns plane efficieny after adding the fraction of sensor which is bad
499 0 : if(key>=kNModule*kNChip)
500 0 : {AliError("LivePlaneEff: you asked for a non existing key");
501 0 : return -1.;}
502 0 : Double_t leff=AliITSPlaneEff::LivePlaneEff(0); // this just for the Warning
503 0 : leff=PlaneEff(key)+GetFracBad(key);
504 0 : return leff>1?1:leff;
505 0 : }
506 : //____________________________________________________________________________
507 : Double_t AliITSPlaneEffSPD::ErrLivePlaneEff(UInt_t key) const {
508 : // returns error on live plane efficiency
509 0 : if(key>=kNModule*kNChip)
510 0 : {AliError("ErrLivePlaneEff: you asked for a non existing key");
511 0 : return -1.;}
512 0 : Int_t nf=fFound[key];
513 0 : Double_t triedInLive=GetFracLive(key)*fTried[key];
514 0 : Int_t nt=TMath::Max(nf,TMath::Nint(triedInLive));
515 0 : return AliITSPlaneEff::ErrPlaneEff(nf,nt); // for the time being: to be checked
516 0 : }
517 : //_____________________________________________________________________________
518 : Double_t AliITSPlaneEffSPD::GetFracLive(const UInt_t key) const {
519 : // returns the fraction of the sensor which is OK
520 0 : if(key>=kNModule*kNChip)
521 0 : {AliError("GetFracLive: you asked for a non existing key");
522 0 : return -1.;}
523 : // Compute the fraction of bad (dead+noisy) detector
524 0 : UInt_t dead=0,noisy=0;
525 0 : GetDeadAndNoisyInChip(key,dead,noisy);
526 0 : Double_t live=dead+noisy;
527 0 : live/=(kNRow*kNCol);
528 0 : return 1.-live;
529 0 : }
530 : //_____________________________________________________________________________
531 : void AliITSPlaneEffSPD::GetDeadAndNoisyInChip(const UInt_t key,
532 : UInt_t& nrDeadInChip, UInt_t& nrNoisyInChip) const {
533 : // returns the number of dead and noisy pixels
534 0 : nrDeadInChip=0;
535 0 : nrNoisyInChip=0;
536 0 : if(key>=kNModule*kNChip)
537 0 : {AliError("GetDeadAndNoisyInChip: you asked for a non existing key");
538 0 : return;}
539 : // Compute the number of bad (dead+noisy) pixel in a chip
540 : //
541 0 : if(!fInitCDBCalled)
542 0 : {AliError("GetDeadAndNoisyInChip: CDB not inizialized: call InitCDB first");
543 0 : return;};
544 0 : AliCDBManager* man = AliCDBManager::Instance();
545 : // retrieve map of dead Pixel
546 0 : AliCDBEntry *cdbSPDDead = man->Get("ITS/Calib/SPDDead", fRunNumber);
547 : TObjArray* spdDead;
548 0 : if(cdbSPDDead) {
549 0 : spdDead = (TObjArray*)cdbSPDDead->GetObject();
550 0 : if(!spdDead)
551 0 : {AliError("GetDeadAndNoisyInChip: SPDDead not found in CDB");
552 0 : return;}
553 : } else {
554 0 : AliError("GetDeadAndNoisyInChip: did not find Calib/SPDDead.");
555 0 : return;
556 : }
557 : // retrieve map of sparse dead Pixel
558 0 : AliCDBEntry *cdbSPDSparseDead = man->Get("ITS/Calib/SPDSparseDead", fRunNumber);
559 : TObjArray* spdSparseDead;
560 0 : if(cdbSPDSparseDead) {
561 0 : spdSparseDead = (TObjArray*)cdbSPDSparseDead->GetObject();
562 0 : if(!spdSparseDead)
563 0 : {AliError("GetDeadAndNoisyInChip: SPDSparseDead not found in CDB");
564 0 : return;}
565 : } else {
566 0 : AliError("GetDeadAndNoisyInChip: did not find Calib/SPDSparseDead.");
567 0 : return;
568 : }
569 :
570 : // retrieve map of noisy Pixel
571 0 : AliCDBEntry *cdbSPDNoisy = man->Get("ITS/Calib/SPDNoisy", fRunNumber);
572 : TObjArray* spdNoisy;
573 0 : if(cdbSPDNoisy) {
574 0 : spdNoisy = (TObjArray*)cdbSPDNoisy->GetObject();
575 0 : if(!spdNoisy)
576 0 : {AliError("GetDeadAndNoisyInChip: SPDNoisy not found in CDB");
577 0 : return;}
578 : } else {
579 0 : AliError("GetDeadAndNoisyInChip: did not find Calib/SPDNoisy.");
580 0 : return;
581 : }
582 : //
583 0 : UInt_t mod=GetModFromKey(key);
584 0 : UInt_t chip=GetChipFromKey(key);
585 : // count number of dead
586 0 : AliITSCalibrationSPD* calibSPD=(AliITSCalibrationSPD*) spdDead->At(mod);
587 0 : UInt_t nrDead = calibSPD->GetNrBad();
588 0 : for (UInt_t index=0; index<nrDead; index++) {
589 0 : if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrDeadInChip++;
590 : }
591 : // add the number of sparse dead to the previous dead
592 0 : calibSPD=(AliITSCalibrationSPD*) spdSparseDead->At(mod);
593 0 : UInt_t nrSparseDead = calibSPD->GetNrBad();
594 0 : for (UInt_t index=0; index<nrSparseDead; index++) {
595 0 : if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrDeadInChip++;
596 : }
597 0 : calibSPD=(AliITSCalibrationSPD*) spdNoisy->At(mod);
598 0 : UInt_t nrNoisy = calibSPD->GetNrBad();
599 0 : for (UInt_t index=0; index<nrNoisy; index++) {
600 0 : if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrNoisyInChip++;
601 : }
602 : return;
603 0 : }
604 : //_____________________________________________________________________________
605 : Double_t AliITSPlaneEffSPD::GetFracBad(const UInt_t key) const {
606 : // returns 1-fractional live
607 0 : if(key>=kNModule*kNChip)
608 0 : {AliError("GetFracBad: you asked for a non existing key");
609 0 : return -1.;}
610 0 : return 1.-GetFracLive(key);
611 0 : }
612 : //_____________________________________________________________________________
613 : Bool_t AliITSPlaneEffSPD::WriteIntoCDB() const {
614 : // write onto CDB
615 0 : if(!fInitCDBCalled)
616 0 : {AliError("WriteIntoCDB: CDB not inizialized. Call InitCDB first");
617 0 : return kFALSE;}
618 : // to be written properly: now only for debugging
619 0 : AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
620 : //md->SetObjectClassName("AliITSPlaneEff");
621 0 : md->SetResponsible("Giuseppe Eugenio Bruno");
622 0 : md->SetBeamPeriod(0);
623 0 : md->SetAliRootVersion("head 19/11/07"); //root version
624 0 : AliCDBId id("ITS/PlaneEff/PlaneEffSPD",0,AliCDBRunRange::Infinity());
625 0 : AliITSPlaneEffSPD eff;
626 0 : eff=*this;
627 0 : Bool_t r=AliCDBManager::Instance()->GetDefaultStorage()->Put(&eff,id,md);
628 0 : delete md;
629 0 : return r;
630 0 : }
631 : //_____________________________________________________________________________
632 : Bool_t AliITSPlaneEffSPD::ReadFromCDB() {
633 : // read from CDB
634 0 : if(!fInitCDBCalled)
635 0 : {AliError("ReadFromCDB: CDB not inizialized. Call InitCDB first");
636 0 : return kFALSE;}
637 0 : AliCDBEntry *cdbEntry = AliCDBManager::Instance()->Get("ITS/PlaneEff/PlaneEffSPD",fRunNumber);
638 0 : if(!cdbEntry) return kFALSE;
639 0 : AliITSPlaneEffSPD* eff= (AliITSPlaneEffSPD*)cdbEntry->GetObject();
640 0 : if(this==eff) return kFALSE;
641 0 : if(fHis) CopyHistos(*eff); // If histos already exist then copy them to eff
642 0 : eff->Copy(*this); // copy everything (statistics and histos) from eff to this
643 0 : return kTRUE;
644 0 : }
645 : //_____________________________________________________________________________
646 : Bool_t AliITSPlaneEffSPD::AddFromCDB(AliCDBId *cdbId) {
647 : AliCDBEntry *cdbEntry=0;
648 0 : if (!cdbId) {
649 0 : if(!fInitCDBCalled)
650 0 : {AliError("ReadFromCDB: CDB not inizialized. Call InitCDB first"); return kFALSE;}
651 0 : cdbEntry = AliCDBManager::Instance()->Get("ITS/PlaneEff/PlaneEffSPD",fRunNumber);
652 0 : } else {
653 0 : cdbEntry = AliCDBManager::Instance()->Get(*cdbId);
654 : }
655 0 : if(!cdbEntry) return kFALSE;
656 0 : AliITSPlaneEffSPD* eff= (AliITSPlaneEffSPD*)cdbEntry->GetObject();
657 0 : *this+=*eff;
658 : return kTRUE;
659 0 : }
660 : //_____________________________________________________________________________
661 : UInt_t AliITSPlaneEffSPD::GetKeyFromDetLocCoord(Int_t ilay, Int_t idet,
662 : Float_t, Float_t locz) const {
663 : // method to locate a basic block from Detector Local coordinate (to be used in tracking)
664 : UInt_t key=999999;
665 0 : if(ilay<0 || ilay>1)
666 0 : {AliError("GetKeyFromDetLocCoord: you asked for a non existing layer");
667 0 : return key;}
668 0 : if(ilay==0 && (idet<0 || idet>79))
669 0 : {AliError("GetKeyFromDetLocCoord: you asked for a non existing detector");
670 0 : return key;}
671 0 : if(ilay==1 && (idet<0 || idet>159))
672 0 : {AliError("GetKeyFromDetLocCoord: you asked for a non existing detector");
673 0 : return key;}
674 :
675 : UInt_t mod=idet;
676 0 : if(ilay==1) mod+=80;
677 0 : key=GetKey(mod,GetChipFromCol(GetColFromLocZ(locz)));
678 : return key;
679 0 : }
680 : //_____________________________________________________________________________
681 : UInt_t AliITSPlaneEffSPD::GetColFromLocZ(Float_t zloc) const {
682 : // method to retrieve column number from the local z coordinate
683 : UInt_t col=0;
684 0 : AliITSsegmentationSPD spd;
685 0 : Int_t ix,iz;
686 0 : if(spd.LocalToDet(0,zloc,ix,iz)) col+=iz;
687 : else {
688 0 : AliDebug(1,Form("cannot compute column number from local z=%f",zloc));
689 : col=99999;}
690 : return col;
691 : /*
692 : const Float_t kconv = 1.0E-04; // converts microns to cm.
693 : Float_t bz[160];
694 : for(Int_t i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
695 : bz[ 31] = bz[ 32] = 625.0; // first chip boundry
696 : bz[ 63] = bz[ 64] = 625.0; // first chip boundry
697 : bz[ 95] = bz[ 96] = 625.0; // first chip boundry
698 : bz[127] = bz[128] = 625.0; // first chip boundry
699 : //
700 : Int_t j=-1;
701 : Float_t dz=0;
702 : for(Int_t i=000;i<160;i++) dz+=bz[i];
703 : dz = -0.5*kconv*dz;
704 : if(zloc<dz || zloc>-1*dz) { // outside z range
705 : AliDebug(1,Form("GetColFromLocZ: cannot compute column number from local z=%f",zloc));
706 : return 99999;}
707 : for(j=0;j<160;j++){
708 : dz += kconv*bz[j];
709 : if(zloc<dz) break;
710 : } // end for j
711 : col+=j;
712 : //
713 : return col;
714 : */
715 0 : }
716 : //________________________________________________________
717 : Bool_t AliITSPlaneEffSPD::GetBlockBoundaries(const UInt_t key, Float_t& xmn,Float_t& xmx,
718 : Float_t& zmn,Float_t& zmx) const {
719 : //
720 : // This method return the geometrical boundaries of the active volume of a given
721 : // basic block, in the detector reference system.
722 : // Input: unique key to locate a basic block.
723 : //
724 : // Output: Ymin, Ymax, Zmin, Zmax of a basic block (chip for SPD)
725 : // Return: kTRUE if computation was succesfully, kFALSE otherwise
726 : //
727 0 : if(key>=kNModule*kNChip)
728 0 : {AliDebug(1,"GetBlockBoundaries: you asked for a non existing key"); return kFALSE;}
729 0 : UInt_t chip=GetChipFromKey(key);
730 0 : zmn=GetLocZFromCol(chip*kNCol);
731 0 : zmx=GetLocZFromCol((chip+1)*kNCol);
732 0 : xmn=GetLocXFromRow(0);
733 0 : xmx=GetLocXFromRow(kNRow);
734 : //
735 0 : Float_t tmp=zmn;
736 0 : if(zmx<zmn) {zmn=zmx; zmx=tmp;}
737 0 : tmp=xmn;
738 0 : if(xmx<xmn) {xmn=xmx; xmx=tmp;}
739 : return kTRUE;
740 0 : }
741 : //________________________________________________________
742 : Float_t AliITSPlaneEffSPD::GetLocXFromRow(const UInt_t row) const {
743 : //
744 : // This method return the local (i.e. detector reference system) lower x coordinate
745 : // of the row. To get the central value of a given row, you can do
746 : // 1/2*[LocXFromRow(row)+LocXFromRow(row+1)].
747 : //
748 : // Input: row number in the range [0,kNRow]
749 : // Output: lower local X coordinate of this row.
750 : //
751 0 : if(row>kNRow) // not >= ! allow also computation of upper limit of the last row.
752 0 : {AliError("LocYFromRow: you asked for a non existing row"); return 9999999.;}
753 : // Use only AliITSsegmentationSPD
754 0 : AliITSsegmentationSPD spd;
755 0 : Double_t dummy,x;
756 0 : if(row==kNRow) spd.CellBoundries((Int_t)row-1,0,dummy,x,dummy,dummy);
757 0 : else spd.CellBoundries((Int_t)row,0,x,dummy,dummy,dummy);
758 0 : return (Float_t)x;
759 :
760 0 : }
761 : //________________________________________________________
762 : Float_t AliITSPlaneEffSPD::GetLocZFromCol(const UInt_t col) const {
763 : //
764 : // This method return the local (i.e. detector reference system) lower Z coordinate
765 : // of the column. To get the central value of a given column, you can do
766 : // 1/2*[LocZFromCol(col)+LocZFromCol(col+1)].
767 : //
768 : // Input: col number in the range [0,kNChip*kNCol]
769 : // Output: lower local Y coordinate of this row.
770 : //
771 0 : if(col>kNChip*kNCol) // not >= ! allow also computation of upper limit of the last column
772 0 : {AliError("LocZFromCol: you asked for a non existing column"); return 9999999.;}
773 : // Use only AliITSsegmentationSPD
774 0 : AliITSsegmentationSPD spd;
775 0 : Double_t dummy,y;
776 0 : if(col==kNChip*kNCol) spd.CellBoundries(0,(Int_t)col-1,dummy,dummy,dummy,y);
777 0 : else spd.CellBoundries(0,(Int_t)col,dummy,dummy,y,dummy);
778 0 : return (Float_t)y;
779 :
780 0 : }
781 : //__________________________________________________________
782 : void AliITSPlaneEffSPD::InitHistos() {
783 : // for the moment let's create the histograms
784 : // module by module
785 0 : TString histnameResX="HistResX_mod_",aux;
786 0 : TString histnameResZ="HistResZ_mod_";
787 0 : TString histnameResXZ="HistResXZ_mod_";
788 0 : TString histnameClusterType="HistClusterType_mod_";
789 0 : TString histnameResXclu="HistResX_mod_";
790 0 : TString histnameResZclu="HistResZ_mod_";
791 0 : TString histnameResXchip="HistResX_mod_";
792 0 : TString histnameResZchip="HistResZ_mod_";
793 0 : TString profnameResXvsPhi="ProfResXvsPhi_mod_";
794 0 : TString profnameResZvsDip="ProfResZvsDip_mod_";
795 0 : TString profnameResXvsPhiclu="ProfResXvsPhi_mod_";
796 0 : TString profnameResZvsDipclu="ProfResZvsDip_mod_";
797 0 : TString histnameTrackErrX="HistTrackErrX_mod_";
798 0 : TString histnameTrackErrZ="HistTrackErrZ_mod_";
799 0 : TString histnameClusErrX="HistClusErrX_mod_";
800 0 : TString histnameClusErrZ="HistClusErrZ_mod_";
801 0 : TString histnameTrackXFOtrue="HistTrackXFOok_mod_";
802 0 : TString histnameTrackZFOtrue="HistTrackZFOok_mod_";
803 0 : TString histnameTrackXFOfalse="HistTrackXFOko_mod_";
804 0 : TString histnameTrackZFOfalse="HistTrackZFOko_mod_";
805 0 : TString histnameTrackXZFOtrue="HistTrackZvsXFOok_mod_";
806 0 : TString histnameTrackXZFOfalse="HistTrackZvsXFOko_mod_";
807 : //
808 :
809 0 : TH1::AddDirectory(kFALSE);
810 :
811 0 : fHisResX=new TH1F*[kNHisto];
812 0 : fHisResZ=new TH1F*[kNHisto];
813 0 : fHisResXZ=new TH2F*[kNHisto];
814 0 : fHisClusterSize=new TH2I*[kNHisto];
815 0 : fHisResXclu=new TH1F**[kNHisto];
816 0 : fHisResZclu=new TH1F**[kNHisto];
817 0 : fHisResXchip=new TH1F**[kNHisto];
818 0 : fHisResZchip=new TH1F**[kNHisto];
819 0 : fProfResXvsPhi=new TProfile*[kNHisto];
820 0 : fProfResZvsDip=new TProfile*[kNHisto];
821 0 : fProfResXvsPhiclu=new TProfile**[kNHisto];
822 0 : fProfResZvsDipclu=new TProfile**[kNHisto];
823 0 : fHisTrackErrX=new TH1F*[kNHisto];
824 0 : fHisTrackErrZ=new TH1F*[kNHisto];
825 0 : fHisClusErrX=new TH1F*[kNHisto];
826 0 : fHisClusErrZ=new TH1F*[kNHisto];
827 0 : fHisTrackXFOtrue=new TH1F**[kNHisto];
828 0 : fHisTrackZFOtrue=new TH1F**[kNHisto];
829 0 : fHisTrackXFOfalse=new TH1F**[kNHisto];
830 0 : fHisTrackZFOfalse=new TH1F**[kNHisto];
831 0 : fHisTrackXZFOtrue=new TH2F**[kNHisto];
832 0 : fHisTrackXZFOfalse=new TH2F**[kNHisto];
833 :
834 0 : for (Int_t nhist=0;nhist<kNHisto;nhist++){
835 0 : aux=histnameResX;
836 0 : aux+=nhist;
837 0 : fHisResX[nhist]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
838 0 : fHisResX[nhist]->SetName(aux.Data());
839 0 : fHisResX[nhist]->SetTitle(aux.Data());
840 :
841 0 : aux=histnameResZ;
842 0 : aux+=nhist;
843 0 : fHisResZ[nhist]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
844 0 : fHisResZ[nhist]->SetName(aux.Data());
845 0 : fHisResZ[nhist]->SetTitle(aux.Data());
846 :
847 0 : aux=histnameResXZ;
848 0 : aux+=nhist;
849 0 : fHisResXZ[nhist]=new TH2F("histname","histname",80,-0.16,0.16,80,-0.32,0.32); // binning:
850 0 : fHisResXZ[nhist]->SetName(aux.Data()); // 40 micron in x;
851 0 : fHisResXZ[nhist]->SetTitle(aux.Data()); // 80 micron in z;
852 :
853 0 : aux=histnameClusterType;
854 0 : aux+=nhist;
855 0 : fHisClusterSize[nhist]=new TH2I("histname","histname",10,0.5,10.5,10,0.5,10.5);
856 0 : fHisClusterSize[nhist]->SetName(aux.Data());
857 0 : fHisClusterSize[nhist]->SetTitle(aux.Data());
858 :
859 0 : fHisResXclu[nhist]=new TH1F*[kNclu];
860 0 : fHisResZclu[nhist]=new TH1F*[kNclu];
861 0 : fHisTrackXFOtrue[nhist]=new TH1F*[kNClockPhase];
862 0 : fHisTrackZFOtrue[nhist]=new TH1F*[kNClockPhase];
863 0 : fHisTrackXFOfalse[nhist]=new TH1F*[kNClockPhase];
864 0 : fHisTrackZFOfalse[nhist]=new TH1F*[kNClockPhase];
865 0 : fHisTrackXZFOtrue[nhist]=new TH2F*[kNClockPhase];
866 0 : fHisTrackXZFOfalse[nhist]=new TH2F*[kNClockPhase];
867 :
868 0 : for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
869 0 : aux=histnameResXclu;
870 0 : aux+=nhist;
871 0 : aux+="_clu_";
872 0 : aux+=clu+1; // clu=0 --> cluster size 1
873 0 : fHisResXclu[nhist][clu]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
874 0 : fHisResXclu[nhist][clu]->SetName(aux.Data());
875 0 : fHisResXclu[nhist][clu]->SetTitle(aux.Data());
876 :
877 0 : aux=histnameResZclu;
878 0 : aux+=nhist;
879 0 : aux+="_clu_";
880 0 : aux+=clu+1; // clu=0 --> cluster size 1
881 0 : fHisResZclu[nhist][clu]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
882 0 : fHisResZclu[nhist][clu]->SetName(aux.Data());
883 0 : fHisResZclu[nhist][clu]->SetTitle(aux.Data());
884 : }
885 :
886 0 : fHisResXchip[nhist]=new TH1F*[kNChip];
887 0 : fHisResZchip[nhist]=new TH1F*[kNChip];
888 0 : for(Int_t chip=0; chip<kNChip; chip++) {
889 0 : aux=histnameResXchip;
890 0 : aux+=nhist;
891 0 : aux+="_chip_";
892 0 : aux+=chip;
893 0 : fHisResXchip[nhist][chip]=new TH1F("histname","histname",800,-0.32,0.32); // +- 3200 micron; 1 bin=8 micron
894 0 : fHisResXchip[nhist][chip]->SetName(aux.Data());
895 0 : fHisResXchip[nhist][chip]->SetTitle(aux.Data());
896 :
897 0 : aux=histnameResZchip;
898 0 : aux+=nhist;
899 0 : aux+="_chip_";
900 0 : aux+=chip;
901 0 : fHisResZchip[nhist][chip]=new TH1F("histname","histname",300,-0.48,0.48); // +-4800 micron; 1 bin=32 micron
902 0 : fHisResZchip[nhist][chip]->SetName(aux.Data());
903 0 : fHisResZchip[nhist][chip]->SetTitle(aux.Data());
904 : }
905 :
906 0 : aux=histnameTrackErrX;
907 0 : aux+=nhist;
908 0 : fHisTrackErrX[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
909 0 : fHisTrackErrX[nhist]->SetName(aux.Data());
910 0 : fHisTrackErrX[nhist]->SetTitle(aux.Data());
911 :
912 0 : aux=histnameTrackErrZ;
913 0 : aux+=nhist;
914 0 : fHisTrackErrZ[nhist]=new TH1F("histname","histname",200,0.,0.32); // 0-3200 micron; 1 bin=16 micron
915 0 : fHisTrackErrZ[nhist]->SetName(aux.Data());
916 0 : fHisTrackErrZ[nhist]->SetTitle(aux.Data());
917 :
918 0 : aux=histnameClusErrX;
919 0 : aux+=nhist;
920 0 : fHisClusErrX[nhist]=new TH1F("histname","histname",400,0.,0.08); // 0-800 micron; 1 bin=2 micron
921 0 : fHisClusErrX[nhist]->SetName(aux.Data());
922 0 : fHisClusErrX[nhist]->SetTitle(aux.Data());
923 :
924 0 : aux=histnameClusErrZ;
925 0 : aux+=nhist;
926 0 : fHisClusErrZ[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
927 0 : fHisClusErrZ[nhist]->SetName(aux.Data());
928 0 : fHisClusErrZ[nhist]->SetTitle(aux.Data());
929 :
930 0 : aux=profnameResXvsPhi;
931 0 : aux+=nhist;
932 0 : fProfResXvsPhi[nhist]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40°
933 0 : fProfResXvsPhi[nhist]->SetName(aux.Data()); // bin width: 2°
934 0 : fProfResXvsPhi[nhist]->SetTitle(aux.Data());
935 :
936 0 : aux=profnameResZvsDip;
937 0 : aux+=nhist;
938 0 : fProfResZvsDip[nhist]=new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-4°
939 0 : fProfResZvsDip[nhist]->SetName(aux.Data()); // bin width: 3°
940 0 : fProfResZvsDip[nhist]->SetTitle(aux.Data());
941 :
942 0 : fProfResXvsPhiclu[nhist]=new TProfile*[kNclu];
943 0 : fProfResZvsDipclu[nhist]=new TProfile*[kNclu];
944 0 : for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
945 0 : aux=profnameResXvsPhiclu;
946 0 : aux+=nhist;
947 0 : aux+="_clu_";
948 0 : aux+=clu+1; // clu=0 --> cluster size 1
949 0 : fProfResXvsPhiclu[nhist][clu]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40
950 0 : fProfResXvsPhiclu[nhist][clu]->SetName(aux.Data()); // bin width: 2°
951 0 : fProfResXvsPhiclu[nhist][clu]->SetTitle(aux.Data());
952 :
953 0 : aux=profnameResZvsDipclu;
954 0 : aux+=nhist;
955 0 : aux+="_clu_";
956 0 : aux+=clu+1; // clu=0 --> cluster size 1
957 0 : fProfResZvsDipclu[nhist][clu]= new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-7°
958 0 : fProfResZvsDipclu[nhist][clu]->SetName(aux.Data()); // bin width: 3°
959 0 : fProfResZvsDipclu[nhist][clu]->SetTitle(aux.Data());
960 : }
961 :
962 0 : fHisTrackXFOtrue[nhist]=new TH1F*[kNClockPhase];
963 0 : fHisTrackZFOtrue[nhist]=new TH1F*[kNClockPhase];
964 0 : fHisTrackXFOfalse[nhist]=new TH1F*[kNClockPhase];
965 0 : fHisTrackZFOfalse[nhist]=new TH1F*[kNClockPhase];
966 0 : fHisTrackXZFOtrue[nhist]=new TH2F*[kNClockPhase];
967 0 : fHisTrackXZFOfalse[nhist]=new TH2F*[kNClockPhase];
968 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
969 0 : aux=histnameTrackXFOtrue;
970 0 : aux+=nhist;
971 0 : aux+="_BCmod4_";
972 0 : aux+=phas;
973 0 : fHisTrackXFOtrue[nhist][phas]=new TH1F("histname","histname",128,-0.64,0.64); // +- 6.4 mm; 1 bin=0.1 mm
974 0 : fHisTrackXFOtrue[nhist][phas]->SetName(aux.Data());
975 0 : fHisTrackXFOtrue[nhist][phas]->SetTitle(aux.Data());
976 :
977 0 : aux=histnameTrackZFOtrue;
978 0 : aux+=nhist;
979 0 : aux+="_BCmod4_";
980 0 : aux+=phas;
981 0 : fHisTrackZFOtrue[nhist][phas]=new TH1F("histname","histname",350,-3.5,3.5); // +- 35. mm; 1 bin=0.2 mm
982 0 : fHisTrackZFOtrue[nhist][phas]->SetName(aux.Data());
983 0 : fHisTrackZFOtrue[nhist][phas]->SetTitle(aux.Data());
984 :
985 0 : aux=histnameTrackXFOfalse;
986 0 : aux+=nhist;
987 0 : aux+="_BCmod4_";
988 0 : aux+=phas;
989 0 : fHisTrackXFOfalse[nhist][phas]=new TH1F("histname","histname",128,-0.64,0.64); // +- 6.4 mm; 1 bin=0.1 mm
990 0 : fHisTrackXFOfalse[nhist][phas]->SetName(aux.Data());
991 0 : fHisTrackXFOfalse[nhist][phas]->SetTitle(aux.Data());
992 :
993 0 : aux=histnameTrackZFOfalse;
994 0 : aux+=nhist;
995 0 : aux+="_BCmod4_";
996 0 : aux+=phas;
997 0 : fHisTrackZFOfalse[nhist][phas]=new TH1F("histname","histname",350,-3.5,3.5); // +- 35. mm; 1 bin=0.2 mm
998 0 : fHisTrackZFOfalse[nhist][phas]->SetName(aux.Data());
999 0 : fHisTrackZFOfalse[nhist][phas]->SetTitle(aux.Data());
1000 :
1001 0 : aux=histnameTrackXZFOtrue;
1002 0 : aux+=nhist;
1003 0 : aux+="_BCmod4_";
1004 0 : aux+=phas;
1005 0 : fHisTrackXZFOtrue[nhist][phas]=new TH2F("histname","histname",22,-3.5,3.5,32,-0.64,0.64); // localZ +- 35. mm; 1 bin=3.2 mm
1006 0 : fHisTrackXZFOtrue[nhist][phas]->SetName(aux.Data()); // localX +- 6.4 mm; 1 bin=0.4 mm
1007 0 : fHisTrackXZFOtrue[nhist][phas]->SetTitle(aux.Data());
1008 :
1009 0 : aux=histnameTrackXZFOfalse;
1010 0 : aux+=nhist;
1011 0 : aux+="_BCmod4_";
1012 0 : aux+=phas;
1013 0 : fHisTrackXZFOfalse[nhist][phas]=new TH2F("histname","histname",22,-3.5,3.5,32,-0.64,0.64); // localZ +- 35. mm; 1 bin=3.2 mm
1014 0 : fHisTrackXZFOfalse[nhist][phas]->SetName(aux.Data()); // localX +- 6.4 mm; 1 bin=0.4 mm
1015 0 : fHisTrackXZFOfalse[nhist][phas]->SetTitle(aux.Data());
1016 : }
1017 : } // end loop on module
1018 :
1019 0 : TH1::AddDirectory(kTRUE);
1020 :
1021 : return;
1022 0 : }
1023 : //__________________________________________________________
1024 : void AliITSPlaneEffSPD::DeleteHistos() {
1025 0 : if(fHisResX) {
1026 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisResX[i];
1027 0 : delete [] fHisResX; fHisResX=0;
1028 0 : }
1029 0 : if(fHisResZ) {
1030 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisResZ[i];
1031 0 : delete [] fHisResZ; fHisResZ=0;
1032 0 : }
1033 0 : if(fHisResXZ) {
1034 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisResXZ[i];
1035 0 : delete [] fHisResXZ; fHisResXZ=0;
1036 0 : }
1037 0 : if(fHisClusterSize) {
1038 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusterSize[i];
1039 0 : delete [] fHisClusterSize; fHisClusterSize=0;
1040 0 : }
1041 0 : if(fHisResXclu) {
1042 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1043 0 : for (Int_t clu=0; clu<kNclu; clu++) if (fHisResXclu[i][clu]) delete fHisResXclu[i][clu];
1044 0 : delete [] fHisResXclu[i];
1045 : }
1046 0 : delete [] fHisResXclu;
1047 0 : fHisResXclu = 0;
1048 0 : }
1049 0 : if(fHisResZclu) {
1050 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1051 0 : for (Int_t clu=0; clu<kNclu; clu++) if (fHisResZclu[i][clu]) delete fHisResZclu[i][clu];
1052 0 : delete [] fHisResZclu[i];
1053 : }
1054 0 : delete [] fHisResZclu;
1055 0 : fHisResZclu = 0;
1056 0 : }
1057 0 : if(fHisResXchip) {
1058 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1059 0 : for (Int_t chip=0; chip<kNChip; chip++) if (fHisResXchip[i][chip]) delete fHisResXchip[i][chip];
1060 0 : delete [] fHisResXchip[i];
1061 : }
1062 0 : delete [] fHisResXchip;
1063 0 : fHisResXchip = 0;
1064 0 : }
1065 0 : if(fHisResZchip) {
1066 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1067 0 : for (Int_t chip=0; chip<kNChip; chip++) if (fHisResZchip[i][chip]) delete fHisResZchip[i][chip];
1068 0 : delete [] fHisResZchip[i];
1069 : }
1070 0 : delete [] fHisResZchip;
1071 0 : fHisResZchip = 0;
1072 0 : }
1073 0 : if(fHisTrackErrX) {
1074 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrX[i];
1075 0 : delete [] fHisTrackErrX; fHisTrackErrX=0;
1076 0 : }
1077 0 : if(fHisTrackErrZ) {
1078 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrZ[i];
1079 0 : delete [] fHisTrackErrZ; fHisTrackErrZ=0;
1080 0 : }
1081 0 : if(fHisClusErrX) {
1082 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrX[i];
1083 0 : delete [] fHisClusErrX; fHisClusErrX=0;
1084 0 : }
1085 0 : if(fHisClusErrZ) {
1086 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrZ[i];
1087 0 : delete [] fHisClusErrZ; fHisClusErrZ=0;
1088 0 : }
1089 0 : if(fProfResXvsPhi) {
1090 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fProfResXvsPhi[i];
1091 0 : delete [] fProfResXvsPhi; fProfResXvsPhi=0;
1092 0 : }
1093 0 : if(fProfResZvsDip) {
1094 0 : for (Int_t i=0; i<kNHisto; i++ ) delete fProfResZvsDip[i];
1095 0 : delete [] fProfResZvsDip; fProfResZvsDip=0;
1096 0 : }
1097 0 : if(fProfResXvsPhiclu) {
1098 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1099 0 : for (Int_t clu=0; clu<kNclu; clu++) if (fProfResXvsPhiclu[i][clu]) delete fProfResXvsPhiclu[i][clu];
1100 0 : delete [] fProfResXvsPhiclu[i];
1101 : }
1102 0 : delete [] fProfResXvsPhiclu;
1103 0 : fProfResXvsPhiclu = 0;
1104 0 : }
1105 0 : if(fProfResZvsDipclu) {
1106 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1107 0 : for (Int_t clu=0; clu<kNclu; clu++) if (fProfResZvsDipclu[i][clu]) delete fProfResZvsDipclu[i][clu];
1108 0 : delete [] fProfResZvsDipclu[i];
1109 : }
1110 0 : delete [] fProfResZvsDipclu;
1111 0 : fProfResZvsDipclu = 0;
1112 0 : }
1113 0 : if(fHisTrackXFOtrue) {
1114 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1115 0 : for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackXFOtrue[i][phas]) delete fHisTrackXFOtrue[i][phas];
1116 0 : delete [] fHisTrackXFOtrue[i];
1117 : }
1118 0 : delete [] fHisTrackXFOtrue;
1119 0 : fHisTrackXFOtrue = 0;
1120 0 : }
1121 0 : if(fHisTrackZFOtrue) {
1122 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1123 0 : for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackZFOtrue[i][phas]) delete fHisTrackZFOtrue[i][phas];
1124 0 : delete [] fHisTrackZFOtrue[i];
1125 : }
1126 0 : delete [] fHisTrackZFOtrue;
1127 0 : fHisTrackZFOtrue = 0;
1128 0 : }
1129 0 : if(fHisTrackXFOfalse) {
1130 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1131 0 : for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackXFOfalse[i][phas]) delete fHisTrackXFOfalse[i][phas];
1132 0 : delete [] fHisTrackXFOfalse[i];
1133 : }
1134 0 : delete [] fHisTrackXFOfalse;
1135 0 : fHisTrackXFOfalse = 0;
1136 0 : }
1137 0 : if(fHisTrackZFOfalse) {
1138 0 : for (Int_t i=0; i<kNHisto; i++ ) {
1139 0 : for (Int_t phas=0; phas<kNClockPhase; phas++) if (fHisTrackZFOfalse[i][phas]) delete fHisTrackZFOfalse[i][phas];
1140 0 : delete [] fHisTrackZFOfalse[i];
1141 : }
1142 0 : delete [] fHisTrackZFOfalse;
1143 0 : fHisTrackZFOfalse = 0;
1144 0 : }
1145 0 : return;
1146 : }
1147 : //__________________________________________________________
1148 : Bool_t AliITSPlaneEffSPD::FillHistos(UInt_t key, Bool_t found,
1149 : Float_t *tr, Float_t *clu, Int_t *csize, Float_t *angtrkmod) {
1150 : //
1151 : // depending on the value of key this method
1152 : // either call the standard one for clusters
1153 : // or the one for FO studies
1154 : // if key < 1200 --> call FillHistosST
1155 : // if key >= 1200 --> call FillHistosFO
1156 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
1157 0 : {AliError("GetChipFromKey: you asked for a non existing key"); return kFALSE;}
1158 0 : if(key<kNModule*kNChip) return FillHistosStd(key,found,tr,clu,csize,angtrkmod);
1159 0 : else return FillHistosFO(key,found,tr);
1160 : return kFALSE;
1161 0 : }
1162 : //__________________________________________________________
1163 : Bool_t AliITSPlaneEffSPD::FillHistosFO(UInt_t key, Bool_t found, Float_t *tr) {
1164 : // this method fill the histograms for FastOr studies
1165 : // input: - key: unique key of the basic block
1166 : // - found: Boolean to asses whether a FastOr bit has been associated to the track or not
1167 : // - tr[0],tr[1] local X and Z coordinates of the track prediction, respectively
1168 : // - tr[2],tr[3] error on local X and Z coordinates of the track prediction, respectively
1169 : // output: kTRUE if filling was succesfull kFALSE otherwise
1170 : // side effects: updating of the histograms.
1171 0 : if (!fHis) {
1172 0 : AliWarning("FillHistos: histograms do not exist! Call SetCreateHistos(kTRUE) first");
1173 0 : return kFALSE;
1174 : }
1175 0 : if(key>=kNModule*kNChip*(kNClockPhase+1))
1176 0 : {AliWarning("FillHistos: you asked for a non existing key"); return kFALSE;}
1177 0 : if(key<kNModule*kNChip)
1178 0 : {AliWarning("FillHistos: you asked for a key which is not for FO studies"); return kFALSE;}
1179 0 : Int_t id=GetModFromKey(key);
1180 0 : Int_t BCm4=GetBCm4FromKey(key);
1181 0 : if(id>=kNHisto)
1182 0 : {AliWarning("FillHistos: you want to fill a non-existing histos"); return kFALSE;}
1183 0 : if(found) {
1184 0 : fHisTrackXFOtrue[id][BCm4]->Fill(tr[0]);
1185 0 : fHisTrackZFOtrue[id][BCm4]->Fill(tr[1]);
1186 0 : fHisTrackXZFOtrue[id][BCm4]->Fill(tr[1],tr[0]);
1187 0 : }
1188 : else {
1189 0 : fHisTrackXFOfalse[id][BCm4]->Fill(tr[0]);
1190 0 : fHisTrackZFOfalse[id][BCm4]->Fill(tr[1]);
1191 0 : fHisTrackXZFOfalse[id][BCm4]->Fill(tr[1],tr[0]);
1192 : }
1193 0 : return kTRUE;
1194 0 : }
1195 : //__________________________________________________________
1196 : Bool_t AliITSPlaneEffSPD::FillHistosStd(UInt_t key, Bool_t found,
1197 : Float_t *tr, Float_t *clu, Int_t *csize, Float_t *angtrkmod) {
1198 : // this method fill the histograms
1199 : // input: - key: unique key of the basic block
1200 : // - found: Boolean to asses whether a cluster has been associated to the track or not
1201 : // - tr[0],tr[1] local X and Z coordinates of the track prediction, respectively
1202 : // - tr[2],tr[3] error on local X and Z coordinates of the track prediction, respectively
1203 : // - clu[0],clu[1] local X and Z coordinates of the cluster associated to the track, respectively
1204 : // - clu[2],clu[3] error on local X and Z coordinates of the cluster associated to the track, respectively
1205 : // - csize[0][1] cluster size in X and Z, respectively
1206 : // - angtrkmod[0],angtrkmod[1]
1207 : // output: kTRUE if filling was succesfull kFALSE otherwise
1208 : // side effects: updating of the histograms.
1209 : //
1210 0 : if (!fHis) {
1211 0 : AliWarning("FillHistos: histograms do not exist! Call SetCreateHistos(kTRUE) first");
1212 0 : return kFALSE;
1213 : }
1214 0 : if(key>=kNModule*kNChip)
1215 0 : {AliWarning("FillHistos: you asked for a non existing key"); return kFALSE;}
1216 0 : Int_t id=GetModFromKey(key);
1217 0 : Int_t chip=GetChipFromKey(key);
1218 0 : if(id>=kNHisto)
1219 0 : {AliWarning("FillHistos: you want to fill a non-existing histos"); return kFALSE;}
1220 0 : if(found) {
1221 0 : Float_t resx=tr[0]-clu[0];
1222 0 : Float_t resz=tr[1]-clu[1];
1223 0 : fHisResX[id]->Fill(resx);
1224 0 : fHisResZ[id]->Fill(resz);
1225 0 : fHisResXZ[id]->Fill(resx,resz);
1226 0 : fHisClusterSize[id]->Fill((Double_t)csize[0],(Double_t)csize[1]);
1227 0 : if(csize[0]>0 && csize[0]<=kNclu) fHisResXclu[id][csize[0]-1]->Fill(resx);
1228 0 : if(csize[1]>0 && csize[1]<=kNclu) fHisResZclu[id][csize[1]-1]->Fill(resz);
1229 0 : fHisResXchip[id][chip]->Fill(resx);
1230 0 : fHisResZchip[id][chip]->Fill(resz);
1231 0 : fProfResXvsPhi[id]->Fill(angtrkmod[0],resx);
1232 0 : fProfResZvsDip[id]->Fill(angtrkmod[1],resz);
1233 0 : if(csize[0]>0 && csize[0]<=kNclu) fProfResXvsPhiclu[id][csize[0]-1]->Fill(angtrkmod[0],resx);
1234 0 : if(csize[1]>0 && csize[1]<=kNclu) fProfResZvsDipclu[id][csize[1]-1]->Fill(angtrkmod[1],resz);
1235 0 : }
1236 0 : fHisTrackErrX[id]->Fill(tr[2]);
1237 0 : fHisTrackErrZ[id]->Fill(tr[3]);
1238 0 : fHisClusErrX[id]->Fill(clu[2]);
1239 0 : fHisClusErrZ[id]->Fill(clu[3]);
1240 0 : return kTRUE;
1241 0 : }
1242 : //__________________________________________________________
1243 : Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) {
1244 : //
1245 : // Saves the histograms into a tree and saves the trees into a file
1246 : //
1247 0 : if (!fHis) return kFALSE;
1248 0 : if (filename.IsNull() || filename.IsWhitespace()) {
1249 0 : AliWarning("WriteHistosToFile: null output filename!");
1250 0 : return kFALSE;
1251 : }
1252 0 : char branchname[51];
1253 0 : TFile *hFile=new TFile(filename.Data(),option,
1254 : "The File containing the TREEs with ITS PlaneEff Histos");
1255 0 : TTree *SPDTree=new TTree("SPDTree","Tree whith Residuals and Cluster Type distributions for SPD");
1256 0 : TH1F *histZ,*histX;
1257 0 : TH2F *histXZ;
1258 0 : TH2I *histClusterType;
1259 0 : TH1F *histXclu[kNclu];
1260 0 : TH1F *histZclu[kNclu];
1261 0 : TH1F *histXchip[kNChip];
1262 0 : TH1F *histZchip[kNChip];
1263 0 : TH1F *histTrErrZ,*histTrErrX;
1264 0 : TH1F *histClErrZ,*histClErrX;
1265 0 : TProfile *profXvsPhi,*profZvsDip;
1266 0 : TProfile *profXvsPhiclu[kNclu],*profZvsDipclu[kNclu];
1267 0 : TH1F *histXtrkFOtrue[kNClockPhase];
1268 0 : TH1F *histZtrkFOtrue[kNClockPhase];
1269 0 : TH1F *histXtrkFOfalse[kNClockPhase];
1270 0 : TH1F *histZtrkFOfalse[kNClockPhase];
1271 0 : TH2F *histXZtrkFOtrue[kNClockPhase];
1272 0 : TH2F *histXZtrkFOfalse[kNClockPhase];
1273 :
1274 0 : histZ=new TH1F();
1275 0 : histX=new TH1F();
1276 0 : histXZ=new TH2F();
1277 0 : histClusterType=new TH2I();
1278 0 : for(Int_t clu=0;clu<kNclu;clu++) {
1279 0 : histXclu[clu]=new TH1F();
1280 0 : histZclu[clu]=new TH1F();
1281 : }
1282 0 : for(Int_t chip=0;chip<kNChip;chip++) {
1283 0 : histXchip[chip]=new TH1F();
1284 0 : histZchip[chip]=new TH1F();
1285 : }
1286 :
1287 0 : histTrErrX=new TH1F();
1288 0 : histTrErrZ=new TH1F();
1289 0 : histClErrX=new TH1F();
1290 0 : histClErrZ=new TH1F();
1291 0 : profXvsPhi=new TProfile();
1292 0 : profZvsDip=new TProfile();
1293 0 : for(Int_t clu=0;clu<kNclu;clu++) {
1294 0 : profXvsPhiclu[clu]=new TProfile();
1295 0 : profZvsDipclu[clu]=new TProfile();
1296 : }
1297 :
1298 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
1299 0 : histXtrkFOtrue[phas]=new TH1F();
1300 0 : histZtrkFOtrue[phas]=new TH1F();
1301 0 : histXtrkFOfalse[phas]=new TH1F();
1302 0 : histZtrkFOfalse[phas]=new TH1F();
1303 0 : histXZtrkFOtrue[phas]=new TH2F();
1304 0 : histXZtrkFOfalse[phas]=new TH2F();
1305 : }
1306 :
1307 0 : SPDTree->Branch("histX","TH1F",&histX,128000,0);
1308 0 : SPDTree->Branch("histZ","TH1F",&histZ,128000,0);
1309 0 : SPDTree->Branch("histXZ","TH2F",&histXZ,128000,0);
1310 0 : SPDTree->Branch("histClusterType","TH2I",&histClusterType,128000,0);
1311 0 : for(Int_t clu=0;clu<kNclu;clu++) {
1312 0 : snprintf(branchname,50,"histXclu_%d",clu+1);
1313 0 : SPDTree->Branch(branchname,"TH1F",&histXclu[clu],128000,0);
1314 0 : snprintf(branchname,50,"histZclu_%d",clu+1);
1315 0 : SPDTree->Branch(branchname,"TH1F",&histZclu[clu],128000,0);
1316 : }
1317 0 : for(Int_t chip=0;chip<kNChip;chip++) {
1318 0 : snprintf(branchname,50,"histXchip_%d",chip);
1319 0 : SPDTree->Branch(branchname,"TH1F",&histXchip[chip],128000,0);
1320 0 : snprintf(branchname,50,"histZchip_%d",chip);
1321 0 : SPDTree->Branch(branchname,"TH1F",&histZchip[chip],128000,0);
1322 : }
1323 0 : SPDTree->Branch("histTrErrX","TH1F",&histTrErrX,128000,0);
1324 0 : SPDTree->Branch("histTrErrZ","TH1F",&histTrErrZ,128000,0);
1325 0 : SPDTree->Branch("histClErrX","TH1F",&histClErrX,128000,0);
1326 0 : SPDTree->Branch("histClErrZ","TH1F",&histClErrZ,128000,0);
1327 0 : SPDTree->Branch("profXvsPhi","TProfile",&profXvsPhi,128000,0);
1328 0 : SPDTree->Branch("profZvsDip","TProfile",&profZvsDip,128000,0);
1329 0 : for(Int_t clu=0;clu<kNclu;clu++) {
1330 0 : snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
1331 0 : SPDTree->Branch(branchname,"TProfile",&profXvsPhiclu[clu],128000,0);
1332 0 : snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
1333 0 : SPDTree->Branch(branchname,"TProfile",&profZvsDipclu[clu],128000,0);
1334 : }
1335 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
1336 0 : snprintf(branchname,50,"histTrXFOokBCmod4_%d",phas);
1337 0 : SPDTree->Branch(branchname,"TH1F",&histXtrkFOtrue[phas],128000,0);
1338 0 : snprintf(branchname,50,"histTrZFOokBCmod4_%d",phas);
1339 0 : SPDTree->Branch(branchname,"TH1F",&histZtrkFOtrue[phas],128000,0);
1340 0 : snprintf(branchname,50,"histTrXFOkoBCmod4_%d",phas);
1341 0 : SPDTree->Branch(branchname,"TH1F",&histXtrkFOfalse[phas],128000,0);
1342 0 : snprintf(branchname,50,"histTrZFOkoBCmod4_%d",phas);
1343 0 : SPDTree->Branch(branchname,"TH1F",&histZtrkFOfalse[phas],128000,0);
1344 0 : snprintf(branchname,50,"histTrXZFOokBCmod4_%d",phas);
1345 0 : SPDTree->Branch(branchname,"TH2F",&histXZtrkFOtrue[phas],128000,0);
1346 0 : snprintf(branchname,50,"histTrXZFOkoBCmod4_%d",phas);
1347 0 : SPDTree->Branch(branchname,"TH2F",&histXZtrkFOfalse[phas],128000,0);
1348 : }
1349 :
1350 0 : for(Int_t j=0;j<kNHisto;j++){
1351 0 : histX=fHisResX[j];
1352 0 : histZ=fHisResZ[j];
1353 0 : histXZ=fHisResXZ[j];
1354 0 : histClusterType=fHisClusterSize[j];
1355 0 : for(Int_t clu=0;clu<kNclu;clu++) {
1356 0 : histXclu[clu]=fHisResXclu[j][clu];
1357 0 : histZclu[clu]=fHisResZclu[j][clu];
1358 : }
1359 0 : for(Int_t chip=0;chip<kNChip;chip++) {
1360 0 : histXchip[chip]=fHisResXchip[j][chip];
1361 0 : histZchip[chip]=fHisResZchip[j][chip];
1362 : }
1363 0 : histTrErrX=fHisTrackErrX[j];
1364 0 : histTrErrZ=fHisTrackErrZ[j];
1365 0 : histClErrX=fHisClusErrX[j];
1366 0 : histClErrZ=fHisClusErrZ[j];
1367 0 : profXvsPhi=fProfResXvsPhi[j];
1368 0 : profZvsDip=fProfResZvsDip[j];
1369 0 : for(Int_t clu=0;clu<kNclu;clu++) {
1370 0 : profXvsPhiclu[clu]=fProfResXvsPhiclu[j][clu];
1371 0 : profZvsDipclu[clu]=fProfResZvsDipclu[j][clu];
1372 : }
1373 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
1374 0 : histXtrkFOtrue[phas]=fHisTrackXFOtrue[j][phas];
1375 0 : histZtrkFOtrue[phas]=fHisTrackZFOtrue[j][phas];
1376 0 : histXtrkFOfalse[phas]=fHisTrackXFOfalse[j][phas];
1377 0 : histZtrkFOfalse[phas]=fHisTrackZFOfalse[j][phas];
1378 0 : histXZtrkFOtrue[phas]=fHisTrackXZFOtrue[j][phas];
1379 0 : histXZtrkFOfalse[phas]=fHisTrackXZFOfalse[j][phas];
1380 : }
1381 :
1382 0 : SPDTree->Fill();
1383 : }
1384 0 : hFile->Write();
1385 0 : hFile->Close();
1386 : return kTRUE;
1387 0 : }
1388 : //__________________________________________________________
1389 : Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) {
1390 : //
1391 : // Read histograms from an already existing file
1392 : //
1393 0 : if (!fHis) return kFALSE;
1394 0 : if (filename.IsNull() || filename.IsWhitespace()) {
1395 0 : AliWarning("ReadHistosFromFile: incorrect output filename!");
1396 0 : return kFALSE;
1397 : }
1398 0 : char branchname[51];
1399 :
1400 0 : TH1F *h = 0;
1401 0 : TH2F *h2 = 0;
1402 0 : TH2I *h2i= 0;
1403 0 : TProfile *p = 0;
1404 :
1405 0 : TFile *file=TFile::Open(filename.Data(),"READONLY");
1406 :
1407 0 : if (!file || file->IsZombie()) {
1408 0 : AliWarning(Form("Can't open %s !",filename.Data()));
1409 0 : delete file;
1410 0 : return kFALSE;
1411 : }
1412 0 : TTree *tree = (TTree*) file->Get("SPDTree");
1413 :
1414 0 : TBranch *histX = (TBranch*) tree->GetBranch("histX");
1415 0 : TBranch *histZ = (TBranch*) tree->GetBranch("histZ");
1416 0 : TBranch *histXZ = (TBranch*) tree->GetBranch("histXZ");
1417 0 : TBranch *histClusterType = (TBranch*) tree->GetBranch("histClusterType");
1418 :
1419 0 : TBranch *histXclu[kNclu], *histZclu[kNclu];
1420 0 : for(Int_t clu=0; clu<kNclu; clu++) {
1421 0 : snprintf(branchname,50,"histXclu_%d",clu+1);
1422 0 : histXclu[clu]= (TBranch*) tree->GetBranch(branchname);
1423 0 : snprintf(branchname,50,"histZclu_%d",clu+1);
1424 0 : histZclu[clu]= (TBranch*) tree->GetBranch(branchname);
1425 : }
1426 :
1427 0 : TBranch *histXchip[kNChip], *histZchip[kNChip];
1428 0 : for(Int_t chip=0; chip<kNChip; chip++) {
1429 0 : snprintf(branchname,50,"histXchip_%d",chip);
1430 0 : histXchip[chip]= (TBranch*) tree->GetBranch(branchname);
1431 0 : snprintf(branchname,50,"histZchip_%d",chip);
1432 0 : histZchip[chip]= (TBranch*) tree->GetBranch(branchname);
1433 : }
1434 :
1435 0 : TBranch *histTrErrX = (TBranch*) tree->GetBranch("histTrErrX");
1436 0 : TBranch *histTrErrZ = (TBranch*) tree->GetBranch("histTrErrZ");
1437 0 : TBranch *histClErrX = (TBranch*) tree->GetBranch("histClErrX");
1438 0 : TBranch *histClErrZ = (TBranch*) tree->GetBranch("histClErrZ");
1439 0 : TBranch *profXvsPhi = (TBranch*) tree->GetBranch("profXvsPhi");
1440 0 : TBranch *profZvsDip = (TBranch*) tree->GetBranch("profZvsDip");
1441 :
1442 0 : TBranch *profXvsPhiclu[kNclu], *profZvsDipclu[kNclu];
1443 0 : for(Int_t clu=0; clu<kNclu; clu++) {
1444 0 : snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
1445 0 : profXvsPhiclu[clu]= (TBranch*) tree->GetBranch(branchname);
1446 0 : snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
1447 0 : profZvsDipclu[clu]= (TBranch*) tree->GetBranch(branchname);
1448 : }
1449 :
1450 0 : TBranch *histXtrkFOtrue[kNClockPhase], *histZtrkFOtrue[kNClockPhase],
1451 : *histXtrkFOfalse[kNClockPhase], *histZtrkFOfalse[kNClockPhase],
1452 : *histXZtrkFOtrue[kNClockPhase], *histXZtrkFOfalse[kNClockPhase];
1453 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
1454 0 : snprintf(branchname,50,"histTrXFOokBCmod4_%d",phas);
1455 0 : histXtrkFOtrue[phas] = (TBranch*) tree->GetBranch(branchname);
1456 0 : snprintf(branchname,50,"histTrZFOokBCmod4_%d",phas);
1457 0 : histZtrkFOtrue[phas] = (TBranch*) tree->GetBranch(branchname);
1458 0 : snprintf(branchname,50,"histTrXFOkoBCmod4_%d",phas);
1459 0 : histXtrkFOfalse[phas] = (TBranch*) tree->GetBranch(branchname);
1460 0 : snprintf(branchname,50,"histTrZFOkoBCmod4_%d",phas);
1461 0 : histZtrkFOfalse[phas] = (TBranch*) tree->GetBranch(branchname);
1462 0 : snprintf(branchname,50,"histTrXZFOokBCmod4_%d",phas);
1463 0 : histXZtrkFOtrue[phas] = (TBranch*) tree->GetBranch(branchname);
1464 0 : snprintf(branchname,50,"histTrXZFOkoBCmod4_%d",phas);
1465 0 : histXZtrkFOfalse[phas] = (TBranch*) tree->GetBranch(branchname);
1466 : }
1467 :
1468 0 : gROOT->cd();
1469 :
1470 0 : Int_t nevent = (Int_t)histX->GetEntries();
1471 0 : if(nevent!=kNHisto)
1472 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1473 0 : histX->SetAddress(&h);
1474 0 : for(Int_t j=0;j<kNHisto;j++){
1475 0 : histX->GetEntry(j);
1476 0 : fHisResX[j]->Add(h);
1477 : }
1478 :
1479 0 : nevent = (Int_t)histZ->GetEntries();
1480 0 : if(nevent!=kNHisto)
1481 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1482 0 : histZ->SetAddress(&h);
1483 0 : for(Int_t j=0;j<kNHisto;j++){
1484 0 : histZ->GetEntry(j);
1485 0 : fHisResZ[j]->Add(h);
1486 : }
1487 :
1488 0 : nevent = (Int_t)histXZ->GetEntries();
1489 0 : if(nevent!=kNHisto)
1490 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1491 0 : histXZ->SetAddress(&h2);
1492 0 : for(Int_t j=0;j<kNHisto;j++){
1493 0 : histXZ->GetEntry(j);
1494 0 : fHisResXZ[j]->Add(h2);
1495 : }
1496 :
1497 0 : nevent = (Int_t)histClusterType->GetEntries();
1498 0 : if(nevent!=kNHisto)
1499 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1500 0 : histClusterType->SetAddress(&h2i);
1501 0 : for(Int_t j=0;j<kNHisto;j++){
1502 0 : histClusterType->GetEntry(j);
1503 0 : fHisClusterSize[j]->Add(h2i);
1504 : }
1505 :
1506 0 : for(Int_t clu=0; clu<kNclu; clu++) {
1507 :
1508 0 : nevent = (Int_t)histXclu[clu]->GetEntries();
1509 0 : if(nevent!=kNHisto)
1510 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1511 0 : histXclu[clu]->SetAddress(&h);
1512 0 : for(Int_t j=0;j<kNHisto;j++){
1513 0 : histXclu[clu]->GetEntry(j);
1514 0 : fHisResXclu[j][clu]->Add(h);
1515 : }
1516 :
1517 0 : nevent = (Int_t)histZclu[clu]->GetEntries();
1518 0 : if(nevent!=kNHisto)
1519 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1520 0 : histZclu[clu]->SetAddress(&h);
1521 0 : for(Int_t j=0;j<kNHisto;j++){
1522 0 : histZclu[clu]->GetEntry(j);
1523 0 : fHisResZclu[j][clu]->Add(h);
1524 : }
1525 : }
1526 :
1527 :
1528 0 : for(Int_t chip=0; chip<kNChip; chip++) {
1529 :
1530 0 : nevent = (Int_t)histXchip[chip]->GetEntries();
1531 0 : if(nevent!=kNHisto)
1532 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1533 0 : histXchip[chip]->SetAddress(&h);
1534 0 : for(Int_t j=0;j<kNHisto;j++){
1535 0 : histXchip[chip]->GetEntry(j);
1536 0 : fHisResXchip[j][chip]->Add(h);
1537 : }
1538 :
1539 0 : nevent = (Int_t)histZchip[chip]->GetEntries();
1540 0 : if(nevent!=kNHisto)
1541 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1542 0 : histZchip[chip]->SetAddress(&h);
1543 0 : for(Int_t j=0;j<kNHisto;j++){
1544 0 : histZchip[chip]->GetEntry(j);
1545 0 : fHisResZchip[j][chip]->Add(h);
1546 : }
1547 : }
1548 :
1549 0 : nevent = (Int_t)histTrErrX->GetEntries();
1550 0 : if(nevent!=kNHisto)
1551 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1552 0 : histTrErrX->SetAddress(&h);
1553 0 : for(Int_t j=0;j<kNHisto;j++){
1554 0 : histTrErrX->GetEntry(j);
1555 0 : fHisTrackErrX[j]->Add(h);
1556 : }
1557 :
1558 0 : nevent = (Int_t)histTrErrZ->GetEntries();
1559 0 : if(nevent!=kNHisto)
1560 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1561 0 : histTrErrZ->SetAddress(&h);
1562 0 : for(Int_t j=0;j<kNHisto;j++){
1563 0 : histTrErrZ->GetEntry(j);
1564 0 : fHisTrackErrZ[j]->Add(h);
1565 : }
1566 :
1567 0 : nevent = (Int_t)histClErrX->GetEntries();
1568 0 : if(nevent!=kNHisto)
1569 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1570 0 : histClErrX->SetAddress(&h);
1571 0 : for(Int_t j=0;j<kNHisto;j++){
1572 0 : histClErrX->GetEntry(j);
1573 0 : fHisClusErrX[j]->Add(h);
1574 : }
1575 :
1576 0 : nevent = (Int_t)histClErrZ->GetEntries();
1577 0 : if(nevent!=kNHisto)
1578 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1579 0 : histClErrZ->SetAddress(&h);
1580 0 : for(Int_t j=0;j<kNHisto;j++){
1581 0 : histClErrZ->GetEntry(j);
1582 0 : fHisClusErrZ[j]->Add(h);
1583 : }
1584 0 : nevent = (Int_t)profXvsPhi->GetEntries();
1585 0 : if(nevent!=kNHisto)
1586 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1587 0 : profXvsPhi->SetAddress(&p);
1588 0 : for(Int_t j=0;j<kNHisto;j++){
1589 0 : profXvsPhi->GetEntry(j);
1590 0 : fProfResXvsPhi[j]->Add(p);
1591 : }
1592 :
1593 0 : nevent = (Int_t)profZvsDip->GetEntries();
1594 0 : if(nevent!=kNHisto)
1595 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1596 0 : profZvsDip->SetAddress(&p);
1597 0 : for(Int_t j=0;j<kNHisto;j++){
1598 0 : profZvsDip->GetEntry(j);
1599 0 : fProfResZvsDip[j]->Add(p);
1600 : }
1601 :
1602 0 : for(Int_t clu=0; clu<kNclu; clu++) {
1603 :
1604 0 : nevent = (Int_t)profXvsPhiclu[clu]->GetEntries();
1605 0 : if(nevent!=kNHisto)
1606 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1607 0 : profXvsPhiclu[clu]->SetAddress(&p);
1608 0 : for(Int_t j=0;j<kNHisto;j++){
1609 0 : profXvsPhiclu[clu]->GetEntry(j);
1610 0 : fProfResXvsPhiclu[j][clu]->Add(p);
1611 : }
1612 :
1613 0 : nevent = (Int_t)profZvsDipclu[clu]->GetEntries();
1614 0 : if(nevent!=kNHisto)
1615 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1616 0 : profZvsDipclu[clu]->SetAddress(&p);
1617 0 : for(Int_t j=0;j<kNHisto;j++){
1618 0 : profZvsDipclu[clu]->GetEntry(j);
1619 0 : fProfResZvsDipclu[j][clu]->Add(p);
1620 : }
1621 : }
1622 :
1623 0 : for(Int_t phas=0; phas<kNClockPhase;phas++){
1624 :
1625 0 : nevent = (Int_t)histXtrkFOtrue[phas]->GetEntries();
1626 0 : if(nevent!=kNHisto)
1627 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1628 0 : histXtrkFOtrue[phas]->SetAddress(&h);
1629 0 : for(Int_t j=0;j<kNHisto;j++){
1630 0 : histXtrkFOtrue[phas]->GetEntry(j);
1631 0 : fHisTrackXFOtrue[j][phas]->Add(h);
1632 : }
1633 :
1634 0 : nevent = (Int_t)histZtrkFOtrue[phas]->GetEntries();
1635 0 : if(nevent!=kNHisto)
1636 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1637 0 : histZtrkFOtrue[phas]->SetAddress(&h);
1638 0 : for(Int_t j=0;j<kNHisto;j++){
1639 0 : histZtrkFOtrue[phas]->GetEntry(j);
1640 0 : fHisTrackZFOtrue[j][phas]->Add(h);
1641 : }
1642 :
1643 0 : nevent = (Int_t)histXtrkFOfalse[phas]->GetEntries();
1644 0 : if(nevent!=kNHisto)
1645 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1646 0 : histXtrkFOfalse[phas]->SetAddress(&h);
1647 0 : for(Int_t j=0;j<kNHisto;j++){
1648 0 : histXtrkFOfalse[phas]->GetEntry(j);
1649 0 : fHisTrackXFOfalse[j][phas]->Add(h);
1650 : }
1651 :
1652 0 : nevent = (Int_t)histZtrkFOfalse[phas]->GetEntries();
1653 0 : if(nevent!=kNHisto)
1654 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1655 0 : histZtrkFOfalse[phas]->SetAddress(&h);
1656 0 : for(Int_t j=0;j<kNHisto;j++){
1657 0 : histZtrkFOfalse[phas]->GetEntry(j);
1658 0 : fHisTrackZFOfalse[j][phas]->Add(h);
1659 : }
1660 :
1661 0 : nevent = (Int_t)histXZtrkFOtrue[phas]->GetEntries();
1662 0 : if(nevent!=kNHisto)
1663 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1664 0 : histXZtrkFOtrue[phas]->SetAddress(&h2);
1665 0 : for(Int_t j=0;j<kNHisto;j++){
1666 0 : histXZtrkFOtrue[phas]->GetEntry(j);
1667 0 : fHisTrackXZFOtrue[j][phas]->Add(h2);
1668 : }
1669 :
1670 0 : nevent = (Int_t)histXZtrkFOfalse[phas]->GetEntries();
1671 0 : if(nevent!=kNHisto)
1672 0 : {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1673 0 : histXZtrkFOfalse[phas]->SetAddress(&h2);
1674 0 : for(Int_t j=0;j<kNHisto;j++){
1675 0 : histXZtrkFOfalse[phas]->GetEntry(j);
1676 0 : fHisTrackXZFOfalse[j][phas]->Add(h2);
1677 : }
1678 :
1679 : }
1680 :
1681 0 : delete h;
1682 0 : delete h2;
1683 0 : delete h2i;
1684 0 : delete p;
1685 :
1686 0 : if (file) {
1687 0 : file->Close();
1688 0 : delete file;
1689 : }
1690 0 : return kTRUE;
1691 0 : }
1692 :
|