]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCommonParam.cxx
Move sampling frequency to common params
[u/mrichter/AliRoot.git] / TRD / AliTRDCommonParam.cxx
index 4abfffd3de2166c5fd1fb5aca26f4598682f96f2..aa025f39305d1f95a1d12c98faf6e2659b27e868 100644 (file)
 
 ///////////////////////////////////////////////////////////////////////////////
 //                                                                           //
-// Class containing constant common parameters                           //
+// Class containing constant common parameters                               //
 //                                                                           //
-// Request an instance with AliTRDCommonParam::Instance()                 //
+// Request an instance with AliTRDCommonParam::Instance()                    //
 // Then request the needed values                                            //
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <TObjArray.h>
+
+#include "AliTracker.h"
 #include "AliRun.h"
 
 #include "AliTRDCommonParam.h"
@@ -32,7 +35,7 @@
 
 ClassImp(AliTRDCommonParam)
 
-AliTRDCommonParamAliTRDCommonParam::fgInstance = 0;
+AliTRDCommonParam *AliTRDCommonParam::fgInstance = 0;
 Bool_t AliTRDCommonParam::fgTerminated = kFALSE;
 
 //_ singleton implementation __________________________________________________
@@ -43,67 +46,64 @@ AliTRDCommonParam* AliTRDCommonParam::Instance()
   // Returns an instance of this class, it is created if neccessary
   // 
   
-  if (fgTerminated != kFALSE)
+  if (fgTerminated != kFALSE) {
     return 0;
+  }
 
-  if (fgInstance == 0)
+  if (fgInstance == 0) {
     fgInstance = new AliTRDCommonParam();
-  
+  }  
+
   return fgInstance;
+
 }
 
+//_____________________________________________________________________________
 void AliTRDCommonParam::Terminate()
 {
   //
   // Singleton implementation
-  // Deletes the instance of this class and sets the terminated flag, instances cannot be requested anymore
+  // Deletes the instance of this class and sets the terminated flag,
+  // instances cannot be requested anymore
   // This function can be called several times.
   //
   
   fgTerminated = kTRUE;
   
-  if (fgInstance != 0)
-  {
+  if (fgInstance != 0) {
     delete fgInstance;
     fgInstance = 0;
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCommonParam::AliTRDCommonParam()
+  :TObject()
+  ,fExBOn(kFALSE)
+  ,fSamplingFrequency(0.0)
+  ,fPadPlaneArray(0)
 {
   //
-  // constructor
+  // Default constructor
   //
   
-  fField              = 0.0;
-
-  fExBOn              = kFALSE;
-  fPRFOn              = kFALSE;
-  
-  fPadPlaneArray      = 0;
-  
   Init();
+
 }
 
 //_____________________________________________________________________________
 void AliTRDCommonParam::Init()
 {
   //
-  // constructor helper
+  // Initialization
   //
   
   // E x B effects
-  fExBOn          = kTRUE;
+  fExBOn             = kTRUE;
 
-  // The pad response function
-  fPRFOn          = kTRUE;
-
-  // The magnetic field strength in Tesla
-  Double_t x[3] = { 0.0, 0.0, 0.0 };
-  Double_t b[3];
-  gAlice->Field(x,b);  // b[] is in kilo Gauss
-  fField = b[2] * 0.1; // Tesla
+  // Sampling Frequency in MHz
+  fSamplingFrequency = 10.0;
   
   // ----------------------------------------------------------------------------
   // The pad planes
@@ -117,13 +117,14 @@ void AliTRDCommonParam::Init()
       fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
     }
   }
+
 }
 
 //_____________________________________________________________________________
 AliTRDCommonParam::~AliTRDCommonParam() 
 {
   //
-  // destructor
+  // Destructor
   //
   
   if (fPadPlaneArray) {
@@ -131,19 +132,22 @@ AliTRDCommonParam::~AliTRDCommonParam()
     delete fPadPlaneArray;
     fPadPlaneArray = 0;
   }
+
 }
 
 //_____________________________________________________________________________
-AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p):TObject(p)
+AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
+  :TObject(p)
+  ,fExBOn(p.fExBOn)
+  ,fSamplingFrequency(p.fSamplingFrequency)
+  ,fPadPlaneArray(0)
 {
   //
-  // copy constructor
+  // Copy constructor
   //
 
-  ((AliTRDCommonParam &) p).Copy(*this);
 }
 
-
 //_____________________________________________________________________________
 AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
 {
@@ -151,8 +155,12 @@ AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
   // Assignment operator
   //
 
-  if (this != &p) ((AliTRDCommonParam &) p).Copy(*this);
+  if (this != &p) {
+    ((AliTRDCommonParam &) p).Copy(*this);
+  }
+
   return *this;
+
 }
 
 //_____________________________________________________________________________
@@ -162,22 +170,14 @@ void AliTRDCommonParam::Copy(TObject &p) const
   // Copy function
   //
   
-  AliTRDCommonParamtarget = dynamic_cast<AliTRDCommonParam*> (&p);
-  if (!target)
+  AliTRDCommonParam *target = dynamic_cast<AliTRDCommonParam*> (&p);
+  if (!target) {
     return;
-  
-  target->fExBOn              = fExBOn;
-  target->fPRFOn              = fPRFOn;
-  /*target->fPRFbin             = fPRFbin;
-  target->fPRFlo              = fPRFlo;
-  target->fPRFhi              = fPRFhi;
-  target->fPRFwid             = fPRFwid;
-  target->fPRFpad             = fPRFpad;
-  if (target->fPRFsmp) delete [] target->fPRFsmp;
-  target->fPRFsmp = new Float_t[fPRFbin];
-  for (Int_t iBin = 0; iBin < fPRFbin; iBin++) {
-    target->fPRFsmp[iBin] = fPRFsmp[iBin];
-  }*/
+  }  
+
+  target->fExBOn             = fExBOn;
+  target->fSamplingFrequency = fSamplingFrequency;
+
 }
 
 //_____________________________________________________________________________