]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TRD/AliTRDCommonParam.cxx
Protection against special particle types.
[u/mrichter/AliRoot.git] / TRD / AliTRDCommonParam.cxx
index b0cb8da66e629b98b8ae1cd989df38cdf49d0d35..aa025f39305d1f95a1d12c98faf6e2659b27e868 100644 (file)
 //                                                                           //
 ///////////////////////////////////////////////////////////////////////////////
 
+#include <TObjArray.h>
+
+#include "AliTracker.h"
 #include "AliRun.h"
 
 #include "AliTRDCommonParam.h"
 #include "AliTRDpadPlane.h"
 
+
 ClassImp(AliTRDCommonParam)
 
-AliTRDCommonParamAliTRDCommonParam::fgInstance = 0;
+AliTRDCommonParam *AliTRDCommonParam::fgInstance = 0;
 Bool_t AliTRDCommonParam::fgTerminated = kFALSE;
 
 //_ singleton implementation __________________________________________________
@@ -42,12 +46,14 @@ 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;
 
 }
@@ -57,14 +63,14 @@ 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;
   }
@@ -74,8 +80,8 @@ void AliTRDCommonParam::Terminate()
 //_____________________________________________________________________________
 AliTRDCommonParam::AliTRDCommonParam()
   :TObject()
-  ,fField(0)
   ,fExBOn(kFALSE)
+  ,fSamplingFrequency(0.0)
   ,fPadPlaneArray(0)
 {
   //
@@ -94,13 +100,10 @@ void AliTRDCommonParam::Init()
   //
   
   // E x B effects
-  fExBOn          = kTRUE;
+  fExBOn             = 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
@@ -135,8 +138,8 @@ AliTRDCommonParam::~AliTRDCommonParam()
 //_____________________________________________________________________________
 AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
   :TObject(p)
-  ,fField(p.fField)
   ,fExBOn(p.fExBOn)
+  ,fSamplingFrequency(p.fSamplingFrequency)
   ,fPadPlaneArray(0)
 {
   //
@@ -152,7 +155,10 @@ AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
   // Assignment operator
   //
 
-  if (this != &p) ((AliTRDCommonParam &) p).Copy(*this);
+  if (this != &p) {
+    ((AliTRDCommonParam &) p).Copy(*this);
+  }
+
   return *this;
 
 }
@@ -164,13 +170,13 @@ void AliTRDCommonParam::Copy(TObject &p) const
   // Copy function
   //
   
-  AliTRDCommonParamtarget = dynamic_cast<AliTRDCommonParam*> (&p);
+  AliTRDCommonParam *target = dynamic_cast<AliTRDCommonParam*> (&p);
   if (!target) {
     return;
   }  
 
-  target->fExBOn = fExBOn;
-  target->fField = fField;
+  target->fExBOn             = fExBOn;
+  target->fSamplingFrequency = fSamplingFrequency;
 
 }