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.1.2.2 2000/06/12 18:09:36 barbera
19 fixed posible compilation errors on HP unix
21 Revision 1.1.2.1 2000/01/12 20:21:30 nilsen
22 missed AliITSetfSDD files ealier
31 #include "AliITSetfSDD.h"
33 ////////////////////////////////////////////////////////////////////////
35 // Written by Piergiorgio Cerello
38 // AliITSmapSDD is the map of SDDs.
42 <img src="picts/ITS/AliITShit_Class_Diagram.gif">
45 <font size=+2 color=red>
46 <p>This show the relasionships between the ITS hit class and the rest of Aliroot.
51 //extern Int_t power(Int_t b, Int_t e);
53 //_____________________________________________________________________________
54 ClassImp(AliITSetfSDD)
56 Int_t ppower(Int_t b, Int_t e) {
58 for(i=0; i<e; i++) power *= b;
62 AliITSetfSDD::AliITSetfSDD(Double_t timeclock)
64 // sampling time in ns
65 fSamplingTime = 1000./timeclock;
67 fDf = ppower(10,9)/(fMaxNofSamples*fSamplingTime);
71 for(i=0; i<fMaxNofPoles; i++) {
80 fPole_R[0] = -2100000.;
81 fPole_I[0] = fPole_R[0];
83 fPole_R[1] = -2100000.;
84 fPole_I[1] = -fPole_R[1];
86 // Compute Transfer Function
88 Double_t PI = acos(-1.);
89 for(i=0; i<=fMaxNofSamples/2; i++) {
90 Double_t frequency = fDf*i;
93 for(k=0; k<fMaxNofPoles; k++) {
95 Double_t VZR = -fZero_R[k];
96 Double_t VZI = frequency - fZero_I[k];
97 Double_t VZM = TMath::Sqrt(VZR*VZR+VZI*VZI);
98 Double_t VZA = TMath::ATan2(VZI,VZR);
99 // cout << "VZM: " << VZM << ", VZA: " << VZA << endl;
100 // cout << "VZR: " << VZR << ", VZI: " << VZI << endl;
101 for(j=1; j<= (Int_t) fZero_M[k]; j++) {
104 if(VA >= PI) VA -= (2.*PI);
105 if(VA <= -PI) VA += (2.*PI);
106 //cout << "VM: " << VM << ", VA: " << VA << endl;
111 Double_t VPR = -fPole_R[k];
112 Double_t VPI = frequency - fPole_I[k];
113 Double_t VPM = TMath::Sqrt(VPR*VPR+VPI*VPI);
114 Double_t VPA = TMath::ATan2(VPI,VPR);
115 //cout << "VPM: " << VPM << ", VPA: " << VPA << endl;
116 //cout << "VPR: " << VPR << ", VPI: " << VPI << endl;
117 for(j=1; j<= (Int_t) fPole_M[k]; j++) {
120 if(VA >= PI) VA -= (2.*PI);
121 if(VA <= -PI) VA += (2.*PI);
122 //cout << "VM: " << VM << ", VA: " << VA << endl;
125 Double_t VR = VM*cos(VA);
126 Double_t VI = VM*sin(VA);
127 //cout << "VM: " << VM << ", VA: " << VA << endl;
128 //cout << "VR: " << VR << ", VI: " << VI << endl;
129 fTf_R[i] = VR*ppower(10,9);
130 fTf_I[i] = VI*ppower(10,9);
131 //cout << "fTf_R[" << i << "] = " << fTf_R[i] << endl;
132 //cout << "fTf_I[" << i << "] = " << fTf_I[i] << endl;
134 fTf_R[fMaxNofSamples-i] = fTf_R[i];
135 fTf_I[fMaxNofSamples-i] = -fTf_I[i];
140 // Compute Fourier Weights
142 for(i=0; i<=fMaxNofSamples/2; i++) {
143 fW_R[i] = cos(-2.*PI*i/fMaxNofSamples);
144 fW_I[i] = sin(-2.*PI*i/fMaxNofSamples);
146 fW_R[fMaxNofSamples-i] = fW_R[i];
147 fW_I[fMaxNofSamples-i] = -fW_I[i];
153 void AliITSetfSDD::Print()
156 cout << "Sampling Time " << fSamplingTime << endl;
157 cout << "Number of Time Samples " << fMaxNofSamples << endl;
158 cout << "fT0 " << fT0 << endl;
159 cout << "fDf " << fDf << endl;
160 cout << "fA0 " << fA0 << endl;
162 cout << "Zero's and Pole's" << endl;
163 cout << "fZero_M " << endl;
164 for(i=0; i<fMaxNofPoles; i++) cout << fZero_M[i] << endl;
165 cout << "fZero_R " << endl;
166 for(i=0; i<fMaxNofPoles; i++) cout << fZero_R[i] << endl;
167 cout << "fZero_I " << endl;
168 for(i=0; i<fMaxNofPoles; i++) cout << fZero_I[i] << endl;
169 cout << "fPole_M " << endl;
170 for(i=0; i<fMaxNofPoles; i++) cout << fPole_M[i] << endl;
171 cout << "fPole_R " << endl;
172 for(i=0; i<fMaxNofPoles; i++) cout << fPole_R[i] << endl;
173 cout << "fPole_I " << endl;
174 for(i=0; i<fMaxNofPoles; i++) cout << fPole_I[i] << endl;
176 cout << "Transfer function" << endl;
177 cout << "Real Part" << endl;
178 for(i=0; i<fMaxNofSamples; i++) cout << fTf_R[i] << endl;
179 cout << "Imaginary Part " << endl;
180 for(i=0; i<fMaxNofSamples; i++) cout << fTf_I[i] << endl;
182 cout << "Fourier Weights" << endl;
183 cout << "Real Part" << endl;
184 for(i=0; i<fMaxNofSamples; i++) cout << fW_R[i] << endl;
185 cout << "Imaginary Part " << endl;
186 for(i=0; i<fMaxNofSamples; i++) cout << fW_I[i] << endl;