// AliTRDdigitizer destructor
//
- if (fDigitsManager) {
- delete fDigitsManager;
- fDigitsManager = 0;
- }
-
- if (fSDigitsManager) {
- // s-digitsmanager will be deleted via list
- fSDigitsManager = 0;
- }
+ delete fDigitsManager;
+ fDigitsManager = 0;
+ // s-digitsmanager will be deleted via list
+ fSDigitsManager = 0;
if (fSDigitsManagerList) {
fSDigitsManagerList->Delete();
delete fSDigitsManagerList;
- fSDigitsManagerList = 0;
}
+ fSDigitsManagerList = 0;
- if (fMasks) {
- delete [] fMasks;
- fMasks = 0;
- }
+ delete [] fMasks;
+ fMasks = 0;
- if (fMcmSim) {
- delete fMcmSim;
- fMcmSim = 0;
- }
+ delete fMcmSim;
+ fMcmSim = 0;
- if (fGeo) {
- delete fGeo;
- fGeo = 0;
- }
+ delete fGeo;
+ fGeo = 0;
}
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(calibration->GetNumberOfTimeBinsDCS());
+ fDigitsManager->GetDigitsParam()->SetNTimeBinsAll(NTB);
}
// Save the values for the raw data headers
AliTRDCalROC *calGainFactorROC = 0x0;
Float_t calGainFactorDetValue = 0.0;
- AliTRDarrayADC *digits = 0x0;
+ AliTRDarrayADC *digits = 0x0;
if (!signals) {
AliError(Form("Signals array for detector %d does not exist\n",det));
calGainFactorROC = calibration->GetGainFactorROC(det);
calGainFactorDetValue = calGainFactorDet->GetValue(det);
- // Get the online gain factors
- //AliTRDCalOnlineGainTableROC *onlineGainFactorROC
- // = calibration->GetOnlineGainTableROC(det);
-
// Create the digits for this chamber
for (row = 0; row < nRowMax; row++ ) {
for (col = 0; col < nColMax; col++ ) {
}
// The gain factors
- Float_t padgain = calGainFactorDetValue
- * calGainFactorROC->GetValue(col,row);
+ Float_t padgain = calGainFactorDetValue
+ * calGainFactorROC->GetValue(col,row);
if (padgain <= 0) {
AliError(Form("Not a valid gain %f, %d %d %d",padgain,det,col,row));
}
// / convert;
// The gainfactor calibration objects
+ // Not used since these digits are supposed to be from real raw data
//const AliTRDCalDet *calGainFactorDet = calibration->GetGainFactorDet();
//AliTRDCalROC *calGainFactorROC = 0;
//Float_t calGainFactorDetValue = 0.0;
return;
//Call the methods in the mcm class using the temporary array as input
- for(Int_t rob = 0; rob < digits->GetNrow() / 2; rob++)
- {
- for(Int_t mcm = 0; mcm < 16; mcm++)
- {
- fMcmSim->Init(det, rob, mcm);
- fMcmSim->SetDataByPad(digits, fDigitsManager);
- fMcmSim->Filter();
- if (feeParam->GetTracklet()) {
- fMcmSim->Tracklet();
- fMcmSim->StoreTracklets();
+ // process the data in the same order as in hardware
+ for (Int_t side = 0; side <= 1; side++) {
+ for(Int_t rob = side; rob < digits->GetNrow() / 2; rob += 2) {
+ for(Int_t mcm = 0; mcm < 16; mcm++) {
+ fMcmSim->Init(det, rob, mcm);
+ fMcmSim->SetDataByPad(digits, fDigitsManager);
+ fMcmSim->Filter();
+ if (feeParam->GetTracklet()) {
+ fMcmSim->Tracklet();
+ fMcmSim->StoreTracklets();
+ }
+ fMcmSim->ZSMapping();
+ fMcmSim->WriteData(digits);
}
- fMcmSim->ZSMapping();
- fMcmSim->WriteData(digits);
}
}
-
}