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++){
63 // default constructor
68 AliDebug(1,Form("Calling default constructor"));
70 //______________________________________________________________________
71 AliITSPlaneEffSPD::~AliITSPlaneEffSPD(){
81 //______________________________________________________________________
82 AliITSPlaneEffSPD::AliITSPlaneEffSPD(const AliITSPlaneEffSPD &s) : AliITSPlaneEff(s),
103 // AliITSPlaneEffSPD &s The original class for which
104 // this class is a copy of
109 for (UInt_t i=0; i<kNModule*kNChip; i++){
110 fFound[i]=s.fFound[i];
111 fTried[i]=s.fTried[i];
115 for(Int_t i=0; i<kNHisto; i++) {
116 s.fHisResX[i]->Copy(*fHisResX[i]);
117 s.fHisResZ[i]->Copy(*fHisResZ[i]);
118 s.fHisResXZ[i]->Copy(*fHisResXZ[i]);
119 s.fHisClusterSize[i]->Copy(*fHisClusterSize[i]);
120 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
121 s.fHisResXclu[i][clu]->Copy(*fHisResXclu[i][clu]);
122 s.fHisResZclu[i][clu]->Copy(*fHisResZclu[i][clu]);
123 s.fProfResXvsPhiclu[i][clu]->Copy(*fProfResXvsPhiclu[i][clu]);
124 s.fProfResZvsDipclu[i][clu]->Copy(*fProfResZvsDipclu[i][clu]);
126 for(Int_t chip=0; chip<kNChip; chip++) {
127 s.fHisResXchip[i][chip]->Copy(*fHisResXchip[i][chip]);
128 s.fHisResZchip[i][chip]->Copy(*fHisResZchip[i][chip]);
130 s.fProfResXvsPhi[i]->Copy(*fProfResXvsPhi[i]);
131 s.fProfResZvsDip[i]->Copy(*fProfResZvsDip[i]);
132 s.fHisTrackErrX[i]->Copy(*fHisTrackErrX[i]);
133 s.fHisTrackErrZ[i]->Copy(*fHisTrackErrZ[i]);
134 s.fHisClusErrX[i]->Copy(*fHisClusErrX[i]);
135 s.fHisClusErrZ[i]->Copy(*fHisClusErrZ[i]);
139 //_________________________________________________________________________
140 AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator+=(const AliITSPlaneEffSPD &add){
141 // Add-to-me operator
143 // const AliITSPlaneEffSPD &add simulation class to be added
148 for (UInt_t i=0; i<kNModule*kNChip; i++){
149 fFound[i] += add.fFound[i];
150 fTried[i] += add.fTried[i];
152 if(fHis && add.fHis) {
153 for(Int_t i=0; i<kNHisto; i++) {
154 fHisResX[i]->Add(add.fHisResX[i]);
155 fHisResZ[i]->Add(add.fHisResZ[i]);
156 fHisResXZ[i]->Add(add.fHisResXZ[i]);
157 fHisClusterSize[i]->Add(add.fHisClusterSize[i]);
158 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
159 fHisResXclu[i][clu]->Add(add.fHisResXclu[i][clu]);
160 fHisResZclu[i][clu]->Add(add.fHisResZclu[i][clu]);
161 fProfResXvsPhiclu[i][clu]->Add(add.fProfResXvsPhiclu[i][clu]);
162 fProfResZvsDipclu[i][clu]->Add(add.fProfResZvsDipclu[i][clu]);
164 for(Int_t chip=0; chip<kNChip; chip++) {
165 fHisResXchip[i][chip]->Add(add.fHisResXchip[i][chip]);
166 fHisResZchip[i][chip]->Add(add.fHisResZchip[i][chip]);
168 fProfResXvsPhi[i]->Add(add.fProfResXvsPhi[i]);
169 fProfResZvsDip[i]->Add(add.fProfResZvsDip[i]);
170 fHisTrackErrX[i]->Add(add.fHisTrackErrX[i]);
171 fHisTrackErrZ[i]->Add(add.fHisTrackErrZ[i]);
172 fHisClusErrX[i]->Add(add.fHisClusErrX[i]);
173 fHisClusErrZ[i]->Add(add.fHisClusErrZ[i]);
178 //______________________________________________________________________
179 AliITSPlaneEffSPD& AliITSPlaneEffSPD::operator=(const
180 AliITSPlaneEffSPD &s){
181 // Assignment operator
183 // AliITSPlaneEffSPD &s The original class for which
184 // this class is a copy of
189 if(this==&s) return *this;
193 //______________________________________________________________________
194 void AliITSPlaneEffSPD::Copy(TObject &obj) const {
195 // protected method. copy this to obj
196 AliITSPlaneEff::Copy(obj);
197 AliITSPlaneEffSPD& target = (AliITSPlaneEffSPD &) obj;
198 for(Int_t i=0;i<kNModule*kNChip;i++) {
199 target.fFound[i] = fFound[i];
200 target.fTried[i] = fTried[i];
205 //_______________________________________________________________________
206 void AliITSPlaneEffSPD::CopyHistos(AliITSPlaneEffSPD &target) const {
207 // protected method: copy histos from this to target
208 target.fHis = fHis; // this is redundant only in some cases. Leave as it is.
210 target.fHisResX=new TH1F*[kNHisto];
211 target.fHisResZ=new TH1F*[kNHisto];
212 target.fHisResXZ=new TH2F*[kNHisto];
213 target.fHisClusterSize=new TH2I*[kNHisto];
214 target.fHisResXclu=new TH1F**[kNHisto];
215 target.fHisResZclu=new TH1F**[kNHisto];
216 target.fHisResXchip=new TH1F**[kNHisto];
217 target.fHisResZchip=new TH1F**[kNHisto];
218 target.fProfResXvsPhi=new TProfile*[kNHisto];
219 target.fProfResZvsDip=new TProfile*[kNHisto];
220 target.fProfResXvsPhiclu=new TProfile**[kNHisto];
221 target.fProfResZvsDipclu=new TProfile**[kNHisto];
222 target.fHisTrackErrX=new TH1F*[kNHisto];
223 target.fHisTrackErrZ=new TH1F*[kNHisto];
224 target.fHisClusErrX=new TH1F*[kNHisto];
225 target.fHisClusErrZ=new TH1F*[kNHisto];
226 for(Int_t i=0; i<kNHisto; i++) {
227 target.fHisResX[i] = new TH1F(*fHisResX[i]);
228 target.fHisResZ[i] = new TH1F(*fHisResZ[i]);
229 target.fHisResXZ[i] = new TH2F(*fHisResXZ[i]);
230 target.fHisClusterSize[i] = new TH2I(*fHisClusterSize[i]);
231 target.fHisResXclu[i]=new TH1F*[kNclu];
232 target.fHisResZclu[i]=new TH1F*[kNclu];
233 target.fProfResXvsPhiclu[i]=new TProfile*[kNclu];
234 target.fProfResZvsDipclu[i]=new TProfile*[kNclu];
235 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
236 target.fHisResXclu[i][clu] = new TH1F(*fHisResXclu[i][clu]);
237 target.fHisResZclu[i][clu] = new TH1F(*fHisResZclu[i][clu]);
238 target.fProfResXvsPhiclu[i][clu] = new TProfile(*fProfResXvsPhiclu[i][clu]);
239 target.fProfResZvsDipclu[i][clu] = new TProfile(*fProfResZvsDipclu[i][clu]);
241 target.fHisResXchip[i]=new TH1F*[kNChip];
242 target.fHisResZchip[i]=new TH1F*[kNChip];
243 for(Int_t chip=0; chip<kNChip; chip++) {
244 target.fHisResXchip[i][chip] = new TH1F(*fHisResXchip[i][chip]);
245 target.fHisResZchip[i][chip] = new TH1F(*fHisResZchip[i][chip]);
247 target.fProfResXvsPhi[i] = new TProfile(*fProfResXvsPhi[i]);
248 target.fProfResZvsDip[i] = new TProfile(*fProfResZvsDip[i]);
249 target.fHisTrackErrX[i] = new TH1F(*fHisTrackErrX[i]);
250 target.fHisTrackErrZ[i] = new TH1F(*fHisTrackErrZ[i]);
251 target.fHisClusErrX[i] = new TH1F(*fHisClusErrX[i]);
252 target.fHisClusErrZ[i] = new TH1F(*fHisClusErrZ[i]);
258 //_______________________________________________________________________
259 Int_t AliITSPlaneEffSPD::GetMissingTracksForGivenEff(Double_t eff, Double_t RelErr,
260 UInt_t im, UInt_t ic) const {
262 // Estimate the number of tracks still to be collected to attain a
263 // given efficiency eff, with relative error RelErr
265 // eff -> Expected efficiency (e.g. those from actual estimate)
266 // RelErr -> tollerance [0,1]
267 // im -> module number [0,249]
268 // ic -> chip number [0,4]
270 // Return: the estimated n. of tracks
272 if (im>=kNModule || ic>=kNChip)
273 {AliError("GetMissingTracksForGivenEff: you asked for a non existing chip");
276 UInt_t key=GetKey(im,ic);
277 if(key<kNModule*kNChip) return GetNTracksForGivenEff(eff,RelErr)-fTried[key];
281 //_________________________________________________________________________
282 Double_t AliITSPlaneEffSPD::PlaneEff(const UInt_t im,const UInt_t ic) const {
283 // Compute the efficiency for a basic block,
285 // im -> module number [0,249]
286 // ic -> chip number [0,4]
287 if (im>=kNModule || ic>=kNChip)
288 {AliError("PlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;}
289 UInt_t key=GetKey(im,ic);
292 if(key<kNModule*kNChip) {
296 return AliITSPlaneEff::PlaneEff(nf,nt);
298 //_________________________________________________________________________
299 Double_t AliITSPlaneEffSPD::ErrPlaneEff(const UInt_t im,const UInt_t ic) const {
300 // Compute the statistical error on efficiency for a basic block,
301 // using binomial statistics
303 // im -> module number [0,249]
304 // ic -> chip number [0,4]
305 if (im>=kNModule || ic>=kNChip)
306 {AliError("ErrPlaneEff(Uint_t,Uint_t): you asked for a non existing chip"); return -1.;}
307 UInt_t key=GetKey(im,ic);
310 if(key<kNModule*kNChip) {
314 return AliITSPlaneEff::ErrPlaneEff(nf,nt);
316 //_________________________________________________________________________
317 Bool_t AliITSPlaneEffSPD::UpDatePlaneEff(const Bool_t Kfound,
318 const UInt_t im, const UInt_t ic) {
319 // Update efficiency for a basic block
320 if (im>=kNModule || ic>=kNChip)
321 {AliError("UpDatePlaneEff: you asked for a non existing chip"); return kFALSE;}
322 UInt_t key=GetKey(im,ic);
323 if(key<kNModule*kNChip) {
325 if(Kfound) fFound[key]++;
330 //_________________________________________________________________________
331 UInt_t AliITSPlaneEffSPD::GetChipFromCol(const UInt_t col) const {
332 // get chip given the column
333 if(col>=kNCol*kNChip)
334 {AliDebug(1,Form("GetChipFromCol: you asked for a non existing column %d",col)); return 10;}
337 //__________________________________________________________________________
338 UInt_t AliITSPlaneEffSPD::GetKey(const UInt_t mod, const UInt_t chip) const {
339 // get key given a basic block
340 if(mod>=kNModule || chip>=kNChip)
341 {AliWarning("GetKey: you asked for a non existing block"); return 99999;}
342 return mod*kNChip+chip;
344 //__________________________________________________________________________
345 UInt_t AliITSPlaneEffSPD::GetModFromKey(const UInt_t key) const {
347 if(key>=kNModule*kNChip)
348 {AliError("GetModFromKey: you asked for a non existing key"); return 9999;}
351 //__________________________________________________________________________
352 UInt_t AliITSPlaneEffSPD::GetChipFromKey(const UInt_t key) const {
353 // retrieves chip from key
354 if(key>=kNModule*kNChip)
355 {AliError("GetChipFromKey: you asked for a non existing key"); return 999;}
356 return (key%(kNModule*kNChip))%kNChip;
358 //__________________________________________________________________________
359 void AliITSPlaneEffSPD::GetModAndChipFromKey(const UInt_t key,UInt_t& mod,UInt_t& chip) const {
360 // get module and chip from a key
361 if(key>=kNModule*kNChip)
362 {AliError("GetModAndChipFromKey: you asked for a non existing key");
367 chip=(key%(kNModule*kNChip))%kNChip;
370 //____________________________________________________________________________
371 Double_t AliITSPlaneEffSPD::LivePlaneEff(UInt_t key) const {
372 // returns plane efficieny after adding the fraction of sensor which is bad
373 if(key>=kNModule*kNChip)
374 {AliError("LivePlaneEff: you asked for a non existing key");
376 Double_t leff=AliITSPlaneEff::LivePlaneEff(0); // this just for the Warning
377 leff=PlaneEff(key)+GetFracBad(key);
378 return leff>1?1:leff;
380 //____________________________________________________________________________
381 Double_t AliITSPlaneEffSPD::ErrLivePlaneEff(UInt_t key) const {
382 // returns error on live plane efficiency
383 if(key>=kNModule*kNChip)
384 {AliError("ErrLivePlaneEff: you asked for a non existing key");
386 Int_t nf=fFound[key];
387 Double_t triedInLive=GetFracLive(key)*fTried[key];
388 Int_t nt=TMath::Max(nf,TMath::Nint(triedInLive));
389 return AliITSPlaneEff::ErrPlaneEff(nf,nt); // for the time being: to be checked
391 //_____________________________________________________________________________
392 Double_t AliITSPlaneEffSPD::GetFracLive(const UInt_t key) const {
393 // returns the fraction of the sensor which is OK
394 if(key>=kNModule*kNChip)
395 {AliError("GetFracLive: you asked for a non existing key");
397 // Compute the fraction of bad (dead+noisy) detector
398 UInt_t dead=0,noisy=0;
399 GetDeadAndNoisyInChip(key,dead,noisy);
400 Double_t live=dead+noisy;
404 //_____________________________________________________________________________
405 void AliITSPlaneEffSPD::GetDeadAndNoisyInChip(const UInt_t key,
406 UInt_t& nrDeadInChip, UInt_t& nrNoisyInChip) const {
407 // returns the number of dead and noisy pixels
410 if(key>=kNModule*kNChip)
411 {AliError("GetDeadAndNoisyInChip: you asked for a non existing key");
413 // Compute the number of bad (dead+noisy) pixel in a chip
416 {AliError("GetDeadAndNoisyInChip: CDB not inizialized: call InitCDB first");
418 AliCDBManager* man = AliCDBManager::Instance();
419 // retrieve map of dead Pixel
420 AliCDBEntry *cdbSPDDead = man->Get("ITS/Calib/SPDDead", fRunNumber);
423 spdDead = (TObjArray*)cdbSPDDead->GetObject();
425 {AliError("GetDeadAndNoisyInChip: SPDDead not found in CDB");
428 AliError("GetDeadAndNoisyInChip: did not find Calib/SPDDead.");
431 // retrieve map of sparse dead Pixel
432 AliCDBEntry *cdbSPDSparseDead = man->Get("ITS/Calib/SPDSparseDead", fRunNumber);
433 TObjArray* spdSparseDead;
434 if(cdbSPDSparseDead) {
435 spdSparseDead = (TObjArray*)cdbSPDSparseDead->GetObject();
437 {AliError("GetDeadAndNoisyInChip: SPDSparseDead not found in CDB");
440 AliError("GetDeadAndNoisyInChip: did not find Calib/SPDSparseDead.");
444 // retrieve map of noisy Pixel
445 AliCDBEntry *cdbSPDNoisy = man->Get("ITS/Calib/SPDNoisy", fRunNumber);
448 spdNoisy = (TObjArray*)cdbSPDNoisy->GetObject();
450 {AliError("GetDeadAndNoisyInChip: SPDNoisy not found in CDB");
453 AliError("GetDeadAndNoisyInChip: did not find Calib/SPDNoisy.");
457 UInt_t mod=GetModFromKey(key);
458 UInt_t chip=GetChipFromKey(key);
459 // count number of dead
460 AliITSCalibrationSPD* calibSPD=(AliITSCalibrationSPD*) spdDead->At(mod);
461 UInt_t nrDead = calibSPD->GetNrBad();
462 for (UInt_t index=0; index<nrDead; index++) {
463 if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrDeadInChip++;
465 // add the number of sparse dead to the previous dead
466 calibSPD=(AliITSCalibrationSPD*) spdSparseDead->At(mod);
467 UInt_t nrSparseDead = calibSPD->GetNrBad();
468 for (UInt_t index=0; index<nrSparseDead; index++) {
469 if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrDeadInChip++;
471 calibSPD=(AliITSCalibrationSPD*) spdNoisy->At(mod);
472 UInt_t nrNoisy = calibSPD->GetNrBad();
473 for (UInt_t index=0; index<nrNoisy; index++) {
474 if(GetChipFromCol(calibSPD->GetBadColAt(index))==chip) nrNoisyInChip++;
478 //_____________________________________________________________________________
479 Double_t AliITSPlaneEffSPD::GetFracBad(const UInt_t key) const {
480 // returns 1-fractional live
481 if(key>=kNModule*kNChip)
482 {AliError("GetFracBad: you asked for a non existing key");
484 return 1.-GetFracLive(key);
486 //_____________________________________________________________________________
487 Bool_t AliITSPlaneEffSPD::WriteIntoCDB() const {
490 {AliError("WriteIntoCDB: CDB not inizialized. Call InitCDB first");
492 // to be written properly: now only for debugging
493 AliCDBMetaData *md= new AliCDBMetaData(); // metaData describing the object
494 //md->SetObjectClassName("AliITSPlaneEff");
495 md->SetResponsible("Giuseppe Eugenio Bruno");
496 md->SetBeamPeriod(0);
497 md->SetAliRootVersion("head 19/11/07"); //root version
498 AliCDBId id("ITS/PlaneEff/PlaneEffSPD",0,AliCDBRunRange::Infinity());
499 AliITSPlaneEffSPD eff;
501 Bool_t r=AliCDBManager::Instance()->GetDefaultStorage()->Put(&eff,id,md);
505 //_____________________________________________________________________________
506 Bool_t AliITSPlaneEffSPD::ReadFromCDB() {
509 {AliError("ReadFromCDB: CDB not inizialized. Call InitCDB first");
511 AliCDBEntry *cdbEntry = AliCDBManager::Instance()->Get("ITS/PlaneEff/PlaneEffSPD",fRunNumber);
512 if(!cdbEntry) return kFALSE;
513 AliITSPlaneEffSPD* eff= (AliITSPlaneEffSPD*)cdbEntry->GetObject();
514 if(this==eff) return kFALSE;
515 if(fHis) CopyHistos(*eff); // If histos already exist then copy them to eff
516 eff->Copy(*this); // copy everything (statistics and histos) from eff to this
519 //_____________________________________________________________________________
520 Bool_t AliITSPlaneEffSPD::AddFromCDB(AliCDBId *cdbId) {
521 AliCDBEntry *cdbEntry=0;
522 // read efficiency values from CDB
525 {AliError("ReadFromCDB: CDB not inizialized. Call InitCDB first"); return kFALSE;}
526 cdbEntry = AliCDBManager::Instance()->Get("ITS/PlaneEff/PlaneEffSPD",fRunNumber);
528 cdbEntry = AliCDBManager::Instance()->Get(*cdbId);
530 if(!cdbEntry) return kFALSE;
531 AliITSPlaneEffSPD* eff= (AliITSPlaneEffSPD*)cdbEntry->GetObject();
535 //_____________________________________________________________________________
536 UInt_t AliITSPlaneEffSPD::GetKeyFromDetLocCoord(Int_t ilay, Int_t idet,
537 Float_t, Float_t locz) const {
538 // method to locate a basic block from Detector Local coordinate (to be used in tracking)
541 {AliError("GetKeyFromDetLocCoord: you asked for a non existing layer");
543 if(ilay==0 && (idet<0 || idet>79))
544 {AliError("GetKeyFromDetLocCoord: you asked for a non existing detector");
546 if(ilay==1 && (idet<0 || idet>159))
547 {AliError("GetKeyFromDetLocCoord: you asked for a non existing detector");
552 key=GetKey(mod,GetChipFromCol(GetColFromLocZ(locz)));
555 //_____________________________________________________________________________
556 UInt_t AliITSPlaneEffSPD::GetColFromLocZ(Float_t zloc) const {
557 // method to retrieve column number from the local z coordinate
559 AliITSsegmentationSPD spd;
561 if(spd.LocalToDet(0,zloc,ix,iz)) col+=iz;
563 AliDebug(1,Form("cannot compute column number from local z=%f",zloc));
567 const Float_t kconv = 1.0E-04; // converts microns to cm.
569 for(Int_t i=000;i<160;i++) bz[i] = 425.0; // most are 425 microns except below
570 bz[ 31] = bz[ 32] = 625.0; // first chip boundry
571 bz[ 63] = bz[ 64] = 625.0; // first chip boundry
572 bz[ 95] = bz[ 96] = 625.0; // first chip boundry
573 bz[127] = bz[128] = 625.0; // first chip boundry
577 for(Int_t i=000;i<160;i++) dz+=bz[i];
579 if(zloc<dz || zloc>-1*dz) { // outside z range
580 AliDebug(1,Form("GetColFromLocZ: cannot compute column number from local z=%f",zloc));
591 //________________________________________________________
592 Bool_t AliITSPlaneEffSPD::GetBlockBoundaries(const UInt_t key, Float_t& xmn,Float_t& xmx,
593 Float_t& zmn,Float_t& zmx) const {
595 // This method return the geometrical boundaries of the active volume of a given
596 // basic block, in the detector reference system.
597 // Input: unique key to locate a basic block.
599 // Output: Ymin, Ymax, Zmin, Zmax of a basic block (chip for SPD)
600 // Return: kTRUE if computation was succesfully, kFALSE otherwise
602 if(key>=kNModule*kNChip)
603 {AliWarning("GetBlockBoundaries: you asked for a non existing key"); return kFALSE;}
604 UInt_t chip=GetChipFromKey(key);
605 zmn=GetLocZFromCol(chip*kNCol);
606 zmx=GetLocZFromCol((chip+1)*kNCol);
607 xmn=GetLocXFromRow(0);
608 xmx=GetLocXFromRow(kNRow);
611 if(zmx<zmn) {zmn=zmx; zmx=tmp;}
613 if(xmx<xmn) {xmn=xmx; xmx=tmp;}
616 //________________________________________________________
617 Float_t AliITSPlaneEffSPD::GetLocXFromRow(const UInt_t row) const {
619 // This method return the local (i.e. detector reference system) lower x coordinate
620 // of the row. To get the central value of a given row, you can do
621 // 1/2*[LocXFromRow(row)+LocXFromRow(row+1)].
623 // Input: row number in the range [0,kNRow]
624 // Output: lower local X coordinate of this row.
626 if(row>kNRow) // not >= ! allow also computation of upper limit of the last row.
627 {AliError("LocYFromRow: you asked for a non existing row"); return 9999999.;}
628 // Use only AliITSsegmentationSPD
629 AliITSsegmentationSPD spd;
631 if(row==kNRow) spd.CellBoundries((Int_t)row-1,0,dummy,x,dummy,dummy);
632 else spd.CellBoundries((Int_t)row,0,x,dummy,dummy,dummy);
636 //________________________________________________________
637 Float_t AliITSPlaneEffSPD::GetLocZFromCol(const UInt_t col) const {
639 // This method return the local (i.e. detector reference system) lower Z coordinate
640 // of the column. To get the central value of a given column, you can do
641 // 1/2*[LocZFromCol(col)+LocZFromCol(col+1)].
643 // Input: col number in the range [0,kNChip*kNCol]
644 // Output: lower local Y coordinate of this row.
646 if(col>kNChip*kNCol) // not >= ! allow also computation of upper limit of the last column
647 {AliError("LocZFromCol: you asked for a non existing column"); return 9999999.;}
648 // Use only AliITSsegmentationSPD
649 AliITSsegmentationSPD spd;
651 if(col==kNChip*kNCol) spd.CellBoundries(0,(Int_t)col-1,dummy,dummy,dummy,y);
652 else spd.CellBoundries(0,(Int_t)col,dummy,dummy,y,dummy);
656 //__________________________________________________________
657 void AliITSPlaneEffSPD::InitHistos() {
658 // for the moment let's create the histograms
660 TString histnameResX="HistResX_mod_",aux;
661 TString histnameResZ="HistResZ_mod_";
662 TString histnameResXZ="HistResXZ_mod_";
663 TString histnameClusterType="HistClusterType_mod_";
664 TString histnameResXclu="HistResX_mod_";
665 TString histnameResZclu="HistResZ_mod_";
666 TString histnameResXchip="HistResX_mod_";
667 TString histnameResZchip="HistResZ_mod_";
668 TString profnameResXvsPhi="ProfResXvsPhi_mod_";
669 TString profnameResZvsDip="ProfResZvsDip_mod_";
670 TString profnameResXvsPhiclu="ProfResXvsPhi_mod_";
671 TString profnameResZvsDipclu="ProfResZvsDip_mod_";
672 TString histnameTrackErrX="HistTrackErrX_mod_";
673 TString histnameTrackErrZ="HistTrackErrZ_mod_";
674 TString histnameClusErrX="HistClusErrX_mod_";
675 TString histnameClusErrZ="HistClusErrZ_mod_";
678 TH1::AddDirectory(kFALSE);
680 fHisResX=new TH1F*[kNHisto];
681 fHisResZ=new TH1F*[kNHisto];
682 fHisResXZ=new TH2F*[kNHisto];
683 fHisClusterSize=new TH2I*[kNHisto];
684 fHisResXclu=new TH1F**[kNHisto];
685 fHisResZclu=new TH1F**[kNHisto];
686 fHisResXchip=new TH1F**[kNHisto];
687 fHisResZchip=new TH1F**[kNHisto];
688 fProfResXvsPhi=new TProfile*[kNHisto];
689 fProfResZvsDip=new TProfile*[kNHisto];
690 fProfResXvsPhiclu=new TProfile**[kNHisto];
691 fProfResZvsDipclu=new TProfile**[kNHisto];
692 fHisTrackErrX=new TH1F*[kNHisto];
693 fHisTrackErrZ=new TH1F*[kNHisto];
694 fHisClusErrX=new TH1F*[kNHisto];
695 fHisClusErrZ=new TH1F*[kNHisto];
697 for (Int_t nhist=0;nhist<kNHisto;nhist++){
700 fHisResX[nhist]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
701 fHisResX[nhist]->SetName(aux.Data());
702 fHisResX[nhist]->SetTitle(aux.Data());
706 fHisResZ[nhist]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
707 fHisResZ[nhist]->SetName(aux.Data());
708 fHisResZ[nhist]->SetTitle(aux.Data());
712 fHisResXZ[nhist]=new TH2F("histname","histname",80,-0.16,0.16,80,-0.32,0.32); // binning:
713 fHisResXZ[nhist]->SetName(aux.Data()); // 40 micron in x;
714 fHisResXZ[nhist]->SetTitle(aux.Data()); // 80 micron in z;
716 aux=histnameClusterType;
718 fHisClusterSize[nhist]=new TH2I("histname","histname",10,0.5,10.5,10,0.5,10.5);
719 fHisClusterSize[nhist]->SetName(aux.Data());
720 fHisClusterSize[nhist]->SetTitle(aux.Data());
722 fHisResXclu[nhist]=new TH1F*[kNclu];
723 fHisResZclu[nhist]=new TH1F*[kNclu];
724 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
728 aux+=clu+1; // clu=0 --> cluster size 1
729 fHisResXclu[nhist][clu]=new TH1F("histname","histname",1600,-0.32,0.32); // +- 3200 micron; 1 bin=4 micron
730 fHisResXclu[nhist][clu]->SetName(aux.Data());
731 fHisResXclu[nhist][clu]->SetTitle(aux.Data());
736 aux+=clu+1; // clu=0 --> cluster size 1
737 fHisResZclu[nhist][clu]=new TH1F("histname","histname",1200,-0.48,0.48); // +-4800 micron; 1 bin=8 micron
738 fHisResZclu[nhist][clu]->SetName(aux.Data());
739 fHisResZclu[nhist][clu]->SetTitle(aux.Data());
742 fHisResXchip[nhist]=new TH1F*[kNChip];
743 fHisResZchip[nhist]=new TH1F*[kNChip];
744 for(Int_t chip=0; chip<kNChip; chip++) {
745 aux=histnameResXchip;
749 fHisResXchip[nhist][chip]=new TH1F("histname","histname",800,-0.32,0.32); // +- 3200 micron; 1 bin=8 micron
750 fHisResXchip[nhist][chip]->SetName(aux.Data());
751 fHisResXchip[nhist][chip]->SetTitle(aux.Data());
753 aux=histnameResZchip;
757 fHisResZchip[nhist][chip]=new TH1F("histname","histname",300,-0.48,0.48); // +-4800 micron; 1 bin=32 micron
758 fHisResZchip[nhist][chip]->SetName(aux.Data());
759 fHisResZchip[nhist][chip]->SetTitle(aux.Data());
762 aux=histnameTrackErrX;
764 fHisTrackErrX[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
765 fHisTrackErrX[nhist]->SetName(aux.Data());
766 fHisTrackErrX[nhist]->SetTitle(aux.Data());
768 aux=histnameTrackErrZ;
770 fHisTrackErrZ[nhist]=new TH1F("histname","histname",200,0.,0.32); // 0-3200 micron; 1 bin=16 micron
771 fHisTrackErrZ[nhist]->SetName(aux.Data());
772 fHisTrackErrZ[nhist]->SetTitle(aux.Data());
774 aux=histnameClusErrX;
776 fHisClusErrX[nhist]=new TH1F("histname","histname",400,0.,0.08); // 0-800 micron; 1 bin=2 micron
777 fHisClusErrX[nhist]->SetName(aux.Data());
778 fHisClusErrX[nhist]->SetTitle(aux.Data());
780 aux=histnameClusErrZ;
782 fHisClusErrZ[nhist]=new TH1F("histname","histname",400,0.,0.32); // 0-3200 micron; 1 bin=8 micron
783 fHisClusErrZ[nhist]->SetName(aux.Data());
784 fHisClusErrZ[nhist]->SetTitle(aux.Data());
786 aux=profnameResXvsPhi;
788 fProfResXvsPhi[nhist]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40°
789 fProfResXvsPhi[nhist]->SetName(aux.Data()); // bin width: 2°
790 fProfResXvsPhi[nhist]->SetTitle(aux.Data());
792 aux=profnameResZvsDip;
794 fProfResZvsDip[nhist]=new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-4°
795 fProfResZvsDip[nhist]->SetName(aux.Data()); // bin width: 3°
796 fProfResZvsDip[nhist]->SetTitle(aux.Data());
798 fProfResXvsPhiclu[nhist]=new TProfile*[kNclu];
799 fProfResZvsDipclu[nhist]=new TProfile*[kNclu];
800 for(Int_t clu=0; clu<kNclu; clu++) { // clu=0 --> cluster size 1
801 aux=profnameResXvsPhiclu;
804 aux+=clu+1; // clu=0 --> cluster size 1
805 fProfResXvsPhiclu[nhist][clu]=new TProfile("histname","histname",40,-40.,40.0); // binning: range: -40°- 40
806 fProfResXvsPhiclu[nhist][clu]->SetName(aux.Data()); // bin width: 2°
807 fProfResXvsPhiclu[nhist][clu]->SetTitle(aux.Data());
809 aux=profnameResZvsDipclu;
812 aux+=clu+1; // clu=0 --> cluster size 1
813 fProfResZvsDipclu[nhist][clu]= new TProfile("histname","histname",48,-72.,72.0); // binning: range: -70°-7°
814 fProfResZvsDipclu[nhist][clu]->SetName(aux.Data()); // bin width: 3°
815 fProfResZvsDipclu[nhist][clu]->SetTitle(aux.Data());
818 } // end loop on module
820 TH1::AddDirectory(kTRUE);
824 //__________________________________________________________
825 void AliITSPlaneEffSPD::DeleteHistos() {
826 // Delete the histograms and clean the memory
828 for (Int_t i=0; i<kNHisto; i++ ) delete fHisResX[i];
829 delete [] fHisResX; fHisResX=0;
832 for (Int_t i=0; i<kNHisto; i++ ) delete fHisResZ[i];
833 delete [] fHisResZ; fHisResZ=0;
836 for (Int_t i=0; i<kNHisto; i++ ) delete fHisResXZ[i];
837 delete [] fHisResXZ; fHisResXZ=0;
839 if(fHisClusterSize) {
840 for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusterSize[i];
841 delete [] fHisClusterSize; fHisClusterSize=0;
844 for (Int_t i=0; i<kNHisto; i++ ) {
845 for (Int_t clu=0; clu<kNclu; clu++) if (fHisResXclu[i][clu]) delete fHisResXclu[i][clu];
846 delete [] fHisResXclu[i];
848 delete [] fHisResXclu;
852 for (Int_t i=0; i<kNHisto; i++ ) {
853 for (Int_t clu=0; clu<kNclu; clu++) if (fHisResZclu[i][clu]) delete fHisResZclu[i][clu];
854 delete [] fHisResZclu[i];
856 delete [] fHisResZclu;
860 for (Int_t i=0; i<kNHisto; i++ ) {
861 for (Int_t chip=0; chip<kNChip; chip++) if (fHisResXchip[i][chip]) delete fHisResXchip[i][chip];
862 delete [] fHisResXchip[i];
864 delete [] fHisResXchip;
868 for (Int_t i=0; i<kNHisto; i++ ) {
869 for (Int_t chip=0; chip<kNChip; chip++) if (fHisResZchip[i][chip]) delete fHisResZchip[i][chip];
870 delete [] fHisResZchip[i];
872 delete [] fHisResZchip;
876 for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrX[i];
877 delete [] fHisTrackErrX; fHisTrackErrX=0;
880 for (Int_t i=0; i<kNHisto; i++ ) delete fHisTrackErrZ[i];
881 delete [] fHisTrackErrZ; fHisTrackErrZ=0;
884 for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrX[i];
885 delete [] fHisClusErrX; fHisClusErrX=0;
888 for (Int_t i=0; i<kNHisto; i++ ) delete fHisClusErrZ[i];
889 delete [] fHisClusErrZ; fHisClusErrZ=0;
892 for (Int_t i=0; i<kNHisto; i++ ) delete fProfResXvsPhi[i];
893 delete [] fProfResXvsPhi; fProfResXvsPhi=0;
896 for (Int_t i=0; i<kNHisto; i++ ) delete fProfResZvsDip[i];
897 delete [] fProfResZvsDip; fProfResZvsDip=0;
899 if(fProfResXvsPhiclu) {
900 for (Int_t i=0; i<kNHisto; i++ ) {
901 for (Int_t clu=0; clu<kNclu; clu++) if (fProfResXvsPhiclu[i][clu]) delete fProfResXvsPhiclu[i][clu];
902 delete [] fProfResXvsPhiclu[i];
904 delete [] fProfResXvsPhiclu;
905 fProfResXvsPhiclu = 0;
907 if(fProfResZvsDipclu) {
908 for (Int_t i=0; i<kNHisto; i++ ) {
909 for (Int_t clu=0; clu<kNclu; clu++) if (fProfResZvsDipclu[i][clu]) delete fProfResZvsDipclu[i][clu];
910 delete [] fProfResZvsDipclu[i];
912 delete [] fProfResZvsDipclu;
913 fProfResZvsDipclu = 0;
918 //__________________________________________________________
919 Bool_t AliITSPlaneEffSPD::FillHistos(UInt_t key, Bool_t found,
920 Float_t *tr, Float_t *clu, Int_t *csize, Float_t *angtrkmod) {
921 // this method fill the histograms
922 // input: - key: unique key of the basic block
923 // - found: Boolean to asses whether a cluster has been associated to the track or not
924 // - tr[0],tr[1] local X and Z coordinates of the track prediction, respectively
925 // - tr[2],tr[3] error on local X and Z coordinates of the track prediction, respectively
926 // - clu[0],clu[1] local X and Z coordinates of the cluster associated to the track, respectively
927 // - clu[2],clu[3] error on local X and Z coordinates of the cluster associated to the track, respectively
928 // - csize[0][1] cluster size in X and Z, respectively
929 // - angtrkmod[0],angtrkmod[1]
930 // output: kTRUE if filling was succesfull kFALSE otherwise
931 // side effects: updating of the histograms.
934 AliWarning("FillHistos: histograms do not exist! Call SetCreateHistos(kTRUE) first");
937 if(key>=kNModule*kNChip)
938 {AliWarning("FillHistos: you asked for a non existing key"); return kFALSE;}
939 Int_t id=GetModFromKey(key);
940 Int_t chip=GetChipFromKey(key);
942 {AliWarning("FillHistos: you want to fill a non-existing histos"); return kFALSE;}
944 Float_t resx=tr[0]-clu[0];
945 Float_t resz=tr[1]-clu[1];
946 fHisResX[id]->Fill(resx);
947 fHisResZ[id]->Fill(resz);
948 fHisResXZ[id]->Fill(resx,resz);
949 fHisClusterSize[id]->Fill((Double_t)csize[0],(Double_t)csize[1]);
950 if(csize[0]>0 && csize[0]<=kNclu) fHisResXclu[id][csize[0]-1]->Fill(resx);
951 if(csize[1]>0 && csize[1]<=kNclu) fHisResZclu[id][csize[1]-1]->Fill(resz);
952 fHisResXchip[id][chip]->Fill(resx);
953 fHisResZchip[id][chip]->Fill(resz);
954 fProfResXvsPhi[id]->Fill(angtrkmod[0],resx);
955 fProfResZvsDip[id]->Fill(angtrkmod[1],resz);
956 if(csize[0]>0 && csize[0]<=kNclu) fProfResXvsPhiclu[id][csize[0]-1]->Fill(angtrkmod[0],resx);
957 if(csize[1]>0 && csize[1]<=kNclu) fProfResZvsDipclu[id][csize[1]-1]->Fill(angtrkmod[1],resz);
959 fHisTrackErrX[id]->Fill(tr[2]);
960 fHisTrackErrZ[id]->Fill(tr[3]);
961 fHisClusErrX[id]->Fill(clu[2]);
962 fHisClusErrZ[id]->Fill(clu[3]);
965 //__________________________________________________________
966 Bool_t AliITSPlaneEffSPD::WriteHistosToFile(TString filename, Option_t* option) {
968 // Saves the histograms into a tree and saves the trees into a file
970 if (!fHis) return kFALSE;
971 if (filename.IsNull() || filename.IsWhitespace()) {
972 AliWarning("WriteHistosToFile: null output filename!");
976 TFile *hFile=new TFile(filename.Data(),option,
977 "The File containing the TREEs with ITS PlaneEff Histos");
978 TTree *SPDTree=new TTree("SPDTree","Tree whith Residuals and Cluster Type distributions for SPD");
981 TH2I *histClusterType;
982 TH1F *histXclu[kNclu];
983 TH1F *histZclu[kNclu];
984 TH1F *histXchip[kNChip];
985 TH1F *histZchip[kNChip];
986 TH1F *histTrErrZ,*histTrErrX;
987 TH1F *histClErrZ,*histClErrX;
988 TProfile *profXvsPhi,*profZvsDip;
989 TProfile *profXvsPhiclu[kNclu],*profZvsDipclu[kNclu];
994 histClusterType=new TH2I();
995 for(Int_t clu=0;clu<kNclu;clu++) {
996 histXclu[clu]=new TH1F();
997 histZclu[clu]=new TH1F();
999 for(Int_t chip=0;chip<kNChip;chip++) {
1000 histXchip[chip]=new TH1F();
1001 histZchip[chip]=new TH1F();
1003 histTrErrX=new TH1F();
1004 histTrErrZ=new TH1F();
1005 histClErrX=new TH1F();
1006 histClErrZ=new TH1F();
1007 profXvsPhi=new TProfile();
1008 profZvsDip=new TProfile();
1009 for(Int_t clu=0;clu<kNclu;clu++) {
1010 profXvsPhiclu[clu]=new TProfile();
1011 profZvsDipclu[clu]=new TProfile();
1015 SPDTree->Branch("histX","TH1F",&histX,128000,0);
1016 SPDTree->Branch("histZ","TH1F",&histZ,128000,0);
1017 SPDTree->Branch("histXZ","TH2F",&histXZ,128000,0);
1018 SPDTree->Branch("histClusterType","TH2I",&histClusterType,128000,0);
1019 for(Int_t clu=0;clu<kNclu;clu++) {
1020 snprintf(branchname,50,"histXclu_%d",clu+1);
1021 SPDTree->Branch(branchname,"TH1F",&histXclu[clu],128000,0);
1022 snprintf(branchname,50,"histZclu_%d",clu+1);
1023 SPDTree->Branch(branchname,"TH1F",&histZclu[clu],128000,0);
1025 for(Int_t chip=0;chip<kNChip;chip++) {
1026 snprintf(branchname,50,"histXchip_%d",chip);
1027 SPDTree->Branch(branchname,"TH1F",&histXchip[chip],128000,0);
1028 snprintf(branchname,50,"histZchip_%d",chip);
1029 SPDTree->Branch(branchname,"TH1F",&histZchip[chip],128000,0);
1031 SPDTree->Branch("histTrErrX","TH1F",&histTrErrX,128000,0);
1032 SPDTree->Branch("histTrErrZ","TH1F",&histTrErrZ,128000,0);
1033 SPDTree->Branch("histClErrX","TH1F",&histClErrX,128000,0);
1034 SPDTree->Branch("histClErrZ","TH1F",&histClErrZ,128000,0);
1035 SPDTree->Branch("profXvsPhi","TProfile",&profXvsPhi,128000,0);
1036 SPDTree->Branch("profZvsDip","TProfile",&profZvsDip,128000,0);
1037 for(Int_t clu=0;clu<kNclu;clu++) {
1038 snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
1039 SPDTree->Branch(branchname,"TProfile",&profXvsPhiclu[clu],128000,0);
1040 snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
1041 SPDTree->Branch(branchname,"TProfile",&profZvsDipclu[clu],128000,0);
1044 for(Int_t j=0;j<kNHisto;j++){
1047 histXZ=fHisResXZ[j];
1048 histClusterType=fHisClusterSize[j];
1049 for(Int_t clu=0;clu<kNclu;clu++) {
1050 histXclu[clu]=fHisResXclu[j][clu];
1051 histZclu[clu]=fHisResZclu[j][clu];
1053 for(Int_t chip=0;chip<kNChip;chip++) {
1054 histXchip[chip]=fHisResXchip[j][chip];
1055 histZchip[chip]=fHisResZchip[j][chip];
1057 histTrErrX=fHisTrackErrX[j];
1058 histTrErrZ=fHisTrackErrZ[j];
1059 histClErrX=fHisClusErrX[j];
1060 histClErrZ=fHisClusErrZ[j];
1061 profXvsPhi=fProfResXvsPhi[j];
1062 profZvsDip=fProfResZvsDip[j];
1063 for(Int_t clu=0;clu<kNclu;clu++) {
1064 profXvsPhiclu[clu]=fProfResXvsPhiclu[j][clu];
1065 profZvsDipclu[clu]=fProfResZvsDipclu[j][clu];
1074 //__________________________________________________________
1075 Bool_t AliITSPlaneEffSPD::ReadHistosFromFile(TString filename) {
1077 // Read histograms from an already existing file
1079 if (!fHis) return kFALSE;
1080 if (filename.IsNull() || filename.IsWhitespace()) {
1081 AliWarning("ReadHistosFromFile: incorrect output filename!");
1084 char branchname[51];
1091 TFile *file=TFile::Open(filename.Data(),"READONLY");
1093 if (!file || file->IsZombie()) {
1094 AliWarning(Form("Can't open %s !",filename.Data()));
1098 TTree *tree = (TTree*) file->Get("SPDTree");
1100 TBranch *histX = (TBranch*) tree->GetBranch("histX");
1101 TBranch *histZ = (TBranch*) tree->GetBranch("histZ");
1102 TBranch *histXZ = (TBranch*) tree->GetBranch("histXZ");
1103 TBranch *histClusterType = (TBranch*) tree->GetBranch("histClusterType");
1105 TBranch *histXclu[kNclu], *histZclu[kNclu];
1106 for(Int_t clu=0; clu<kNclu; clu++) {
1107 snprintf(branchname,50,"histXclu_%d",clu+1);
1108 histXclu[clu]= (TBranch*) tree->GetBranch(branchname);
1109 snprintf(branchname,50,"histZclu_%d",clu+1);
1110 histZclu[clu]= (TBranch*) tree->GetBranch(branchname);
1113 TBranch *histXchip[kNChip], *histZchip[kNChip];
1114 for(Int_t chip=0; chip<kNChip; chip++) {
1115 snprintf(branchname,50,"histXchip_%d",chip);
1116 histXchip[chip]= (TBranch*) tree->GetBranch(branchname);
1117 snprintf(branchname,50,"histZchip_%d",chip);
1118 histZchip[chip]= (TBranch*) tree->GetBranch(branchname);
1121 TBranch *histTrErrX = (TBranch*) tree->GetBranch("histTrErrX");
1122 TBranch *histTrErrZ = (TBranch*) tree->GetBranch("histTrErrZ");
1123 TBranch *histClErrX = (TBranch*) tree->GetBranch("histClErrX");
1124 TBranch *histClErrZ = (TBranch*) tree->GetBranch("histClErrZ");
1125 TBranch *profXvsPhi = (TBranch*) tree->GetBranch("profXvsPhi");
1126 TBranch *profZvsDip = (TBranch*) tree->GetBranch("profZvsDip");
1128 TBranch *profXvsPhiclu[kNclu], *profZvsDipclu[kNclu];
1129 for(Int_t clu=0; clu<kNclu; clu++) {
1130 snprintf(branchname,50,"profXvsPhiclu_%d",clu+1);
1131 profXvsPhiclu[clu]= (TBranch*) tree->GetBranch(branchname);
1132 snprintf(branchname,50,"profZvsDipclu_%d",clu+1);
1133 profZvsDipclu[clu]= (TBranch*) tree->GetBranch(branchname);
1138 Int_t nevent = (Int_t)histX->GetEntries();
1140 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1141 histX->SetAddress(&h);
1142 for(Int_t j=0;j<kNHisto;j++){
1144 fHisResX[j]->Add(h);
1147 nevent = (Int_t)histZ->GetEntries();
1149 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1150 histZ->SetAddress(&h);
1151 for(Int_t j=0;j<kNHisto;j++){
1153 fHisResZ[j]->Add(h);
1156 nevent = (Int_t)histXZ->GetEntries();
1158 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1159 histXZ->SetAddress(&h2);
1160 for(Int_t j=0;j<kNHisto;j++){
1161 histXZ->GetEntry(j);
1162 fHisResXZ[j]->Add(h2);
1165 nevent = (Int_t)histClusterType->GetEntries();
1167 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1168 histClusterType->SetAddress(&h2i);
1169 for(Int_t j=0;j<kNHisto;j++){
1170 histClusterType->GetEntry(j);
1171 fHisClusterSize[j]->Add(h2i);
1174 for(Int_t clu=0; clu<kNclu; clu++) {
1176 nevent = (Int_t)histXclu[clu]->GetEntries();
1178 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1179 histXclu[clu]->SetAddress(&h);
1180 for(Int_t j=0;j<kNHisto;j++){
1181 histXclu[clu]->GetEntry(j);
1182 fHisResXclu[j][clu]->Add(h);
1185 nevent = (Int_t)histZclu[clu]->GetEntries();
1187 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1188 histZclu[clu]->SetAddress(&h);
1189 for(Int_t j=0;j<kNHisto;j++){
1190 histZclu[clu]->GetEntry(j);
1191 fHisResZclu[j][clu]->Add(h);
1196 for(Int_t chip=0; chip<kNChip; chip++) {
1198 nevent = (Int_t)histXchip[chip]->GetEntries();
1200 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1201 histXchip[chip]->SetAddress(&h);
1202 for(Int_t j=0;j<kNHisto;j++){
1203 histXchip[chip]->GetEntry(j);
1204 fHisResXchip[j][chip]->Add(h);
1207 nevent = (Int_t)histZchip[chip]->GetEntries();
1209 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1210 histZchip[chip]->SetAddress(&h);
1211 for(Int_t j=0;j<kNHisto;j++){
1212 histZchip[chip]->GetEntry(j);
1213 fHisResZchip[j][chip]->Add(h);
1217 nevent = (Int_t)histTrErrX->GetEntries();
1219 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1220 histTrErrX->SetAddress(&h);
1221 for(Int_t j=0;j<kNHisto;j++){
1222 histTrErrX->GetEntry(j);
1223 fHisTrackErrX[j]->Add(h);
1226 nevent = (Int_t)histTrErrZ->GetEntries();
1228 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1229 histTrErrZ->SetAddress(&h);
1230 for(Int_t j=0;j<kNHisto;j++){
1231 histTrErrZ->GetEntry(j);
1232 fHisTrackErrZ[j]->Add(h);
1235 nevent = (Int_t)histClErrX->GetEntries();
1237 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1238 histClErrX->SetAddress(&h);
1239 for(Int_t j=0;j<kNHisto;j++){
1240 histClErrX->GetEntry(j);
1241 fHisClusErrX[j]->Add(h);
1244 nevent = (Int_t)histClErrZ->GetEntries();
1246 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1247 histClErrZ->SetAddress(&h);
1248 for(Int_t j=0;j<kNHisto;j++){
1249 histClErrZ->GetEntry(j);
1250 fHisClusErrZ[j]->Add(h);
1253 nevent = (Int_t)profXvsPhi->GetEntries();
1255 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1256 profXvsPhi->SetAddress(&p);
1257 for(Int_t j=0;j<kNHisto;j++){
1258 profXvsPhi->GetEntry(j);
1259 fProfResXvsPhi[j]->Add(p);
1262 nevent = (Int_t)profZvsDip->GetEntries();
1264 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1265 profZvsDip->SetAddress(&p);
1266 for(Int_t j=0;j<kNHisto;j++){
1267 profZvsDip->GetEntry(j);
1268 fProfResZvsDip[j]->Add(p);
1271 for(Int_t clu=0; clu<kNclu; clu++) {
1273 nevent = (Int_t)profXvsPhiclu[clu]->GetEntries();
1275 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1276 profXvsPhiclu[clu]->SetAddress(&p);
1277 for(Int_t j=0;j<kNHisto;j++){
1278 profXvsPhiclu[clu]->GetEntry(j);
1279 fProfResXvsPhiclu[j][clu]->Add(p);
1282 nevent = (Int_t)profZvsDipclu[clu]->GetEntries();
1284 {AliWarning("ReadHistosFromFile: trying to read too many or too few histos!"); return kFALSE;}
1285 profZvsDipclu[clu]->SetAddress(&p);
1286 for(Int_t j=0;j<kNHisto;j++){
1287 profZvsDipclu[clu]->GetEntry(j);
1288 fProfResZvsDipclu[j][clu]->Add(p);