compilation warnings
[u/mrichter/AliRoot.git] / ITS / AliITSCalibrationSSD.cxx
CommitLineData
fcf95fc7 1/**************************************************************************
b42cfa25 2 * Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
fcf95fc7 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 **************************************************************************/
b42cfa25 15/* $Id$ */
fcf95fc7 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
26const Double_t AliITSCalibrationSSD::fgkNoiseNDefault = 625.;
27const Double_t AliITSCalibrationSSD::fgkNoisePDefault = 420.;
28const Int_t AliITSCalibrationSSD::fgkNParDefault = 6;
29const Double_t AliITSCalibrationSSD::fgkSigmaPDefault = 3.;
30const Double_t AliITSCalibrationSSD::fgkSigmaNDefault = 2.;
31
32ClassImp(AliITSCalibrationSSD)
33
34//______________________________________________________________________
e56160b8 35AliITSCalibrationSSD::AliITSCalibrationSSD():
36fNPar(0),
37fDetPar(0),
38fNoiseP(0),
39fNoiseN(0),
40fSigmaP(0),
41fSigmaN(0),
fb4dfab9 42fNoise(0),
5a88c45b 43fPedestal(),
fb4dfab9 44fGain(0),
45fBadChannels(0),
df1d5598 46fIsBad(kFALSE),
e56160b8 47fGainP(0),
48fGainN(0),
49fNoisP(0),
50fNoisN(0),
5a88c45b 51fPedP(),
52fPedN(),
e56160b8 53fNoisePThreshold(0),
54fNoisyPChannelsList(0),
55fNoiseNThreshold(0),
56fNoisyNChannelsList(0),
57fDeadNChannelsList(0),
58fDeadPChannelsList(0){
fcf95fc7 59 // Default Constructor
60
fcf95fc7 61 SetNoiseParam(fgkNoisePDefault,fgkNoiseNDefault);
df1d5598 62 for(Int_t i=0;i<fgkChipsPerModule;i++){
63 fIsChipBad[i]=kFALSE;
64 }
fcf95fc7 65}
66//______________________________________________________________________
e56160b8 67AliITSCalibrationSSD::AliITSCalibrationSSD(const char *dataType):
68fNPar(0),
69fDetPar(0),
70fNoiseP(0),
71fNoiseN(0),
72fSigmaP(0),
73fSigmaN(0),
fb4dfab9 74fNoise(0),
b42cfa25 75fPedestal(0),
fb4dfab9 76fGain(0),
77fBadChannels(0),
df1d5598 78fIsBad(kFALSE),
e56160b8 79fGainP(0),
80fGainN(0),
81fNoisP(0),
82fNoisN(0),
b42cfa25 83fPedP(0),
84fPedN(0),
e56160b8 85fNoisePThreshold(0),
86fNoisyPChannelsList(0),
87fNoiseNThreshold(0),
88fNoisyNChannelsList(0),
89fDeadNChannelsList(0),
90fDeadPChannelsList(0){
fcf95fc7 91 // constructor
92
93 SetNoiseParam(fgkNoisePDefault,fgkNoiseNDefault);
94 SetDataType(dataType);
95 SetSigmaSpread(fgkSigmaPDefault,fgkSigmaNDefault);
96 SetNDetParam(fgkNParDefault); // Sets fNPar=6 by default.
97 fDetPar = new Double_t[fNPar];
98 if (fNPar==6) {
99 fDetPar[0]=10.;
100 fDetPar[1]=5.;
101 fDetPar[2]=0.02;
102 fDetPar[3]=0.02;
103 fDetPar[4]=0.02;
104 fDetPar[5]=0.03;
105 } // end if
df1d5598 106 for(Int_t i=0;i<fgkChipsPerModule;i++){
107 fIsChipBad[i]=kFALSE;
108 }
fcf95fc7 109}
110//______________________________________________________________________
111AliITSCalibrationSSD::~AliITSCalibrationSSD(){
112 // destructor
23197852 113
fcf95fc7 114 delete [] fDetPar;
115}
116//______________________________________________________________________
fcf95fc7 117void AliITSCalibrationSSD::SetDetParam(Double_t *par){
118 // set det param
119 Int_t i;
120
121 for (i=0; i<fNPar; i++) {
122 fDetPar[i]=par[i];
123 //printf("\n CompressPar %d %d \n",i,fCPar[i]);
124 } // end for i
125}
126//______________________________________________________________________
127void AliITSCalibrationSSD::GetDetParam(Double_t *par) const {
128 // get det param
129 Int_t i;
130
131 for (i=0; i<fNPar; i++) {
132 par[i]=fDetPar[i];
133 } // end for i
134}
23197852 135
136//______________________________________________________________________
137void AliITSCalibrationSSD::FillBadChipMap() {
138
139 Int_t mc=0;
140 Int_t cc[12];
141
142 // P-side
143 for(Int_t i=0; i<6; i++){
144 cc[i]=0;
145 for(Int_t j=0; j<ChannelsPerChip(); j++) {
146 if(IsPChannelBad(i*ChannelsPerChip()+j)) cc[i]++;
147 }
148 if(cc[i]==ChannelsPerChip()) { SetChipBad(i); mc++; }
149 }
150
151 // N-side
152 for(Int_t i=6; i<11; i++){
153 cc[i]=0;
154 for(Int_t j=0; j<ChannelsPerChip(); j++) {
155 if(IsNChannelBad(1535-i*ChannelsPerChip()-j)) cc[i]++;
156 }
157 if(cc[i]==ChannelsPerChip()) { SetChipBad(i); mc++; }
158 }
159
160 if(mc==ChannelsPerChip()) fIsBad=kTRUE;
161}