///////////////////////////////////////////////////////////////////////////////
// //
-// 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 "AliRun.h"
+#include <TObjArray.h>
+
+#include "AliTracker.h"
#include "AliTRDCommonParam.h"
#include "AliTRDpadPlane.h"
-
ClassImp(AliTRDCommonParam)
-AliTRDCommonParam* AliTRDCommonParam::fgInstance = 0;
+AliTRDCommonParam *AliTRDCommonParam::fgInstance = 0;
Bool_t AliTRDCommonParam::fgTerminated = kFALSE;
//_ singleton implementation __________________________________________________
// 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()
{
//
fgTerminated = kTRUE;
- if (fgInstance != 0)
- {
+ if (fgInstance != 0) {
delete fgInstance;
fgInstance = 0;
}
+
}
//_____________________________________________________________________________
AliTRDCommonParam::AliTRDCommonParam()
+ :TObject()
+ ,fField(0)
+ ,fExBOn(kFALSE)
+ ,fPadPlaneArray(0)
{
//
- // constructor
+ // Default constructor
//
- fField = 0.0;
-
- fExBOn = kFALSE;
-
- fPadPlaneArray = 0;
-
Init();
+
}
//_____________________________________________________________________________
void AliTRDCommonParam::Init()
{
//
- // constructor helper
+ // Initialization
//
// E x B effects
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
+ fField = AliTracker::GetBz() * 0.1;
// ----------------------------------------------------------------------------
// The pad planes
fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
}
}
+
}
//_____________________________________________________________________________
AliTRDCommonParam::~AliTRDCommonParam()
{
//
- // destructor
+ // Destructor
//
if (fPadPlaneArray) {
delete fPadPlaneArray;
fPadPlaneArray = 0;
}
+
}
//_____________________________________________________________________________
-AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p):TObject(p)
+AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
+ :TObject(p)
+ ,fField(p.fField)
+ ,fExBOn(p.fExBOn)
+ ,fPadPlaneArray(0)
{
//
- // copy constructor
+ // Copy constructor
//
- ((AliTRDCommonParam &) p).Copy(*this);
}
-
//_____________________________________________________________________________
AliTRDCommonParam &AliTRDCommonParam::operator=(const AliTRDCommonParam &p)
{
// Assignment operator
//
- if (this != &p) ((AliTRDCommonParam &) p).Copy(*this);
+ if (this != &p) {
+ ((AliTRDCommonParam &) p).Copy(*this);
+ }
+
return *this;
+
}
//_____________________________________________________________________________
// Copy function
//
- AliTRDCommonParam* target = dynamic_cast<AliTRDCommonParam*> (&p);
- if (!target)
+ AliTRDCommonParam *target = dynamic_cast<AliTRDCommonParam*> (&p);
+ if (!target) {
return;
-
- target->fExBOn = fExBOn;
- target->fField = fField;
+ }
+
+ target->fExBOn = fExBOn;
+ target->fField = fField;
+
}
//_____________________________________________________________________________