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 <Riostream.h>
21 #include "AliITSetfSDD.h"
23 ////////////////////////////////////////////////////////////////////////
25 // Written by Piergiorgio Cerello
27 // Revised to comply with coding conventions: Nov, 21 2003 m.m.
28 //_____________________________________________________________________________
31 ClassImp(AliITSetfSDD)
33 const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofPoles = 5;
34 const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofSamples = 1024;
36 AliITSetfSDD::AliITSetfSDD():
52 // Default constructor
55 AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif):
72 // Standard constructor. sampling time in ns
75 cout<<"Number of poles: "<<AliITSetfSDDparam::NumberOfPoles()<<endl;
76 cout<<"Number of samples: "<<AliITSetfSDDparam::NumberOfSamples()<<endl;
79 if(amplif == 2) fTimeDelay = 35.5;
80 fSamplingTime = timestep;
81 Double_t xGiga=1.0E+9;
83 fDf = xGiga/(AliITSetfSDDparam::NumberOfSamples()*fSamplingTime);
85 fZeroM = new Double_t[AliITSetfSDDparam::NumberOfPoles()];
86 fZeroR = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
87 fZeroI = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
88 fPoleM = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
89 fPoleR = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
90 fPoleI = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
91 fTfR = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
92 fTfI = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
93 fWR = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
94 fWI = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
96 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) {
107 fA0 = 5.53269815e+11;
109 fPoleR[0] = -8280000.;
112 if(amplif == 2) { // OLA amplif.
115 fPoleR[0] = -3000000.;
116 fPoleI[0] = 4000000.;
118 fPoleR[1] = fPoleR[0];
119 fPoleI[1] = -fPoleI[0];
122 if( amplif == 3 ) { // old PASCAL
123 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
125 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
126 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
128 fPoleR[1] = fPoleR[0];
129 fPoleI[1] = -fPoleI[0];
132 //cout << "fA0: " << fA0 << endl;
133 //cout << "fTimeDelay: " << fTimeDelay << endl;
135 // Compute Transfer Function
137 Double_t pigr = acos(-1.);
138 for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) {
139 Double_t frequency = fDf*i;
142 for(Int_t k=0; k<AliITSetfSDDparam::NumberOfPoles(); k++) {
144 Double_t vVZR = -fZeroR[k];
145 Double_t vVZI = frequency - fZeroI[k];
146 Double_t vVZM = TMath::Sqrt(vVZR*vVZR+vVZI*vVZI);
147 Double_t vVZA = TMath::ATan2(vVZI,vVZR);
148 // cout << "VZM: " << vVZM << ", VZA: " << vVZA << endl;
149 // cout << "VZR: " << vVZR << ", VZI: " << vVZI << endl;
150 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
153 if(vVA >= pigr) vVA -= (2.*pigr);
154 if(vVA <= -pigr) vVA += (2.*pigr);
155 //cout << "vVM: " << vVM << ", VA: " << vVA << endl;
160 Double_t vVPR = -fPoleR[k];
161 Double_t vVPI = frequency - fPoleI[k];
162 Double_t vVPM = TMath::Sqrt(vVPR*vVPR+vVPI*vVPI);
163 Double_t vVPA = TMath::ATan2(vVPI,vVPR);
164 //cout << "VPM: " << vVPM << ", VPA: " << vVPA << endl;
165 //cout << "VPR: " << vVPR << ", VPI: " << vVPI << endl;
166 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
169 if(vVA >= pigr) vVA -= (2.*pigr);
170 if(vVA <= -pigr) vVA += (2.*pigr);
171 //cout << "VM: " << vVM << ", vVA: " << vVA << endl;
174 Double_t vVR = vVM*cos(vVA);
175 Double_t vVI = vVM*sin(vVA);
176 //cout << "VM: " << vVM << ", VA: " << vVA << endl;
177 //cout << "VR: " << vVR << ", VI: " << vVI << endl;
180 //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
181 //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
183 fTfR[AliITSetfSDDparam::NumberOfSamples()-i] = fTfR[i];
184 fTfI[AliITSetfSDDparam::NumberOfSamples()-i] = -fTfI[i];
189 // Compute Fourier Weights
191 for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) {
192 fWR[i] = cos(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples());
193 fWI[i] = sin(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples());
195 fWR[AliITSetfSDDparam::NumberOfSamples()-i] = fWR[i];
196 fWI[AliITSetfSDDparam::NumberOfSamples()-i] = -fWI[i];
203 AliITSetfSDD::~AliITSetfSDD(){
205 if(fZeroM) delete []fZeroM;
206 if(fZeroR) delete []fZeroR;
207 if(fZeroI) delete []fZeroI;
208 if(fPoleM) delete []fPoleM;
209 if(fPoleR) delete []fPoleR;
210 if(fPoleI) delete []fPoleI;
211 if(fTfR) delete []fTfR;
212 if(fTfI) delete []fTfI;
213 if(fWR) delete []fWR;
214 if(fWI) delete []fWI;
217 void AliITSetfSDD::PrintElectronics() const {
218 // Printout of the parameters defining the f.e. electronics
220 cout << "Time Delay " << fTimeDelay << endl;
221 cout << "Sampling Time " << fSamplingTime << endl;
222 cout << "Number of Time Samples " << AliITSetfSDDparam::NumberOfSamples() << endl;
223 cout << "fT0 " << fT0 << endl;
224 cout << "fDf " << fDf << endl;
225 cout << "fA0 " << fA0 << endl;
227 cout << "Zero's and Pole's" << endl;
228 cout << "fZeroM " << endl;
230 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroM[i] << endl;
231 cout << "fZero_R " << endl;
232 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroR[i] << endl;
233 cout << "fZeroI " << endl;
234 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroI[i] << endl;
235 cout << "fPoleM " << endl;
236 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleM[i] << endl;
237 cout << "fPoleR " << endl;
238 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleR[i] << endl;
239 cout << "fPoleI " << endl;
240 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleI[i] << endl;
242 cout << "Transfer function" << endl;
243 cout << "Real Part" << endl;
244 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fTfR[i] << endl;
245 cout << "Imaginary Part " << endl;
246 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fTfI[i] << endl;
248 cout << "Fourier Weights" << endl;
249 cout << "Real Part" << endl;
250 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fWR[i] << endl;
251 cout << "Imaginary Part " << endl;
252 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fWI[i] << endl;