///////////////////////////////////////////////////////////////////////////////
// //
-// 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"
-#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()
{
//
// 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)
{
//
- // 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;
+ // Sampling Frequency in MHz
+ fSamplingFrequency = 10.0;
- // 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
-
- // ----------------------------------------------------------------------------
- // The pad planes
- // ----------------------------------------------------------------------------
-
- fPadPlaneArray = new TObjArray(kNplan * kNcham);
-
- for (Int_t iplan = 0; iplan < kNplan; iplan++) {
- for (Int_t icham = 0; icham < kNcham; icham++) {
- Int_t ipp = iplan + icham * kNplan;
- fPadPlaneArray->AddAt(new AliTRDpadPlane(iplan,icham),ipp);
- }
- }
}
//_____________________________________________________________________________
AliTRDCommonParam::~AliTRDCommonParam()
{
//
- // destructor
+ // Destructor
//
- if (fPadPlaneArray) {
- fPadPlaneArray->Delete();
- delete fPadPlaneArray;
- fPadPlaneArray = 0;
- }
}
//_____________________________________________________________________________
-AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p):TObject(p)
+AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
+ :TObject(p)
+ ,fExBOn(p.fExBOn)
+ ,fSamplingFrequency(p.fSamplingFrequency)
{
//
- // 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];
- }*/
-}
-
-//_____________________________________________________________________________
-AliTRDpadPlane *AliTRDCommonParam::GetPadPlane(Int_t p, Int_t c) const
-{
- //
- // Returns the pad plane for a given plane <p> and chamber <c> number
- //
-
- Int_t ipp = p + c * kNplan;
- return ((AliTRDpadPlane *) fPadPlaneArray->At(ipp));
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDCommonParam::GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const
-{
- //
- // Returns the number of rows on the pad plane
- //
-
- return GetPadPlane(p,c)->GetNrows();
-
-}
-
-//_____________________________________________________________________________
-Int_t AliTRDCommonParam::GetColMax(Int_t p) const
-{
- //
- // Returns the number of rows on the pad plane
- //
-
- return GetPadPlane(p,0)->GetNcols();
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDCommonParam::GetRow0(Int_t p, Int_t c, Int_t /*s*/) const
-{
- //
- // Returns the position of the border of the first pad in a row
- //
-
- return GetPadPlane(p,c)->GetRow0();
-
-}
-
-//_____________________________________________________________________________
-Double_t AliTRDCommonParam::GetCol0(Int_t p) const
-{
- //
- // Returns the position of the border of the first pad in a column
- //
+ }
- return GetPadPlane(p,0)->GetCol0();
+ target->fExBOn = fExBOn;
+ target->fSamplingFrequency = fSamplingFrequency;
}