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 **************************************************************************/
18 Revision 1.8 2002/10/14 14:57:00 hristov
19 Merging the VirtualMC branch to the main development branch (HEAD)
21 Revision 1.6.6.1 2002/06/10 17:51:15 hristov
24 Revision 1.7 2002/04/24 22:02:31 nilsen
25 New SDigits and Digits routines, and related changes, (including new
29 #include <Riostream.h>
32 #include "AliITSetfSDD.h"
34 ////////////////////////////////////////////////////////////////////////
36 // Written by Piergiorgio Cerello
39 //_____________________________________________________________________________
42 ClassImp(AliITSetfSDD)
44 Int_t ppower(Int_t b, Int_t e) {
46 for(Int_t i=0; i<e; i++) power *= b;
50 AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif)
52 // sampling time in ns
55 if(amplif == 2) fTimeDelay = 35.5;
56 fSamplingTime = timestep;
59 fDf = ppower(10,9)/(kMaxNofSamples*fSamplingTime);
62 for(i=0; i<kMaxNofPoles; i++) {
75 fPoleR[0] = -8280000.;
78 if(amplif == 2) { // OLA amplif.
81 fPoleR[0] = -3000000.;
84 fPoleR[1] = fPoleR[0];
85 fPoleI[1] = -fPoleI[0];
88 if( amplif == 3 ) { // old PASCAL
89 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
91 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
92 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
94 fPoleR[1] = fPoleR[0];
95 fPoleI[1] = -fPoleI[0];
98 //cout << "fA0: " << fA0 << endl;
99 //cout << "fTimeDelay: " << fTimeDelay << endl;
101 // Compute Transfer Function
103 Double_t PI = acos(-1.);
104 for(i=0; i<=kMaxNofSamples/2; i++) {
105 Double_t frequency = fDf*i;
108 for(Int_t k=0; k<kMaxNofPoles; k++) {
110 Double_t VZR = -fZeroR[k];
111 Double_t VZI = frequency - fZeroI[k];
112 Double_t VZM = TMath::Sqrt(VZR*VZR+VZI*VZI);
113 Double_t VZA = TMath::ATan2(VZI,VZR);
114 // cout << "VZM: " << VZM << ", VZA: " << VZA << endl;
115 // cout << "VZR: " << VZR << ", VZI: " << VZI << endl;
116 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
119 if(VA >= PI) VA -= (2.*PI);
120 if(VA <= -PI) VA += (2.*PI);
121 //cout << "VM: " << VM << ", VA: " << VA << endl;
126 Double_t VPR = -fPoleR[k];
127 Double_t VPI = frequency - fPoleI[k];
128 Double_t VPM = TMath::Sqrt(VPR*VPR+VPI*VPI);
129 Double_t VPA = TMath::ATan2(VPI,VPR);
130 //cout << "VPM: " << VPM << ", VPA: " << VPA << endl;
131 //cout << "VPR: " << VPR << ", VPI: " << VPI << endl;
132 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
135 if(VA >= PI) VA -= (2.*PI);
136 if(VA <= -PI) VA += (2.*PI);
137 //cout << "VM: " << VM << ", VA: " << VA << endl;
140 Double_t VR = VM*cos(VA);
141 Double_t VI = VM*sin(VA);
142 //cout << "VM: " << VM << ", VA: " << VA << endl;
143 //cout << "VR: " << VR << ", VI: " << VI << endl;
144 fTfR[i] = VR*ppower(10,9);
145 fTfI[i] = VI*ppower(10,9);
146 //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
147 //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
149 fTfR[kMaxNofSamples-i] = fTfR[i];
150 fTfI[kMaxNofSamples-i] = -fTfI[i];
155 // Compute Fourier Weights
157 for(i=0; i<=kMaxNofSamples/2; i++) {
158 fWR[i] = cos(-2.*PI*i/kMaxNofSamples);
159 fWI[i] = sin(-2.*PI*i/kMaxNofSamples);
161 fWR[kMaxNofSamples-i] = fWR[i];
162 fWI[kMaxNofSamples-i] = -fWI[i];
168 void AliITSetfSDD::PrintElectronics()
170 cout << "Time Delay " << fTimeDelay << endl;
171 cout << "Sampling Time " << fSamplingTime << endl;
172 cout << "Number of Time Samples " << kMaxNofSamples << endl;
173 cout << "fT0 " << fT0 << endl;
174 cout << "fDf " << fDf << endl;
175 cout << "fA0 " << fA0 << endl;
177 cout << "Zero's and Pole's" << endl;
178 cout << "fZeroM " << endl;
180 for(i=0; i<kMaxNofPoles; i++) cout << fZeroM[i] << endl;
181 cout << "fZero_R " << endl;
182 for(i=0; i<kMaxNofPoles; i++) cout << fZeroR[i] << endl;
183 cout << "fZeroI " << endl;
184 for(i=0; i<kMaxNofPoles; i++) cout << fZeroI[i] << endl;
185 cout << "fPoleM " << endl;
186 for(i=0; i<kMaxNofPoles; i++) cout << fPoleM[i] << endl;
187 cout << "fPoleR " << endl;
188 for(i=0; i<kMaxNofPoles; i++) cout << fPoleR[i] << endl;
189 cout << "fPoleI " << endl;
190 for(i=0; i<kMaxNofPoles; i++) cout << fPoleI[i] << endl;
192 cout << "Transfer function" << endl;
193 cout << "Real Part" << endl;
194 for(i=0; i<kMaxNofSamples; i++) cout << fTfR[i] << endl;
195 cout << "Imaginary Part " << endl;
196 for(i=0; i<kMaxNofSamples; i++) cout << fTfI[i] << endl;
198 cout << "Fourier Weights" << endl;
199 cout << "Real Part" << endl;
200 for(i=0; i<kMaxNofSamples; i++) cout << fWR[i] << endl;
201 cout << "Imaginary Part " << endl;
202 for(i=0; i<kMaxNofSamples; i++) cout << fWI[i] << endl;