TString optionString = option;
if (optionString.Contains("deb")) {
AliLog::SetClassDebugLevel("AliTRDdigitizer",1);
- AliInfo("Called with debug option\n");
+ AliInfo("Called with debug option");
}
// The AliRoot file is already connected by the manager
AliRunLoader *inrl;
if (gAlice) {
- AliDebug(1,"AliRun object found on file.\n");
+ AliDebug(1,"AliRun object found on file.");
}
else {
inrl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(0));
inrl->LoadgAlice();
gAlice = inrl->GetAliRun();
if (!gAlice) {
- AliError("Could not find AliRun object.\n")
+ AliError("Could not find AliRun object.")
return;
}
}
for (iInput = 0; iInput < nInput; iInput++) {
- AliDebug(1,Form("Add input stream %d\n",iInput));
+ AliDebug(1,Form("Add input stream %d",iInput));
// Check if the input tree exists
inrl = AliRunLoader::GetRunLoader(fManager->GetInputFolderName(iInput));
}
if (treees == 0x0) {
- AliError(Form("Input stream %d does not exist\n",iInput));
+ AliError(Form("Input stream %d does not exist",iInput));
return;
}
}
// Convert the s-digits to normal digits
- AliDebug(1,"Do the conversion\n");
+ AliDebug(1,"Do the conversion");
SDigits2Digits();
// Store the digits
- AliDebug(1,"Write the digits\n");
+ AliDebug(1,"Write the digits");
fDigitsManager->WriteDigits();
// Write parameters
orl->CdGAFile();
- AliDebug(1,"Done\n");
+ AliDebug(1,"Done");
DeleteSDigitsManager();
gAlice = fRunLoader->GetAliRun();
if (gAlice) {
- AliDebug(1,"AliRun object found on file.\n");
+ AliDebug(1,"AliRun object found on file.");
}
else {
- AliError("Could not find AliRun object.\n");
+ AliError("Could not find AliRun object.");
return kFALSE;
}
gAlice = fRunLoader->GetAliRun();
if (gAlice) {
- AliDebug(1,"AliRun object found on file.\n");
+ AliDebug(1,"AliRun object found on file.");
}
else {
- AliError("Could not find AliRun object.\n");
+ AliError("Could not find AliRun object.");
return kFALSE;
}
// Get the pointer to the detector class and check for version 1
fTRD = (AliTRD *) gAlice->GetDetector("TRD");
if (!fTRD) {
- AliFatal("No TRD module found\n");
+ AliFatal("No TRD module found");
exit(1);
}
if (fTRD->IsVersion() != 1) {
- AliFatal("TRD must be version 1 (slow simulator)\n");
+ AliFatal("TRD must be version 1 (slow simulator)");
exit(1);
}
// Get the geometry
fGeo = fTRD->GetGeometry();
- AliDebug(1,Form("Geometry version %d\n",fGeo->IsVersion()));
+ AliDebug(1,Form("Geometry version %d",fGeo->IsVersion()));
// Create a digits manager
delete fDigitsManager;
AliTRDSimParam *simParam = AliTRDSimParam::Instance();
if (!simParam) {
- AliError("Could not get simulation parameters\n");
+ AliError("Could not get simulation parameters");
return kFALSE;
}
AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
if (!commonParam) {
- AliError("Could not get common parameterss\n");
+ AliError("Could not get common parameterss");
return kFALSE;
}
AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
if (!calibration) {
- AliError("Could not get calibration object\n");
+ AliError("Could not get calibration object");
return kFALSE;
}
if (simParam->TRFOn()) {
timeBinTRFend = ((Int_t) (simParam->GetTRFhi()
- * calibration->GetSamplingFrequency())) - 1;
- AliDebug(1,Form("Sample the TRF up to bin %d\n",timeBinTRFend));
+ * commonParam->GetSamplingFrequency())) - 1;
+ AliDebug(1,Form("Sample the TRF up to bin %d",timeBinTRFend));
}
Float_t elAttachProp = simParam->GetElAttachProp() / 100.0;
if (!fGeo) {
- AliError("No geometry defined\n");
+ AliError("No geometry defined");
return kFALSE;
}
- AliDebug(1,"Start creating digits.\n");
+ AliDebug(1,"Start creating digits.");
AliLoader *gimme = fRunLoader->GetLoader("TRDLoader");
if (!gimme->TreeH()) {
// Get the number of entries in the hit tree
// (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("Gain = %d\n" ,((Int_t) simParam->GetGasGain())));
- AliDebug(1,Form("Noise = %d\n" ,((Int_t) simParam->GetNoise())));
+ AliDebug(1,Form("Found %d primary particles",nTrack));
+ AliDebug(1,Form("Sampling = %.0fMHz" ,commonParam->GetSamplingFrequency()));
+ AliDebug(1,Form("Gain = %d" ,((Int_t) simParam->GetGasGain())));
+ AliDebug(1,Form("Noise = %d" ,((Int_t) simParam->GetNoise())));
if (simParam->TimeStructOn()) {
- AliDebug(1,"Time Structure of drift cells implemented.\n");
+ AliDebug(1,"Time Structure of drift cells implemented.");
}
else {
- AliDebug(1,"Constant drift velocity in drift cells.\n");
+ AliDebug(1,"Constant drift velocity in drift cells.");
}
Int_t detectorOld = -1;
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++) {
pos[2] = hit->Z();
Int_t track = hit->Track();
Int_t detector = hit->GetDetector();
+ Float_t hittime = hit->GetTime();
Int_t plane = fGeo->GetPlane(detector);
Int_t chamber = fGeo->GetChamber(detector);
Float_t time0 = AliTRDgeometry::GetTime0(plane);
if ((xyz[2] < padPlane->GetRowEnd()) ||
(xyz[2] > padPlane->GetRow0())) {
if (iEl == 0) {
- AliDebug(2,Form("Hit outside of sensitive volume, row (z=%f, row0=%f, rowE=%f)\n"
+ AliDebug(2,Form("Hit outside of sensitive volume, row (z=%f, row0=%f, rowE=%f)"
,xyz[2],padPlane->GetRow0(),padPlane->GetRowEnd()));
}
continue;
if ((tt < 0.0) ||
(tt > kDrWidth + 2.0*kAmWidth)) {
if (iEl == 0) {
- AliDebug(2,Form("Hit outside of sensitive volume, time (Q = %d)\n"
+ AliDebug(2,Form("Hit outside of sensitive volume, time (Q = %d)"
,((Int_t) q)));
}
continue;
// Also re-retrieve drift velocity because col and row may have changed
driftvelocity = calibration->GetVdrift(detector,colE,rowE);
Float_t t0 = calibration->GetT0(detector,colE,rowE);
-
+
// Convert the position to drift time, using either constant drift velocity or
// time structure of drift cells (non-isochronity, GARFIELD calculation).
Double_t drifttime;
Z = 0.5 - Z;
}
// Use drift time map (GARFIELD)
- drifttime = TimeStruct(driftvelocity,time0-xyz[0]+kAmWidth,Z);
+ drifttime = TimeStruct(driftvelocity,time0-xyz[0]+kAmWidth,Z)
+ + hittime;
}
else {
// Use constant drift velocity
- drifttime = TMath::Abs(time0 - xyz[0]) / driftvelocity;
+ drifttime = TMath::Abs(time0 - xyz[0]) / driftvelocity
+ + hittime;
}
// Apply the gas gain including fluctuations
} // Loop: primary tracks
- AliDebug(1,Form("Finished analyzing %d hits\n",countHits));
+ AliDebug(1,Form("Finished analyzing %d hits",countHits));
// The coupling factor
Double_t coupling = simParam->GetPadCoupling()
// Check whether pad is masked
// Bridged pads are not considered yet!!!
if (calibration->IsPadMasked(iDet,iCol,iRow)) continue;
- // Check whether MCM is masked
- if (calibration->IsMCMMasked(iDet,iCol,iRow)) continue;
// Create summable digits
if (fSDigits) {
Float_t padgain = calibration->GetGainFactor(iDet,iCol,iRow);
if (padgain <= 0) {
- AliError(Form("Not a valid gain %f, %d %d %d\n",padgain,iDet,iCol,iRow));
+ AliError(Form("Not a valid gain %f, %d %d %d",padgain,iDet,iCol,iRow));
}
signalAmp *= padgain;
for (iTime = 0; iTime < nTimeTotal; iTime++) {
// Store the amplitude of the digit if above threshold
- if (outADC[iTime] > simParam->GetADCthreshold()) {
+ if ( outADC[iTime] > ( simParam->GetADCbaseline() + simParam->GetADCthreshold() ) ) {
nDigits++;
digits->SetDataUnchecked(iRow,iCol,iTime,((Int_t) outADC[iTime]));
}
if (nDigits > 0) {
Float_t nPixel = nRowMax * nColMax * nTimeTotal;
- AliDebug(1,Form("Found %d digits in detector %d (%3.0f).\n"
+ AliDebug(1,Form("Found %d digits in detector %d (%3.0f)."
,nDigits,iDet
,100.0 * ((Float_t) nDigits) / nPixel));
}
signalsArray = 0;
}
- AliDebug(1,Form("Total number of analyzed hits = %d\n",countHits));
- AliDebug(1,Form("Total digits data size = %d, %d, %d, %d\n",totalSizeDigits
+ AliDebug(1,Form("Total number of analyzed hits = %d",countHits));
+ AliDebug(1,Form("Total digits data size = %d, %d, %d, %d",totalSizeDigits
,totalSizeDict0
,totalSizeDict1
,totalSizeDict2));
AliTRDSimParam *simParam = AliTRDSimParam::Instance();
if (!simParam) {
- AliError("Could not get simulation parameters\n");
+ AliError("Could not get simulation parameters");
return kFALSE;
}
AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
if (!commonParam) {
- AliError("Could not get common parameters\n");
+ AliError("Could not get common parameters");
return kFALSE;
}
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
- AliError("Could not get calibration object\n");
+ AliError("Could not get calibration object");
return kFALSE;
}
// Check whether pad is masked
// Bridged pads are not considered yet!!!
if (calibration->IsPadMasked(iDet,iCol,iRow)) continue;
- // Check whether MCM is masked
- if (calibration->IsMCMMasked(iDet,iCol,iRow)) continue;
for (iTime = 0; iTime < nTimeTotal; iTime++) {
// Apply the pad-by-pad gain factors
Float_t padgain = calibration->GetGainFactor(iDet,iCol,iRow);
if (padgain <= 0.0) {
- AliError(Form("Not a valid gain %f, %d %d %d\n",padgain,iDet,iCol,iRow));
+ AliError(Form("Not a valid gain %f, %d %d %d",padgain,iDet,iCol,iRow));
}
signal *= padgain;
// Pad and time coupling
for (iTime = 0; iTime < nTimeTotal; iTime++) {
// Store the amplitude of the digit if above threshold
- if (outADC[iTime] > adcThreshold) {
+ if (outADC[iTime] > (adcBaseline + adcThreshold)) {
digitsOut->SetDataUnchecked(iRow,iCol,iTime,((Int_t) outADC[iTime]));
// Copy the dictionary
for (iDict = 0; iDict < kNDict; iDict++) {
AliTRDSimParam *simParam = AliTRDSimParam::Instance();
if (!simParam) {
- AliError("Could not get simulation parameters\n");
+ AliError("Could not get simulation parameters");
return kFALSE;
}
AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
if (!commonParam) {
- AliError("Could not get common parameters\n");
+ AliError("Could not get common parameters");
return kFALSE;
}
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
- AliError("Could not get calibration object\n");
+ AliError("Could not get calibration object");
return kFALSE;
}
// Get the first s-digits
fSDigitsManager = (AliTRDdigitsManager *) fSDigitsManagerList->First();
if (!fSDigitsManager) {
- AliError("No SDigits manager\n");
+ AliError("No SDigits manager");
return kFALSE;
}
fSDigitsManagerList->After(fSDigitsManager);
if (mergeSDigitsManager) {
- AliDebug(1,Form("Merge %d input files.\n",fSDigitsManagerList->GetSize()));
+ AliDebug(1,Form("Merge %d input files.",fSDigitsManagerList->GetSize()));
}
else {
- AliDebug(1,"Only one input file.\n");
+ AliDebug(1,"Only one input file.");
}
Int_t nTimeTotal = calibration->GetNumberOfTimeBins();
if (doMerge) {
- AliDebug(1,Form("Merge detector %d of input no.%d\n",iDet,iMerge+1));
+ AliDebug(1,Form("Merge detector %d of input no.%d",iDet,iMerge+1));
for (Int_t iRow = 0; iRow < nRowMax; iRow++ ) {
for (Int_t iCol = 0; iCol < nColMax; iCol++ ) {
(r1 > 37) ||
(kz1 < 0) ||
(kz1 > 10)) {
- AliWarning(Form("Indices out of range: dist=%.2f, z=%.2f, r1=%d, kz1=%d\n"
+ AliWarning(Form("Indices out of range: dist=%.2f, z=%.2f, r1=%d, kz1=%d"
,dist,z,r1,kz1));
}
fVDsmp[7] = 2.134;
if (vdrift < fVDsmp[0]) {
- AliWarning(Form("Drift Velocity too small (%.3f<%.3f)\n",vdrift,fVDsmp[0]));
+ AliWarning(Form("Drift Velocity too small (%.3f<%.3f)",vdrift,fVDsmp[0]));
vdrift = fVDsmp[0];
}
else if (vdrift > fVDsmp[7]) {
- AliWarning(Form("Drift Velocity too large (%.3f>%.3f)\n",vdrift,fVDsmp[6]));
+ AliWarning(Form("Drift Velocity too large (%.3f>%.3f)",vdrift,fVDsmp[6]));
vdrift = fVDsmp[7];
}
AliTRDSimParam *simParam = AliTRDSimParam::Instance();
if (!simParam) {
- AliError("Could not get simulation parameters\n");
+ AliError("Could not get simulation parameters");
return;
}
AliTRDCommonParam *commonParam = AliTRDCommonParam::Instance();
if (!commonParam) {
- AliError("Could not get common parameters\n");
+ AliError("Could not get common parameters");
return;
}
AliTRDcalibDB *calibration = AliTRDcalibDB::Instance();
if (!calibration) {
- AliError("Could not get calibration object\n");
+ AliError("Could not get calibration object");
return;
}