// s-digitsmanager will be deleted via list
fSDigitsManager = 0;
- fSDigitsManagerList->Delete();
- delete fSDigitsManagerList;
+ if (fSDigitsManagerList) {
+ fSDigitsManagerList->Delete();
+ delete fSDigitsManagerList;
+ }
fSDigitsManagerList = 0;
delete [] fMasks;
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!");
+ // }
+ nTB = AliTRDSimParam::Instance()->GetNTimeBins();
+ }
// 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
(nhit[det] > 0)) {
signals = new AliTRDarraySignal();
-
+
// Convert the hits of the current detector to detector signals
if (!ConvertHits(det,hits[det],nhit[det],signals)) {
AliError(Form("Conversion of hits failed for detector=%d",det));
colE = padPlane->GetPadColNumber(locC+offsetTilt);
if (colE < 0) continue;
colOffset = padPlane->GetPadColOffset(colE,locC+offsetTilt);
-
+
// Also re-retrieve drift velocity because col and row may have changed
driftvelocity = calVdriftDetValue * calVdriftROC->GetValue(colE,rowE);
Float_t t0 = calT0DetValue + calT0ROC->GetValue(colE,rowE);
}
// Compress the arrays
- CompressOutputArrays(det);
+ CompressOutputArrays(det);
return kTRUE;
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++ ) {
+ // halfchamber masking
+ Int_t iMcm = (Int_t)(col/18); // current group of 18 col pads
+ Int_t halfchamberside = (iMcm>3 ? 1 : 0); // 0=Aside, 1=Bside
+ // Halfchambers that are switched off, masked by calibration
+ if (calibration->IsHalfChamberNoData(det, halfchamberside))
+ continue;
+
// Check whether pad is masked
// Bridged pads are not considered yet!!!
if (calibration->IsPadMasked(det,col,row) ||
}
// 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));
}
// Create the sdigits for this chamber
for (row = 0; row < nRowMax; row++ ) {
for (col = 0; col < nColMax; col++ ) {
- for (time = 0; time < nTimeTotal; time++) {
+
+ // halfchamber masking
+ Int_t iMcm = (Int_t)(col/18); // current group of 18 col pads
+ Int_t halfchamberside = (iMcm>3 ? 1 : 0); // 0=Aside, 1=Bside
+ // Halfchambers that are switched off, masked by calibration
+ if (calibration->IsHalfChamberNoData(det, halfchamberside))
+ continue;
+
+ for (time = 0; time < nTimeTotal; time++) {
digits->SetData(row,col,time,signals->GetData(row,col,time));
} // for: time
} // for: col
} // for: row
-
+
return kTRUE;
}
// / 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);
}
}
-
}