Line data Source code
1 : /**************************************************************************
2 : * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
3 : * *
4 : * Author: The ALICE Off-line Project. *
5 : * Contributors are mentioned in the code where appropriate. *
6 : * *
7 : * Permission to use, copy, modify and distribute this software and its *
8 : * documentation strictly for non-commercial purposes is hereby granted *
9 : * without fee, provided that the above copyright notice appears in all *
10 : * copies and that both the copyright notice and this permission notice *
11 : * appear in the supporting documentation. The authors make no claims *
12 : * about the suitability of this software for any purpose. It is *
13 : * provided "as is" without express or implied warranty. *
14 : **************************************************************************/
15 : /* $Id$ */
16 :
17 : #include "AliITSCalibrationSSD.h"
18 : //////////////////////////////////////////////////////
19 : // Calibration class for set:ITS //
20 : // Specific subdetector implementation //
21 : // for silicon strips detectors //
22 : // //
23 : // //
24 : //////////////////////////////////////////////////////
25 :
26 : const Int_t AliITSCalibrationSSD::fgkNParDefault = 6;
27 :
28 118 : ClassImp(AliITSCalibrationSSD)
29 :
30 : //______________________________________________________________________
31 15 : AliITSCalibrationSSD::AliITSCalibrationSSD():
32 15 : fModule(0),
33 15 : fNPar(0),
34 15 : fDetPar(0),
35 15 : fNoise(0),
36 15 : fPedestal(),
37 15 : fGain(0),
38 15 : fBadChannels(0),
39 15 : fIsBad(kFALSE),
40 15 : fSSDADCpereV(0.),
41 15 : fKeVperADC(0)
42 75 : {
43 : // Default Constructor
44 :
45 390 : for(Int_t i=0;i<fgkChipsPerModule;i++){
46 180 : fIsChipBad[i]=kFALSE;
47 : }
48 15 : SetSSDADCpereV();
49 15 : SetKeVperADC();
50 30 : }
51 : //______________________________________________________________________
52 0 : AliITSCalibrationSSD::AliITSCalibrationSSD(const char *dataType):
53 0 : fModule(0),
54 0 : fNPar(0),
55 0 : fDetPar(0),
56 0 : fNoise(0),
57 0 : fPedestal(0),
58 0 : fGain(0),
59 0 : fBadChannels(0),
60 0 : fIsBad(kFALSE) ,
61 0 : fSSDADCpereV(0.),
62 0 : fKeVperADC(0){
63 : // constructor
64 :
65 0 : SetDataType(dataType);
66 0 : SetNDetParam(fgkNParDefault); // Sets fNPar=6 by default.
67 0 : fDetPar = new Double_t[fNPar];
68 0 : if (fNPar==6) {
69 0 : fDetPar[0]=10.;
70 0 : fDetPar[1]=5.;
71 0 : fDetPar[2]=0.02;
72 0 : fDetPar[3]=0.02;
73 0 : fDetPar[4]=0.02;
74 0 : fDetPar[5]=0.03;
75 0 : } // end if
76 0 : for(Int_t i=0;i<fgkChipsPerModule;i++){
77 0 : fIsChipBad[i]=kFALSE;
78 : }
79 0 : SetSSDADCpereV();
80 0 : SetKeVperADC();
81 0 : }
82 : //______________________________________________________________________
83 0 : AliITSCalibrationSSD::~AliITSCalibrationSSD(){
84 : // destructor
85 :
86 0 : delete [] fDetPar;
87 0 : if(fNoise)delete fNoise;
88 0 : if(fPedestal)delete fPedestal;
89 0 : if(fGain)delete fGain;
90 0 : if(fBadChannels)delete fBadChannels;
91 0 : }
92 : //______________________________________________________________________
93 : void AliITSCalibrationSSD::SetDetParam(Double_t *par){
94 : // set det param
95 : Int_t i;
96 :
97 0 : for (i=0; i<fNPar; i++) {
98 0 : fDetPar[i]=par[i];
99 : //printf("\n CompressPar %d %d \n",i,fCPar[i]);
100 : } // end for i
101 0 : }
102 : //______________________________________________________________________
103 : void AliITSCalibrationSSD::GetDetParam(Double_t *par) const {
104 : // get det param
105 : Int_t i;
106 :
107 0 : for (i=0; i<fNPar; i++) {
108 0 : par[i]=fDetPar[i];
109 : } // end for i
110 0 : }
111 :
112 : //______________________________________________________________________
113 : void AliITSCalibrationSSD::FillBadChipMap() {
114 :
115 : // reset
116 6792 : fIsBad=kFALSE;
117 88296 : for(Int_t i=0;i<fgkChipsPerModule;i++){
118 40752 : fIsChipBad[i]=kFALSE;
119 : }
120 :
121 :
122 : Int_t mc=0;
123 3396 : Int_t cc[fgkChipsPerModule];
124 :
125 : // P-side
126 47544 : for(Int_t i=0; i<fgkChipsPerModule/2; i++){
127 20376 : cc[i]=0;
128 5257008 : for(Int_t j=0; j<ChannelsPerChip(); j++) {
129 2771698 : if(IsPChannelBad(i*ChannelsPerChip()+j)) cc[i]++;
130 : }
131 21360 : if(cc[i]==ChannelsPerChip()) { SetChipBad(i); mc++; }
132 : }
133 :
134 : // N-side
135 47544 : for(Int_t i=fgkChipsPerModule/2; i<fgkChipsPerModule; i++){
136 20376 : cc[i]=0;
137 5257008 : for(Int_t j=0; j<ChannelsPerChip(); j++) {
138 2767822 : if(IsNChannelBad(1535-i*ChannelsPerChip()-j)) cc[i]++;
139 : }
140 21226 : if(cc[i]==ChannelsPerChip()) { SetChipBad(i); mc++; }
141 : }
142 :
143 3516 : if(mc==fgkChipsPerModule) fIsBad=kTRUE;
144 3396 : }
|