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
10 changes: 5 additions & 5 deletions Tracking/components/GenfitTrackFitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -554,7 +554,7 @@ struct GenfitTrackFitter final
this, "RunCalorimeterExtrapolation", true,
"If true, the track is extrapolated to the calorimeter surfaces (barrel and endcap)"
"and the corresponding track states are stored in the output track."
"This is applied only if a non-zero magnetic field (Bz > 0) is found at the last hit position."};
"This is applied only if a non-zero magnetic field (|Bz| > 0) is found at the last hit position."};

// ====================== Track Classification ======================
Gaudi::Property<double> m_RadialThresholdPromptTrack{
Expand Down Expand Up @@ -598,7 +598,7 @@ struct GenfitTrackFitter final
* @return true if the track fit was successful, false otherwise
*
* @note If the fit fails, the function exits early and no track is added to the output collections.
* @note Calorimeter extrapolation is applied only if a non-zero magnetic field (Bz > 0) is found
* @note Calorimeter extrapolation is applied only if a non-zero magnetic field (|Bz| > 0) is found
* at the last hit position.
*/
bool ProcessTrack(const edm4hep::Track& track, bool LimitHits, int particleHypothesis,
Expand Down Expand Up @@ -662,7 +662,7 @@ struct GenfitTrackFitter final
}
}

if (runCalorimeterExtrapolation && Bz > 0) {
if (runCalorimeterExtrapolation && std::abs(Bz) > 0) {

FillTrackWithCalorimeterExtrapolation(edm4hep_track, Bz, track_interface.GetCharge(), m_eCalBarrelInnerR,
m_eCalBarrelMaxZ, m_eCalEndCapInnerR, m_eCalEndCapOuterR,
Expand Down Expand Up @@ -697,7 +697,7 @@ struct GenfitTrackFitter final

auto edm4hep_track_with_fit = track_interface.GetTrackWithFit_edm4hep();

if (runCalorimeterExtrapolation && Bz > 0) {
if (runCalorimeterExtrapolation && std::abs(Bz) > 0) {

FillTrackWithCalorimeterExtrapolation(edm4hep_track_with_fit, Bz, track_interface.GetCharge(),
m_eCalBarrelInnerR, m_eCalBarrelMaxZ, m_eCalEndCapInnerR,
Expand Down Expand Up @@ -797,4 +797,4 @@ struct GenfitTrackFitter final
}
};

DECLARE_COMPONENT(GenfitTrackFitter)
DECLARE_COMPONENT(GenfitTrackFitter)
4 changes: 2 additions & 2 deletions Tracking/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ void FillTrackWithCalorimeterExtrapolation(edm4hep::MutableTrack& edm4hep_track,

auto trackStateLastHit = edm4hep_track.getTrackStates()[2];
double omega_lastHit = trackStateLastHit.omega;
double pt_lasthit = ConversionUnits::a_lcio * Bz / abs(omega_lastHit);
double pt_lasthit = std::abs(ConversionUnits::a_lcio * Bz / omega_lastHit);
double phi_lasthit = trackStateLastHit.phi;
double pz_lasthit = trackStateLastHit.tanLambda * pt_lasthit;
double px_lasthit = pt_lasthit * std::cos(phi_lasthit);
Expand Down Expand Up @@ -229,4 +229,4 @@ bool isPositiveSemiDefinite(const TMatrixDSym& M, double tol) {
return false;
}
return true;
}
}
Loading