]> git.uio.no Git - u/mrichter/AliRoot.git/blame_incremental - ITS/AliITSetfSDD.cxx
Removing obsolete class AliITSGeant3Geometry - Test beam simulation classes back...
[u/mrichter/AliRoot.git] / ITS / AliITSetfSDD.cxx
... / ...
CommitLineData
1/**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3 * *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
6 * *
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 **************************************************************************/
15
16/* $Id$ */
17
18
19#include <Riostream.h>
20#include <TMath.h>
21#include "AliITSetfSDD.h"
22
23////////////////////////////////////////////////////////////////////////
24// Version: 0
25// Written by Piergiorgio Cerello
26// November 23 1999
27// Revised to comply with coding conventions: Nov, 21 2003 m.m.
28//_____________________________________________________________________________
29
30
31ClassImp(AliITSetfSDD)
32
33const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofPoles = 5;
34const Int_t AliITSetfSDD::AliITSetfSDDparam::fgkMaxNofSamples = 1024;
35
36Int_t ppower(Int_t b, Int_t e) {
37 Int_t power = 1;
38 for(Int_t i=0; i<e; i++) power *= b;
39 return power;
40}
41
42AliITSetfSDD::AliITSetfSDD() {
43 // Default constructor
44 fTimeDelay = 0.;
45 fSamplingTime = 0.;
46 fT0 = 0.;
47 fDf = 0.;
48 fA0 = 0.;
49 fZeroM = 0;
50 fZeroR = 0;
51 fPoleM = 0;
52 fPoleR = 0;
53 fPoleI = 0;
54 fTfR = 0;
55 fTfI = 0;
56 fWR = 0;
57 fWI = 0;
58}
59
60AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif)
61{
62 // Standard constructor. sampling time in ns
63
64 /*
65 cout<<"Number of poles: "<<AliITSetfSDDparam::NumberOfPoles()<<endl;
66 cout<<"Number of samples: "<<AliITSetfSDDparam::NumberOfSamples()<<endl;
67 */
68 fTimeDelay = 53.5;
69 if(amplif == 2) fTimeDelay = 35.5;
70 fSamplingTime = timestep;
71
72 fT0 = 0.;
73 fDf = ppower(10,9)/(AliITSetfSDDparam::NumberOfSamples()*fSamplingTime);
74
75 Int_t i,j;
76 fZeroM = new Double_t[AliITSetfSDDparam::NumberOfPoles()];
77 fZeroR = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
78 fZeroI = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
79 fPoleM = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
80 fPoleR = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
81 fPoleI = new Double_t [AliITSetfSDDparam::NumberOfPoles()];
82 fTfR = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
83 fTfI = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
84 fWR = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
85 fWI = new Double_t [AliITSetfSDDparam::NumberOfSamples()];
86
87 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) {
88 fZeroM[i] = 0.;
89 fZeroR[i] = 0.;
90 fZeroI[i] = 0.;
91 fPoleM[i] = 0.;
92 fPoleR[i] = 0.;
93 fPoleI[i] = 0.;
94 }
95 // Alice
96
97 // PASCAL amplif
98 fA0 = 5.53269815e+11;
99 fPoleM[0] = 3.;
100 fPoleR[0] = -8280000.;
101 fPoleI[0] = 0.;
102
103 if(amplif == 2) { // OLA amplif.
104 fA0 = 24000.;
105 fPoleM[0] = 1.;
106 fPoleR[0] = -3000000.;
107 fPoleI[0] = 4000000.;
108 fPoleM[1] = 1.;
109 fPoleR[1] = fPoleR[0];
110 fPoleI[1] = -fPoleI[0];
111 }
112
113 if( amplif == 3 ) { // old PASCAL
114 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
115 fPoleM[0] = 1.;
116 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
117 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
118 fPoleM[1] = 1.;
119 fPoleR[1] = fPoleR[0];
120 fPoleI[1] = -fPoleI[0];
121 }
122
123 //cout << "fA0: " << fA0 << endl;
124 //cout << "fTimeDelay: " << fTimeDelay << endl;
125
126 // Compute Transfer Function
127
128 Double_t pigr = acos(-1.);
129 for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) {
130 Double_t frequency = fDf*i;
131 Double_t vVM = fA0;
132 Double_t vVA = 0.;
133 for(Int_t k=0; k<AliITSetfSDDparam::NumberOfPoles(); k++) {
134 if(fZeroM[k]) {
135 Double_t vVZR = -fZeroR[k];
136 Double_t vVZI = frequency - fZeroI[k];
137 Double_t vVZM = TMath::Sqrt(vVZR*vVZR+vVZI*vVZI);
138 Double_t vVZA = TMath::ATan2(vVZI,vVZR);
139 // cout << "VZM: " << vVZM << ", VZA: " << vVZA << endl;
140 // cout << "VZR: " << vVZR << ", VZI: " << vVZI << endl;
141 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
142 vVM *= vVZM;
143 vVA += vVZA;
144 if(vVA >= pigr) vVA -= (2.*pigr);
145 if(vVA <= -pigr) vVA += (2.*pigr);
146 //cout << "vVM: " << vVM << ", VA: " << vVA << endl;
147 }
148 }
149
150 if(fPoleM[k]) {
151 Double_t vVPR = -fPoleR[k];
152 Double_t vVPI = frequency - fPoleI[k];
153 Double_t vVPM = TMath::Sqrt(vVPR*vVPR+vVPI*vVPI);
154 Double_t vVPA = TMath::ATan2(vVPI,vVPR);
155 //cout << "VPM: " << vVPM << ", VPA: " << vVPA << endl;
156 //cout << "VPR: " << vVPR << ", VPI: " << vVPI << endl;
157 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
158 vVM /= vVPM;
159 vVA -= vVPA;
160 if(vVA >= pigr) vVA -= (2.*pigr);
161 if(vVA <= -pigr) vVA += (2.*pigr);
162 //cout << "VM: " << vVM << ", vVA: " << vVA << endl;
163 }
164 }
165 Double_t vVR = vVM*cos(vVA);
166 Double_t vVI = vVM*sin(vVA);
167 //cout << "VM: " << vVM << ", VA: " << vVA << endl;
168 //cout << "VR: " << vVR << ", VI: " << vVI << endl;
169 fTfR[i] = vVR*ppower(10,9);
170 fTfI[i] = vVI*ppower(10,9);
171 //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
172 //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
173 if(i) {
174 fTfR[AliITSetfSDDparam::NumberOfSamples()-i] = fTfR[i];
175 fTfI[AliITSetfSDDparam::NumberOfSamples()-i] = -fTfI[i];
176 }
177 }
178 }
179
180 // Compute Fourier Weights
181
182 for(i=0; i<=AliITSetfSDDparam::NumberOfSamples()/2; i++) {
183 fWR[i] = cos(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples());
184 fWI[i] = sin(-2.*pigr*i/AliITSetfSDDparam::NumberOfSamples());
185 if(i) {
186 fWR[AliITSetfSDDparam::NumberOfSamples()-i] = fWR[i];
187 fWI[AliITSetfSDDparam::NumberOfSamples()-i] = -fWI[i];
188 }
189 }
190
191}
192
193//______________________________________________________________________
194AliITSetfSDD::AliITSetfSDD(const AliITSetfSDD &obj) : TObject(obj) {
195 // Copy constructor
196 // Copies are not allowed. The method is protected to avoid misuse.
197 Error("AliITSetfSDD","Copy constructor not allowed\n");
198}
199
200//______________________________________________________________________
201AliITSetfSDD& AliITSetfSDD::operator=(const AliITSetfSDD& /* obj */){
202 // Assignment operator
203 // Assignment is not allowed. The method is protected to avoid misuse.
204 Error("= operator","Assignment operator not allowed\n");
205 return *this;
206}
207
208AliITSetfSDD::~AliITSetfSDD(){
209 // Destructor
210 if(fZeroM) delete []fZeroM;
211 if(fZeroR) delete []fZeroR;
212 if(fZeroI) delete []fZeroI;
213 if(fPoleM) delete []fPoleM;
214 if(fPoleR) delete []fPoleR;
215 if(fPoleI) delete []fPoleI;
216 if(fTfR) delete []fTfR;
217 if(fTfI) delete []fTfI;
218 if(fWR) delete []fWR;
219 if(fWI) delete []fWI;
220}
221
222void AliITSetfSDD::PrintElectronics() const {
223 // Printout of the parameters defining the f.e. electronics
224
225 cout << "Time Delay " << fTimeDelay << endl;
226 cout << "Sampling Time " << fSamplingTime << endl;
227 cout << "Number of Time Samples " << AliITSetfSDDparam::NumberOfSamples() << endl;
228 cout << "fT0 " << fT0 << endl;
229 cout << "fDf " << fDf << endl;
230 cout << "fA0 " << fA0 << endl;
231
232 cout << "Zero's and Pole's" << endl;
233 cout << "fZeroM " << endl;
234 Int_t i;
235 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroM[i] << endl;
236 cout << "fZero_R " << endl;
237 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroR[i] << endl;
238 cout << "fZeroI " << endl;
239 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fZeroI[i] << endl;
240 cout << "fPoleM " << endl;
241 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleM[i] << endl;
242 cout << "fPoleR " << endl;
243 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleR[i] << endl;
244 cout << "fPoleI " << endl;
245 for(i=0; i<AliITSetfSDDparam::NumberOfPoles(); i++) cout << fPoleI[i] << endl;
246
247 cout << "Transfer function" << endl;
248 cout << "Real Part" << endl;
249 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fTfR[i] << endl;
250 cout << "Imaginary Part " << endl;
251 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fTfI[i] << endl;
252
253 cout << "Fourier Weights" << endl;
254 cout << "Real Part" << endl;
255 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fWR[i] << endl;
256 cout << "Imaginary Part " << endl;
257 for(i=0; i<AliITSetfSDDparam::NumberOfSamples(); i++) cout << fWI[i] << endl;
258}
259
260
261
262
263
264
265
266