Skip to content

Commit

Permalink
set seedCollection= nullptr before leaving the scope, else would asse…
Browse files Browse the repository at this point in the history
…rt/crash next call
  • Loading branch information
slava77devel committed Aug 21, 2014
1 parent 6b1eb59 commit fe57c40
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,22 +53,22 @@ PhotonConversionTrajectorySeedProducerFromSingleLegAlgo::find(const edm::Event &
if (clustsOrZero){
if (!theSilentOnClusterCheck)
edm::LogError("TooManyClusters") << "Found too many clusters (" << clustsOrZero << "), bailing out.\n";
return ;
seedCollection= nullptr; return ;
}


edm::ESHandle<MagneticField> handleMagField;
setup.get<IdealMagneticFieldRecord>().get(handleMagField);
magField = handleMagField.product();
if (unlikely(magField->inTesla(GlobalPoint(0.,0.,0.)).z()<0.01)) return;
if (unlikely(magField->inTesla(GlobalPoint(0.,0.,0.)).z()<0.01)){seedCollection= nullptr; return;}

_IdealHelixParameters.setMagnField(magField);


event.getByToken(token_vertex, vertexHandle);
if (!vertexHandle.isValid() || vertexHandle->empty()){
edm::LogError("PhotonConversionFinderFromTracks") << "Error! Can't get the product primary Vertex Collection "<< _primaryVtxInputTag << "\n";
return;
seedCollection= nullptr; return;
}

event.getByToken(token_bs,recoBeamSpotHandle);
Expand Down

0 comments on commit fe57c40

Please sign in to comment.