]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ITS/AliITSetfSDD.cxx
Removed warning from part of code not properly implimneted yet.
[u/mrichter/AliRoot.git] / ITS / AliITSetfSDD.cxx
CommitLineData
b0f5e3fc 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 **************************************************************************/
48058160 15
16/*
17$Log$
4ae5bbc4 18Revision 1.8 2002/10/14 14:57:00 hristov
19Merging the VirtualMC branch to the main development branch (HEAD)
20
b9d0a01d 21Revision 1.6.6.1 2002/06/10 17:51:15 hristov
22Merged with v3-08-02
23
24Revision 1.7 2002/04/24 22:02:31 nilsen
25New SDigits and Digits routines, and related changes, (including new
26noise values).
27
48058160 28*/
4ae5bbc4 29#include <Riostream.h>
b0f5e3fc 30#include <TMath.h>
11ad066f 31#include <TString.h>
b0f5e3fc 32#include "AliITSetfSDD.h"
33
34////////////////////////////////////////////////////////////////////////
35// Version: 0
36// Written by Piergiorgio Cerello
37// November 23 1999
38//
b0f5e3fc 39//_____________________________________________________________________________
b669392e 40
41
b0f5e3fc 42ClassImp(AliITSetfSDD)
43
44Int_t ppower(Int_t b, Int_t e) {
e8189707 45 Int_t power = 1;
46 for(Int_t i=0; i<e; i++) power *= b;
b0f5e3fc 47 return power;
48}
49
11ad066f 50AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif)
b0f5e3fc 51{
52 // sampling time in ns
e8189707 53
11ad066f 54 fTimeDelay = 53.5;
55 if(amplif == 2) fTimeDelay = 35.5;
e8189707 56 fSamplingTime = timestep;
57
b0f5e3fc 58 fT0 = 0.;
b669392e 59 fDf = ppower(10,9)/(kMaxNofSamples*fSamplingTime);
b0f5e3fc 60
e8189707 61 Int_t i,j;
b669392e 62 for(i=0; i<kMaxNofPoles; i++) {
e8189707 63 fZeroM[i] = 0.;
64 fZeroR[i] = 0.;
65 fZeroI[i] = 0.;
66 fPoleM[i] = 0.;
67 fPoleR[i] = 0.;
68 fPoleI[i] = 0.;
b0f5e3fc 69 }
11ad066f 70 // Alice
71
48058160 72 // PASCAL amplif
73 fA0 = 5.53269815e+11;
74 fPoleM[0] = 3.;
75 fPoleR[0] = -8280000.;
76 fPoleI[0] = 0.;
77
78 if(amplif == 2) { // OLA amplif.
79 fA0 = 24000.;
80 fPoleM[0] = 1.;
11ad066f 81 fPoleR[0] = -3000000.;
82 fPoleI[0] = 4000000.;
48058160 83 fPoleM[1] = 1.;
84 fPoleR[1] = fPoleR[0];
85 fPoleI[1] = -fPoleI[0];
86 }
87
88 if( amplif == 3 ) { // old PASCAL
89 fA0 = 16500.; // AL: 16500.; // TB: 24000.; // 26000.; // 24000.; // 18000.;
90 fPoleM[0] = 1.;
91 fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.;
92 fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.;
93 fPoleM[1] = 1.;
94 fPoleR[1] = fPoleR[0];
95 fPoleI[1] = -fPoleI[0];
11ad066f 96 }
b0f5e3fc 97
48058160 98 //cout << "fA0: " << fA0 << endl;
99 //cout << "fTimeDelay: " << fTimeDelay << endl;
100
11ad066f 101 // Compute Transfer Function
b0f5e3fc 102
103 Double_t PI = acos(-1.);
b669392e 104 for(i=0; i<=kMaxNofSamples/2; i++) {
b0f5e3fc 105 Double_t frequency = fDf*i;
106 Double_t VM = fA0;
107 Double_t VA = 0.;
b669392e 108 for(Int_t k=0; k<kMaxNofPoles; k++) {
e8189707 109 if(fZeroM[k]) {
110 Double_t VZR = -fZeroR[k];
111 Double_t VZI = frequency - fZeroI[k];
b0f5e3fc 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;
e8189707 116 for(j=1; j<= (Int_t) fZeroM[k]; j++) {
b0f5e3fc 117 VM *= VZM;
118 VA += VZA;
119 if(VA >= PI) VA -= (2.*PI);
120 if(VA <= -PI) VA += (2.*PI);
121 //cout << "VM: " << VM << ", VA: " << VA << endl;
122 }
123 }
124
e8189707 125 if(fPoleM[k]) {
126 Double_t VPR = -fPoleR[k];
127 Double_t VPI = frequency - fPoleI[k];
b0f5e3fc 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;
e8189707 132 for(j=1; j<= (Int_t) fPoleM[k]; j++) {
b0f5e3fc 133 VM /= VPM;
134 VA -= VPA;
135 if(VA >= PI) VA -= (2.*PI);
136 if(VA <= -PI) VA += (2.*PI);
137 //cout << "VM: " << VM << ", VA: " << VA << endl;
138 }
139 }
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;
e8189707 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;
b0f5e3fc 148 if(i) {
b669392e 149 fTfR[kMaxNofSamples-i] = fTfR[i];
150 fTfI[kMaxNofSamples-i] = -fTfI[i];
b0f5e3fc 151 }
152 }
153 }
154
155 // Compute Fourier Weights
156
b669392e 157 for(i=0; i<=kMaxNofSamples/2; i++) {
158 fWR[i] = cos(-2.*PI*i/kMaxNofSamples);
159 fWI[i] = sin(-2.*PI*i/kMaxNofSamples);
b0f5e3fc 160 if(i) {
b669392e 161 fWR[kMaxNofSamples-i] = fWR[i];
162 fWI[kMaxNofSamples-i] = -fWI[i];
b0f5e3fc 163 }
164 }
165
166}
167
e8189707 168void AliITSetfSDD::PrintElectronics()
b0f5e3fc 169{
11ad066f 170 cout << "Time Delay " << fTimeDelay << endl;
b0f5e3fc 171 cout << "Sampling Time " << fSamplingTime << endl;
b669392e 172 cout << "Number of Time Samples " << kMaxNofSamples << endl;
b0f5e3fc 173 cout << "fT0 " << fT0 << endl;
174 cout << "fDf " << fDf << endl;
175 cout << "fA0 " << fA0 << endl;
176
177 cout << "Zero's and Pole's" << endl;
e8189707 178 cout << "fZeroM " << endl;
179 Int_t i;
b669392e 180 for(i=0; i<kMaxNofPoles; i++) cout << fZeroM[i] << endl;
b0f5e3fc 181 cout << "fZero_R " << endl;
b669392e 182 for(i=0; i<kMaxNofPoles; i++) cout << fZeroR[i] << endl;
e8189707 183 cout << "fZeroI " << endl;
b669392e 184 for(i=0; i<kMaxNofPoles; i++) cout << fZeroI[i] << endl;
e8189707 185 cout << "fPoleM " << endl;
b669392e 186 for(i=0; i<kMaxNofPoles; i++) cout << fPoleM[i] << endl;
e8189707 187 cout << "fPoleR " << endl;
b669392e 188 for(i=0; i<kMaxNofPoles; i++) cout << fPoleR[i] << endl;
e8189707 189 cout << "fPoleI " << endl;
b669392e 190 for(i=0; i<kMaxNofPoles; i++) cout << fPoleI[i] << endl;
b0f5e3fc 191
192 cout << "Transfer function" << endl;
193 cout << "Real Part" << endl;
b669392e 194 for(i=0; i<kMaxNofSamples; i++) cout << fTfR[i] << endl;
b0f5e3fc 195 cout << "Imaginary Part " << endl;
b669392e 196 for(i=0; i<kMaxNofSamples; i++) cout << fTfI[i] << endl;
b0f5e3fc 197
198 cout << "Fourier Weights" << endl;
199 cout << "Real Part" << endl;
b669392e 200 for(i=0; i<kMaxNofSamples; i++) cout << fWR[i] << endl;
b0f5e3fc 201 cout << "Imaginary Part " << endl;
b669392e 202 for(i=0; i<kMaxNofSamples; i++) cout << fWI[i] << endl;
b0f5e3fc 203}
204
205
206
207
208
209
210
211