Skip to content

Commit

Permalink
Fixed L1TrackNtupleMaker crash (#223)
Browse files Browse the repository at this point in the history
* Fixed L1TrackNtupleMaker crash

* Fixed L1TrackNtupleMaker crash

* Fixed L1TrackNtupleMaker crash
  • Loading branch information
tomalin authored May 17, 2023
1 parent e0a9a38 commit cf9087e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -936,6 +936,13 @@ void L1TrackNtupleMaker::analyze(const edm::Event& iEvent, const edm::EventSetup
float tmp_trk_phi = iterL1Track->momentum().phi();
float tmp_trk_z0 = iterL1Track->z0(); //cm
float tmp_trk_tanL = iterL1Track->tanL();
bool usingNewKF = hphSetup->useNewKF();
if (usingNewKF) {
// Skip crazy tracks to avoid crash (as NewKF applies no cuts to kill them).
constexpr float crazy_z0_cut = 30.; // Cut to kill any crazy tracks found by New KF (which applies no cuts)
if (fabs(tmp_trk_z0) > crazy_z0_cut)
continue;
}

int tmp_trk_hitpattern = 0;
tmp_trk_hitpattern = (int)iterL1Track->hitPattern();
Expand Down
2 changes: 2 additions & 0 deletions L1Trigger/TrackFindingTracklet/test/L1TrackNtupleMaker_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,8 @@
fwConfig( process )
if (L1TRKALGO == 'HYBRID_REDUCED'):
reducedConfig( process )
# Needed by L1TrackNtupleMaker
process.HitPatternHelperSetup.useNewKF = True

# LEGACY ALGORITHM (EXPERTS ONLY): TRACKLET
elif (L1TRKALGO == 'TRACKLET'):
Expand Down
1 change: 1 addition & 0 deletions L1Trigger/TrackerTFP/src/DataFormats.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ namespace trackerTFP {
numStreamsTracks_[+Process::kfin] = numStreams_[+Process::kf];
numStreamsTracks_[+Process::kf] = numStreams_[+Process::kf];
// Print digi data format of all variables of any specified algo step
// (Look at DataFormat.h::tracks_ to see variable names).
//for (const Variable v : tracks_[+Process::kf]) {
// const DataFormat& f = format(v, Process::kf);
// cout <<" KF "<< f.base() << " " << f.range() << " " << f.width() << endl;
Expand Down

0 comments on commit cf9087e

Please sign in to comment.