Skip to content

Commit 5ae130d

Browse files
jolopezlsawenzel
authored andcommitted
TRD digitizer signals to ADC O2-455 (#2009)
One more step toward the full digitization chain. Signal conversion to ADC values completed with the number of time bins defaulted to 30 as discussed previously in meetings. Last thing to do (and next): Filling vectors and passing info to the DPL. https://alice.its.cern.ch/jira/browse/O2-455 * signal2adc * correct driftv
1 parent 1a838c2 commit 5ae130d

File tree

2 files changed

+9
-30
lines changed

2 files changed

+9
-30
lines changed

Detectors/TRD/simulation/include/TRDSimulation/Digitizer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ class PadResponse;
2929
class Digitizer
3030
{
3131
public:
32+
enum { kTimeBins = 30 };
3233
//
3334
Digitizer();
3435
~Digitizer() = default;

Detectors/TRD/simulation/src/Digitizer.cxx

Lines changed: 8 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ bool Digitizer::convertHits(const int det, const std::vector<HitType>& hits, TRD
154154
timeBinTRFend = ((int)(mSimParam->GetTRFhi() * mCommonParam->GetSamplingFrequency())) - 1;
155155
}
156156

157-
const int nTimeTotal = 0; // DigitsManager->GetDigitsParam()->GetNTimeBins(det);
157+
const int nTimeTotal = kTimeBins; // DigitsManager->GetDigitsParam()->GetNTimeBins(det);
158158
const float samplingRate = mCommonParam->GetSamplingFrequency();
159159
const float elAttachProp = mSimParam->GetElAttachProp() / 100;
160160

@@ -222,7 +222,7 @@ bool Digitizer::convertHits(const int det, const std::vector<HitType>& hits, TRD
222222
absDriftLength /= TMath::Sqrt(1 / (1 + calExBDetValue * calExBDetValue));
223223
}
224224
// double driftVelocity = calVdriftDetValue * calVdriftROC->GetValue(colE, rowE); PLEASE FIX ME when CCDB is ready
225-
double driftVelocity = 2150; // Defaults values from OCDB (AliRoot DrawTrending macro) for 5 TeV pp - 27 runs from LHC15n
225+
double driftVelocity = 2.13; // Defaults values from OCDB (AliRoot DrawTrending macro) for 5 TeV pp - 27 runs from LHC15n
226226

227227
// Loop over all created electrons
228228
const int nElectrons = abs(qTotal);
@@ -278,7 +278,7 @@ bool Digitizer::convertHits(const int det, const std::vector<HitType>& hits, TRD
278278

279279
// Retrieve drift velocity becuase col and row may have changed
280280
// driftVelocity = calVdriftDetValue* calVdriftROC->GetValue(colE, rowE); PLEASE FIX ME when CCDB is ready
281-
driftVelocity = 2150; // Defaults values from OCDB (AliRoot DrawTrending macro) for 5 TeV pp - 27 runs from LHC15n
281+
driftVelocity = 2.13; // Defaults values from OCDB (AliRoot DrawTrending macro) for 5 TeV pp - 27 runs from LHC15n
282282
// float t0 = calT0DetValue + calT0ROC->getValue(colE, rowE); PLEASE FIX ME when CCDB is ready
283283
const float t0 = -1.38 + 0; // Defaults values from OCDB (AliRoot DrawTrending macro) for 5 TeV pp - 27 runs from LHC15n
284284

@@ -436,49 +436,27 @@ bool Digitizer::convertSignalsToADC(const int det, int& signals)
436436

437437
int nRowMax = mGeo->getPadPlane(det)->getNrows();
438438
int nColMax = mGeo->getPadPlane(det)->getNcols();
439-
int nTimeTotal = 100; // fDigitsManager->GetDigitsParam()->GetNTimeBins(det);
439+
int nTimeTotal = kTimeBins; // fDigitsManager->GetDigitsParam()->GetNTimeBins(det);
440440
// if (fSDigitsManager->GetDigitsParam()->GetNTimeBins(det)) {
441441
// nTimeTotal = fSDigitsManager->GetDigitsParam()->GetNTimeBins(det);
442442
// } else {
443443
// LOG(FATAL) << "Could not get number of time bins";
444444
// return false;
445445
// }
446446

447-
// The gain factor mCalib objects
448-
// const AliTRDCalDet* calGainFactorDet = mCalib->GetGainFactorDet();
449-
// AliTRDCalROC* calGainFactorROC = 0x0;
450-
float calGainFactorDetValue = 0.0;
451-
452447
// AliTRDarrayADC* digits = 0x0;
453448
int digits = 0;
454449

455450
if (!signals) {
456451
LOG(FATAL) << "Signals array for detector " << det << " does not exis";
457452
return false;
458453
}
459-
// if (signals->HasData()) {
460-
// // Expand the container if neccessary
461-
// signals->Expand();
462-
// } else {
463-
// // Create missing containers
464-
// signals->Allocate(nRowMax, nColMax, nTimeTotal);
465-
// }
466-
467-
// Get the container for the digits of this detector
468-
// if (fDigitsManager->HasSDigits()) {
469-
// AliError("Digits manager has s-digits");
470-
// return false;
471-
// }
472-
473-
// digits = (AliTRDarrayADC*)fDigitsManager->GetDigits(det);
474-
// // Allocate memory space for the digits buffer
475-
// if (!digits->HasData()) {
476-
// digits->Allocate(nRowMax, nColMax, nTimeTotal);
477-
// }
478454

479455
// Get the mCalib objects
480-
// calGainFactorROC = mCalib->GetGainFactorROC(det);
456+
// CalDet* calGainFactorDet = mCalib->GetGainFactorDet();
457+
// CalRoc* calGainFactorROC = mCalib->GetGainFactorROC(det);
481458
// calGainFactorDetValue = calGainFactorDet->GetValue(det);
459+
float calGainFactorDetValue = 0.47; // +/- 0.06 // Defaults value from OCDB (AliRoot DrawTrending macro) for 5 TeV pp - 27 runs from LHC15n
482460

483461
// Create the digits for this chamber
484462
for (row = 0; row < nRowMax; row++) {
@@ -499,7 +477,7 @@ bool Digitizer::convertSignalsToADC(const int det, int& signals)
499477
// }
500478

501479
// The gain factors
502-
float padgain = calGainFactorDetValue; // * calGainFactorROC->GetValue(col, row);
480+
float padgain = calGainFactorDetValue; // * calGainFactorROC->GetValue(col, row); // PLEASE FIX ME when CCDB is ready
503481
if (padgain <= 0) {
504482
const auto msg = Form("Not a valid gain %f, %d %d %d", padgain, det, col, row);
505483
LOG(FATAL) << msg;

0 commit comments

Comments
 (0)