Skip to content

Commit

Permalink
Update TrackingMonitor.cc
Browse files Browse the repository at this point in the history
protect pv0 assignment
  • Loading branch information
VinInn committed Sep 2, 2015
1 parent 07e5ad0 commit dfec2ee
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions DQM/TrackingMonitor/src/TrackingMonitor.cc
Expand Up @@ -515,12 +515,13 @@ void TrackingMonitor::analyze(const edm::Event& iEvent, const edm::EventSetup& i
edm::Handle< reco::VertexCollection > pvHandle;
iEvent.getByToken(pvSrcToken_, pvHandle );
reco::Vertex const * pv0 = nullptr;
if (pvHandle.isValid()) pv0 = &pvHandle->front();
//--- pv fake (the pv collection should have size==1 and the pv==beam spot)
if ( pv0->isFake() || pv0->tracksSize()==0
// definition of goodOfflinePrimaryVertex
|| pv0->ndof() < 4. || pv0->z() > 24.) pv0 = nullptr;

if (pvHandle.isValid()) {
pv0 = &pvHandle->front();
//--- pv fake (the pv collection should have size==1 and the pv==beam spot)
if ( pv0->isFake() || pv0->tracksSize()==0
// definition of goodOfflinePrimaryVertex
|| pv0->ndof() < 4. || pv0->z() > 24.) pv0 = nullptr;
}


if (trackHandle.isValid()) {
Expand Down

0 comments on commit dfec2ee

Please sign in to comment.