Skip to content

Commit

Permalink
Update tpcsd2 (#263)
Browse files Browse the repository at this point in the history
* deal with case of undefined previousStep

* add time information to LowPt hits
  • Loading branch information
danieljeans authored Jan 13, 2023
1 parent 18e7bb4 commit a8bcaa5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/TPCSDAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,8 @@ namespace dd4hep {
//--------------------------------


if ( ( previousStep->GetPostStepPoint()->GetPosition() - step->GetPreStepPoint()->GetPosition() ).mag() > 1.0e-6 * CLHEP::mm ) {
if ( previousStep &&
( previousStep->GetPostStepPoint()->GetPosition() - step->GetPreStepPoint()->GetPosition() ).mag() > 1.0e-6 * CLHEP::mm ) {

// This step does not continue the previous path. Deposit the energy and begin a new Pt hit.

Expand Down Expand Up @@ -405,6 +406,7 @@ namespace dd4hep {
CumulativeMeanMomentum += (step->GetPreStepPoint()->GetMomentum() + step->GetPostStepPoint()->GetMomentum()) / 2;
CumulativeEnergyDeposit += step->GetTotalEnergyDeposit();
CumulativePathLength += step->GetStepLength();
CumulativeMeanTime += step->GetTrack()->GetGlobalTime();
}

};
Expand Down

0 comments on commit a8bcaa5

Please sign in to comment.