Skip to content

Commit

Permalink
Fix check on bestTrack(). packedLayers_ is not going to be zero for n…
Browse files Browse the repository at this point in the history
…ew miniAOD, but will be zero when reading old ones, so better check both that and packedHits_ (which may be zero on new miniAODs if there's just one hit per layer)
  • Loading branch information
gpetruc committed Aug 25, 2016
1 parent 09284c6 commit 4d00309
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DataFormats/PatCandidates/interface/PackedCandidate.h
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ namespace pat {

/// return a pointer to the track if present. otherwise, return a null pointer
virtual const reco::Track * bestTrack() const {
if (packedHits_!=0) {
if (packedHits_!=0 || packedLayers_ !=0) {
if (!track_) unpackTrk();
return track_.load();
}
Expand Down

0 comments on commit 4d00309

Please sign in to comment.