New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix MET Significance, Covariance Matrix and unclustered energy lepton subtraction #29385
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
201f6d3
use slimmedLeptons for MET signfiance
ahinzmann 4527be2
use dR for lepton cleaning in uncluster uncertainty
ahinzmann f58441d
convert EG candidates
ahinzmann 4644673
fix pat test
ahinzmann c333d37
comments
ahinzmann e8fdb6f
use getvalue
ahinzmann 2b889a6
fix typos
ahinzmann 9d6e4c7
fix weired issue with input tag assignment
ahinzmann 5f8cb30
copy collection parameters
ahinzmann File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
Take as input: | ||
- the electron and photon collections | ||
- the electron and photon pf maps (edm::ValueMap<std::vector<reco::PFCandidateRef>>) pointing to old PF candidates | ||
Produce as output: | ||
- the electron and photon collections as VertexCompositePtrCandidates | ||
*/ | ||
|
||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/global/EDProducer.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h" | ||
#include "DataFormats/Common/interface/ValueMap.h" | ||
#include "DataFormats/Common/interface/PtrVector.h" | ||
#include "DataFormats/PatCandidates/interface/Photon.h" | ||
#include "DataFormats/PatCandidates/interface/Electron.h" | ||
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" | ||
#include "DataFormats/Common/interface/RefToPtr.h" | ||
#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" | ||
|
||
class PFEGammaToCandidate : public edm::global::EDProducer<> { | ||
public: | ||
explicit PFEGammaToCandidate(const edm::ParameterSet &iConfig); | ||
~PFEGammaToCandidate() override = default; | ||
|
||
void produce(edm::StreamID iID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override; | ||
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions); | ||
|
||
private: | ||
const edm::EDGetTokenT<edm::View<pat::Photon>> photons_; | ||
const edm::EDGetTokenT<edm::View<pat::Electron>> electrons_; | ||
const edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef>>> photon2pf_, electron2pf_; | ||
|
||
template <typename T> | ||
void run(edm::Event &iEvent, | ||
const edm::EDGetTokenT<edm::View<T>> &colltoken, | ||
const edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef>>> &oldmaptoken, | ||
const std::string &name) const { | ||
auto const &coll = iEvent.get(colltoken); | ||
|
||
edm::Handle<edm::ValueMap<std::vector<reco::PFCandidateRef>>> oldmap; | ||
iEvent.getByToken(oldmaptoken, oldmap); | ||
|
||
auto result = std::make_unique<std::vector<reco::VertexCompositePtrCandidate>>(); | ||
for (auto const &obj : coll) { | ||
result->push_back(reco::VertexCompositePtrCandidate(obj)); | ||
for (reco::PFCandidateRef pfRef : (*oldmap)[obj.originalObjectRef()]) | ||
result->back().addDaughter(refToPtr(pfRef)); | ||
} | ||
iEvent.put(std::move(result), name); | ||
} | ||
}; | ||
|
||
PFEGammaToCandidate::PFEGammaToCandidate(const edm::ParameterSet &iConfig) | ||
: photons_(consumes<edm::View<pat::Photon>>(iConfig.getParameter<edm::InputTag>("photons"))), | ||
electrons_(consumes<edm::View<pat::Electron>>(iConfig.getParameter<edm::InputTag>("electrons"))), | ||
photon2pf_( | ||
consumes<edm::ValueMap<std::vector<reco::PFCandidateRef>>>(iConfig.getParameter<edm::InputTag>("photon2pf"))), | ||
electron2pf_(consumes<edm::ValueMap<std::vector<reco::PFCandidateRef>>>( | ||
iConfig.getParameter<edm::InputTag>("electron2pf"))) { | ||
produces<std::vector<reco::VertexCompositePtrCandidate>>("photons"); | ||
produces<std::vector<reco::VertexCompositePtrCandidate>>("electrons"); | ||
} | ||
|
||
void PFEGammaToCandidate::produce(edm::StreamID iID, edm::Event &iEvent, const edm::EventSetup &iSetup) const { | ||
run<pat::Photon>(iEvent, photons_, photon2pf_, "photons"); | ||
run<pat::Electron>(iEvent, electrons_, electron2pf_, "electrons"); | ||
} | ||
|
||
void PFEGammaToCandidate::fillDescriptions(edm::ConfigurationDescriptions &descriptions) { | ||
edm::ParameterSetDescription desc; | ||
desc.add<edm::InputTag>("photons", edm::InputTag("selectedPatPhotons")); | ||
desc.add<edm::InputTag>("electrons", edm::InputTag("selectedPatElectrons")); | ||
desc.add<edm::InputTag>("photon2pf", edm::InputTag("particleBasedIsolation", "gedPhotons")); | ||
desc.add<edm::InputTag>("electron2pf", edm::InputTag("particleBasedIsolation", "gedGsfElectrons")); | ||
descriptions.addWithDefaultLabel(desc); | ||
} | ||
|
||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
DEFINE_FWK_MODULE(PFEGammaToCandidate); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new producers should come with a
::fillDescriptions
method.Please define one.