Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions k4Reco/DDPlanarDigi/components/DDPlanarDigi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,27 +176,31 @@ DDPlanarDigi::operator()(const edm4hep::SimTrackerHitCollection& simTrackerHits,
<< " ns according to resolution: " << resT << " ns" << endmsg;
}

// Correcting for the propagation time
if (m_correctTimesForPropagation) {
double dt = oldPos.r() / (TMath::C() / 1e6);
hitT -= dt;
debug() << "corrected hit at R: " << oldPos.r() << " mm by propagation time: " << dt << " ns to T: " << hitT
<< " ns" << endmsg;
}

// Skip the hit if its time is outside the acceptance time window
if (m_useTimeWindow) {
// TODO: Check that the length of the time window is OK
float timeWindow_min = m_timeWindowMin.size() > 1 ? m_timeWindowMin[layer] : m_timeWindowMin[0];
float timeWindow_max = m_timeWindowMax.size() > 1 ? m_timeWindowMax[layer] : m_timeWindowMax[0];
if (hitT < timeWindow_min || hitT > timeWindow_max) {
debug() << "hit at T: " << hit.getTime() << " smeared to: " << hitT
double windowT = hitT;
if (m_correctTimeWindowForPropagation) {
windowT -= oldPos.r() / (TMath::C() / 1e6);
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A debug (or maybe better verbose) log output here could help in figuring out why hits are dropped via inspecting the logs.

if (windowT < timeWindow_min || windowT > timeWindow_max) {
debug() << "hit at T: " << hit.getTime() << " smeared to: " << windowT
<< " is outside the time window: hit dropped" << endmsg;
++nDismissedHits;
continue;
}
}

// Correcting for the propagation time
if (m_correctTimesForPropagation) {
double dt = oldPos.r() / (TMath::C() / 1e6);
hitT -= dt;
debug() << "corrected hit at R: " << oldPos.r() << " mm by propagation time: " << dt << " ns to T: " << hitT
<< " ns" << endmsg;
}

// Try to smear the hit position but ensure the hit is inside the sensitive region
dd4hep::rec::Vector3D u = surf->u();
dd4hep::rec::Vector3D v = surf->v();
Expand Down
5 changes: 4 additions & 1 deletion k4Reco/DDPlanarDigi/components/DDPlanarDigi.h
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,10 @@ struct DDPlanarDigi final
"Only accept hits with time (after smearing) within the specified time window (default: false)"};
Gaudi::Property<bool> m_correctTimesForPropagation{
this, "CorrectTimesForPropagation", false,
"Correct hit time for the propagation: radial distance/c (default: false)"};
"Correct the stored hit time for the propagation time-of-flight: radial distance/c (default: false)"};
Gaudi::Property<bool> m_correctTimeWindowForPropagation{
this, "CorrectTimeWindowForPropagation", true,
"Correct the hit time for the propagation time-of-flight when applying the time window cut (default: true)"};

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should also state that this does not affect the stored time.

Gaudi::Property<std::vector<float>> m_timeWindowMin{
this, "TimeWindowMin", {-1e9}, "Minimum time (ns) of SimTrackerHit to be digitized"};
Gaudi::Property<std::vector<float>> m_timeWindowMax{
Expand Down