+
+ // 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 {
+ // Get the OCDB values
+ Int_t NTB=calibration->GetNumberOfTimeBinsDCS();
+ if (NTB < 0) { // Currently -1 gets returned for "undefined" and "mixed",
+ // one might go back to -1 undefined and -2 mixed?
+ AliError("No useful DCS information available for this run! Using standard values.");
+ // We fall back to the standard OCDB object,
+ // cache the current run number..
+ Long64_t run = calibration->GetRun();
+ calibration->SetRun(0);
+ NTB=calibration->GetNumberOfTimeBinsDCS();
+ // ..to set it again
+ calibration->SetRun(run);
+ // If there's no standard OCDB object, we can still fail
+ if(NTB < 0){
+ AliFatal("No standard object found in the OCDB!");
+ }
+ }
+ // Save the values for the raw data headers
+ fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(NTB);
+ }
+
+ // Save the values for the raw data headers
+ fDigitsManager->GetDigitsParam()->SetADCbaselineAll(AliTRDSimParam::Instance()->GetADCbaseline());