-
Notifications
You must be signed in to change notification settings - Fork 35
Izisopou patch miniaod #29
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
Open
izisopou
wants to merge
19
commits into
cms-jet:master
Choose a base branch
from
izisopou:izisopou-patch-MINIAOD
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8498413
Update BuildFile.xml
izisopou 2c2decb
Update JetResponseAnalyzer.hh
izisopou 5588ac5
Update JetReconstruction_cff.py
izisopou 2fd6c93
Update addAlgorithm.py
izisopou 77d7747
Update JetResponseAnalyzer.cc
izisopou 345364f
Update Defaults_cff.py
izisopou f9c3488
Update JRAEvent.cc
izisopou 650984b
Update JRAEvent.h
izisopou 8edaf1c
Create XrdClFileSystem_v2.hh
izisopou 19a622a
Update jet_correction_analyzer_x.cc
izisopou a60f42d
Delete XrdClFileSystem_v2.hh
izisopou b9712c6
Update jet_correction_analyzer_x.cc
izisopou dbf79af
Update JetResponseAnalyzer.hh
izisopou a80a146
Update JetReconstruction_cff.py
izisopou 34aebad
Update addAlgorithm.py
izisopou e1fb630
Update JetResponseAnalyzer.cc
izisopou 28e40e4
Update JRAEvent.h
izisopou 95ad4db
Update Defaults_cff.py
izisopou c30dca5
Update HistogramUtilities.cc
izisopou 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
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 | ||
|---|---|---|---|---|
|
|
@@ -25,11 +25,11 @@ JetResponseAnalyzer::JetResponseAnalyzer(const edm::ParameterSet& iConfig) | |||
| , srcRhoHLT_ (consumes<double>(iConfig.getParameter<edm::InputTag> ("srcRhoHLT"))) | ||||
| , srcVtx_ (consumes<reco::VertexCollection>(iConfig.getParameter<edm::InputTag> ("srcVtx"))) | ||||
| , srcGenInfo_ (consumes<GenEventInfoProduct>(edm::InputTag("generator")) ) | ||||
| , srcPileupInfo_ (consumes<vector<PileupSummaryInfo> >(edm::InputTag("addPileupInfo")) ) | ||||
| , srcPileupInfo_ (consumes<vector<PileupSummaryInfo> >(edm::InputTag("slimmedAddPileupInfo")) ) | ||||
| //, srcPFCandidates_ (consumes<vector<reco::PFCandidate> >(iConfig.getParameter<edm::InputTag>("srcPFCandidates"))) | ||||
| , srcPFCandidates_ (consumes<PFCandidateView>(iConfig.getParameter<edm::InputTag>("srcPFCandidates"))) | ||||
| , srcPFCandidatesAsFwdPtr_(consumes<std::vector<edm::FwdPtr<reco::PFCandidate> > >(iConfig.getParameter<edm::InputTag>("srcPFCandidates"))) | ||||
| , srcGenParticles_ (consumes<vector<reco::GenParticle> >(iConfig.getParameter<edm::InputTag>("srcGenParticles"))) | ||||
| , srcGenParticles_ (consumes<vector<pat::PackedGenParticle> >(iConfig.getParameter<edm::InputTag>("srcGenParticles"))) | ||||
| , jecLabel_ (iConfig.getParameter<std::string> ("jecLabel")) | ||||
| , doComposition_ (iConfig.getParameter<bool> ("doComposition")) | ||||
| , doFlavor_ (iConfig.getParameter<bool> ("doFlavor")) | ||||
|
|
@@ -115,6 +115,46 @@ void JetResponseAnalyzer::beginJob() | |||
| } | ||||
|
|
||||
|
|
||||
| void getMult( vector<reco::CandidatePtr> const & particles, int* nMult, int* chMult ) { | ||||
|
|
||||
| vector<reco::CandidatePtr>::const_iterator itParticle; | ||||
| for (itParticle=particles.begin();itParticle!=particles.end();++itParticle){ | ||||
| const reco::Candidate* pfCand = itParticle->get(); | ||||
|
|
||||
| switch (std::abs(pfCand->pdgId())) { | ||||
|
|
||||
| case 211: //PFCandidate::h: // charged hadron | ||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't use unnamed constants. Instead, you should define enums as in
You also only really have two cases:
|
||||
| (*chMult)++; | ||||
| break; | ||||
|
|
||||
| case 130: //PFCandidate::h0 : // neutral hadron | ||||
| (*nMult)++; | ||||
| break; | ||||
|
|
||||
| case 22: //PFCandidate::gamma: // photon | ||||
| (*nMult)++; | ||||
| break; | ||||
|
|
||||
| case 11: // PFCandidate::e: // electron | ||||
| (*chMult)++; | ||||
| break; | ||||
|
|
||||
| case 13: //PFCandidate::mu: // muon | ||||
| (*chMult)++; | ||||
| break; | ||||
|
|
||||
| case 1: // PFCandidate::h_HF : // hadron in HF | ||||
| (*nMult)++; | ||||
| break; | ||||
|
|
||||
| case 2: //PFCandidate::egamma_HF : // electromagnetic in HF | ||||
| (*nMult)++; | ||||
| break; | ||||
| } | ||||
| } | ||||
| } | ||||
|
|
||||
| //_______________ | ||||
| //______________________________________________________________________________ | ||||
| void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | ||||
| const edm::EventSetup& iSetup) | ||||
|
|
@@ -134,7 +174,7 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
| edm::Handle<reco::VertexCollection> vtx; | ||||
| edm::Handle<PFCandidateView> pfCandidates; | ||||
| edm::Handle<std::vector<edm::FwdPtr<reco::PFCandidate> > > pfCandidatesAsFwdPtr; | ||||
| edm::Handle<vector<reco::GenParticle> > genParticles; | ||||
| edm::Handle<vector<pat::PackedGenParticle> > genParticles; | ||||
|
|
||||
| // Jet CORRECTOR | ||||
| jetCorrector_ = (jecLabel_.empty()) ? 0 : JetCorrector::getJetCorrector(jecLabel_,iSetup); | ||||
|
|
@@ -189,8 +229,8 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
| JRAEvt_->refpvz = -1000.0; | ||||
| iEvent.getByToken(srcGenParticles_, genParticles); | ||||
| for (size_t i = 0; i < genParticles->size(); ++i) { | ||||
| const reco::GenParticle & genIt = (*genParticles)[i]; | ||||
| if ( genIt.isHardProcess() ) { | ||||
| const pat::PackedGenParticle & genIt = (*genParticles)[i]; | ||||
| if ( genIt.fromHardProcessFinalState() ) { | ||||
| JRAEvt_->refpvz = genIt.vz(); | ||||
| break; | ||||
| } | ||||
|
|
@@ -264,11 +304,10 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
| else JRAEvt_->refdrjt->pop_back(); | ||||
| continue; | ||||
| } | ||||
|
|
||||
| JRAEvt_->refpdgid->push_back(0); | ||||
| JRAEvt_->refpdgid_algorithmicDef->push_back(0); | ||||
| JRAEvt_->refpdgid_physicsDef->push_back(0); | ||||
| if (getFlavorFromMap_) { | ||||
| JRAEvt_->refpdgid_algorithmicDef->push_back(0); | ||||
| JRAEvt_->refpdgid_physicsDef->push_back(0); | ||||
| reco::JetMatchedPartonsCollection::const_iterator itPartonMatch; | ||||
| itPartonMatch=refToPartonMap->begin(); | ||||
| for (;itPartonMatch!=refToPartonMap->end();++itPartonMatch) { | ||||
|
|
@@ -315,10 +354,6 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
| } | ||||
| } | ||||
| } | ||||
| else { | ||||
| JRAEvt_->refpdgid_algorithmicDef->at(JRAEvt_->nref)=0; | ||||
| JRAEvt_->refpdgid_physicsDef->at(JRAEvt_->nref)=0; | ||||
| } | ||||
| JRAEvt_->refpdgid->at(JRAEvt_->nref)=ref->pdgId(); | ||||
|
|
||||
| // Beta/Beta Star Calculation | ||||
|
|
@@ -439,12 +474,21 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
| JRAEvt_->jtmuf ->push_back(pfJetRef->muonEnergyFraction() *JRAEvt_->jtjec->at(JRAEvt_->nref)); | ||||
| JRAEvt_->jthfhf->push_back(pfJetRef->HFHadronEnergyFraction() *JRAEvt_->jtjec->at(JRAEvt_->nref)); | ||||
| JRAEvt_->jthfef->push_back(pfJetRef->HFEMEnergyFraction() *JRAEvt_->jtjec->at(JRAEvt_->nref)); | ||||
| int chMult=0, nMult=0; | ||||
| getMult( ref.castTo<reco::GenJetRef>()->getJetConstituents(), &nMult, &chMult ); | ||||
| JRAEvt_->refnMult ->push_back( nMult ); | ||||
| JRAEvt_->refchMult->push_back( chMult ); | ||||
|
|
||||
| //this method exists for pfjets (neutralMultiplicity()), but not for genjets | ||||
| //original i thought since genjet didn't have it i should make this method | ||||
| chMult=0; nMult=0; | ||||
| getMult( jet.castTo<reco::PFJetRef>()->getJetConstituents(), &nMult, &chMult ); | ||||
| JRAEvt_->jtnMult ->push_back( nMult ); | ||||
| JRAEvt_->jtchMult->push_back( chMult ); | ||||
| } | ||||
| } | ||||
|
|
||||
| JRAEvt_->nref++; | ||||
| } | ||||
|
|
||||
| // PFCANDIDATE INFORMATION | ||||
| //Dual handle idea from https://github.com/aperloff/cmssw/blob/CMSSW_7_6_X/RecoJets/JetProducers/plugins/VirtualJetProducer.cc | ||||
| //Random-Cone algo from https://github.com/cihar29/OffsetAnalysis/blob/master/run_offset.py | ||||
|
|
@@ -483,8 +527,6 @@ void JetResponseAnalyzer::analyze(const edm::Event& iEvent, | |||
| } | ||||
| } | ||||
| } | ||||
|
|
||||
|
|
||||
| tree_->Fill(); | ||||
|
|
||||
| return; | ||||
|
|
||||
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
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.
Why are you recreating the particleFlow collection without any cuts? Why not just use the packedPFCandidates directly as inputs on line 583? Same comment for lines 585-589.