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 **************************************************************************/
22 #include "AliITSetfSDD.h"
24 ////////////////////////////////////////////////////////////////////////
26 // Written by Piergiorgio Cerello
29 //_____________________________________________________________________________
32 ClassImp(AliITSetfSDD)
34 Int_t ppower(Int_t b, Int_t e) {
36 for(Int_t i=0; i<e; i++) power *= b;
40 AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif)
42 // sampling time in ns
45 if(amplif == 2) fTimeDelay = 35.5;
46 fSamplingTime = timestep;
49 fDf = ppower(10,9)/(kMaxNofSamples*fSamplingTime);
52 for(i=0; i<kMaxNofPoles; i++) {
65 fPoleR[0] = -8280000.;
68 if(amplif == 2) { // OLA amplif.
71 fPoleR[0] = -3000000.;
74 fPoleR[1] = fPoleR[0];
75 fPoleI[1] = -fPoleI[0];
78 if( amplif == 3 ) { // old PASCAL
79 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
81 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
82 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
84 fPoleR[1] = fPoleR[0];
85 fPoleI[1] = -fPoleI[0];
88 //cout << "fA0: " << fA0 << endl;
89 //cout << "fTimeDelay: " << fTimeDelay << endl;
91 // Compute Transfer Function
93 Double_t PI = acos(-1.);
94 for(i=0; i<=kMaxNofSamples/2; i++) {
95 Double_t frequency = fDf*i;
98 for(Int_t k=0; k<kMaxNofPoles; k++) {
100 Double_t VZR = -fZeroR[k];
101 Double_t VZI = frequency - fZeroI[k];
102 Double_t VZM = TMath::Sqrt(VZR*VZR+VZI*VZI);
103 Double_t VZA = TMath::ATan2(VZI,VZR);
104 // cout << "VZM: " << VZM << ", VZA: " << VZA << endl;
105 // cout << "VZR: " << VZR << ", VZI: " << VZI << endl;
106 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
109 if(VA >= PI) VA -= (2.*PI);
110 if(VA <= -PI) VA += (2.*PI);
111 //cout << "VM: " << VM << ", VA: " << VA << endl;
116 Double_t VPR = -fPoleR[k];
117 Double_t VPI = frequency - fPoleI[k];
118 Double_t VPM = TMath::Sqrt(VPR*VPR+VPI*VPI);
119 Double_t VPA = TMath::ATan2(VPI,VPR);
120 //cout << "VPM: " << VPM << ", VPA: " << VPA << endl;
121 //cout << "VPR: " << VPR << ", VPI: " << VPI << endl;
122 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
125 if(VA >= PI) VA -= (2.*PI);
126 if(VA <= -PI) VA += (2.*PI);
127 //cout << "VM: " << VM << ", VA: " << VA << endl;
130 Double_t VR = VM*cos(VA);
131 Double_t VI = VM*sin(VA);
132 //cout << "VM: " << VM << ", VA: " << VA << endl;
133 //cout << "VR: " << VR << ", VI: " << VI << endl;
134 fTfR[i] = VR*ppower(10,9);
135 fTfI[i] = VI*ppower(10,9);
136 //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
137 //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
139 fTfR[kMaxNofSamples-i] = fTfR[i];
140 fTfI[kMaxNofSamples-i] = -fTfI[i];
145 // Compute Fourier Weights
147 for(i=0; i<=kMaxNofSamples/2; i++) {
148 fWR[i] = cos(-2.*PI*i/kMaxNofSamples);
149 fWI[i] = sin(-2.*PI*i/kMaxNofSamples);
151 fWR[kMaxNofSamples-i] = fWR[i];
152 fWI[kMaxNofSamples-i] = -fWI[i];
158 void AliITSetfSDD::PrintElectronics()
160 cout << "Time Delay " << fTimeDelay << endl;
161 cout << "Sampling Time " << fSamplingTime << endl;
162 cout << "Number of Time Samples " << kMaxNofSamples << endl;
163 cout << "fT0 " << fT0 << endl;
164 cout << "fDf " << fDf << endl;
165 cout << "fA0 " << fA0 << endl;
167 cout << "Zero's and Pole's" << endl;
168 cout << "fZeroM " << endl;
170 for(i=0; i<kMaxNofPoles; i++) cout << fZeroM[i] << endl;
171 cout << "fZero_R " << endl;
172 for(i=0; i<kMaxNofPoles; i++) cout << fZeroR[i] << endl;
173 cout << "fZeroI " << endl;
174 for(i=0; i<kMaxNofPoles; i++) cout << fZeroI[i] << endl;
175 cout << "fPoleM " << endl;
176 for(i=0; i<kMaxNofPoles; i++) cout << fPoleM[i] << endl;
177 cout << "fPoleR " << endl;
178 for(i=0; i<kMaxNofPoles; i++) cout << fPoleR[i] << endl;
179 cout << "fPoleI " << endl;
180 for(i=0; i<kMaxNofPoles; i++) cout << fPoleI[i] << endl;
182 cout << "Transfer function" << endl;
183 cout << "Real Part" << endl;
184 for(i=0; i<kMaxNofSamples; i++) cout << fTfR[i] << endl;
185 cout << "Imaginary Part " << endl;
186 for(i=0; i<kMaxNofSamples; i++) cout << fTfI[i] << endl;
188 cout << "Fourier Weights" << endl;
189 cout << "Real Part" << endl;
190 for(i=0; i<kMaxNofSamples; i++) cout << fWR[i] << endl;
191 cout << "Imaginary Part " << endl;
192 for(i=0; i<kMaxNofSamples; i++) cout << fWI[i] << endl;