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 "AliITSetfSDD.h"
21 ////////////////////////////////////////////////////////////////////////
23 // Written by Piergiorgio Cerello
26 //_____________________________________________________________________________
29 ClassImp(AliITSetfSDD)
31 Int_t ppower(Int_t b, Int_t e) {
33 for(Int_t i=0; i<e; i++) power *= b;
37 AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif)
39 // sampling time in ns
42 if(amplif == 2) fTimeDelay = 35.5;
43 fSamplingTime = timestep;
46 fDf = ppower(10,9)/(kMaxNofSamples*fSamplingTime);
47 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
49 if(amplif == 2) fA0 = 24000.;
50 // cout << "fA0: " << fA0 << endl;
51 // cout << "fTimeDelay: " << fTimeDelay << endl;
53 for(i=0; i<kMaxNofPoles; i++) {
64 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
65 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
67 fPoleR[0] = -3000000.;
71 fPoleR[1] = fPoleR[0];
72 fPoleI[1] = -fPoleI[0];
74 // Compute Transfer Function
76 Double_t PI = acos(-1.);
77 for(i=0; i<=kMaxNofSamples/2; i++) {
78 Double_t frequency = fDf*i;
81 for(Int_t k=0; k<kMaxNofPoles; k++) {
83 Double_t VZR = -fZeroR[k];
84 Double_t VZI = frequency - fZeroI[k];
85 Double_t VZM = TMath::Sqrt(VZR*VZR+VZI*VZI);
86 Double_t VZA = TMath::ATan2(VZI,VZR);
87 // cout << "VZM: " << VZM << ", VZA: " << VZA << endl;
88 // cout << "VZR: " << VZR << ", VZI: " << VZI << endl;
89 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
92 if(VA >= PI) VA -= (2.*PI);
93 if(VA <= -PI) VA += (2.*PI);
94 //cout << "VM: " << VM << ", VA: " << VA << endl;
99 Double_t VPR = -fPoleR[k];
100 Double_t VPI = frequency - fPoleI[k];
101 Double_t VPM = TMath::Sqrt(VPR*VPR+VPI*VPI);
102 Double_t VPA = TMath::ATan2(VPI,VPR);
103 //cout << "VPM: " << VPM << ", VPA: " << VPA << endl;
104 //cout << "VPR: " << VPR << ", VPI: " << VPI << endl;
105 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
108 if(VA >= PI) VA -= (2.*PI);
109 if(VA <= -PI) VA += (2.*PI);
110 //cout << "VM: " << VM << ", VA: " << VA << endl;
113 Double_t VR = VM*cos(VA);
114 Double_t VI = VM*sin(VA);
115 //cout << "VM: " << VM << ", VA: " << VA << endl;
116 //cout << "VR: " << VR << ", VI: " << VI << endl;
117 fTfR[i] = VR*ppower(10,9);
118 fTfI[i] = VI*ppower(10,9);
119 //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
120 //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
122 fTfR[kMaxNofSamples-i] = fTfR[i];
123 fTfI[kMaxNofSamples-i] = -fTfI[i];
128 // Compute Fourier Weights
130 for(i=0; i<=kMaxNofSamples/2; i++) {
131 fWR[i] = cos(-2.*PI*i/kMaxNofSamples);
132 fWI[i] = sin(-2.*PI*i/kMaxNofSamples);
134 fWR[kMaxNofSamples-i] = fWR[i];
135 fWI[kMaxNofSamples-i] = -fWI[i];
141 void AliITSetfSDD::PrintElectronics()
143 cout << "Time Delay " << fTimeDelay << endl;
144 cout << "Sampling Time " << fSamplingTime << endl;
145 cout << "Number of Time Samples " << kMaxNofSamples << endl;
146 cout << "fT0 " << fT0 << endl;
147 cout << "fDf " << fDf << endl;
148 cout << "fA0 " << fA0 << endl;
150 cout << "Zero's and Pole's" << endl;
151 cout << "fZeroM " << endl;
153 for(i=0; i<kMaxNofPoles; i++) cout << fZeroM[i] << endl;
154 cout << "fZero_R " << endl;
155 for(i=0; i<kMaxNofPoles; i++) cout << fZeroR[i] << endl;
156 cout << "fZeroI " << endl;
157 for(i=0; i<kMaxNofPoles; i++) cout << fZeroI[i] << endl;
158 cout << "fPoleM " << endl;
159 for(i=0; i<kMaxNofPoles; i++) cout << fPoleM[i] << endl;
160 cout << "fPoleR " << endl;
161 for(i=0; i<kMaxNofPoles; i++) cout << fPoleR[i] << endl;
162 cout << "fPoleI " << endl;
163 for(i=0; i<kMaxNofPoles; i++) cout << fPoleI[i] << endl;
165 cout << "Transfer function" << endl;
166 cout << "Real Part" << endl;
167 for(i=0; i<kMaxNofSamples; i++) cout << fTfR[i] << endl;
168 cout << "Imaginary Part " << endl;
169 for(i=0; i<kMaxNofSamples; i++) cout << fTfI[i] << endl;
171 cout << "Fourier Weights" << endl;
172 cout << "Real Part" << endl;
173 for(i=0; i<kMaxNofSamples; i++) cout << fWR[i] << endl;
174 cout << "Imaginary Part " << endl;
175 for(i=0; i<kMaxNofSamples; i++) cout << fWI[i] << endl;