1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
19 #include "AliITSresponseSDD.h"
22 //___________________________________________
23 ClassImp(AliITSresponseSDD)
25 AliITSresponseSDD::AliITSresponseSDD()
35 SetNSigmaIntegration();
39 SetNoiseAfterElectronics();
50 // set the default zero suppression parameters
53 fCPar[2]=(Int_t)(fBaseline + 2.*fNoiseAfterEl + 0.2);
54 fCPar[3]=(Int_t)(fBaseline + 2.*fNoiseAfterEl + 0.2);
61 AliITSresponseSDD::~AliITSresponseSDD() {
63 if(fGaus) delete fGaus;
67 void AliITSresponseSDD::SetCompressParam(Int_t cp[8])
69 // set compression param
74 //printf("\n CompressPar %d %d \n",i,fCPar[i]);
78 void AliITSresponseSDD::GiveCompressParam(Int_t cp[8])
80 // give compression param
88 void AliITSresponseSDD::SetDeadChannels(Int_t nmod, Int_t nchip, Int_t nchan) {
90 for(Int_t m=0; m<fModules; m++)
91 for(Int_t n=0; n<fChips; n++)
92 for(Int_t p=0; p<fChannels; p++)
95 if(nmod < 0 || nmod > fModules) { cout << "Wrong number of dead modules: " << nmod << endl; return; }
96 Int_t nmax = (fModules-nmod)*fChips;
97 if(nchip < 0 || nchip > nmax) { cout << "Wrong number of dead chips: " << nchip << endl; return; }
98 nmax = ((fModules - nmod)*fChips - nchip)*fChannels;
99 if(nchan < 0 || nchan > nmax) { cout << "Wrong number of dead channels: " << nchan << endl; return; }
101 TRandom *gran = new TRandom();
103 // cout << "modules" << endl;
104 Int_t * mod = new Int_t [nmod];
105 Int_t i; //loop variable
106 for(i=0;i<nmod;i++) {
107 mod[i] = (Int_t) (1.+fModules*gran->Uniform());
108 cout << i+1 << ": Dead module nr: " << mod[i] << endl;
109 for(Int_t n=0; n<fChips; n++)
110 for(Int_t p=0; p<fChannels; p++)
111 fGain[mod[i]-1][n][p] = 0.;
114 // cout << "chips" << endl;
115 Int_t * chip = new Int_t[nchip];
116 Int_t * chip_mod = new Int_t[nchip];
119 Int_t module = (Int_t) (fModules*gran->Uniform() + 1.);
120 if(module <=0 || module > fModules) cout << "Wrong module: " << module << endl;
122 for(Int_t k=0;k<nmod;k++) if(module == mod[k]) flag_mod = 1;
123 if(flag_mod == 1) continue;
124 Int_t chi = (Int_t) (fChips*gran->Uniform() + 1.);
125 if(chi <=0 || chi > fChips) cout << "Wrong chip: " << chi << endl;
128 chip_mod[i-1] = module;
129 for(Int_t m=0; m<fChannels; m++) fGain[module-1][chi-1][m] = 0.;
130 cout << i << ": Dead chip nr. " << chip[i-1] << " in module nr: " << chip_mod[i-1] << endl;
133 // cout << "channels" << endl;
134 Int_t * channel = new Int_t[nchan];
135 Int_t * channel_chip = new Int_t[nchan];
136 Int_t * channel_mod = new Int_t[nchan];
139 Int_t k; //loop variable
140 Int_t module = (Int_t) (fModules*gran->Uniform() + 1.);
141 if(module <=0 || module > fModules) cout << "Wrong module: " << module << endl;
143 for(k=0;k<nmod;k++) if(module == mod[k]) flag_mod = 1;
144 if(flag_mod == 1) continue;
145 Int_t chipp = (Int_t) (fChips*gran->Uniform() + 1.);
146 if(chipp <=0 || chipp > fChips) cout << "Wrong chip: " << chipp << endl;
148 for(k=0;k<nchip;k++) if(chipp == chip[k] && module == chip_mod[k]) flag_chip = 1;
149 if(flag_chip == 1) continue;
151 channel[i-1] = (Int_t) (fChannels*gran->Uniform() + 1.);
152 if(channel[i-1] <=0 || channel[i-1] > fChannels) cout << "Wrong channel: " << channel[i-1] << endl;
153 channel_chip[i-1] = chipp;
154 channel_mod[i-1] = module;
155 fGain[module-1][chipp-1][channel[i-1]-1] = 0.;
156 cout << i << ": Dead channel nr. " << channel[i-1] << " in chip nr. " << channel_chip[i-1] << " in module nr: " << channel_mod[i-1] << endl;
163 delete [] channel_mod;
164 delete [] channel_chip;
167 void AliITSresponseSDD::PrintGains()
169 // Print SDD electronic gains
170 for(Int_t t=0; t<fModules;t++)
171 for(Int_t u=0; u<fChips;u++)
172 for(Int_t v=0; v<fChannels;v++)
173 cout << "Gain for Module: " << t+1 << ", Chip " << u+1 << ", Channel " << v+1 << " = " << fGain[t][u][v] << endl;
177 void AliITSresponseSDD::Print()
179 // Print SDD response Parameters
181 cout << "**************************************************" << endl;
182 cout << " Silicon Drift Detector Response Parameters " << endl;
183 cout << "**************************************************" << endl;
184 cout << "Diffusion Coefficients: " << fDiffCoeff << ", " << fDiffCoeff1 << endl;
186 cout << "Hardware compression parameters: " << endl;
187 for(Int_t i=0; i<8; i++) cout << "fCPar[" << i << "] = " << fCPar[i] << endl;
188 cout << "Noise before electronics (arbitrary units): " << fNoise << endl;
189 cout << "Baseline (ADC units): " << fBaseline << endl;
190 cout << "Noise after electronics (ADC units): " << fNoiseAfterEl << endl;
192 cout << "Dynamic Range: " << fDynamicRange << endl;
193 cout << "Charge Loss: " << fChargeLoss << endl;
194 cout << "Temperature: " << fTemperature << endl;
195 cout << "Drift Speed: " << fDriftSpeed << endl;
196 cout << "Electronics (1=PASCAL, 2=OLA): " << fElectronics << endl;
198 cout << "N. of Sigma for signal integration: " << fNsigmas << endl;
199 cout << "N. of bins in lookup table: " << fNcomps << endl;
201 cout << "Max. ADC Value: " << fMaxAdc << endl;
202 cout << "Min. Value: " << fMinVal << endl;
204 cout << "**************************************************" << endl;
205 cout << " Print Electronics Gains " << endl;
206 cout << "**************************************************" << endl;