]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ITS/AliITSetfSDD.cxx
Posible memory leak fixed. Changes AliITSpList destructor. Not clear if
[u/mrichter/AliRoot.git] / ITS / AliITSetfSDD.cxx
index b28e796cf2965ad141be6eb2fe52bc02c1849070..27d37d17eb558c9b479e6f6cb6c7136c3f3f9499 100644 (file)
  * about the suitability of this software for any purpose. It is          *
  * provided "as is" without express or implied warranty.                  *
  **************************************************************************/
-
+/*
+$Log$
+*/
 #include <iostream.h>
 #include <TMath.h>
+#include <TString.h>
 #include "AliITSetfSDD.h"
 
 ////////////////////////////////////////////////////////////////////////
@@ -23,6 +27,8 @@
 // November 23 1999
 //
 //_____________________________________________________________________________
+
+
 ClassImp(AliITSetfSDD)
 
 Int_t ppower(Int_t b, Int_t e) {
@@ -31,18 +37,19 @@ Int_t ppower(Int_t b, Int_t e) {
   return power;
 }
 
-AliITSetfSDD::AliITSetfSDD(Double_t timestep)
+AliITSetfSDD::AliITSetfSDD(Double_t timestep, Int_t amplif)
 {
   // sampling time in ns
 
+  fTimeDelay = 53.5;
+  if(amplif == 2) fTimeDelay = 35.5;
   fSamplingTime = timestep;
 
   fT0 = 0.;
-  fDf = ppower(10,9)/(fkMaxNofSamples*fSamplingTime);
-  fA0 = 9000.;
+  fDf = ppower(10,9)/(kMaxNofSamples*fSamplingTime);
 
   Int_t i,j;
-  for(i=0; i<fkMaxNofPoles; i++) {
+  for(i=0; i<kMaxNofPoles; i++) {
     fZeroM[i] = 0.;
     fZeroR[i] = 0.;
     fZeroI[i] = 0.;
@@ -50,21 +57,45 @@ AliITSetfSDD::AliITSetfSDD(Double_t timestep)
     fPoleR[i] = 0.;
     fPoleI[i] = 0.;
   }
-  fPoleM[0] = 1.;
-  fPoleR[0] = -2100000.;
-  fPoleI[0] = fPoleR[0];
-  fPoleM[1] = 1.;
-  fPoleR[1] = -2100000.;
-  fPoleI[1] = -fPoleR[1];
+  // Alice
+
+  // PASCAL amplif
+  fA0 = 5.53269815e+11; 
+  fPoleM[0] = 3.;
+  fPoleR[0] = -8280000.; 
+  fPoleI[0] = 0.; 
+
+  if(amplif == 2) { // OLA amplif.
+    fA0 = 24000.;
+    fPoleM[0] = 1.;
+    fPoleR[0] = -3000000.;
+    fPoleI[0] = 4000000.;
+    fPoleM[1] = 1.;
+    fPoleR[1] = fPoleR[0];
+    fPoleI[1] = -fPoleI[0]; 
+  }
 
-   // Compute Transfer Function
+  if( amplif == 3 ) { // old PASCAL
+    fA0 = 16500.; // AL: 16500.;  // TB: 24000.; // 26000.; // 24000.; // 18000.; 
+    fPoleM[0] = 1.;
+    fPoleR[0] = -4140000.; // AL: -4140000.; // TB: -3000000.; // -3750000.; // -3500000; // -3000000.; 
+    fPoleI[0] = 0.; // AL: 0.; // TB: 4000000.; // 3750000.; // 3500000.; // 3000000.; 
+    fPoleM[1] = 1.;
+    fPoleR[1] = fPoleR[0];
+    fPoleI[1] = -fPoleI[0]; 
+  }
+
+  //cout << "fA0: " << fA0 << endl;
+  //cout << "fTimeDelay: " << fTimeDelay << endl;
+  
+  // Compute Transfer Function
 
   Double_t PI = acos(-1.);
-  for(i=0; i<=fkMaxNofSamples/2; i++) {
+  for(i=0; i<=kMaxNofSamples/2; i++) {
     Double_t frequency = fDf*i;
     Double_t VM = fA0;
     Double_t VA = 0.;
-    for(Int_t k=0; k<fkMaxNofPoles; k++) {
+    for(Int_t k=0; k<kMaxNofPoles; k++) {
       if(fZeroM[k]) {
         Double_t VZR = -fZeroR[k];
         Double_t VZI = frequency - fZeroI[k];
@@ -105,20 +136,20 @@ AliITSetfSDD::AliITSetfSDD(Double_t timestep)
       //cout << "fTfR[" << i << "] = " << fTfR[i] << endl;
       //cout << "fTfI[" << i << "] = " << fTfI[i] << endl;
       if(i) {
-        fTfR[fkMaxNofSamples-i] = fTfR[i];
-        fTfI[fkMaxNofSamples-i] = -fTfI[i];
+        fTfR[kMaxNofSamples-i] = fTfR[i];
+        fTfI[kMaxNofSamples-i] = -fTfI[i];
       }
     }
   }
   
   // Compute Fourier Weights
 
-  for(i=0; i<=fkMaxNofSamples/2; i++) {
-    fWR[i] = cos(-2.*PI*i/fkMaxNofSamples);
-    fWI[i] = sin(-2.*PI*i/fkMaxNofSamples);
+  for(i=0; i<=kMaxNofSamples/2; i++) {
+    fWR[i] = cos(-2.*PI*i/kMaxNofSamples);
+    fWI[i] = sin(-2.*PI*i/kMaxNofSamples);
     if(i) {
-      fWR[fkMaxNofSamples-i] = fWR[i];
-      fWI[fkMaxNofSamples-i] = -fWI[i];
+      fWR[kMaxNofSamples-i] = fWR[i];
+      fWI[kMaxNofSamples-i] = -fWI[i];
     }
   }
 
@@ -126,8 +157,9 @@ AliITSetfSDD::AliITSetfSDD(Double_t timestep)
 
 void AliITSetfSDD::PrintElectronics()
 {
+  cout << "Time Delay " << fTimeDelay << endl;
   cout << "Sampling Time " << fSamplingTime << endl;
-  cout << "Number of Time Samples " << fkMaxNofSamples << endl;
+  cout << "Number of Time Samples " << kMaxNofSamples << endl;
   cout << "fT0 " << fT0 << endl;
   cout << "fDf " << fDf << endl;
   cout << "fA0 " << fA0 << endl;
@@ -135,29 +167,29 @@ void AliITSetfSDD::PrintElectronics()
   cout << "Zero's and Pole's" << endl;
   cout << "fZeroM " << endl;
   Int_t i;
-  for(i=0; i<fkMaxNofPoles; i++) cout << fZeroM[i] << endl;
+  for(i=0; i<kMaxNofPoles; i++) cout << fZeroM[i] << endl;
   cout << "fZero_R " << endl;
-  for(i=0; i<fkMaxNofPoles; i++) cout << fZeroR[i] << endl;
+  for(i=0; i<kMaxNofPoles; i++) cout << fZeroR[i] << endl;
   cout << "fZeroI " << endl;
-  for(i=0; i<fkMaxNofPoles; i++) cout << fZeroI[i] << endl;
+  for(i=0; i<kMaxNofPoles; i++) cout << fZeroI[i] << endl;
   cout << "fPoleM " << endl;
-  for(i=0; i<fkMaxNofPoles; i++) cout << fPoleM[i] << endl;
+  for(i=0; i<kMaxNofPoles; i++) cout << fPoleM[i] << endl;
   cout << "fPoleR " << endl;
-  for(i=0; i<fkMaxNofPoles; i++) cout << fPoleR[i] << endl;
+  for(i=0; i<kMaxNofPoles; i++) cout << fPoleR[i] << endl;
   cout << "fPoleI " << endl;
-  for(i=0; i<fkMaxNofPoles; i++) cout << fPoleI[i] << endl;
+  for(i=0; i<kMaxNofPoles; i++) cout << fPoleI[i] << endl;
 
   cout << "Transfer function" << endl;
   cout << "Real Part" << endl;
-  for(i=0; i<fkMaxNofSamples; i++) cout << fTfR[i] << endl;
+  for(i=0; i<kMaxNofSamples; i++) cout << fTfR[i] << endl;
   cout << "Imaginary Part " << endl;
-  for(i=0; i<fkMaxNofSamples; i++) cout << fTfI[i] << endl;
+  for(i=0; i<kMaxNofSamples; i++) cout << fTfI[i] << endl;
 
   cout << "Fourier Weights" << endl;
   cout << "Real Part" << endl;
-  for(i=0; i<fkMaxNofSamples; i++) cout << fWR[i] << endl;
+  for(i=0; i<kMaxNofSamples; i++) cout << fWR[i] << endl;
   cout << "Imaginary Part " << endl;
-  for(i=0; i<fkMaxNofSamples; i++) cout << fWI[i] << endl;
+  for(i=0; i<kMaxNofSamples; i++) cout << fWI[i] << endl;
 }