-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Sub-event aware genJet and parton matching for HI miniAOD #31698
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
Merged
cmsbuild
merged 10 commits into
cms-sw:master
from
mandrenguyen:subEventGenJetHIminiAOD
Oct 20, 2020
Merged
Changes from 4 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
9bb1b99
Sub-event aware genJet clustering for HI miniAOD
mandrenguyen fb1c496
Oops, not all files were staged
mandrenguyen b270197
code checks and format
mandrenguyen afa1434
move from era to process modifier
mandrenguyen 8ac4539
cleanup from code review
mandrenguyen 0262462
remove unneeded memory include
mandrenguyen 8859bd0
fix fill descriptions, range-based loop, comments cleanup
mandrenguyen f189a56
code checks
mandrenguyen 5db41b8
indent relval_steps.py
mandrenguyen fdbde17
Remove cfis and use fillDescriptions defaults
mandrenguyen File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,4 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| genJetSubEvent = cms.Modifier() | ||
|
|
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,128 @@ | ||
| // -*- C++ -*- | ||
| // | ||
| // Package: HiSignalGenJetProducer | ||
| // Class: HiSignalGenJetProducer | ||
| // | ||
| /**\class HiSignalGenJetProducer HiSignalGenJetProducer.cc yetkin/HiSignalGenJetProducer/src/HiSignalGenJetProducer.cc | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| Description: <one line class summary> | ||
|
|
||
| Implementation: | ||
| <Notes on implementation> | ||
| */ | ||
| // | ||
| // Original Author: Yetkin Yilmaz | ||
| // Created: Tue Jul 21 04:26:01 EDT 2009 | ||
| // | ||
| // | ||
|
|
||
| // system include files | ||
| #include <memory> | ||
| #include <vector> | ||
|
|
||
| // user include files | ||
| #include "FWCore/Framework/interface/Frameworkfwd.h" | ||
| #include "FWCore/Framework/interface/EDProducer.h" | ||
|
|
||
| #include "FWCore/Framework/interface/Event.h" | ||
| #include "FWCore/Framework/interface/MakerMacros.h" | ||
|
|
||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
| #include "FWCore/Utilities/interface/InputTag.h" | ||
|
|
||
| #include "DataFormats/Common/interface/View.h" | ||
| #include "DataFormats/JetReco/interface/GenJetCollection.h" | ||
| #include "DataFormats/GeometryVector/interface/VectorUtil.h" | ||
| #include "DataFormats/HepMCCandidate/interface/GenParticle.h" | ||
|
|
||
| #include "DataFormats/Math/interface/Point3D.h" | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| #include "DataFormats/Math/interface/LorentzVector.h" | ||
|
|
||
| using namespace std; | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| using namespace edm; | ||
|
|
||
| // | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // class decleration | ||
| // | ||
|
|
||
| class HiSignalGenJetProducer : public edm::EDProducer { | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public: | ||
| explicit HiSignalGenJetProducer(const edm::ParameterSet&); | ||
| ~HiSignalGenJetProducer() override; | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| private: | ||
| void produce(edm::Event&, const edm::EventSetup&) override; | ||
| // ----------member data --------------------------- | ||
|
|
||
| edm::EDGetTokenT<edm::View<reco::GenJet> > jetSrc_; | ||
| }; | ||
|
|
||
| // | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // constants, enums and typedefs | ||
| // | ||
|
|
||
| // | ||
| // static data member definitions | ||
| // | ||
|
|
||
| // | ||
| // constructors and destructor | ||
| // | ||
|
|
||
| HiSignalGenJetProducer::HiSignalGenJetProducer(const edm::ParameterSet& iConfig) | ||
| : jetSrc_(consumes<edm::View<reco::GenJet> >(iConfig.getParameter<edm::InputTag>("src"))) { | ||
| std::string alias = (iConfig.getParameter<InputTag>("src")).label(); | ||
| produces<reco::GenJetCollection>().setBranchAlias(alias); | ||
| } | ||
|
|
||
| HiSignalGenJetProducer::~HiSignalGenJetProducer() { | ||
| // do anything here that needs to be done at desctruction time | ||
| // (e.g. close files, deallocate resources etc.) | ||
| } | ||
|
|
||
| // | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| // member functions | ||
| // | ||
|
|
||
| // ------------ method called to produce the data ------------ | ||
|
|
||
| void HiSignalGenJetProducer::produce(edm::Event& iEvent, const edm::EventSetup& iSetup) { | ||
| using namespace edm; | ||
| using namespace reco; | ||
|
|
||
| auto jets = std::make_unique<GenJetCollection>(); | ||
|
|
||
| edm::Handle<edm::View<GenJet> > genjets; | ||
| iEvent.getByToken(jetSrc_, genjets); | ||
|
|
||
| int jetsize = genjets->size(); | ||
|
|
||
| vector<int> selection; | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| selection.reserve(jetsize); | ||
| for (int ijet = 0; ijet < jetsize; ++ijet) { | ||
| selection.push_back(-1); | ||
| } | ||
|
|
||
| vector<int> selectedIndices; | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| vector<int> removedIndices; | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| for (int ijet = 0; ijet < jetsize; ++ijet) { | ||
mandrenguyen marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const GenJet* jet1 = &((*genjets)[ijet]); | ||
|
|
||
| const GenParticle* gencon = jet1->getGenConstituent(0); | ||
|
|
||
| if (gencon == nullptr) | ||
| throw cms::Exception("GenConstituent", "GenJet is missing its constituents"); | ||
| else if (gencon->collisionId() == 0) { | ||
| jets->push_back(*jet1); | ||
| selection[ijet] = 1; | ||
| } else { | ||
| selection[ijet] = 0; | ||
| removedIndices.push_back(ijet); | ||
| } | ||
| } | ||
|
|
||
| iEvent.put(std::move(jets)); | ||
| } | ||
|
|
||
| DEFINE_FWK_MODULE(HiSignalGenJetProducer); | ||
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.
Uh oh!
There was an error while loading. Please reload this page.