///////////////////////////////////////////////////////////////////////////////
// //
-// 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"
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()
{
//
// 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
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)
+ ,fExBOn(p.fExBOn)
+ ,fSamplingFrequency(p.fSamplingFrequency)
+ ,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->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;
+
}
//_____________________________________________________________________________