Skip to content
Merged
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
13 changes: 7 additions & 6 deletions HLTrigger/JetMET/plugins/PixelJetPuId.cc
Original file line number Diff line number Diff line change
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