Skip to content

Commit

Permalink
Merge pull request #45689 from stahlleiton/Fix_UParT_CMSSW_14_1_X
Browse files Browse the repository at this point in the history
Fix sorting index for lost tracks in UnifiedParticleTransformer producer
  • Loading branch information
cmsbuild authored Aug 14, 2024
2 parents c84a6e6 + a5dd705 commit a961243
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class UnifiedParticleTransformerAK4TagInfoProducer : public edm::stream::EDProdu
const double jet_radius_;
const double min_candidate_pt_;
const bool flip_;
const bool fix_lt_sorting_;

const edm::EDGetTokenT<edm::View<reco::Jet>> jet_token_;
const edm::EDGetTokenT<VertexCollection> vtx_token_;
Expand Down Expand Up @@ -108,6 +109,7 @@ UnifiedParticleTransformerAK4TagInfoProducer::UnifiedParticleTransformerAK4TagIn
: jet_radius_(iConfig.getParameter<double>("jet_radius")),
min_candidate_pt_(iConfig.getParameter<double>("min_candidate_pt")),
flip_(iConfig.getParameter<bool>("flip")),
fix_lt_sorting_(iConfig.getParameter<bool>("fix_lt_sorting")),
jet_token_(consumes<edm::View<reco::Jet>>(iConfig.getParameter<edm::InputTag>("jets"))),
vtx_token_(consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("vertices"))),
lt_token_(consumes<edm::View<reco::Candidate>>(iConfig.getParameter<edm::InputTag>("losttracks"))),
Expand Down Expand Up @@ -154,6 +156,7 @@ void UnifiedParticleTransformerAK4TagInfoProducer::fillDescriptions(edm::Configu
desc.add<double>("jet_radius", 0.4);
desc.add<double>("min_candidate_pt", 0.10);
desc.add<bool>("flip", false);
desc.add<bool>("fix_lt_sorting", false);
desc.add<edm::InputTag>("vertices", edm::InputTag("offlinePrimaryVertices"));
desc.add<edm::InputTag>("losttracks", edm::InputTag("lostTracks"));
desc.add<edm::InputTag>("puppi_value_map", edm::InputTag("puppi"));
Expand Down Expand Up @@ -312,7 +315,7 @@ void UnifiedParticleTransformerAK4TagInfoProducer::produce(edm::Event& iEvent, c
float drminpfcandsv = btagbtvdeep::mindrsvpfcand(svs_unsorted, PackedCandidate_);
float distminpfcandsv = 0;

size_t entry = lt_sortedindices.at(i);
size_t entry = lt_sortedindices.at(fix_lt_sorting_ ? lt_sorted[i].get() : i);
// get cached track info
auto& trackinfo = lt_trackinfos.emplace(i, track_builder).first->second;
trackinfo.buildTrackInfo(PackedCandidate_, jet_dir, jet_ref_track_dir, pv);
Expand Down

0 comments on commit a961243

Please sign in to comment.