1 // **************************************************************************
2 // This file is property of and copyright by the ALICE HLT Project *
3 // ALICE Experiment at CERN, All rights reserved. *
5 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
6 // for The ALICE HLT Project. *
8 // Permission to use, copy, modify and distribute this software and its *
9 // documentation strictly for non-commercial purposes is hereby granted *
10 // without fee, provided that the above copyright notice appears in all *
11 // copies and that both the copyright notice and this permission notice *
12 // appear in the supporting documentation. The authors make no claims *
13 // about the suitability of this software for any purpose. It is *
14 // provided "as is" without express or implied warranty. *
16 //***************************************************************************
19 #include "AliHLTITSDetector.h"
21 #include "AliITSgeomTGeo.h"
22 #include "AliITSCalibration.h"
23 #include "AliITSsegmentation.h"
24 #include "AliITSDetTypeRec.h"
26 //------------------------------------------------------------------------
27 AliHLTITSDetector::AliHLTITSDetector(const AliHLTITSDetector& det):
39 fChipIsBad(det.fChipIsBad)
43 //------------------------------------------------------------------------
44 void AliHLTITSDetector::ReadBadDetectorAndChips(Int_t ilayer,Int_t idet,
45 const AliITSDetTypeRec *detTypeRec)
47 //--------------------------------------------------------------------
48 // Read bad detectors and chips from calibration objects in AliITSDetTypeRec
49 //--------------------------------------------------------------------
51 // In AliITSDetTypeRec, detector numbers go from 0 to 2197
52 // while in the tracker they start from 0 for each layer
53 for(Int_t il=0; il<ilayer; il++)
54 idet += AliITSgeomTGeo::GetNLadders(il+1)*AliITSgeomTGeo::GetNDetectors(il+1);
57 if (ilayer==0 || ilayer==1) { // ---------- SPD
59 } else if (ilayer==2 || ilayer==3) { // ---------- SDD
61 } else if (ilayer==4 || ilayer==5) { // ---------- SSD
64 printf("AliITStrackerHLT::AliHLTITSDetector::InitBadFromOCDB: Wrong layer number %d\n",ilayer);
68 // Get calibration from AliITSDetTypeRec
69 AliITSCalibration *calib = (AliITSCalibration*)detTypeRec->GetCalibrationModel(idet);
70 calib->SetModuleIndex(idet);
71 AliITSCalibration *calibSPDdead = 0;
72 if(detType==0) calibSPDdead = (AliITSCalibration*)detTypeRec->GetSPDDeadModel(idet); // TEMPORARY
74 (detType==0 && calibSPDdead->IsBad())) // TEMPORARY
77 // printf("lay %d bad %d\n",ilayer,idet);
80 // Get segmentation from AliITSDetTypeRec
81 AliITSsegmentation *segm = (AliITSsegmentation*)detTypeRec->GetSegmentationModel(detType);
83 // Read info about bad chips
84 fNChips = segm->GetMaximumChipIndex()+1;
85 //printf("ilayer %d detType %d idet %d fNChips %d %d GetNumberOfChips %d\n",ilayer,detType,idet,fNChips,segm->GetMaximumChipIndex(),segm->GetNumberOfChips());
86 if(fChipIsBad) { delete [] fChipIsBad; fChipIsBad=NULL; }
87 fChipIsBad = new Bool_t[fNChips];
88 for (Int_t iCh=0;iCh<fNChips;iCh++) {
89 fChipIsBad[iCh] = calib->IsChipBad(iCh);
90 if (detType==0 && calibSPDdead->IsChipBad(iCh)) fChipIsBad[iCh] = kTRUE; // TEMPORARY
91 //if(fChipIsBad[iCh]) {printf("lay %d det %d bad chip %d\n",ilayer,idet,iCh);}