Skip to content

Commit

Permalink
TPC digi: Cut digits arriving before timeframe/readout start
Browse files Browse the repository at this point in the history
Relates to
https://its.cern.ch/jira/browse/O2-5395

and should allow to treat correctly events coming before the timeframe
start to reduce the startup effect in MC.
  • Loading branch information
sawenzel committed Oct 3, 2024
1 parent 37a1238 commit f6591b7
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions Detectors/TPC/simulation/src/Digitizer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void Digitizer::process(const std::vector<o2::tpc::HitGroup>& hits,

/// Loop over electrons
for (int iEle = 0; iEle < nPrimaryElectrons; ++iEle) {

Check failure on line 104 in Detectors/TPC/simulation/src/Digitizer.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
/// Drift and Diffusion
const GlobalPosition3D posEleDiff = electronTransport.getElectronDrift(posEle, driftTime);
const float eleTime = driftTime + hitTime; /// in us
Expand All @@ -111,6 +111,13 @@ void Digitizer::process(const std::vector<o2::tpc::HitGroup>& hits,
}
const float absoluteTime = eleTime + mTDriftOffset + (mEventTime - mOutputDigitTimeOffset); /// in us


Check failure on line 114 in Detectors/TPC/simulation/src/Digitizer.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
/// the absolute time needs to be within the readout limits
/// (otherwise negative times would all be accumulated in the 0-th timebin further below)
if ( ! (absoluteTime >= 0 /* && absoluteTime <= timeframelength */ ) ) {
continue;
}

Check failure on line 120 in Detectors/TPC/simulation/src/Digitizer.cxx

View workflow job for this annotation

GitHub Actions / PR formatting / whitespace

Trailing spaces

Remove the trailing spaces at the end of the line.
/// Attachment
if (electronTransport.isElectronAttachment(driftTime)) {
continue;
Expand Down Expand Up @@ -217,9 +224,14 @@ void Digitizer::setUseSCDistortions(std::string_view finp)

void Digitizer::setStartTime(double time)
{
// this is setting the first timebin index for the digit container
// note that negative times w.r.t start of timeframe/data-taking == mOutputDigitTimeOffset
// will yield the 0-th bin (due to casting logic in sampaProcessing)
SAMPAProcessing& sampaProcessing = SAMPAProcessing::instance();
sampaProcessing.updateParameters(mVDrift);
mDigitContainer.setStartTime(sampaProcessing.getTimeBinFromTime(time - mOutputDigitTimeOffset));
const auto timediff = time - mOutputDigitTimeOffset;
const auto starttimebin = sampaProcessing.getTimeBinFromTime(timediff);
mDigitContainer.setStartTime(starttimebin);
}

void Digitizer::setLumiScaleFactor()
Expand Down

0 comments on commit f6591b7

Please sign in to comment.