]> git.uio.no Git - u/mrichter/AliRoot.git/blob - HLT/ITS/tracking/AliHLTITSDetector.cxx
AliHLTVertexer is moved from ITS/tracking/. to global/.
[u/mrichter/AliRoot.git] / HLT / ITS / tracking / AliHLTITSDetector.cxx
1 // **************************************************************************
2 // This file is property of and copyright by the ALICE HLT Project          *
3 // ALICE Experiment at CERN, All rights reserved.                           *
4 //                                                                          *
5 // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> *
6 //                  for The ALICE HLT Project.                              *
7 //                                                                          *
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.                    *
15 //                                                                          *
16 //***************************************************************************
17
18
19 #include "AliHLTITSDetector.h"
20
21 #include "AliITSgeomTGeo.h"
22 #include "AliITSCalibration.h"
23 #include "AliITSsegmentation.h"
24 #include "AliITSDetTypeRec.h"
25
26 //------------------------------------------------------------------------
27 AliHLTITSDetector::AliHLTITSDetector(const AliHLTITSDetector& det):
28 fR(det.fR),
29 fRmisal(det.fRmisal),
30 fPhi(det.fPhi),
31 fSinPhi(det.fSinPhi),
32 fCosPhi(det.fCosPhi),
33 fYmin(det.fYmin),
34 fYmax(det.fYmax),
35 fZmin(det.fZmin),
36 fZmax(det.fZmax),
37 fIsBad(det.fIsBad),
38 fNChips(det.fNChips),
39 fChipIsBad(det.fChipIsBad)
40 {
41   //Copy constructor
42 }
43 //------------------------------------------------------------------------
44 void AliHLTITSDetector::ReadBadDetectorAndChips(Int_t ilayer,Int_t idet,
45                                                 const AliITSDetTypeRec *detTypeRec)
46 {
47   //--------------------------------------------------------------------
48   // Read bad detectors and chips from calibration objects in AliITSDetTypeRec
49   //--------------------------------------------------------------------
50
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);
55
56   Int_t detType;
57   if (ilayer==0 || ilayer==1) {        // ----------  SPD
58     detType = 0;
59   } else if (ilayer==2 || ilayer==3) { // ----------  SDD
60     detType = 1;
61   } else if (ilayer==4 || ilayer==5) { // ----------  SSD
62     detType = 2;
63   } else {
64     printf("AliITStrackerHLT::AliHLTITSDetector::InitBadFromOCDB: Wrong layer number %d\n",ilayer);
65     return;
66   }
67
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
73   if (calib->IsBad() ||
74       (detType==0 && calibSPDdead->IsBad())) // TEMPORARY
75     {
76       SetBad();
77       //      printf("lay %d bad %d\n",ilayer,idet);
78     }
79
80   // Get segmentation from AliITSDetTypeRec
81   AliITSsegmentation *segm = (AliITSsegmentation*)detTypeRec->GetSegmentationModel(detType);
82
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);}
92   }
93
94   return;
95 }
96
97