#include <TF1.h>
#include <TList.h>
#include <TTask.h>
+#include <TGeoManager.h>
#include "AliRun.h"
#include "AliRunLoader.h"
#include "AliRunDigitizer.h"
#include "AliRunLoader.h"
#include "AliLoader.h"
+#include "AliLog.h"
#include "AliTRD.h"
#include "AliTRDhit.h"
#include "AliTRDsegmentArray.h"
#include "AliTRDdigitsManager.h"
#include "AliTRDgeometry.h"
-#include "AliTRDparameter.h"
#include "AliTRDpadPlane.h"
#include "AliTRDcalibDB.h"
#include "AliTRDSimParam.h"
fSDigitsManagerList = 0;
fTRD = 0;
fGeo = 0;
- fPar = 0;
fEvent = 0;
fMasks = 0;
fCompress = kTRUE;
fSDigits = kFALSE;
fSDigitsScale = 0.0;
fMergeSignalOnly = kFALSE;
- fSimpleSim = kFALSE;
- fSimpleDet = 0;
+ fFixedGeometry = kFALSE;
- fTimeStructInfo.fLastVdrift = 0;
- fTimeStructInfo.fTimeStruct1 = 0;
- fTimeStructInfo.fTimeStruct2 = 0;
- fTimeStructInfo.fVDlo = 0;
- fTimeStructInfo.fVDhi = 0;
+ fTimeStructInfo.fLastVdrift = 0;
+ fTimeStructInfo.fTimeStruct1 = 0;
+ fTimeStructInfo.fTimeStruct2 = 0;
+ fTimeStructInfo.fVDlo = 0;
+ fTimeStructInfo.fVDhi = 0;
- fDiffusionInfo.fLastVdrift = 0;
- fDiffusionInfo.fDiffusionT = 0.0;
- fDiffusionInfo.fDiffusionL = 0.0;
+ fDiffusionInfo.fLastVdrift = 0;
+ fDiffusionInfo.fDiffusionT = 0.0;
+ fDiffusionInfo.fDiffusionL = 0.0;
fDiffusionInfo.fLorentzFactor = 0.0;
Init();
+
}
//_____________________________________________________________________________
//
Init();
+
}
//_____________________________________________________________________________
//
Init();
+
}
//_____________________________________________________________________________
//
Init();
+
}
//_____________________________________________________________________________
Bool_t AliTRDdigitizer::Init()
{
+ //
+ // Initialize the digitizer with default values
+ //
+
fRunLoader = 0;
//NewIO: These data members probably are not needed anymore
fSDigitsManagerList = 0;
fTRD = 0;
fGeo = 0;
- fPar = 0;
-
//End NewIO comment
+
fEvent = 0;
fMasks = 0;
fCompress = kTRUE;
fSDigits = kFALSE;
fSDigitsScale = 100.; // For the summable digits
fMergeSignalOnly = kFALSE;
- fSimpleSim = kFALSE;
- fSimpleDet = 0;
+ fFixedGeometry = kFALSE;
- fTimeStructInfo.fLastVdrift = -1;
- fTimeStructInfo.fTimeStruct1 = 0;
- fTimeStructInfo.fTimeStruct2 = 0;
- fTimeStructInfo.fVDlo = 0;
- fTimeStructInfo.fVDhi = 0;
+ fTimeStructInfo.fLastVdrift = -1;
+ fTimeStructInfo.fTimeStruct1 = 0;
+ fTimeStructInfo.fTimeStruct2 = 0;
+ fTimeStructInfo.fVDlo = 0;
+ fTimeStructInfo.fVDhi = 0;
- fDiffusionInfo.fLastVdrift = -1;
- fDiffusionInfo.fDiffusionT = 0.0;
- fDiffusionInfo.fDiffusionL = 0.0;
+ fDiffusionInfo.fLastVdrift = -1;
+ fDiffusionInfo.fDiffusionT = 0.0;
+ fDiffusionInfo.fDiffusionL = 0.0;
fDiffusionInfo.fLorentzFactor = 0.0;
return AliDigitizer::Init();
+
}
//_____________________________________________________________________________
delete [] fTimeStructInfo.fTimeStruct2;
fTimeStructInfo.fTimeStruct2 = 0;
}
+
}
//_____________________________________________________________________________
((AliTRDdigitizer &) d).fSDigitsManagerList = 0;
((AliTRDdigitizer &) d).fTRD = 0;
((AliTRDdigitizer &) d).fGeo = 0;
- ((AliTRDdigitizer &) d).fPar = 0;
((AliTRDdigitizer &) d).fEvent = 0;
((AliTRDdigitizer &) d).fMasks = 0;
((AliTRDdigitizer &) d).fCompress = fCompress;
((AliTRDdigitizer &) d).fSDigits = fSDigits;
((AliTRDdigitizer &) d).fSDigitsScale = fSDigitsScale;
((AliTRDdigitizer &) d).fMergeSignalOnly = fMergeSignalOnly;
- ((AliTRDdigitizer &) d).fSimpleSim = fSimpleSim;
- ((AliTRDdigitizer &) d).fSimpleDet = fSimpleDet;
+ ((AliTRDdigitizer &) d).fFixedGeometry = fFixedGeometry;
AliTRDdigitizer& target = (AliTRDdigitizer &) d;
target.fDiffusionInfo = fDiffusionInfo;
- // do not copy timestructs, just invalidate lastvdrift. Next time they are requested, they get recalculated
+ // Do not copy timestructs, just invalidate lastvdrift.
+ // Next time they are requested, they get recalculated
if (target.fTimeStructInfo.fTimeStruct1)
{
delete[] target.fTimeStructInfo.fTimeStruct1;
{
delete[] target.fTimeStructInfo.fTimeStruct2;
target.fTimeStructInfo.fTimeStruct2 = 0;
- }
-
+ }
target.fTimeStructInfo.fLastVdrift = -1;
+
}
//_____________________________________________________________________________
//Write parameters
orl->CdGAFile();
- if (!gFile->Get("TRDparameter")) GetParameter()->Write();
if (fDebug > 0) {
printf("<AliTRDdigitizer::Exec> ");
//
// Opens a ROOT-file with TRD-hits and reads in the hit-tree
//
-
// Connect the AliRoot file containing Geometry, Kine, and Hits
-
+ //
TString evfoldname = AliConfig::GetDefaultEventFolderName();
fRunLoader = AliRunLoader::GetRunLoader(evfoldname);
// The list for the input s-digits manager to be merged
if (fSDigitsManagerList) {
fSDigitsManagerList->Delete();
- } else {
+ }
+ else {
fSDigitsManagerList = new TList();
}
// Half the width of the amplification region
const Float_t kAmWidth = AliTRDgeometry::AmThick() / 2.;
- // Width of the drit region
+ // Width of the drift region
const Float_t kDrWidth = AliTRDgeometry::DrThick();
Int_t iRow, iCol, iTime, iPad;
AliTRDpadPlane *padPlane = 0;
- // Create a default parameter class if none is defined
- if (!fPar) {
- fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter");
- if (fDebug > 0) {
- printf("<AliTRDdigitizer::MakeDigits> ");
- printf("Create the default parameter object\n");
- }
- }
-
+ if (!gGeoManager) AliFatal("No geometry!");
+
+
AliTRDSimParam* simParam = AliTRDSimParam::Instance();
- if (!simParam)
- {
+ if (!simParam) {
printf("<AliTRDdigitizer::MakeDigits> ");
printf("Could not get simulation params\n");
return kFALSE;
}
AliTRDCommonParam* commonParam = AliTRDCommonParam::Instance();
- if (!commonParam)
- {
+ if (!commonParam) {
printf("<AliTRDdigitizer::MakeDigits> ");
printf("Could not get common params\n");
return kFALSE;
,AliTRDgeometry::Ndet());
AliTRDcalibDB* calibration = AliTRDcalibDB::Instance();
- if (!calibration)
- {
+ if (!calibration) {
printf("<AliTRDdigitizer::MakeDigits> ");
printf("Could not get calibration object\n");
return kFALSE;
}
+ if (!gGeoManager) {
+ printf("<AliTRDdigitizer::MakeDigits> ");
+ printf("No TGeoManager available. Switch to fixed geometry.\n");
+ fFixedGeometry = kTRUE;
+ }
+
if (simParam->TRFOn()) {
timeBinTRFend = ((Int_t) ( simParam->GetTRFhi() * calibration->GetSamplingFrequency())) - 1;
if (fDebug > 0) {
AliLoader* gimme = fRunLoader->GetLoader("TRDLoader");
if (!gimme->TreeH()) gimme->LoadHits();
TTree* hitTree = gimme->TreeH();
- if (hitTree == 0x0)
- {
+ if (hitTree == 0x0) {
Error("MakeDigits","Can not get TreeH");
return kFALSE;
- }
+ }
fTRD->SetTreeAddress();
// Get the number of entries in the hit tree
// (Number of primary particles creating a hit somewhere)
- Int_t nTrack = 1;
- if (!fSimpleSim) {
- nTrack = (Int_t) hitTree->GetEntries();
- if (fDebug > 0) {
- printf("<AliTRDdigitizer::MakeDigits> ");
- printf("Found %d primary particles\n",nTrack);
- }
+ Int_t nTrack = (Int_t) hitTree->GetEntries();
+ if (fDebug > 0) {
+ printf("<AliTRDdigitizer::MakeDigits> ");
+ printf("Found %d primary particles\n",nTrack);
}
Int_t detectorOld = -1;
}
}
- Int_t nTimeTotal = calibration->GetNumberOfTimeBins();
- Float_t samplingRate = calibration->GetSamplingFrequency();
+ Int_t nTimeTotal = calibration->GetNumberOfTimeBins();
+ Float_t samplingRate = calibration->GetSamplingFrequency();
// Loop through all entries in the tree
for (Int_t iTrack = 0; iTrack < nTrack; iTrack++) {
- if (!fSimpleSim) {
- gAlice->ResetHits();
- nBytes += hitTree->GetEvent(iTrack);
- }
+ gAlice->ResetHits();
+ nBytes += hitTree->GetEvent(iTrack);
// Loop through the TRD hits
Int_t iHit = 0;
Int_t nRowMax = padPlane->GetNrows();
Int_t nColMax = padPlane->GetNcols();
+ Int_t inDrift = 1;
+ if (!fFixedGeometry) {
+ gGeoManager->SetCurrentPoint(pos);
+ gGeoManager->FindNode();
+ if (strstr(gGeoManager->GetPath(),"/UK")) {
+ inDrift = 0;
+ }
+ }
+
if (fDebug > 1) {
printf("Analyze hit no. %d ",iHit);
printf("-----------------------------------------------------------\n");
}
signals->Allocate(nRowMax,nColMax,nTimeTotal);
}
- else if (fSimpleSim) {
- // Clear an old one for the simple simulation
- if (fDebug > 1) {
- printf("<AliTRDdigitizer::MakeDigits> ");
- printf("Clear a old container ... ");
- }
- signals->Clear();
- }
else {
// Expand an existing one
if (fCompress) {
}
}
// The same for the dictionary
- if (!fSimpleSim) {
- for (iDict = 0; iDict < kNDict; iDict++) {
- dictionary[iDict] = fDigitsManager->GetDictionary(detector,iDict);
- if (dictionary[iDict]->GetNtime() == 0) {
- dictionary[iDict]->Allocate(nRowMax,nColMax,nTimeTotal);
- }
- else {
- if (fCompress) dictionary[iDict]->Expand();
- }
+ for (iDict = 0; iDict < kNDict; iDict++) {
+ dictionary[iDict] = fDigitsManager->GetDictionary(detector,iDict);
+ if (dictionary[iDict]->GetNtime() == 0) {
+ dictionary[iDict]->Allocate(nRowMax,nColMax,nTimeTotal);
}
+ else {
+ if (fCompress) dictionary[iDict]->Expand();
+ }
}
if (fDebug > 1) printf("done\n");
detectorOld = detector;
}
- // Rotate the sectors on top of each other
- if (fSimpleSim) {
- rot[0] = pos[0];
- rot[1] = pos[1];
- rot[2] = pos[2];
- }
- else {
+ if (fFixedGeometry) {
+ // Rotate the sectors on top of each other
fGeo->Rotate(detector,pos,rot);
}
+ else {
+ // Use the geoManager
+ Double_t aaa[3];
+ gGeoManager->MasterToLocal(pos,aaa);
+ if (inDrift) {
+ aaa[2] = time0 - (kDrWidth / 2.0 + kAmWidth) + aaa[2];
+ }
+ else {
+ aaa[2] = time0 + aaa[2];
+ }
+ aaa[1] = row0 + padPlane->GetLengthRim() + fGeo->RpadW()
+ - 0.5 * fGeo->GetChamberLength(plane,chamber)
+ + aaa[1];
+ rot[0] = aaa[2];
+ rot[1] = aaa[0];
+ rot[2] = aaa[1];
+ }
// The driftlength. It is negative if the hit is between pad plane and anode wires.
Double_t driftlength = time0 - rot[0];
// The electron position after diffusion and ExB in pad coordinates.
// The pad row (z-direction)
- rowE = padPlane->GetPadRowNumber(xyz[2]);
+ rowE = padPlane->GetPadRowNumber(xyz[2]);
if (rowE < 0) continue;
- rowOffset = padPlane->GetPadRowOffset(rowE,xyz[2]);
+ rowOffset = padPlane->GetPadRowOffset(rowE,xyz[2]);
// The pad column (rphi-direction)
- offsetTilt = padPlane->GetTiltOffset(rowOffset); // MI change
- colE = padPlane->GetPadColNumber(xyz[1]+offsetTilt,rowOffset);
+ offsetTilt = padPlane->GetTiltOffset(rowOffset); // MI change
+ colE = padPlane->GetPadColNumber(xyz[1]+offsetTilt,rowOffset);
if (colE < 0) continue;
- colOffset = padPlane->GetPadColOffset(colE,xyz[1]+offsetTilt);
+ colOffset = padPlane->GetPadColOffset(colE,xyz[1]+offsetTilt);
- // also re-retrieve drift velocity because col and row may have changed
+ // 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);
Int_t signal = (Int_t) (-(simParam->GetGasGain()) * TMath::Log(ggRndm));
// Apply the pad response
- if (commonParam->PRFOn()) {
+ if (simParam->PRFOn()) {
// The distance of the electron to the center of the pad
// in units of pad width
//Double_t dist = - colOffset / padPlane->GetColSize(colE);
- Double_t dist = (0.5 * padPlane->GetColSize(colE) - colOffset)
+ Double_t dist = (colOffset - 0.5*padPlane->GetColSize(colE))
/ padPlane->GetColSize(colE);
+
if (!(calibration->PadResponse(signal,dist,plane,padSignal))) continue;
}
else {
// The time bin (always positive), with t0 correction
Double_t timeBinIdeal = drifttime * samplingRate + t0;
+ // Protection according to MI
+ if (TMath::Abs(timeBinIdeal) > 2*nTimeTotal) {
+ timeBinIdeal = 2 * nTimeTotal;
+ }
Int_t timeBinTruncated = (Int_t) timeBinIdeal;
// The distance of the position to the middle of the timebin
Double_t timeOffset = ((Float_t) timeBinTruncated + 0.5 - timeBinIdeal) / samplingRate;
// Store the track index in the dictionary
// Note: We store index+1 in order to allow the array to be compressed
- if ((signalOld[iPad] > 0) && (!fSimpleSim)) {
+ if (signalOld[iPad] > 0) {
for (iDict = 0; iDict < kNDict; iDict++) {
Int_t oldTrack = dictionary[iDict]->GetDataUnchecked(rowE
,colPos
// Loop through all chambers to finalize the digits
Int_t iDetBeg = 0;
Int_t iDetEnd = AliTRDgeometry::Ndet();
- if (fSimpleSim) {
- iDetBeg = fSimpleDet;
- iDetEnd = iDetBeg + 1;
- }
for (Int_t iDet = iDetBeg; iDet < iDetEnd; iDet++) {
Int_t plane = fGeo->GetPlane(iDet);
if (digits->GetNtime() == 0) {
digits->Allocate(nRowMax,nColMax,nTimeTotal);
}
- else if (fSimpleSim) {
- digits->Clear();
- }
// Get the signal container
signals = (AliTRDdataArrayF *) signalsArray->At(iDet);
if (fCompress) signals->Expand();
}
// Create the missing dictionary containers
- if (!fSimpleSim) {
- for (iDict = 0; iDict < kNDict; iDict++) {
- dictionary[iDict] = fDigitsManager->GetDictionary(iDet,iDict);
- if (dictionary[iDict]->GetNtime() == 0) {
- dictionary[iDict]->Allocate(nRowMax,nColMax,nTimeTotal);
- }
+ for (iDict = 0; iDict < kNDict; iDict++) {
+ dictionary[iDict] = fDigitsManager->GetDictionary(iDet,iDict);
+ if (dictionary[iDict]->GetNtime() == 0) {
+ dictionary[iDict]->Allocate(nRowMax,nColMax,nTimeTotal);
}
}
for (iTime = 0; iTime < nTimeTotal; iTime++) {
Float_t signalAmp = signals->GetDataUnchecked(iRow,iCol,iTime);
+
// Pad and time coupling
signalAmp *= coupling;
+
+ Float_t padgain = calibration->GetGainFactor(iDet, iCol, iRow);
+ if (padgain<=0) {
+ TString error;
+ error.Form("Not a valid gain %f, %d %d %d\n", padgain, iDet, iCol, iRow);
+ AliError(error);
+ }
+ signalAmp *= padgain;
+
// Add the noise, starting from minus ADC baseline in electrons
Double_t baselineEl = simParam->GetADCbaseline() * (simParam->GetADCinRange()
- / simParam->GetADCoutRange())
+ / simParam->GetADCoutRange())
/ convert;
signalAmp = TMath::Max((Double_t) gRandom->Gaus(signalAmp,simParam->GetNoise())
,-baselineEl);
// Add ADC baseline in mV
signalAmp += simParam->GetADCbaseline() * (simParam->GetADCinRange()
/ simParam->GetADCoutRange());
- // Convert to ADC counts. Set the overflow-bit fADCoutRange if the
+ // Convert to ADC counts. Set the overflow-bit fADCoutRange if the
// signal is larger than fADCinRange
Int_t adc = 0;
if (signalAmp >= simParam->GetADCinRange()) {
adc = ((Int_t) simParam->GetADCoutRange());
}
else {
- adc = ((Int_t) (signalAmp * (simParam->GetADCoutRange()
- / simParam->GetADCinRange())));
+ adc = TMath::Nint(signalAmp * (simParam->GetADCoutRange()
+ / simParam->GetADCinRange()));
}
+
inADC[iTime] = adc;
outADC[iTime] = adc;
}
- // Apply the tail cancelation via the digital filter
- if (simParam->TCOn()) {
- DeConvExp(inADC,outADC,nTimeTotal,simParam->GetTCnexp());
- }
-
for (iTime = 0; iTime < nTimeTotal; iTime++) {
// Store the amplitude of the digit if above threshold
if (outADC[iTime] > simParam->GetADCthreshold()) {
}
// Compress the arrays
- if (!fSimpleSim) {
- digits->Compress(1,0);
- for (iDict = 0; iDict < kNDict; iDict++) {
- dictionary[iDict]->Compress(1,0);
- }
+ digits->Compress(1,0);
+ for (iDict = 0; iDict < kNDict; iDict++) {
+ dictionary[iDict]->Compress(1,0);
+ }
- totalSizeDigits += digits->GetSize();
- totalSizeDict0 += dictionary[0]->GetSize();
- totalSizeDict1 += dictionary[1]->GetSize();
- totalSizeDict2 += dictionary[2]->GetSize();
-
- Float_t nPixel = nRowMax * nColMax * nTimeTotal;
- if (fDebug > 0) {
- printf("<AliTRDdigitizer::MakeDigits> ");
- printf("Found %d digits in detector %d (%3.0f).\n"
- ,nDigits,iDet
- ,100.0 * ((Float_t) nDigits) / nPixel);
- }
+ totalSizeDigits += digits->GetSize();
+ totalSizeDict0 += dictionary[0]->GetSize();
+ totalSizeDict1 += dictionary[1]->GetSize();
+ totalSizeDict2 += dictionary[2]->GetSize();
- if (fCompress) signals->Compress(1,0);
+ Float_t nPixel = nRowMax * nColMax * nTimeTotal;
+ if (fDebug > 0) {
+ printf("<AliTRDdigitizer::MakeDigits> ");
+ printf("Found %d digits in detector %d (%3.0f).\n"
+ ,nDigits,iDet
+ ,100.0 * ((Float_t) nDigits) / nPixel);
+ }
- }
+ if (fCompress) signals->Compress(1,0);
delete [] inADC;
delete [] outADC;
if (fDebug > 0) {
printf("<AliTRDdigitizer::MakeDigits> ");
printf("Total number of analyzed hits = %d\n",countHits);
- if (!fSimpleSim) {
- printf("<AliTRDdigitizer::MakeDigits> ");
- printf("Total digits data size = %d, %d, %d, %d\n",totalSizeDigits
- ,totalSizeDict0
- ,totalSizeDict1
- ,totalSizeDict2);
- }
+ printf("<AliTRDdigitizer::MakeDigits> ");
+ printf("Total digits data size = %d, %d, %d, %d\n",totalSizeDigits
+ ,totalSizeDict0
+ ,totalSizeDict1
+ ,totalSizeDict2);
}
return kTRUE;
Int_t iCol;
Int_t iTime;
- if (!fPar) {
- fPar = new AliTRDparameter("TRDparameter","Standard parameter");
- if (fDebug > 0) {
- printf("<AliTRDdigitizer::ConvertSDigits> ");
- printf("Create the default parameter object\n");
- }
- }
-
AliTRDSimParam* simParam = AliTRDSimParam::Instance();
if (!simParam)
{
for (iRow = 0; iRow < nRowMax; iRow++ ) {
for (iCol = 0; iCol < nColMax; iCol++ ) {
- for (iTime = 0; iTime < nTimeTotal; iTime++) {
+ for (iTime = 0; iTime < nTimeTotal; iTime++) {
Double_t signal = (Double_t) digitsIn->GetDataUnchecked(iRow,iCol,iTime);
signal *= sDigitsScale;
+ Float_t padgain = calibration->GetGainFactor(iDet, iCol, iRow);
+ if (padgain<=0) {
+ TString error;
+ error.Form("Not a valid gain %f, %d %d %d\n", padgain, iDet, iCol, iRow);
+ AliError(error);
+ }
+
+ signal *= padgain;
// Pad and time coupling
signal *= coupling;
// Add the noise, starting from minus ADC baseline in electrons
signal *= convert;
// add ADC baseline in mV
signal += adcBaseline * (adcInRange / adcOutRange);
- // Convert to ADC counts. Set the overflow-bit adcOutRange if the
+ // Convert to ADC counts. Set the overflow-bit adcOutRange if the
// signal is larger than adcInRange
Int_t adc = 0;
if (signal >= adcInRange) {
adc = ((Int_t) adcOutRange);
}
else {
- adc = ((Int_t) (signal * (adcOutRange / adcInRange)));
+ adc = TMath::Nint(signal * (adcOutRange / adcInRange));
}
inADC[iTime] = adc;
outADC[iTime] = adc;
}
- // Apply the tail cancelation via the digital filter
- if (simParam->TCOn()) {
- DeConvExp(inADC,outADC,nTimeTotal,simParam->GetTCnexp());
- }
-
- for (iTime = 0; iTime < nTimeTotal; iTime++) {
+ for (iTime = 0; iTime < nTimeTotal; iTime++) {
// Store the amplitude of the digit if above threshold
if (outADC[iTime] > adcThreshold) {
digitsOut->SetDataUnchecked(iRow,iCol,iTime,((Int_t) outADC[iTime]));
// Number of track dictionary arrays
const Int_t kNDict = AliTRDdigitsManager::kNDict;
- if (!fPar) {
- fPar = new AliTRDparameter("TRDparameter","Standard parameter");
- if (fDebug > 0) {
- printf("<AliTRDdigitizer::MergeSDigits> ");
- printf("Create the default parameter object\n");
- }
- }
-
AliTRDSimParam* simParam = AliTRDSimParam::Instance();
if (!simParam)
{
// Checks whether a detector is enabled
//
- if (fSimpleSim) return kTRUE;
-
if ((fTRD->GetSensChamber() >= 0) &&
(fTRD->GetSensChamber() != chamber)) return kFALSE;
if ((fTRD->GetSensPlane() >= 0) &&
//Write parameters
fRunLoader->CdGAFile();
- if (!gFile->Get("TRDparameter")) GetParameter()->Write();
// Store the digits and the dictionary in the tree
return fDigitsManager->WriteDigits();
}
-//_____________________________________________________________________________
-void AliTRDdigitizer::DeConvExp(Double_t *source, Double_t *target
- , Int_t n, Int_t nexp)
-{
- //
- // Does the deconvolution by the digital filter.
- //
- // Author: Marcus Gutfleisch, KIP Heidelberg
- // Optimized for: New TRF from Venelin Angelov, simulated with CADENCE
- // Pad-ground capacitance = 25 pF
- // Pad-pad cross talk capacitance = 6 pF
- // For 10 MHz digitization, corresponding to 20 time bins
- // in the drift region
- //
-
- Double_t rates[2];
- Double_t coefficients[2];
- Double_t Dt = 0.100; // time bin width [mus] for 10 MHz sampling frequence
-
- /* initialize (coefficient = alpha, rates = lambda) */
-
- rates[0] = 0.7680;
- rates[1] = 0.0995;
-
- rates[0] = TMath::Exp(-Dt/(rates[0]));
- rates[1] = TMath::Exp(-Dt/(rates[1]));
-
- // dummy initialization
- coefficients[0] = 0.0000;
- coefficients[1] = 0.0000;
-
- if( nexp == 1 ) {
- coefficients[0] = 0.0844;
- coefficients[1] = 0.0000;
- }
- if( nexp == 2 ) {
- coefficients[0] = 0.1445;
- coefficients[1] = 0.7524;
- }
-
- Int_t i, k;
- Double_t reminder[2];
- Double_t correction, result;
-
- /* attention: computation order is important */
- correction=0.0;
- for ( k = 0; k < nexp; k++ ) reminder[k]=0.0;
-
- for ( i = 0; i < n; i++ ) {
- result = ( source[i] - correction ); /* no rescaling */
- target[i] = result;
-
- for ( k = 0; k < nexp; k++ ) reminder[k] = rates[k]
- * ( reminder[k] + coefficients[k] * result);
-
- correction=0.0;
- for ( k = 0; k < nexp; k++ ) correction += reminder[k];
- }
-
-}
-
//_____________________________________________________________________________
void AliTRDdigitizer::InitOutput(Int_t iEvent)
{
// indices:
Int_t r1 = (Int_t)(10*dist);
- Int_t r2 = r1+1;
if (r1<0) r1 = 0;
if (r1>37) r1 = 37;
+ Int_t r2 = r1+1;
+ if (r2<0) r2 = 0;
+ if (r2>37) r2 = 37;
const Int_t kz1 = (Int_t)(100*z/2.5);
const Int_t kz2 = kz1+1;
if (r1<0 || r1>37 || kz1<0 || kz1>10) {
- printf("<AliTRDparameter::TimeStruct> Warning. Indices out of range: ");
+ printf("<AliTRDdigitizer::TimeStruct> Warning. Indices out of range: ");
printf("dist=%.2f, z=%.2f, r1=%d, kz1=%d\n",dist,z,r1,kz1);
}
fVDsmp[7] = 2.134;
if ( vdrift < fVDsmp[0] ) {
- printf("<AliTRDparameter::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
- printf("<AliTRDparameter::SampleTimeStruct> Drift Velocity too small (%.3f<%.3f)\n"
+ printf("<AliTRDdigitizer::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf("<AliTRDdigitizer::SampleTimeStruct> Drift Velocity too small (%.3f<%.3f)\n"
, vdrift, fVDsmp[0]);
- printf("<AliTRDparameter::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf("<AliTRDdigitizer::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
vdrift = fVDsmp[0];
} else if ( vdrift > fVDsmp[7] ) {
- printf("<AliTRDparameter::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
- printf("<AliTRDparameter::SampleTimeStruct> Drift Velocity too large (%.3f>%.3f)\n"
+ printf("<AliTRDdigitizer::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf("<AliTRDdigitizer::SampleTimeStruct> Drift Velocity too large (%.3f>%.3f)\n"
, vdrift,fVDsmp[6]);
- printf("<AliTRDparameter::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
+ printf("<AliTRDdigitizer::SampleTimeStruct> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\n");
vdrift = fVDsmp[7];
}
{
if (vdrift == fDiffusionInfo.fLastVdrift)
return;
-
- if (!fPar) {
- fPar = new AliTRDparameter("TRDparameter","Standard TRD parameter");
- if (fDebug > 0) {
- printf("<AliTRDdigitizer::RecalcDiffusion> ");
- printf("Create the default parameter object\n");
- }
- }
-
+
AliTRDSimParam* simParam = AliTRDSimParam::Instance();
if (!simParam)
{