1 /**************************************************************************
2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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)
21 // giuseppe.bruno@ba.infn.it
23 ///////////////////////////////////////////////////////////////////////////
32 #include "AliITSPlaneEffSPD.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"
41 ClassImp(AliITSPlaneEffSPD)
42 //______________________________________________________________________
43 AliITSPlaneEffSPD::AliITSPlaneEffSPD():
61 for (UInt_t i=0; i<kNModule*kNChip; i++){
65 // default constructor
66 AliDebug(1,Form("Calling default constructor"));
68 //______________________________________________________________________
69 AliITSPlaneEffSPD::~AliITSPlaneEffSPD(){
79 //______________________________________________________________________
80 AliITSPlaneEffSPD::AliITSPlaneEffSPD(const AliITSPlaneEffSPD &s) : AliITSPlaneEff(s),
101 // AliITSPlaneEffSPD &s The original class for which
102 // this class is a copy of
107 for (UInt_t i=0; i<kNModule*kNChip; i++){
108 fFound[i]=s.fFound[i];
109 fTried[i]=s.fTried[i];
113 for(Int_t i=0; i<kNHisto; i++) {
114 s.fHisResX[i]->Copy(*fHisResX[i]);
115 s.fHisResZ[i]->Copy(*fHisResZ[i]);
116 s.fHisResXZ[i]->Copy(*fHisResXZ[i]);
117 s.fHisClusterSize[i]->Copy(*fHisClusterSize[i]);
118 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
119 s.fHisResXclu[i][clu]->Copy(*fHisResXclu[i][clu]);
120 s.fHisResZclu[i][clu]->Copy(*fHisResZclu[i][clu]);
121 s.fProfResXvsPhiclu[i][clu]->Copy(*fProfResXvsPhiclu[i][clu]);
122 s.fProfResZvsDipclu[i][clu]->Copy(*fProfResZvsDipclu[i][clu]);
124 for(Int_t chip=0; chip<kNChip; chip++) {
125 s.fHisResXchip[i][chip]->Copy(*fHisResXchip[i][chip]);
126 s.fHisResZchip[i][chip]->Copy(*fHisResZchip[i][chip]);
128 s.fProfResXvsPhi[i]->Copy(*fProfResXvsPhi[i]);
129 s.fProfResZvsDip[i]->Copy(*fProfResZvsDip[i]);
130 s.fHisTrackErrX[i]->Copy(*fHisTrackErrX[i]);
131 s.fHisTrackErrZ[i]->Copy(*fHisTrackErrZ[i]);
132 s.fHisClusErrX[i]->Copy(*fHisClusErrX[i]);
133 s.fHisClusErrZ[i]->Copy(*fHisClusErrZ[i]);
137 //_________________________________________________________________________
138 AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator+=(const AliITSPlaneEffSPD &add){
139 // Add-to-me operator
141 // const AliITSPlaneEffSPD &add simulation class to be added
146 for (UInt_t i=0; i<kNModule*kNChip; i++){
147 fFound[i] += add.fFound[i];
148 fTried[i] += add.fTried[i];
150 if(fHis && add.fHis) {
151 for(Int_t i=0; i<kNHisto; i++) {
152 fHisResX[i]->Add(add.fHisResX[i]);
153 fHisResZ[i]->Add(add.fHisResZ[i]);
154 fHisResXZ[i]->Add(add.fHisResXZ[i]);
155 fHisClusterSize[i]->Add(add.fHisClusterSize[i]);
156 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
157 fHisResXclu[i][clu]->Add(add.fHisResXclu[i][clu]);
158 fHisResZclu[i][clu]->Add(add.fHisResZclu[i][clu]);
159 fProfResXvsPhiclu[i][clu]->Add(add.fProfResXvsPhiclu[i][clu]);
160 fProfResZvsDipclu[i][clu]->Add(add.fProfResZvsDipclu[i][clu]);
162 for(Int_t chip=0; chip<kNChip; chip++) {
163 fHisResXchip[i][chip]->Add(add.fHisResXchip[i][chip]);
164 fHisResZchip[i][chip]->Add(add.fHisResZchip[i][chip]);
166 fProfResXvsPhi[i]->Add(add.fProfResXvsPhi[i]);
167 fProfResZvsDip[i]->Add(add.fProfResZvsDip[i]);
168 fHisTrackErrX[i]->Add(add.fHisTrackErrX[i]);
169 fHisTrackErrZ[i]->Add(add.fHisTrackErrZ[i]);
170 fHisClusErrX[i]->Add(add.fHisClusErrX[i]);
171 fHisClusErrZ[i]->Add(add.fHisClusErrZ[i]);
176 //______________________________________________________________________
177 AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator=(const
178 AliITSPlaneEffSPD &s){
179 // Assignment operator
181 // AliITSPlaneEffSPD &s The original class for which
182 // this class is a copy of
187 if(this==&s) return *this;
191 //______________________________________________________________________
192 void AliITSPlaneEffSPD::Copy(TObject &obj) const {
193 // protected method. copy this to obj
194 AliITSPlaneEff::Copy(obj);
195 AliITSPlaneEffSPD& target = (AliITSPlaneEffSPD &) obj;
196 for(Int_t i=0;i<kNModule*kNChip;i++) {
197 target.fFound[i] = fFound[i];
198 target.fTried[i] = fTried[i];
203 //_______________________________________________________________________
204 void AliITSPlaneEffSPD::CopyHistos(AliITSPlaneEffSPD &target) const {
205 // protected method: copy histos from this to target
206 target.fHis = fHis; // this is redundant only in some cases. Leave as it is.
208 target.fHisResX=new TH1F*[kNHisto];
209 target.fHisResZ=new TH1F*[kNHisto];
210 target.fHisResXZ=new TH2F*[kNHisto];
211 target.fHisClusterSize=new TH2I*[kNHisto];
212 target.fHisResXclu=new TH1F**[kNHisto];
213 target.fHisResZclu=new TH1F**[kNHisto];
214 target.fHisResXchip=new TH1F**[kNHisto];
215 target.fHisResZchip=new TH1F**[kNHisto];
216 target.fProfResXvsPhi=new TProfile*[kNHisto];
217 target.fProfResZvsDip=new TProfile*[kNHisto];
218 target.fProfResXvsPhiclu=new TProfile**[kNHisto];
219 target.fProfResZvsDipclu=new TProfile**[kNHisto];
220 target.fHisTrackErrX=new TH1F*[kNHisto];
221 target.fHisTrackErrZ=new TH1F*[kNHisto];
222 target.fHisClusErrX=new TH1F*[kNHisto];
223 target.fHisClusErrZ=new TH1F*[kNHisto];
224 for(Int_t i=0; i<kNHisto; i++) {
225 target.fHisResX[i] = new TH1F(*fHisResX[i]);
226 target.fHisResZ[i] = new TH1F(*fHisResZ[i]);
227 target.fHisResXZ[i] = new TH2F(*fHisResXZ[i]);
228 target.fHisClusterSize[i] = new TH2I(*fHisClusterSize[i]);
229 target.fHisResXclu[i]=new TH1F*[kNclu];
230 target.fHisResZclu[i]=new TH1F*[kNclu];
231 target.fProfResXvsPhiclu[i]=new TProfile*[kNclu];
232 target.fProfResZvsDipclu[i]=new TProfile*[kNclu];
233 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
234 target.fHisResXclu[i][clu] = new TH1F(*fHisResXclu[i][clu]);
235 target.fHisResZclu[i][clu] = new TH1F(*fHisResZclu[i][clu]);
236 target.fProfResXvsPhiclu[i][clu] = new TProfile(*fProfResXvsPhiclu[i][clu]);
237 target.fProfResZvsDipclu[i][clu] = new TProfile(*fProfResZvsDipclu[i][clu]);
239 target.fHisResXchip[i]=new TH1F*[kNChip];
240 target.fHisResZchip[i]=new TH1F*[kNChip];
241 for(Int_t chip=0; chip<kNChip; chip++) {
242 target.fHisResXchip[i][chip] = new TH1F(*fHisResXchip[i][chip]);
243 target.fHisResZchip[i][chip] = new TH1F(*fHisResZchip[i][chip]);
245 target.fProfResXvsPhi[i] = new TProfile(*fProfResXvsPhi[i]);
246 target.fProfResZvsDip[i] = new TProfile(*fProfResZvsDip[i]);
247 target.fHisTrackErrX[i] = new TH1F(*fHisTrackErrX[i]);
248 target.fHisTrackErrZ[i] = new TH1F(*fHisTrackErrZ[i]);
249 target.fHisClusErrX[i] = new TH1F(*fHisClusErrX[i]);
250 target.fHisClusErrZ[i] = new TH1F(*fHisClusErrZ[i]);
256 //_______________________________________________________________________
257 Int_t AliITSPlaneEffSPD::GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr,
258 UInt_t im, UInt_t ic) const {
260 // Estimate the number of tracks still to be collected to attain a
261 // given efficiency eff, with relative error RelErr
263 // eff -> Expected efficiency (e.g. those from actual estimate)
264 // RelErr -> tollerance [0,1]
265 // im -> module number [0,249]
266 // ic -> chip number [0,4]
268 // Return: the estimated n. of tracks
270 if (im>=kNModule || ic>=kNChip)
271 {AliError("GetMissingTracksForGivenEff: you asked for a non existing chip");
274 UInt_t key=GetKey(im,ic);
275 if(key<kNModule*kNChip) return GetNTracksForGivenEff(eff,RelErr)-fTried[key];
279 //_________________________________________________________________________
280 Double_t AliITSPlaneEffSPD::PlaneEff(const UInt_t im,const UInt_t ic) const {
281 // Compute the efficiency for a basic block,
283 // im -> module number [0,249]
284 // ic -> chip number [0,4]
285 if (im>=kNModule || ic>=kNChip)
286 {AliError("PlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;}
287 UInt_t key=GetKey(im,ic);
290 if(key<kNModule*kNChip) {
294 return AliITSPlaneEff::PlaneEff(nf,nt);
296 //_________________________________________________________________________
297 Double_t AliITSPlaneEffSPD::ErrPlaneEff(const UInt_t im,const UInt_t ic) const {
298 // Compute the statistical error on efficiency for a basic block,
299 // using binomial statistics
301 // im -> module number [0,249]
302 // ic -> chip number [0,4]
303 if (im>=kNModule || ic>=kNChip)
304 {AliError("ErrPlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;}
305 UInt_t key=GetKey(im,ic);
308 if(key<kNModule*kNChip) {
312 return AliITSPlaneEff::ErrPlaneEff(nf,nt);
314 //_________________________________________________________________________
315 Bool_t AliITSPlaneEffSPD::UpDatePlaneEff(const Bool_t Kfound,
316 const UInt_t im, const UInt_t ic) {
317 // Update efficiency for a basic block
318 if (im>=kNModule || ic>=kNChip)
319 {AliError("UpDatePlaneEff: you asked for a non existing chip"); return kFALSE;}
320 UInt_t key=GetKey(im,ic);
321 if(key<kNModule*kNChip) {
323 if(Kfound) fFound[key]++;
328 //_________________________________________________________________________
329 UInt_t AliITSPlaneEffSPD::GetChipFromCol(const UInt_t col) const {
330 // get chip given the column
331 if(col>=kNCol*kNChip)
332 {AliDebug(1,Form("GetChipFromCol: you asked for a non existing column %d",col)); return 10;}
335 //__________________________________________________________________________
336 UInt_t AliITSPlaneEffSPD::GetKey(const UInt_t mod, const UInt_t chip) const {
337 // get key given a basic block
338 if(mod>=kNModule || chip>=kNChip)
339 {AliWarning("GetKey: you asked for a non existing block"); return 99999;}
340 return mod*kNChip+chip;
342 //__________________________________________________________________________
343 UInt_t AliITSPlaneEffSPD::GetModFromKey(const UInt_t key) const {
345 if(key>=kNModule*kNChip)
346 {AliError("GetModFromKey: you asked for a non existing key"); return 9999;}
349 //__________________________________________________________________________
350 UInt_t AliITSPlaneEffSPD::GetChipFromKey(const UInt_t key) const {
351 // retrieves chip from key
352 if(key>=kNModule*kNChip)
353 {AliError("GetChipFromKey: you asked for a non existing key"); return 999;}
354 return (key%(kNModule*kNChip))%kNChip;
356 //__________________________________________________________________________
357 void AliITSPlaneEffSPD::GetModAndChipFromKey(const UInt_t key,UInt_t& mod,UInt_t& chip) const {
358 // get module and chip from a key
359 if(key>=kNModule*kNChip)
360 {AliError("GetModAndChipFromKey: you asked for a non existing key");
365 chip=(key%(kNModule*kNChip))%kNChip;
368 //____________________________________________________________________________
369 Double_t AliITSPlaneEffSPD::LivePlaneEff(UInt_t key) const {
370 // returns plane efficieny after adding the fraction of sensor which is bad
371 if(key>=kNModule*kNChip)
372 {AliError("LivePlaneEff: you asked for a non existing key");
374 Double_t leff=AliITSPlaneEff::LivePlaneEff(0); // this just for the Warning
375 leff=PlaneEff(key)+GetFracBad(key);
376 return leff>1?1:leff;
378 //____________________________________________________________________________
379 Double_t AliITSPlaneEffSPD::ErrLivePlaneEff(UInt_t key) const {
380 // returns error on live plane efficiency
381 if(key>=kNModule*kNChip)
382 {AliError("ErrLivePlaneEff: you asked for a non existing key");
384 Int_t nf=fFound[key];
385 Double_t triedInLive=GetFracLive(key)*fTried[key];
386 Int_t nt=TMath::Max(nf,TMath::Nint(triedInLive));
387 return AliITSPlaneEff::ErrPlaneEff(nf,nt); // for the time being: to be checked
389 //_____________________________________________________________________________
390 Double_t AliITSPlaneEffSPD::GetFracLive(const UInt_t key) const {
391 // returns the fraction of the sensor which is OK
392 if(key>=kNModule*kNChip)
393 {AliError("GetFracLive: you asked for a non existing key");
395 // Compute the fraction of bad (dead+noisy) detector
396 UInt_t dead=0,noisy=0;
397 GetDeadAndNoisyInChip(key,dead,noisy);
398 Double_t live=dead+noisy;
402 //_____________________________________________________________________________
403 void AliITSPlaneEffSPD::GetDeadAndNoisyInChip(const UInt_t key,
404 UInt_t& nrDeadInChip, UInt_t& nrNoisyInChip) const {
405 // returns the number of dead and noisy pixels
408 if(key>=kNModule*kNChip)
409 {AliError("GetDeadAndNoisyInChip: you asked for a non existing key");
411 // Compute the number of bad (dead+noisy) pixel in a chip
414 {AliError("GetDeadAndNoisyInChip: CDB not inizialized: call InitCDB first");
416 AliCDBManager* man = AliCDBManager::Instance();
417 // retrieve map of dead Pixel
418 AliCDBEntry *cdbSPDDead = man->Get("ITS/Calib/SPDDead", fRunNumber);
421 spdDead = (TObjArray*)cdbSPDDead->GetObject();
423 {AliError("GetDeadAndNoisyInChip: SPDDead not found in CDB");
426 AliError("GetDeadAndNoisyInChip: did not find Calib/SPDDead.");
429 // retrieve map of noisy Pixel
430 AliCDBEntry *cdbSPDNoisy = man->Get("ITS/Calib/SPDNoisy", fRunNumber);
433 spdNoisy = (TObjArray*)cdbSPDNoisy->GetObject();
435 {AliError("GetDeadAndNoisyInChip: SPDNoisy not found in CDB");
438 AliError("GetDeadAndNoisyInChip: did not find Calib/SPDNoisy.");
442 UInt_t mod=GetModFromKey(key);
443 UInt_t chip=GetChipFromKey(key);
444 // count number of dead
445 AliITSCalibrationSPD* calibSPD=(AliITSCalibrationSPD*) spdDead->At(mod);
446 UInt_t nrDead = calibSPD->GetNrBad();
447 for (UInt_t index=0; index<nrDead; index++) {
448 if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrDeadInChip++;
450 calibSPD=(AliITSCalibrationSPD*) spdNoisy->At(mod);
451 UInt_t nrNoisy = calibSPD->GetNrBad();
452 for (UInt_t index=0; index<nrNoisy; index++) {
453 if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrNoisyInChip++;
457 //_____________________________________________________________________________
458 Double_t AliITSPlaneEffSPD::GetFracBad(const UInt_t key) const {
459 // returns 1-fractional live
460 if(key>=kNModule*kNChip)
461 {AliError("GetFracBad: you asked for a non existing key");
463 return 1.-GetFracLive(key);
465 //_____________________________________________________________________________
466 Bool_t AliITSPlaneEffSPD::WriteIntoCDB() const {
469 {AliError("WriteIntoCDB: CDB not inizialized. Call InitCDB first");
471 // to be written properly: now only for debugging
472 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
473 //md->SetObjectClassName("AliITSPlaneEff");
474 md->SetResponsible("Giuseppe Eugenio Bruno");
475 md->SetBeamPeriod(0);
476 md->SetAliRootVersion("head 19/11/07"); //root version
477 AliCDBId id("ITS/PlaneEff/PlaneEffSPD",0,AliCDBRunRange::Infinity());
478 AliITSPlaneEffSPD eff;
480 Bool_t r=AliCDBManager::Instance()->GetDefaultStorage()->Put(&eff,id,md);
484 //_____________________________________________________________________________
485 Bool_t AliITSPlaneEffSPD::ReadFromCDB() {
488 {AliError("ReadFromCDB: CDB not inizialized. Call InitCDB first");
490 AliCDBEntry *cdbEntry = AliCDBManager::Instance()->Get("ITS/PlaneEff/PlaneEffSPD",fRunNumber);
491 if(!cdbEntry) return kFALSE;
492 AliITSPlaneEffSPD* eff= (AliITSPlaneEffSPD*)cdbEntry->GetObject();
493 if(this==eff) return kFALSE;
494 if(fHis) CopyHistos(*eff); // If histos already exist then copy them to eff
495 eff->Copy(*this); // copy everything (statistics and histos) from eff to this
498 //_____________________________________________________________________________
499 Bool_t AliITSPlaneEffSPD::AddFromCDB(AliCDBId *cdbId) {
500 AliCDBEntry *cdbEntry=0;
503 {AliError("ReadFromCDB: CDB not inizialized. Call InitCDB first"); return kFALSE;}
504 cdbEntry = AliCDBManager::Instance()->Get("ITS/PlaneEff/PlaneEffSPD",fRunNumber);
506 cdbEntry = AliCDBManager::Instance()->Get(*cdbId);
508 if(!cdbEntry) return kFALSE;
509 AliITSPlaneEffSPD* eff= (AliITSPlaneEffSPD*)cdbEntry->GetObject();
513 //_____________________________________________________________________________
514 UInt_t AliITSPlaneEffSPD::GetKeyFromDetLocCoord(Int_t ilay, Int_t idet,
515 Float_t, Float_t locz) const {
516 // method to locate a basic block from Detector Local coordinate (to be used in tracking)
519 {AliError("GetKeyFromDetLocCoord: you asked for a non existing layer");
521 if(ilay==0 && (idet<0 || idet>79))
522 {AliError("GetKeyFromDetLocCoord: you asked for a non existing detector");
524 if(ilay==1 && (idet<0 || idet>159))
525 {AliError("GetKeyFromDetLocCoord: you asked for a non existing detector");
530 key=GetKey(mod,GetChipFromCol(GetColFromLocZ(locz)));
533 //_____________________________________________________________________________
534 UInt_t AliITSPlaneEffSPD::GetColFromLocZ(Float_t zloc) const {
535 // method to retrieve column number from the local z coordinate
537 AliITSsegmentationSPD spd;
539 if(spd.LocalToDet(0,zloc,ix,iz)) col+=iz;
541 AliDebug(1,Form("cannot compute column number from local z=%f",zloc));
545 const Float_t kconv = 1.0E-04; // converts microns to cm.
547 for(Int_t i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
548 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
549 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
550 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
551 bz[127] = bz[128] = 625.0; // first chip boundry
555 for(Int_t i=000;i<160;i++) dz+=bz[i];
557 if(zloc<dz || zloc>-1*dz) { // outside z range
558 AliDebug(1,Form("GetColFromLocZ: cannot compute column number from local z=%f",zloc));
569 //________________________________________________________
570 Bool_t AliITSPlaneEffSPD::GetBlockBoundaries(const UInt_t key, Float_t& xmn,Float_t& xmx,
571 Float_t& zmn,Float_t& zmx) const {
573 // This method return the geometrical boundaries of the active volume of a given
574 // basic block, in the detector reference system.
575 // Input: unique key to locate a basic block.
577 // Output: Ymin, Ymax, Zmin, Zmax of a basic block (chip for SPD)
578 // Return: kTRUE if computation was succesfully, kFALSE otherwise
580 if(key>=kNModule*kNChip)
581 {AliWarning("GetBlockBoundaries: you asked for a non existing key"); return kFALSE;}
582 UInt_t chip=GetChipFromKey(key);
583 zmn=GetLocZFromCol(chip*kNCol);
584 zmx=GetLocZFromCol((chip+1)*kNCol);
585 xmn=GetLocXFromRow(0);
586 xmx=GetLocXFromRow(kNRow);
589 if(zmx<zmn) {zmn=zmx; zmx=tmp;}
591 if(xmx<xmn) {xmn=xmx; xmx=tmp;}
594 //________________________________________________________
595 Float_t AliITSPlaneEffSPD::GetLocXFromRow(const UInt_t row) const {
597 // This method return the local (i.e. detector reference system) lower x coordinate
598 // of the row. To get the central value of a given row, you can do
599 // 1/2*[LocXFromRow(row)+LocXFromRow(row+1)].
601 // Input: row number in the range [0,kNRow]
602 // Output: lower local X coordinate of this row.
604 if(row>kNRow) // not >= ! allow also computation of upper limit of the last row.
605 {AliError("LocYFromRow: you asked for a non existing row"); return 9999999.;}
606 // Use only AliITSsegmentationSPD
607 AliITSsegmentationSPD spd;
609 if(row==kNRow) spd.CellBoundries((Int_t)row-1,0,dummy,x,dummy,dummy);
610 else spd.CellBoundries((Int_t)row,0,x,dummy,dummy,dummy);
614 //________________________________________________________
615 Float_t AliITSPlaneEffSPD::GetLocZFromCol(const UInt_t col) const {
617 // This method return the local (i.e. detector reference system) lower Z coordinate
618 // of the column. To get the central value of a given column, you can do
619 // 1/2*[LocZFromCol(col)+LocZFromCol(col+1)].
621 // Input: col number in the range [0,kNChip*kNCol]
622 // Output: lower local Y coordinate of this row.
624 if(col>kNChip*kNCol) // not >= ! allow also computation of upper limit of the last column
625 {AliError("LocZFromCol: you asked for a non existing column"); return 9999999.;}
626 // Use only AliITSsegmentationSPD
627 AliITSsegmentationSPD spd;
629 if(col==kNChip*kNCol) spd.CellBoundries(0,(Int_t)col-1,dummy,dummy,dummy,y);
630 else spd.CellBoundries(0,(Int_t)col,dummy,dummy,y,dummy);
634 //__________________________________________________________
635 void AliITSPlaneEffSPD::InitHistos() {
636 // for the moment let's create the histograms
638 TString histnameResX="HistResX_mod_",aux;
639 TString histnameResZ="HistResZ_mod_";
640 TString histnameResXZ="HistResXZ_mod_";
641 TString histnameClusterType="HistClusterType_mod_";
642 TString histnameResXclu="HistResX_mod_";
643 TString histnameResZclu="HistResZ_mod_";
644 TString histnameResXchip="HistResX_mod_";
645 TString histnameResZchip="HistResZ_mod_";
646 TString profnameResXvsPhi="ProfResXvsPhi_mod_";
647 TString profnameResZvsDip="ProfResZvsDip_mod_";
648 TString profnameResXvsPhiclu="ProfResXvsPhi_mod_";
649 TString profnameResZvsDipclu="ProfResZvsDip_mod_";
650 TString histnameTrackErrX="HistTrackErrX_mod_";
651 TString histnameTrackErrZ="HistTrackErrZ_mod_";
652 TString histnameClusErrX="HistClusErrX_mod_";
653 TString histnameClusErrZ="HistClusErrZ_mod_";
656 TH1::AddDirectory(kFALSE);
658 fHisResX=new TH1F*[kNHisto];
659 fHisResZ=new TH1F*[kNHisto];
660 fHisResXZ=new TH2F*[kNHisto];
661 fHisClusterSize=new TH2I*[kNHisto];
662 fHisResXclu=new TH1F**[kNHisto];
663 fHisResZclu=new TH1F**[kNHisto];
664 fHisResXchip=new TH1F**[kNHisto];
665 fHisResZchip=new TH1F**[kNHisto];
666 fProfResXvsPhi=new TProfile*[kNHisto];
667 fProfResZvsDip=new TProfile*[kNHisto];
668 fProfResXvsPhiclu=new TProfile**[kNHisto];
669 fProfResZvsDipclu=new TProfile**[kNHisto];
670 fHisTrackErrX=new TH1F*[kNHisto];
671 fHisTrackErrZ=new TH1F*[kNHisto];
672 fHisClusErrX=new TH1F*[kNHisto];
673 fHisClusErrZ=new TH1F*[kNHisto];
675 for (Int_t nhist=0;nhist<kNHisto;nhist++){
678 fHisResX[nhist]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
679 fHisResX[nhist]->SetName(aux.Data());
680 fHisResX[nhist]->SetTitle(aux.Data());
684 fHisResZ[nhist]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
685 fHisResZ[nhist]->SetName(aux.Data());
686 fHisResZ[nhist]->SetTitle(aux.Data());
690 fHisResXZ[nhist]=new TH2F("histname","histname",80,-0.16,0.16,80,-0.32,0.32); // binning:
691 fHisResXZ[nhist]->SetName(aux.Data()); // 40 micron in x;
692 fHisResXZ[nhist]->SetTitle(aux.Data()); // 80 micron in z;
694 aux=histnameClusterType;
696 fHisClusterSize[nhist]=new TH2I("histname","histname",10,0.5,10.5,10,0.5,10.5);
697 fHisClusterSize[nhist]->SetName(aux.Data());
698 fHisClusterSize[nhist]->SetTitle(aux.Data());
700 fHisResXclu[nhist]=new TH1F*[kNclu];
701 fHisResZclu[nhist]=new TH1F*[kNclu];
702 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
706 aux+=clu+1; // clu=0 --> cluster size 1
707 fHisResXclu[nhist][clu]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
708 fHisResXclu[nhist][clu]->SetName(aux.Data());
709 fHisResXclu[nhist][clu]->SetTitle(aux.Data());
714 aux+=clu+1; // clu=0 --> cluster size 1
715 fHisResZclu[nhist][clu]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
716 fHisResZclu[nhist][clu]->SetName(aux.Data());
717 fHisResZclu[nhist][clu]->SetTitle(aux.Data());
720 fHisResXchip[nhist]=new TH1F*[kNChip];
721 fHisResZchip[nhist]=new TH1F*[kNChip];
722 for(Int_t chip=0; chip<kNChip; chip++) {
723 aux=histnameResXchip;
727 fHisResXchip[nhist][chip]=new TH1F("histname","histname",800,-0.32,0.32); // +- 3200 micron; 1 bin=8 micron
728 fHisResXchip[nhist][chip]->SetName(aux.Data());
729 fHisResXchip[nhist][chip]->SetTitle(aux.Data());
731 aux=histnameResZchip;
735 fHisResZchip[nhist][chip]=new TH1F("histname","histname",300,-0.48,0.48); // +-4800 micron; 1 bin=32 micron
736 fHisResZchip[nhist][chip]->SetName(aux.Data());
737 fHisResZchip[nhist][chip]->SetTitle(aux.Data());
740 aux=histnameTrackErrX;
742 fHisTrackErrX[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
743 fHisTrackErrX[nhist]->SetName(aux.Data());
744 fHisTrackErrX[nhist]->SetTitle(aux.Data());
746 aux=histnameTrackErrZ;
748 fHisTrackErrZ[nhist]=new TH1F("histname","histname",200,0.,0.32); // 0-3200 micron; 1 bin=16 micron
749 fHisTrackErrZ[nhist]->SetName(aux.Data());
750 fHisTrackErrZ[nhist]->SetTitle(aux.Data());
752 aux=histnameClusErrX;
754 fHisClusErrX[nhist]=new TH1F("histname","histname",400,0.,0.08); // 0-800 micron; 1 bin=2 micron
755 fHisClusErrX[nhist]->SetName(aux.Data());
756 fHisClusErrX[nhist]->SetTitle(aux.Data());
758 aux=histnameClusErrZ;
760 fHisClusErrZ[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
761 fHisClusErrZ[nhist]->SetName(aux.Data());
762 fHisClusErrZ[nhist]->SetTitle(aux.Data());
764 aux=profnameResXvsPhi;
766 fProfResXvsPhi[nhist]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40°
767 fProfResXvsPhi[nhist]->SetName(aux.Data()); // bin width: 2°
768 fProfResXvsPhi[nhist]->SetTitle(aux.Data());
770 aux=profnameResZvsDip;
772 fProfResZvsDip[nhist]=new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-4°
773 fProfResZvsDip[nhist]->SetName(aux.Data()); // bin width: 3°
774 fProfResZvsDip[nhist]->SetTitle(aux.Data());
776 fProfResXvsPhiclu[nhist]=new TProfile*[kNclu];
777 fProfResZvsDipclu[nhist]=new TProfile*[kNclu];
778 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
779 aux=profnameResXvsPhiclu;
782 aux+=clu+1; // clu=0 --> cluster size 1
783 fProfResXvsPhiclu[nhist][clu]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40
784 fProfResXvsPhiclu[nhist][clu]->SetName(aux.Data()); // bin width: 2°
785 fProfResXvsPhiclu[nhist][clu]->SetTitle(aux.Data());
787 aux=profnameResZvsDipclu;
790 aux+=clu+1; // clu=0 --> cluster size 1
791 fProfResZvsDipclu[nhist][clu]= new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-7°
792 fProfResZvsDipclu[nhist][clu]->SetName(aux.Data()); // bin width: 3°
793 fProfResZvsDipclu[nhist][clu]->SetTitle(aux.Data());
796 } // end loop on module
798 TH1::AddDirectory(kTRUE);
802 //__________________________________________________________
803 void AliITSPlaneEffSPD::DeleteHistos() {
805 for (Int_t i=0; i<kNHisto; i++ ) delete fHisResX[i];
806 delete [] fHisResX; fHisResX=0;
809 for (Int_t i=0; i<kNHisto; i++ ) delete fHisResZ[i];
810 delete [] fHisResZ; fHisResZ=0;
813 for (Int_t i=0; i<kNHisto; i++ ) delete fHisResXZ[i];
814 delete [] fHisResXZ; fHisResXZ=0;
816 if(fHisClusterSize) {
817 for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusterSize[i];
818 delete [] fHisClusterSize; fHisClusterSize=0;
821 for (Int_t i=0; i<kNHisto; i++ ) {
822 for (Int_t clu=0; clu<kNclu; clu++) if (fHisResXclu[i][clu]) delete fHisResXclu[i][clu];
823 delete [] fHisResXclu[i];
825 delete [] fHisResXclu;
829 for (Int_t i=0; i<kNHisto; i++ ) {
830 for (Int_t clu=0; clu<kNclu; clu++) if (fHisResZclu[i][clu]) delete fHisResZclu[i][clu];
831 delete [] fHisResZclu[i];
833 delete [] fHisResZclu;
837 for (Int_t i=0; i<kNHisto; i++ ) {
838 for (Int_t chip=0; chip<kNChip; chip++) if (fHisResXchip[i][chip]) delete fHisResXchip[i][chip];
839 delete [] fHisResXchip[i];
841 delete [] fHisResXchip;
845 for (Int_t i=0; i<kNHisto; i++ ) {
846 for (Int_t chip=0; chip<kNChip; chip++) if (fHisResZchip[i][chip]) delete fHisResZchip[i][chip];
847 delete [] fHisResZchip[i];
849 delete [] fHisResZchip;
853 for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrX[i];
854 delete [] fHisTrackErrX; fHisTrackErrX=0;
857 for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrZ[i];
858 delete [] fHisTrackErrZ; fHisTrackErrZ=0;
861 for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrX[i];
862 delete [] fHisClusErrX; fHisClusErrX=0;
865 for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrZ[i];
866 delete [] fHisClusErrZ; fHisClusErrZ=0;
869 for (Int_t i=0; i<kNHisto; i++ ) delete fProfResXvsPhi[i];
870 delete [] fProfResXvsPhi; fProfResXvsPhi=0;
873 for (Int_t i=0; i<kNHisto; i++ ) delete fProfResZvsDip[i];
874 delete [] fProfResZvsDip; fProfResZvsDip=0;
876 if(fProfResXvsPhiclu) {
877 for (Int_t i=0; i<kNHisto; i++ ) {
878 for (Int_t clu=0; clu<kNclu; clu++) if (fProfResXvsPhiclu[i][clu]) delete fProfResXvsPhiclu[i][clu];
879 delete [] fProfResXvsPhiclu[i];
881 delete [] fProfResXvsPhiclu;
882 fProfResXvsPhiclu = 0;
884 if(fProfResZvsDipclu) {
885 for (Int_t i=0; i<kNHisto; i++ ) {
886 for (Int_t clu=0; clu<kNclu; clu++) if (fProfResZvsDipclu[i][clu]) delete fProfResZvsDipclu[i][clu];
887 delete [] fProfResZvsDipclu[i];
889 delete [] fProfResZvsDipclu;
890 fProfResZvsDipclu = 0;
895 //__________________________________________________________
896 Bool_t AliITSPlaneEffSPD::FillHistos(UInt_t key, Bool_t found,
897 Float_t *tr, Float_t *clu, Int_t *csize, Float_t *angtrkmod) {
898 // this method fill the histograms
899 // input: - key: unique key of the basic block
900 // - found: Boolean to asses whether a cluster has been associated to the track or not
901 // - tr[0],tr[1] local X and Z coordinates of the track prediction, respectively
902 // - tr[2],tr[3] error on local X and Z coordinates of the track prediction, respectively
903 // - clu[0],clu[1] local X and Z coordinates of the cluster associated to the track, respectively
904 // - clu[2],clu[3] error on local X and Z coordinates of the cluster associated to the track, respectively
905 // - csize[0][1] cluster size in X and Z, respectively
906 // - angtrkmod[0],angtrkmod[1]
907 // output: kTRUE if filling was succesfull kFALSE otherwise
908 // side effects: updating of the histograms.
911 AliWarning("FillHistos: histograms do not exist! Call SetCreateHistos(kTRUE) first");
914 if(key>=kNModule*kNChip)
915 {AliWarning("FillHistos: you asked for a non existing key"); return kFALSE;}
916 Int_t id=GetModFromKey(key);
917 Int_t chip=GetChipFromKey(key);
919 {AliWarning("FillHistos: you want to fill a non-existing histos"); return kFALSE;}
921 Float_t resx=tr[0]-clu[0];
922 Float_t resz=tr[1]-clu[1];
923 fHisResX[id]->Fill(resx);
924 fHisResZ[id]->Fill(resz);
925 fHisResXZ[id]->Fill(resx,resz);
926 fHisClusterSize[id]->Fill((Double_t)csize[0],(Double_t)csize[1]);
927 if(csize[0]>0 && csize[0]<=kNclu) fHisResXclu[id][csize[0]-1]->Fill(resx);
928 if(csize[1]>0 && csize[1]<=kNclu) fHisResZclu[id][csize[1]-1]->Fill(resz);
929 fHisResXchip[id][chip]->Fill(resx);
930 fHisResZchip[id][chip]->Fill(resz);
931 fProfResXvsPhi[id]->Fill(angtrkmod[0],resx);
932 fProfResZvsDip[id]->Fill(angtrkmod[1],resz);
933 if(csize[0]>0 && csize[0]<=kNclu) fProfResXvsPhiclu[id][csize[0]-1]->Fill(angtrkmod[0],resx);
934 if(csize[1]>0 && csize[1]<=kNclu) fProfResZvsDipclu[id][csize[1]-1]->Fill(angtrkmod[1],resz);
936 fHisTrackErrX[id]->Fill(tr[2]);
937 fHisTrackErrZ[id]->Fill(tr[3]);
938 fHisClusErrX[id]->Fill(clu[2]);
939 fHisClusErrZ[id]->Fill(clu[3]);
942 //__________________________________________________________
943 Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) {
945 // Saves the histograms into a tree and saves the trees into a file
947 if (!fHis) return kFALSE;
948 if (filename.IsNull() || filename.IsWhitespace()) {
949 AliWarning("WriteHistosToFile: null output filename!");
953 TFile *hFile=new TFile(filename.Data(),option,
954 "The File containing the TREEs with ITS PlaneEff Histos");
955 TTree *SPDTree=new TTree("SPDTree","Tree whith Residuals and Cluster Type distributions for SPD");
958 TH2I *histClusterType;
959 TH1F *histXclu[kNclu];
960 TH1F *histZclu[kNclu];
961 TH1F *histXchip[kNChip];
962 TH1F *histZchip[kNChip];
963 TH1F *histTrErrZ,*histTrErrX;
964 TH1F *histClErrZ,*histClErrX;
965 TProfile *profXvsPhi,*profZvsDip;
966 TProfile *profXvsPhiclu[kNclu],*profZvsDipclu[kNclu];
971 histClusterType=new TH2I();
972 for(Int_t clu=0;clu<kNclu;clu++) {
973 histXclu[clu]=new TH1F();
974 histZclu[clu]=new TH1F();
976 for(Int_t chip=0;chip<kNChip;chip++) {
977 histXchip[chip]=new TH1F();
978 histZchip[chip]=new TH1F();
980 histTrErrX=new TH1F();
981 histTrErrZ=new TH1F();
982 histClErrX=new TH1F();
983 histClErrZ=new TH1F();
984 profXvsPhi=new TProfile();
985 profZvsDip=new TProfile();
986 for(Int_t clu=0;clu<kNclu;clu++) {
987 profXvsPhiclu[clu]=new TProfile();
988 profZvsDipclu[clu]=new TProfile();
992 SPDTree->Branch("histX","TH1F",&histX,128000,0);
993 SPDTree->Branch("histZ","TH1F",&histZ,128000,0);
994 SPDTree->Branch("histXZ","TH2F",&histXZ,128000,0);
995 SPDTree->Branch("histClusterType","TH2I",&histClusterType,128000,0);
996 for(Int_t clu=0;clu<kNclu;clu++) {
997 snprintf(branchname,50,"histXclu_%d",clu+1);
998 SPDTree->Branch(branchname,"TH1F",&histXclu[clu],128000,0);
999 snprintf(branchname,50,"histZclu_%d",clu+1);
1000 SPDTree->Branch(branchname,"TH1F",&histZclu[clu],128000,0);
1002 for(Int_t chip=0;chip<kNChip;chip++) {
1003 snprintf(branchname,50,"histXchip_%d",chip);
1004 SPDTree->Branch(branchname,"TH1F",&histXchip[chip],128000,0);
1005 snprintf(branchname,50,"histZchip_%d",chip);
1006 SPDTree->Branch(branchname,"TH1F",&histZchip[chip],128000,0);
1008 SPDTree->Branch("histTrErrX","TH1F",&histTrErrX,128000,0);
1009 SPDTree->Branch("histTrErrZ","TH1F",&histTrErrZ,128000,0);
1010 SPDTree->Branch("histClErrX","TH1F",&histClErrX,128000,0);
1011 SPDTree->Branch("histClErrZ","TH1F",&histClErrZ,128000,0);
1012 SPDTree->Branch("profXvsPhi","TProfile",&profXvsPhi,128000,0);
1013 SPDTree->Branch("profZvsDip","TProfile",&profZvsDip,128000,0);
1014 for(Int_t clu=0;clu<kNclu;clu++) {
1015 snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
1016 SPDTree->Branch(branchname,"TProfile",&profXvsPhiclu[clu],128000,0);
1017 snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
1018 SPDTree->Branch(branchname,"TProfile",&profZvsDipclu[clu],128000,0);
1021 for(Int_t j=0;j<kNHisto;j++){
1024 histXZ=fHisResXZ[j];
1025 histClusterType=fHisClusterSize[j];
1026 for(Int_t clu=0;clu<kNclu;clu++) {
1027 histXclu[clu]=fHisResXclu[j][clu];
1028 histZclu[clu]=fHisResZclu[j][clu];
1030 for(Int_t chip=0;chip<kNChip;chip++) {
1031 histXchip[chip]=fHisResXchip[j][chip];
1032 histZchip[chip]=fHisResZchip[j][chip];
1034 histTrErrX=fHisTrackErrX[j];
1035 histTrErrZ=fHisTrackErrZ[j];
1036 histClErrX=fHisClusErrX[j];
1037 histClErrZ=fHisClusErrZ[j];
1038 profXvsPhi=fProfResXvsPhi[j];
1039 profZvsDip=fProfResZvsDip[j];
1040 for(Int_t clu=0;clu<kNclu;clu++) {
1041 profXvsPhiclu[clu]=fProfResXvsPhiclu[j][clu];
1042 profZvsDipclu[clu]=fProfResZvsDipclu[j][clu];
1051 //__________________________________________________________
1052 Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) {
1054 // Read histograms from an already existing file
1056 if (!fHis) return kFALSE;
1057 if (filename.IsNull() || filename.IsWhitespace()) {
1058 AliWarning("ReadHistosFromFile: incorrect output filename!");
1061 char branchname[51];
1068 TFile *file=TFile::Open(filename.Data(),"READONLY");
1070 if (!file || file->IsZombie()) {
1071 AliWarning(Form("Can't open %s !",filename.Data()));
1075 TTree *tree = (TTree*) file->Get("SPDTree");
1077 TBranch *histX = (TBranch*) tree->GetBranch("histX");
1078 TBranch *histZ = (TBranch*) tree->GetBranch("histZ");
1079 TBranch *histXZ = (TBranch*) tree->GetBranch("histXZ");
1080 TBranch *histClusterType = (TBranch*) tree->GetBranch("histClusterType");
1082 TBranch *histXclu[kNclu], *histZclu[kNclu];
1083 for(Int_t clu=0; clu<kNclu; clu++) {
1084 snprintf(branchname,50,"histXclu_%d",clu+1);
1085 histXclu[clu]= (TBranch*) tree->GetBranch(branchname);
1086 snprintf(branchname,50,"histZclu_%d",clu+1);
1087 histZclu[clu]= (TBranch*) tree->GetBranch(branchname);
1090 TBranch *histXchip[kNChip], *histZchip[kNChip];
1091 for(Int_t chip=0; chip<kNChip; chip++) {
1092 snprintf(branchname,50,"histXchip_%d",chip);
1093 histXchip[chip]= (TBranch*) tree->GetBranch(branchname);
1094 snprintf(branchname,50,"histZchip_%d",chip);
1095 histZchip[chip]= (TBranch*) tree->GetBranch(branchname);
1098 TBranch *histTrErrX = (TBranch*) tree->GetBranch("histTrErrX");
1099 TBranch *histTrErrZ = (TBranch*) tree->GetBranch("histTrErrZ");
1100 TBranch *histClErrX = (TBranch*) tree->GetBranch("histClErrX");
1101 TBranch *histClErrZ = (TBranch*) tree->GetBranch("histClErrZ");
1102 TBranch *profXvsPhi = (TBranch*) tree->GetBranch("profXvsPhi");
1103 TBranch *profZvsDip = (TBranch*) tree->GetBranch("profZvsDip");
1105 TBranch *profXvsPhiclu[kNclu], *profZvsDipclu[kNclu];
1106 for(Int_t clu=0; clu<kNclu; clu++) {
1107 snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
1108 profXvsPhiclu[clu]= (TBranch*) tree->GetBranch(branchname);
1109 snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
1110 profZvsDipclu[clu]= (TBranch*) tree->GetBranch(branchname);
1115 Int_t nevent = (Int_t)histX->GetEntries();
1117 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1118 histX->SetAddress(&h);
1119 for(Int_t j=0;j<kNHisto;j++){
1121 fHisResX[j]->Add(h);
1124 nevent = (Int_t)histZ->GetEntries();
1126 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1127 histZ->SetAddress(&h);
1128 for(Int_t j=0;j<kNHisto;j++){
1130 fHisResZ[j]->Add(h);
1133 nevent = (Int_t)histXZ->GetEntries();
1135 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1136 histXZ->SetAddress(&h2);
1137 for(Int_t j=0;j<kNHisto;j++){
1138 histXZ->GetEntry(j);
1139 fHisResXZ[j]->Add(h2);
1142 nevent = (Int_t)histClusterType->GetEntries();
1144 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1145 histClusterType->SetAddress(&h2i);
1146 for(Int_t j=0;j<kNHisto;j++){
1147 histClusterType->GetEntry(j);
1148 fHisClusterSize[j]->Add(h2i);
1151 for(Int_t clu=0; clu<kNclu; clu++) {
1153 nevent = (Int_t)histXclu[clu]->GetEntries();
1155 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1156 histXclu[clu]->SetAddress(&h);
1157 for(Int_t j=0;j<kNHisto;j++){
1158 histXclu[clu]->GetEntry(j);
1159 fHisResXclu[j][clu]->Add(h);
1162 nevent = (Int_t)histZclu[clu]->GetEntries();
1164 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1165 histZclu[clu]->SetAddress(&h);
1166 for(Int_t j=0;j<kNHisto;j++){
1167 histZclu[clu]->GetEntry(j);
1168 fHisResZclu[j][clu]->Add(h);
1173 for(Int_t chip=0; chip<kNChip; chip++) {
1175 nevent = (Int_t)histXchip[chip]->GetEntries();
1177 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1178 histXchip[chip]->SetAddress(&h);
1179 for(Int_t j=0;j<kNHisto;j++){
1180 histXchip[chip]->GetEntry(j);
1181 fHisResXchip[j][chip]->Add(h);
1184 nevent = (Int_t)histZchip[chip]->GetEntries();
1186 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1187 histZchip[chip]->SetAddress(&h);
1188 for(Int_t j=0;j<kNHisto;j++){
1189 histZchip[chip]->GetEntry(j);
1190 fHisResZchip[j][chip]->Add(h);
1194 nevent = (Int_t)histTrErrX->GetEntries();
1196 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1197 histTrErrX->SetAddress(&h);
1198 for(Int_t j=0;j<kNHisto;j++){
1199 histTrErrX->GetEntry(j);
1200 fHisTrackErrX[j]->Add(h);
1203 nevent = (Int_t)histTrErrZ->GetEntries();
1205 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1206 histTrErrZ->SetAddress(&h);
1207 for(Int_t j=0;j<kNHisto;j++){
1208 histTrErrZ->GetEntry(j);
1209 fHisTrackErrZ[j]->Add(h);
1212 nevent = (Int_t)histClErrX->GetEntries();
1214 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1215 histClErrX->SetAddress(&h);
1216 for(Int_t j=0;j<kNHisto;j++){
1217 histClErrX->GetEntry(j);
1218 fHisClusErrX[j]->Add(h);
1221 nevent = (Int_t)histClErrZ->GetEntries();
1223 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1224 histClErrZ->SetAddress(&h);
1225 for(Int_t j=0;j<kNHisto;j++){
1226 histClErrZ->GetEntry(j);
1227 fHisClusErrZ[j]->Add(h);
1230 nevent = (Int_t)profXvsPhi->GetEntries();
1232 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1233 profXvsPhi->SetAddress(&p);
1234 for(Int_t j=0;j<kNHisto;j++){
1235 profXvsPhi->GetEntry(j);
1236 fProfResXvsPhi[j]->Add(p);
1239 nevent = (Int_t)profZvsDip->GetEntries();
1241 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1242 profZvsDip->SetAddress(&p);
1243 for(Int_t j=0;j<kNHisto;j++){
1244 profZvsDip->GetEntry(j);
1245 fProfResZvsDip[j]->Add(p);
1248 for(Int_t clu=0; clu<kNclu; clu++) {
1250 nevent = (Int_t)profXvsPhiclu[clu]->GetEntries();
1252 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1253 profXvsPhiclu[clu]->SetAddress(&p);
1254 for(Int_t j=0;j<kNHisto;j++){
1255 profXvsPhiclu[clu]->GetEntry(j);
1256 fProfResXvsPhiclu[j][clu]->Add(p);
1259 nevent = (Int_t)profZvsDipclu[clu]->GetEntries();
1261 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1262 profZvsDipclu[clu]->SetAddress(&p);
1263 for(Int_t j=0;j<kNHisto;j++){
1264 profZvsDipclu[clu]->GetEntry(j);
1265 fProfResZvsDipclu[j][clu]->Add(p);