]>
Commit | Line | Data |
---|---|---|
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 | ClassImp(AliITSCalibrationSSD) | |
29 | ||
30 | //______________________________________________________________________ | |
31 | AliITSCalibrationSSD::AliITSCalibrationSSD(): | |
32 | fModule(0), | |
33 | fNPar(0), | |
34 | fDetPar(0), | |
35 | fNoise(0), | |
36 | fPedestal(), | |
37 | fGain(0), | |
38 | fBadChannels(0), | |
39 | fIsBad(kFALSE), | |
40 | fSSDADCpereV(0.), | |
41 | fKeVperADC(0) | |
42 | { | |
43 | // Default Constructor | |
44 | ||
45 | for(Int_t i=0;i<fgkChipsPerModule;i++){ | |
46 | fIsChipBad[i]=kFALSE; | |
47 | } | |
48 | SetSSDADCpereV(); | |
49 | SetKeVperADC(); | |
50 | } | |
51 | //______________________________________________________________________ | |
52 | AliITSCalibrationSSD::AliITSCalibrationSSD(const char *dataType): | |
53 | fModule(0), | |
54 | fNPar(0), | |
55 | fDetPar(0), | |
56 | fNoise(0), | |
57 | fPedestal(0), | |
58 | fGain(0), | |
59 | fBadChannels(0), | |
60 | fIsBad(kFALSE) , | |
61 | fSSDADCpereV(0.), | |
62 | fKeVperADC(0){ | |
63 | // constructor | |
64 | ||
65 | SetDataType(dataType); | |
66 | SetNDetParam(fgkNParDefault); // Sets fNPar=6 by default. | |
67 | fDetPar = new Double_t[fNPar]; | |
68 | if (fNPar==6) { | |
69 | fDetPar[0]=10.; | |
70 | fDetPar[1]=5.; | |
71 | fDetPar[2]=0.02; | |
72 | fDetPar[3]=0.02; | |
73 | fDetPar[4]=0.02; | |
74 | fDetPar[5]=0.03; | |
75 | } // end if | |
76 | for(Int_t i=0;i<fgkChipsPerModule;i++){ | |
77 | fIsChipBad[i]=kFALSE; | |
78 | } | |
79 | SetSSDADCpereV(); | |
80 | SetKeVperADC(); | |
81 | } | |
82 | //______________________________________________________________________ | |
83 | AliITSCalibrationSSD::~AliITSCalibrationSSD(){ | |
84 | // destructor | |
85 | ||
86 | delete [] fDetPar; | |
87 | } | |
88 | //______________________________________________________________________ | |
89 | void AliITSCalibrationSSD::SetDetParam(Double_t *par){ | |
90 | // set det param | |
91 | Int_t i; | |
92 | ||
93 | for (i=0; i<fNPar; i++) { | |
94 | fDetPar[i]=par[i]; | |
95 | //printf("\n CompressPar %d %d \n",i,fCPar[i]); | |
96 | } // end for i | |
97 | } | |
98 | //______________________________________________________________________ | |
99 | void AliITSCalibrationSSD::GetDetParam(Double_t *par) const { | |
100 | // get det param | |
101 | Int_t i; | |
102 | ||
103 | for (i=0; i<fNPar; i++) { | |
104 | par[i]=fDetPar[i]; | |
105 | } // end for i | |
106 | } | |
107 | ||
108 | //______________________________________________________________________ | |
109 | void AliITSCalibrationSSD::FillBadChipMap() { | |
110 | ||
111 | // reset | |
112 | fIsBad=kFALSE; | |
113 | for(Int_t i=0;i<fgkChipsPerModule;i++){ | |
114 | fIsChipBad[i]=kFALSE; | |
115 | } | |
116 | ||
117 | ||
118 | Int_t mc=0; | |
119 | Int_t cc[fgkChipsPerModule]; | |
120 | ||
121 | // P-side | |
122 | for(Int_t i=0; i<fgkChipsPerModule/2; i++){ | |
123 | cc[i]=0; | |
124 | for(Int_t j=0; j<ChannelsPerChip(); j++) { | |
125 | if(IsPChannelBad(i*ChannelsPerChip()+j)) cc[i]++; | |
126 | } | |
127 | if(cc[i]==ChannelsPerChip()) { SetChipBad(i); mc++; } | |
128 | } | |
129 | ||
130 | // N-side | |
131 | for(Int_t i=fgkChipsPerModule/2; i<fgkChipsPerModule; i++){ | |
132 | cc[i]=0; | |
133 | for(Int_t j=0; j<ChannelsPerChip(); j++) { | |
134 | if(IsNChannelBad(1535-i*ChannelsPerChip()-j)) cc[i]++; | |
135 | } | |
136 | if(cc[i]==ChannelsPerChip()) { SetChipBad(i); mc++; } | |
137 | } | |
138 | ||
139 | if(mc==fgkChipsPerModule) fIsBad=kTRUE; | |
140 | } |