Skip to content

Commit

Permalink
Merge pull request #46412 from RSalvatico/fixPATEleProducer
Browse files Browse the repository at this point in the history
Fix beamspot in PATElectronProducer
  • Loading branch information
cmsbuild authored Oct 18, 2024
2 parents fe85c4c + 50e2d9f commit c2a54b5
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions PhysicsTools/PatAlgos/plugins/PATElectronProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -536,6 +536,13 @@ void PATElectronProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSe
// This is needed by the IPTools methods from the tracking group
trackBuilder = iSetup.getHandle(trackBuilderToken_);

if (beamSpotHandle.isValid()) {
beamSpot = *beamSpotHandle;
beamSpotIsValid = true;
} else {
edm::LogError("DataNotAvailable") << "No beam spot available from EventSetup, not adding high level selection \n";
}

if (pvHandle.isValid() && !pvHandle->empty()) {
primaryVertex = pvHandle->at(0);
primaryVertexIsValid = true;
Expand Down

0 comments on commit c2a54b5

Please sign in to comment.