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 //_____________________________________________________________________________
32 ClassImp(AliITSetfSDD)
34 const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofPoles = 5;
35 const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofSamples = 1024;
37 AliITSetfSDD::AliITSetfSDD():
53 // Default constructor
56 AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif):
73 // Standard constructor. sampling time in ns
76 cout<<"Number of poles: "<<AliITSetfSDDparam::NumberOfPoles()<<endl;
77 cout<<"Number of samples: "<<AliITSetfSDDparam::NumberOfSamples()<<endl;
80 if(amplif == 2) fTimeDelay = 35.5;
81 fSamplingTime = timestep;
82 Double_t xGiga=1.0E+9;
84 fDf = xGiga/(AliITSetfSDDparam::NumberOfSamples()*fSamplingTime);
86 fZeroM = new Double_t[AliITSetfSDDparam::NumberOfPoles()];
87 fZeroR = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
88 fZeroI = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
89 fPoleM = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
90 fPoleR = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
91 fPoleI = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
92 fTfR = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
93 fTfI = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
94 fWR = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
95 fWI = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
97 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) {
108 fA0 = 5.53269815e+11;
110 fPoleR[0] = -8280000.;
113 if(amplif == 2) { // OLA amplif.
116 fPoleR[0] = -3000000.;
117 fPoleI[0] = 4000000.;
119 fPoleR[1] = fPoleR[0];
120 fPoleI[1] = -fPoleI[0];
123 if( amplif == 3 ) { // old PASCAL
124 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
126 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
127 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
129 fPoleR[1] = fPoleR[0];
130 fPoleI[1] = -fPoleI[0];
133 //cout << "fA0: " << fA0 << endl;
134 //cout << "fTimeDelay: " << fTimeDelay << endl;
136 // Compute Transfer Function
138 Double_t pigr = acos(-1.);
139 for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) {
140 Double_t frequency = fDf*i;
143 for(Int_t k=0; k<AliITSetfSDDparam::NumberOfPoles(); k++) {
145 Double_t vVZR = -fZeroR[k];
146 Double_t vVZI = frequency - fZeroI[k];
147 Double_t vVZM = TMath::Sqrt(vVZR*vVZR+vVZI*vVZI);
148 Double_t vVZA = TMath::ATan2(vVZI,vVZR);
149 // cout << "VZM: " << vVZM << ", VZA: " << vVZA << endl;
150 // cout << "VZR: " << vVZR << ", VZI: " << vVZI << endl;
151 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
154 if(vVA >= pigr) vVA -= (2.*pigr);
155 if(vVA <= -pigr) vVA += (2.*pigr);
156 //cout << "vVM: " << vVM << ", VA: " << vVA << endl;
161 Double_t vVPR = -fPoleR[k];
162 Double_t vVPI = frequency - fPoleI[k];
163 Double_t vVPM = TMath::Sqrt(vVPR*vVPR+vVPI*vVPI);
164 Double_t vVPA = TMath::ATan2(vVPI,vVPR);
165 //cout << "VPM: " << vVPM << ", VPA: " << vVPA << endl;
166 //cout << "VPR: " << vVPR << ", VPI: " << vVPI << endl;
167 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
170 if(vVA >= pigr) vVA -= (2.*pigr);
171 if(vVA <= -pigr) vVA += (2.*pigr);
172 //cout << "VM: " << vVM << ", vVA: " << vVA << endl;
175 Double_t vVR = vVM*cos(vVA);
176 Double_t vVI = vVM*sin(vVA);
177 //cout << "VM: " << vVM << ", VA: " << vVA << endl;
178 //cout << "VR: " << vVR << ", VI: " << vVI << endl;
181 //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
182 //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
184 fTfR[AliITSetfSDDparam::NumberOfSamples()-i] = fTfR[i];
185 fTfI[AliITSetfSDDparam::NumberOfSamples()-i] = -fTfI[i];
190 // Compute Fourier Weights
192 for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) {
193 fWR[i] = cos(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples());
194 fWI[i] = sin(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples());
196 fWR[AliITSetfSDDparam::NumberOfSamples()-i] = fWR[i];
197 fWI[AliITSetfSDDparam::NumberOfSamples()-i] = -fWI[i];
204 AliITSetfSDD::~AliITSetfSDD(){
206 if(fZeroM) delete []fZeroM;
207 if(fZeroR) delete []fZeroR;
208 if(fZeroI) delete []fZeroI;
209 if(fPoleM) delete []fPoleM;
210 if(fPoleR) delete []fPoleR;
211 if(fPoleI) delete []fPoleI;
212 if(fTfR) delete []fTfR;
213 if(fTfI) delete []fTfI;
214 if(fWR) delete []fWR;
215 if(fWI) delete []fWI;
218 void AliITSetfSDD::PrintElectronics() const {
219 // Printout of the parameters defining the f.e. electronics
221 cout << "Time Delay " << fTimeDelay << endl;
222 cout << "Sampling Time " << fSamplingTime << endl;
223 cout << "Number of Time Samples " << AliITSetfSDDparam::NumberOfSamples() << endl;
224 cout << "fT0 " << fT0 << endl;
225 cout << "fDf " << fDf << endl;
226 cout << "fA0 " << fA0 << endl;
228 cout << "Zero's and Pole's" << endl;
229 cout << "fZeroM " << endl;
231 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroM[i] << endl;
232 cout << "fZero_R " << endl;
233 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroR[i] << endl;
234 cout << "fZeroI " << endl;
235 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroI[i] << endl;
236 cout << "fPoleM " << endl;
237 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleM[i] << endl;
238 cout << "fPoleR " << endl;
239 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleR[i] << endl;
240 cout << "fPoleI " << endl;
241 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleI[i] << endl;
243 cout << "Transfer function" << endl;
244 cout << "Real Part" << endl;
245 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fTfR[i] << endl;
246 cout << "Imaginary Part " << endl;
247 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fTfI[i] << endl;
249 cout << "Fourier Weights" << endl;
250 cout << "Real Part" << endl;
251 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fWR[i] << endl;
252 cout << "Imaginary Part " << endl;
253 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fWI[i] << endl;