Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

technical fix for PixelJetPuId #36060

Merged
merged 1 commit into from Nov 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 7 additions & 6 deletions HLTrigger/JetMET/plugins/PixelJetPuId.cc
Expand Up @@ -20,6 +20,7 @@ If the sum of the tracks momentum is under a threshold the jet is tagged as "PUj

// system include files
#include <memory>
#include <algorithm>

// user include files
#include "FWCore/Framework/interface/Frameworkfwd.h"
Expand Down Expand Up @@ -149,13 +150,13 @@ void PixelJetPuId::produce(edm::StreamID sid, edm::Event& iEvent, const edm::Eve
//get tracks
Handle<std::vector<reco::Track> > tracks;
iEvent.getByToken(tracksToken, tracks);
unsigned int tsize = tracks->size();
float teta[tsize], tphi[tsize];
unsigned int i = 0;
uint const asize = std::max(1u, (uint)tracks->size());
float teta[asize], tphi[asize];
uint tsize = 0;
for (auto const& tr : *tracks) {
teta[i] = tr.eta();
tphi[i] = tr.phi();
++i;
teta[tsize] = tr.eta();
tphi[tsize] = tr.phi();
++tsize;
}

//get jets
Expand Down