// DB Setting
// Get cal
- AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
+ AliTRDcalibDB *cal = AliTRDcalibDB::Instance();
if (!cal) {
AliInfo("Could not get calibDB");
return kFALSE;
}
+ AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
+ if (!parCom) {
+ AliInfo("Could not get CommonParam");
+ return kFALSE;
+ }
// Some parameters
fTimeMax = cal->GetNumberOfTimeBins();
- fSf = cal->GetSamplingFrequency();
+ fSf = parCom->GetSamplingFrequency();
if (fRelativeScaleAuto) {
fRelativeScale = 0;
}
return kFALSE;
}
- Int_t npads = 18;
- Int_t colmcm = (Int_t) col / npads;
-
if (!cal->IsChamberInstalled(detector) ||
cal->IsChamberMasked(detector) ||
cal->IsPadMasked(detector,col,row)) {
// Some parameters
fTimeMax = cal->GetNumberOfTimeBins();
- fSf = (Float_t) cal->GetSamplingFrequency();
+ fSf = (Float_t) parCom->GetSamplingFrequency();
if (fRelativeScaleAuto) {
fRelativeScale = 0;
}
// Some parameters
fTimeMax = cal->GetNumberOfTimeBins();
- fSf = (Float_t) cal->GetSamplingFrequency();
+ fSf = (Float_t) parCom->GetSamplingFrequency();
if (fRelativeScaleAuto) {
fRelativeScale = 0;
}
AliTRDCommonParam::AliTRDCommonParam()
:TObject()
,fExBOn(kFALSE)
+ ,fSamplingFrequency(0.0)
,fPadPlaneArray(0)
{
//
//
// E x B effects
- fExBOn = kTRUE;
+ fExBOn = kTRUE;
+
+ // Sampling Frequency in MHz
+ fSamplingFrequency = 10.0;
// ----------------------------------------------------------------------------
// The pad planes
AliTRDCommonParam::AliTRDCommonParam(const AliTRDCommonParam &p)
:TObject(p)
,fExBOn(p.fExBOn)
+ ,fSamplingFrequency(p.fSamplingFrequency)
,fPadPlaneArray(0)
{
//
return;
}
- target->fExBOn = fExBOn;
+ target->fExBOn = fExBOn;
+ target->fSamplingFrequency = fSamplingFrequency;
}
virtual void Copy(TObject &p) const;
- void SetExB(Int_t exbOn = 1) { fExBOn = exbOn; };
+ void SetExB(Int_t exbOn = 1) { fExBOn = exbOn; }
+ void SetSamplingFrequency(Float_t freq) { fSamplingFrequency = freq; }
- Bool_t ExBOn() const { return fExBOn; };
+ Bool_t ExBOn() const { return fExBOn; }
AliTRDpadPlane *GetPadPlane(Int_t p, Int_t c) const;
Int_t GetRowMax(Int_t p, Int_t c, Int_t /*s*/) const;
Int_t GetColMax(Int_t p) const;
Double_t GetRow0(Int_t p, Int_t c, Int_t /*s*/) const;
Double_t GetCol0(Int_t p) const;
-
+ Float_t GetSamplingFrequency() const { return fSamplingFrequency; }
+
protected:
- static AliTRDCommonParam *fgInstance; // Instance of this class (singleton implementation)
- static Bool_t fgTerminated; // Defines if this class has already been terminated
+ static AliTRDCommonParam *fgInstance; // Instance of this class (singleton implementation)
+ static Bool_t fgTerminated; // Defines if this class has already been terminated
void Init();
- Int_t fExBOn; // Switch for the ExB effects
+ Int_t fExBOn; // Switch for the ExB effects
+
+ Float_t fSamplingFrequency; // Sampling Frequency in MHz
- TObjArray *fPadPlaneArray; //! Array of pad plane objects
+ TObjArray *fPadPlaneArray; //! Array of pad plane objects
private:
// This is a singleton, constructor is private!
AliTRDCommonParam();
- ClassDef(AliTRDCommonParam,2) // The constant parameters common to simulation and reconstruction
-
+ ClassDef(AliTRDCommonParam,3) // The constant parameters common to simulation and reconstruction
};
#endif
//
// The default parameter for the digitization
- fGasGain = 4000.0;
- fChipGain = 12.4;
- fNoise = 1000.0;
- fADCoutRange = 1023.0; // 10-bit ADC
- fADCinRange = 2000.0; // 2V input range
- fADCthreshold = 3;
- fADCbaseline = 0;
+ fGasGain = 4000.0;
+ fChipGain = 12.4;
+ fNoise = 1000.0;
+ fADCoutRange = 1023.0; // 10-bit ADC
+ fADCinRange = 2000.0; // 2V input range
+ fADCthreshold = 3;
+ fADCbaseline = 0;
// Diffusion on
- fDiffusionOn = kTRUE;
+ fDiffusionOn = kTRUE;
// Propability for electron attachment
- fElAttachOn = kFALSE;
- fElAttachProp = 0.0;
+ fElAttachOn = kFALSE;
+ fElAttachProp = 0.0;
// The time response function
- fTRFOn = kTRUE;
+ fTRFOn = kTRUE;
// The cross talk
- fCTOn = kTRUE;
+ fCTOn = kTRUE;
// The pad coupling factor
// Use 0.46, instead of the theroetical value 0.3, since it reproduces better
// the test beam data, even tough it is not understood why.
- fPadCoupling = 0.46;
+ fPadCoupling = 0.46;
// The time coupling factor (same number as for the TPC)
- fTimeCoupling = 0.4;
+ fTimeCoupling = 0.4;
// Distance of first Anode wire from first pad edge
- fAnodeWireOffset = 0.25;
+ fAnodeWireOffset = 0.25;
// Use drift time maps
- fTimeStructOn = kTRUE;
+ fTimeStructOn = kTRUE;
// The pad response function
- fPRFOn = kTRUE;
+ fPRFOn = kTRUE;
ReInit();
// Assignment operator
//
- if (this != &p) ((AliTRDSimParam &) p).Copy(*this);
+ if (this != &p) {
+ ((AliTRDSimParam &) p).Copy(*this);
+ }
return *this;
// Copy function
//
- AliTRDSimParam* target = dynamic_cast<AliTRDSimParam*> (&p);
+ AliTRDSimParam *target = dynamic_cast<AliTRDSimParam *> (&p);
if (!target) {
return;
}
virtual void Copy(TObject &p) const;
- void SetGasGain(Float_t gasgain) { fGasGain = gasgain; }
- void SetNoise(Float_t noise) { fNoise = noise; }
- void SetChipGain(Float_t chipgain) { fChipGain = chipgain; }
- void SetADCoutRange(Float_t range) { fADCoutRange = range; }
- void SetADCinRange(Float_t range) { fADCinRange = range; }
- void SetADCthreshold(Int_t thresh) { fADCthreshold = thresh; }
- void SetADCbaseline(Int_t basel) { fADCbaseline = basel; }
- void SetDiffusion(Int_t diffOn = 1) { fDiffusionOn = diffOn; }
- void SetElAttach(Int_t elOn = 1) { fElAttachOn = elOn; }
- void SetElAttachProp(Float_t prop) { fElAttachProp = prop; }
- void SetTimeResponse(Int_t trfOn = 1) { fTRFOn = trfOn; ReInit(); }
- void SetCrossTalk(Int_t ctOn = 1) { fCTOn = ctOn; ReInit(); }
- void SetPadCoupling(Float_t v) { fPadCoupling = v; }
- void SetTimeCoupling(Float_t v) { fTimeCoupling = v; }
- void SetAnodeWireOffset(Float_t offset = 0.25) { fAnodeWireOffset = offset; }
- void SetTimeStruct(Bool_t tsOn = 1) { fTimeStructOn = tsOn; }
- void SetPadResponse(Int_t prfOn = 1) { fPRFOn = prfOn; }
+ void SetGasGain(Float_t gasgain) { fGasGain = gasgain; }
+ void SetNoise(Float_t noise) { fNoise = noise; }
+ void SetChipGain(Float_t chipgain) { fChipGain = chipgain; }
+ void SetADCoutRange(Float_t range) { fADCoutRange = range; }
+ void SetADCinRange(Float_t range) { fADCinRange = range; }
+ void SetADCthreshold(Int_t thresh) { fADCthreshold = thresh; }
+ void SetADCbaseline(Int_t basel) { fADCbaseline = basel; }
+ void SetDiffusion(Int_t diffOn = 1) { fDiffusionOn = diffOn; }
+ void SetElAttach(Int_t elOn = 1) { fElAttachOn = elOn; }
+ void SetElAttachProp(Float_t prop) { fElAttachProp = prop; }
+ void SetTimeResponse(Int_t trfOn = 1) { fTRFOn = trfOn; ReInit(); }
+ void SetCrossTalk(Int_t ctOn = 1) { fCTOn = ctOn; ReInit(); }
+ void SetPadCoupling(Float_t v) { fPadCoupling = v; }
+ void SetTimeCoupling(Float_t v) { fTimeCoupling = v; }
+ void SetAnodeWireOffset(Float_t offset = 0.25) { fAnodeWireOffset = offset; }
+ void SetTimeStruct(Bool_t tsOn = 1) { fTimeStructOn = tsOn; }
+ void SetPadResponse(Int_t prfOn = 1) { fPRFOn = prfOn; }
- Float_t GetGasGain() const { return fGasGain; }
- Float_t GetNoise() const { return fNoise; }
- Float_t GetChipGain() const { return fChipGain; }
- Float_t GetADCoutRange() const { return fADCoutRange; }
- Float_t GetADCinRange() const { return fADCinRange; }
- Int_t GetADCthreshold() const { return fADCthreshold; }
- Int_t GetADCbaseline() const { return fADCbaseline; }
- Float_t GetTRFlo() const { return fTRFlo; }
- Float_t GetTRFhi() const { return fTRFhi; }
- Float_t GetPadCoupling() const { return fPadCoupling; }
- Float_t GetTimeCoupling() const { return fTimeCoupling; }
- Float_t GetAnodeWireOffset() const { return fAnodeWireOffset; }
+ Float_t GetGasGain() const { return fGasGain; }
+ Float_t GetNoise() const { return fNoise; }
+ Float_t GetChipGain() const { return fChipGain; }
+ Float_t GetADCoutRange() const { return fADCoutRange; }
+ Float_t GetADCinRange() const { return fADCinRange; }
+ Int_t GetADCthreshold() const { return fADCthreshold; }
+ Int_t GetADCbaseline() const { return fADCbaseline; }
+ Float_t GetTRFlo() const { return fTRFlo; }
+ Float_t GetTRFhi() const { return fTRFhi; }
+ Float_t GetPadCoupling() const { return fPadCoupling; }
+ Float_t GetTimeCoupling() const { return fTimeCoupling; }
+ Float_t GetAnodeWireOffset() const { return fAnodeWireOffset; }
- Bool_t DiffusionOn() const { return fDiffusionOn; }
- Bool_t ElAttachOn() const { return fElAttachOn; }
- Float_t GetElAttachProp() const { return fElAttachProp; }
- Bool_t TRFOn() const { return fTRFOn; }
- Bool_t CTOn() const { return fCTOn; }
- Bool_t TimeStructOn() const { return fTimeStructOn; }
- Bool_t PRFOn() const { return fPRFOn; }
+ Bool_t DiffusionOn() const { return fDiffusionOn; }
+ Bool_t ElAttachOn() const { return fElAttachOn; }
+ Float_t GetElAttachProp() const { return fElAttachProp; }
+ Bool_t TRFOn() const { return fTRFOn; }
+ Bool_t CTOn() const { return fCTOn; }
+ Bool_t TimeStructOn() const { return fTimeStructOn; }
+ Bool_t PRFOn() const { return fPRFOn; }
Double_t TimeResponse(Double_t time) const;
Double_t CrossTalk(Double_t time) const;
protected:
- static AliTRDSimParam* fgInstance; // Instance of this class (singleton implementation)
- static Bool_t fgTerminated; // Defines if this class has already been terminated and
- // therefore does not return instances in GetInstance anymore
+ static AliTRDSimParam* fgInstance; // Instance of this class (singleton implementation)
+ static Bool_t fgTerminated; // Defines if this class has already been terminated and
+ // therefore does not return instances in GetInstance anymore
// Digitization parameter
- Float_t fGasGain; // Gas gain
- Float_t fNoise; // Electronics noise
- Float_t fChipGain; // Electronics gain
+ Float_t fGasGain; // Gas gain
+ Float_t fNoise; // Electronics noise
+ Float_t fChipGain; // Electronics gain
- Float_t fADCoutRange; // ADC output range (number of channels)
- Float_t fADCinRange; // ADC input range (input charge)
- Int_t fADCthreshold; // ADC threshold in ADC channel
- Int_t fADCbaseline; // ADC baseline in ADC chann
+ Float_t fADCoutRange; // ADC output range (number of channels)
+ Float_t fADCinRange; // ADC input range (input charge)
+ Int_t fADCthreshold; // ADC threshold in ADC channel
+ Int_t fADCbaseline; // ADC baseline in ADC chann
- Int_t fDiffusionOn; // Switch for the diffusion
+ Int_t fDiffusionOn; // Switch for the diffusion
- Int_t fElAttachOn; // Switch for the electron attachment
- Float_t fElAttachProp; // Propability for electron attachment (for 1m)
+ Int_t fElAttachOn; // Switch for the electron attachment
+ Float_t fElAttachProp; // Propability for electron attachment (for 1m)
- Int_t fTRFOn; // Switch for the time response
- Float_t *fTRFsmp; //! Integrated time response
- Int_t fTRFbin; // Number of bins for the TRF
- Float_t fTRFlo; // Lower boundary of the TRF
- Float_t fTRFhi; // Higher boundary of the TRF
- Float_t fTRFwid; // Bin width of the integrated TRF
+ Int_t fTRFOn; // Switch for the time response
+ Float_t *fTRFsmp; //! Integrated time response
+ Int_t fTRFbin; // Number of bins for the TRF
+ Float_t fTRFlo; // Lower boundary of the TRF
+ Float_t fTRFhi; // Higher boundary of the TRF
+ Float_t fTRFwid; // Bin width of the integrated TRF
- Int_t fCTOn; // Switch for cross talk
- Float_t *fCTsmp; //! Integrated cross talk
+ Int_t fCTOn; // Switch for cross talk
+ Float_t *fCTsmp; //! Integrated cross talk
- Float_t fAnodeWireOffset; // Distance of first anode wire from pad edge
- Float_t fPadCoupling; // Pad coupling factor
- Float_t fTimeCoupling; // Time coupling factor (image charge of moving ions)
- Int_t fTimeStructOn; // Switch for cell time structure
+ Float_t fAnodeWireOffset; // Distance of first anode wire from pad edge
+ Float_t fPadCoupling; // Pad coupling factor
+ Float_t fTimeCoupling; // Time coupling factor (image charge of moving ions)
+ Int_t fTimeStructOn; // Switch for cell time structure
- Int_t fPRFOn; // Switch for the pad response
+ Int_t fPRFOn; // Switch for the pad response
private:
return roc->GetValue(col,row);
}
-
-//_____________________________________________________________________________
-Float_t AliTRDcalibDB::GetSamplingFrequency()
-{
- //
- // Returns the sampling frequency of the TRD read-out.
- //
-
- const AliTRDCalGlobals *calGlobal = dynamic_cast<const AliTRDCalGlobals *>
- (GetCachedCDBObject(kIDGlobals));
- if (!calGlobal) {
- return -1;
- }
-
- return calGlobal->GetSamplingFrequency();
-
-}
//_____________________________________________________________________________
Int_t AliTRDcalibDB::GetNumberOfTimeBins()
public:
- enum { kNplan = 6, kNcham = 5, kNsect = 18, kNdet = 540 };
+ enum { kNplan = 6
+ , kNcham = 5
+ , kNsect = 18
+ , kNdet = 540 };
static AliTRDcalibDB *Instance();
static void Terminate();
Float_t GetPRFWidth(Int_t det, Int_t col, Int_t row);
- Float_t GetSamplingFrequency();
Int_t GetNumberOfTimeBins();
Char_t GetPadStatus(Int_t det, Int_t col, Int_t row);
// Related functions, these depend on calibration data
static Float_t GetOmegaTau(Float_t vdrift, Float_t bz);
-
- Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
+ Int_t PadResponse(Double_t signal, Double_t dist, Int_t plane, Double_t *pad) const;
protected:
// For caching see also implentation of GetCachedCDBObject in the .cxx file
enum { kCDBCacheSize = 15 }; // Number of cached objects
- enum { kIDVdriftPad = 0, kIDVdriftChamber,
- kIDT0Pad, kIDT0Chamber,
- kIDGainFactorPad, kIDGainFactorChamber,
- kIDPRFWidth,
- kIDGlobals,
- kIDChamberPos, kIDStackPos, kIDSuperModulePos,
- kIDPIDLQ, kIDMonitoringData,
- kIDChamberStatus, kIDPadStatus }; // IDs of cached objects
+ enum { kIDVdriftPad = 0
+ , kIDVdriftChamber
+ , kIDT0Pad
+ , kIDT0Chamber
+ , kIDGainFactorPad
+ , kIDGainFactorChamber
+ , kIDPRFWidth
+ , kIDGlobals
+ , kIDChamberPos
+ , kIDStackPos
+ , kIDSuperModulePos
+ , kIDPIDLQ
+ , kIDMonitoringData
+ , kIDChamberStatus
+ , kIDPadStatus }; // IDs of cached objects
const TObject* GetCachedCDBObject(Int_t id);
void Invalidate();
void SamplePRF();
- AliCDBEntry *GetCDBEntry(const char* cdbPath);
- const TObject *CacheCDBEntry(Int_t id, const char* cdbPath);
+ AliCDBEntry *GetCDBEntry(const Char_t *cdbPath);
+ const TObject *CacheCDBEntry(Int_t id, const Char_t *cdbPath);
static AliTRDcalibDB *fgInstance; // Instance of this class (singleton implementation)
static Bool_t fgTerminated; // Defines if this class has already been terminated
AliTRDcalibDB &operator=(const AliTRDcalibDB &c);
virtual ~AliTRDcalibDB();
- ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB
+ ClassDef(AliTRDcalibDB,3) // Provides central access to the CDB
};
#include "AliTRDrecPoint.h"
#include "AliTRDgeometry.h"
#include "AliTRDcalibDB.h"
+#include "AliTRDCommonParam.h"
ClassImp(AliTRDclusterizer)
// Assignment operator
//
- if (this != &c) ((AliTRDclusterizer &) c).Copy(*this);
+ if (this != &c) {
+ ((AliTRDclusterizer &) c).Copy(*this);
+ }
return *this;
}
// depends on the drift velocity and t0
//
- AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
+ AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
AliError("Cannot find calibration object");
return -1;
}
+ AliTRDCommonParam *parCom = AliTRDCommonParam::Instance();
+ if (!parCom) {
+ AliError("Could not get common parameters\n");
+ return kFALSE;
+ }
Float_t vdrift = calibration->GetVdrift(idet,col,row);
Float_t t0 = calibration->GetT0(idet,col,row);
- Float_t samplingFrequency = calibration->GetSamplingFrequency();
+ Float_t samplingFrequency = parCom->GetSamplingFrequency();
timebin -= t0;
if (simParam->TRFOn()) {
timeBinTRFend = ((Int_t) (simParam->GetTRFhi()
- * calibration->GetSamplingFrequency())) - 1;
+ * commonParam->GetSamplingFrequency())) - 1;
AliDebug(1,Form("Sample the TRF up to bin %d\n",timeBinTRFend));
}
// (Number of primary particles creating a hit somewhere)
Int_t nTrack = (Int_t) hitTree->GetEntries();
AliDebug(1,Form("Found %d primary particles\n",nTrack));
- AliDebug(1,Form("Sampling = %.0fMHz\n" ,calibration->GetSamplingFrequency()));
+ AliDebug(1,Form("Sampling = %.0fMHz\n" ,commonParam->GetSamplingFrequency()));
AliDebug(1,Form("Gain = %d\n" ,((Int_t) simParam->GetGasGain())));
AliDebug(1,Form("Noise = %d\n" ,((Int_t) simParam->GetNoise())));
if (simParam->TimeStructOn()) {
Int_t countHits = 0;
Int_t nTimeTotal = calibration->GetNumberOfTimeBins();
- Float_t samplingRate = calibration->GetSamplingFrequency();
+ Float_t samplingRate = commonParam->GetSamplingFrequency();
// Loop through all entries in the tree
for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
AliTRDpadPlane *padPlane = commonParam->GetPadPlane(iplan,icham);
- Float_t samplFreq = calibration->GetSamplingFrequency();
+ Float_t samplFreq = commonParam->GetSamplingFrequency();
Int_t time, col;
Float_t amp[3];
}
dx = AliTRDcalibDB::Instance()->GetVdrift(0,0,0)
- / AliTRDcalibDB::Instance()->GetSamplingFrequency();
+ / commonParam->GetSamplingFrequency();
rho = 0.00295 * 0.85; //????
radLength = 11.0;
///////////////////////////////////////////////////////////////////////////////
// //
-// TRD calibration class for global TRD parameters //
+// TRD calibration class for global TRD parameters //
// //
///////////////////////////////////////////////////////////////////////////////
//_____________________________________________________________________________
AliTRDCalGlobals::AliTRDCalGlobals()
:TNamed()
- ,fSamplingFrequency(0)
,fNumberOfTimeBins(0)
{
//
//_____________________________________________________________________________
AliTRDCalGlobals::AliTRDCalGlobals(const Text_t *name, const Text_t *title)
:TNamed(name,title)
- ,fSamplingFrequency(0)
,fNumberOfTimeBins(0)
{
//
public:
AliTRDCalGlobals();
- AliTRDCalGlobals(const Text_t* name, const Text_t* title);
+ AliTRDCalGlobals(const Text_t *name, const Text_t *title);
virtual ~AliTRDCalGlobals() {};
- void SetSamplingFrequency(Float_t freq) { fSamplingFrequency = freq; };
- Float_t GetSamplingFrequency() const { return fSamplingFrequency; };
-
void SetNumberOfTimeBins(Int_t value) { fNumberOfTimeBins = value; };
Int_t GetNumberOfTimeBins() const { return fNumberOfTimeBins; };
protected:
- Float_t fSamplingFrequency; // Sampling Frequency in MHz
Int_t fNumberOfTimeBins; // Number of timebins
- ClassDef(AliTRDCalGlobals,1) // TRD calibration class for global TRD parameters
+ ClassDef(AliTRDCalGlobals,2) // TRD calibration class for global TRD parameters
};