void SetTimeStruct(Bool_t tsOn = 1) { fTimeStructOn = tsOn; }
void SetPadResponse(Int_t prfOn = 1) { fPRFOn = prfOn; }
void SetNTimeBins(Int_t ntb) { fNTimeBins = ntb; }
-
+ void SetNTBoverwriteOCDB(Bool_t over = kTRUE) { fNTBoverwriteOCDB = over; }
+
Float_t GetGasGain() const { return fGasGain; }
Float_t GetNoise() const { return fNoise; }
Float_t GetChipGain() const { return fChipGain; }
Float_t GetPadCoupling() const { return fPadCoupling; }
Float_t GetTimeCoupling() const { return fTimeCoupling; }
Int_t GetNTimeBins() const { return fNTimeBins; }
+ Bool_t GetNTBoverwriteOCDB() const { return fNTBoverwriteOCDB; }
Bool_t DiffusionOn() const { return fDiffusionOn; }
Bool_t ElAttachOn() const { return fElAttachOn; }
protected:
static AliTRDSimParam* fgInstance; // Instance of this class (singleton implementation)
- static Bool_t fgTerminated; // Defines if this class has already been terminated and
+ static Bool_t fgTerminated; // Defines if this class has already been terminated and
// therefore does not return instances in GetInstance anymore
// Digitization parameter
Int_t fPRFOn; // Switch for the pad response
- Int_t fNTimeBins; // Number of time bins
+ Int_t fNTimeBins; // Number of time bins (only used it fNTBoverwriteOCDB = true)
+ Bool_t fNTBoverwriteOCDB; // Switch to overwrite number of time bins from PCDB
private:
void Init();
void SampleTRF();
- ClassDef(AliTRDSimParam,5) // The TRD simulation parameters
+ ClassDef(AliTRDSimParam,6) // The TRD simulation parameters
};
return kTRUE;
}
+
//_____________________________________________________________________________
Bool_t AliTRDdigitizer::MakeBranch(TTree *tree) const
{
AliTRDarraySignal *signals = 0x0;
- //
- if (calibration->GetNumberOfTimeBinsDCS() != AliTRDSimParam::Instance()->GetNTimeBins()) {
- AliWarning(Form("Number of time bins is different to OCDB value [SIM=%d, OCDB=%d]"
- ,AliTRDSimParam::Instance()->GetNTimeBins()
- ,calibration->GetNumberOfTimeBinsDCS()));
+ // Check the number of time bins from simParam against OCDB,
+ // if OCDB value is not supposed to be used.
+ // As default, the value from OCDB is taken
+ if (AliTRDSimParam::Instance()->GetNTBoverwriteOCDB()) {
+ if (calibration->GetNumberOfTimeBinsDCS() != AliTRDSimParam::Instance()->GetNTimeBins()) {
+ AliWarning(Form("Number of time bins is different to OCDB value [SIM=%d, OCDB=%d]"
+ ,AliTRDSimParam::Instance()->GetNTimeBins()
+ ,calibration->GetNumberOfTimeBinsDCS()));
+ }
+ // Save the values for the raw data headers
+ fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(AliTRDSimParam::Instance()->GetNTimeBins());
+ }
+ else {
+ // Save the values for the raw data headers
+ fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(calibration->GetNumberOfTimeBinsDCS());
}
+
+ // Save the values for the raw data headers
+ fDigitsManager->GetDigitsParam()->SetADCbaselineAll(AliTRDSimParam::Instance()->GetADCbaseline());
// Sort all hits according to detector number
if (!SortHits(hits,nhit)) {
delete [] hits;
delete [] nhit;
- // Save the values for the raw data headers
- fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(AliTRDSimParam::Instance()->GetNTimeBins());
- fDigitsManager->GetDigitsParam()->SetADCbaselineAll(AliTRDSimParam::Instance()->GetADCbaseline());
-
return kTRUE;
}
* commonParam->GetSamplingFrequency())) - 1;
}
- Int_t nTimeTotal = simParam->GetNTimeBins();
+ Int_t nTimeTotal = fDigitsManager->GetDigitsParam()->GetNTimeBins(det);
Float_t samplingRate = commonParam->GetSamplingFrequency();
Float_t elAttachProp = simParam->GetElAttachProp() / 100.0;
Int_t nRowMax = fGeo->GetPadPlane(det)->GetNrows();
Int_t nColMax = fGeo->GetPadPlane(det)->GetNcols();
- Int_t nTimeTotal = simParam->GetNTimeBins();
+ Int_t nTimeTotal = fDigitsManager->GetDigitsParam()->GetNTimeBins(det);
+ if (fSDigitsManager->GetDigitsParam()->GetNTimeBins(det)) {
+ nTimeTotal = fSDigitsManager->GetDigitsParam()->GetNTimeBins(det);
+ }
+ else {
+ AliFatal("Could not get number of time bins");
+ return kFALSE;
+ }
// The gainfactor calibration objects
const AliTRDCalDet *calGainFactorDet = calibration->GetGainFactorDet();
Int_t nRowMax = fGeo->GetPadPlane(det)->GetNrows();
Int_t nColMax = fGeo->GetPadPlane(det)->GetNcols();
- Int_t nTimeTotal = AliTRDSimParam::Instance()->GetNTimeBins();
+ Int_t nTimeTotal = fDigitsManager->GetDigitsParam()->GetNTimeBins(det);
// Get the container for the digits of this detector
-
if (!fDigitsManager->HasSDigits()) {
AliError("Digits manager has no s-digits");
return kFALSE;
}
// Save the values for the raw data headers
- fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(AliTRDSimParam::Instance()->GetNTimeBins());
+ if (AliTRDSimParam::Instance()->GetNTBoverwriteOCDB()) {
+ fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(AliTRDSimParam::Instance()->GetNTimeBins());
+ }
+ else {
+ fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(AliTRDcalibDB::Instance()->GetNumberOfTimeBinsDCS());
+ }
fDigitsManager->GetDigitsParam()->SetADCbaselineAll(AliTRDSimParam::Instance()->GetADCbaseline());
return kTRUE;
Int_t nRowMax = fGeo->GetPadPlane(det)->GetNrows();
Int_t nColMax = fGeo->GetPadPlane(det)->GetNcols();
- Int_t nTimeTotal = AliTRDSimParam::Instance()->GetNTimeBins();
+ Int_t nTimeTotal = fSDigitsManager->GetDigitsParam()->GetNTimeBins(det);
Int_t row = 0;
Int_t col = 0;
fMcmSim->WriteData(digits);
}
}
+
}