forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Micro from700 reduced egamma #24
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
bendavid
wants to merge
8
commits into
arizzi:micro-from700-andrea
Choose a base branch
from
bendavid:micro-from700-reducedEgamma
base: micro-from700-andrea
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
8 commits
Select commit
Hold shift + click to select a range
57427c0
fix EcalClusterTools dependency
bendavid c18cdda
Adapt ConversionTools to mini aod (work with embedded tracks and add …
bendavid a4cd3de
add setters to egamma objects to allow relinking to reduced collectio…
bendavid aaa6786
add ReducedEGProducer for creating reduced collections of electrons a…
bendavid 4ec622d
adapt mini aod configs to use reducedEgamma collections
bendavid d06e10d
add function to clear detid vector for supercluster slimming in miniaod
bendavid 770a539
restore slimming of internal electron and photon variables
bendavid c5d269c
add additional flexibility in relinking and restore previous mini aod…
bendavid 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
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
106 changes: 106 additions & 0 deletions
106
RecoEgamma/EgammaPhotonProducers/interface/ReducedEGProducer.h
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,106 @@ | ||
| #ifndef RecoEgamma_EgammaPhotonProducers_ReducedEGProducer_h | ||
| #define RecoEgamma_EgammaPhotonProducers_ReducedEGProducer_h | ||
| /** \class ReducedEGProducer | ||
| ** | ||
| ** Select subset of electrons and photons from input collections and | ||
| ** produced consistently relinked output collections including | ||
| ** associated SuperClusters, CaloClusters and ecal RecHits | ||
| ** | ||
| ** \author J.Bendavid (CERN) | ||
| ** | ||
| ***/ | ||
|
|
||
| #include "FWCore/Framework/interface/EDProducer.h" | ||
| #include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
| #include "FWCore/Framework/interface/Event.h" | ||
| #include "FWCore/Framework/interface/EventSetup.h" | ||
| #include "DataFormats/Common/interface/Handle.h" | ||
| #include "FWCore/Framework/interface/ESHandle.h" | ||
| #include "Geometry/CaloGeometry/interface/CaloGeometry.h" | ||
| #include "Geometry/CaloTopology/interface/CaloTopology.h" | ||
| #include "DataFormats/EgammaCandidates/interface/Conversion.h" | ||
| #include "DataFormats/EgammaReco/interface/BasicCluster.h" | ||
| #include "DataFormats/EgammaReco/interface/SuperCluster.h" | ||
| #include "DataFormats/EgammaCandidates/interface/Photon.h" | ||
| #include "DataFormats/EgammaCandidates/interface/PhotonCore.h" | ||
| #include "DataFormats/EgammaReco/interface/BasicClusterShapeAssociation.h" | ||
| #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h" | ||
| #include "RecoEcal/EgammaCoreTools/interface/PositionCalc.h" | ||
| #include "DataFormats/EgammaReco/interface/ElectronSeedFwd.h" | ||
| #include "RecoEgamma/EgammaIsolationAlgos/interface/PfBlockBasedIsolation.h" | ||
| #include "RecoCaloTools/MetaCollections/interface/CaloRecHitMetaCollections.h" | ||
| #include "RecoEcal/EgammaCoreTools/interface/EcalClusterTools.h" | ||
| #include "RecoEgamma/PhotonIdentification/interface/PFPhotonIsolationCalculator.h" | ||
| #include "RecoEgamma/PhotonIdentification/interface/PhotonIsolationCalculator.h" | ||
| #include "RecoLocalCalo/EcalRecAlgos/interface/EcalSeverityLevelAlgo.h" | ||
| #include "RecoEgamma/PhotonIdentification/interface/PhotonMIPHaloTagger.h" | ||
| #include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionFactory.h" | ||
| #include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionBaseClass.h" | ||
| #include "CondFormats/EcalObjects/interface/EcalFunctionParameters.h" | ||
| #include "RecoEgamma/EgammaPhotonAlgos/interface/PhotonEnergyCorrector.h" | ||
|
|
||
| #include "DataFormats/EgammaCandidates/interface/PhotonFwd.h" | ||
| #include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h" | ||
|
|
||
| #include "CommonTools/UtilAlgos/interface/StringCutObjectSelector.h" | ||
|
|
||
|
|
||
| // ReducedEGProducer inherits from EDProducer, so it can be a module: | ||
| class ReducedEGProducer : public edm::EDProducer { | ||
|
|
||
| public: | ||
|
|
||
| ReducedEGProducer (const edm::ParameterSet& ps); | ||
| ~ReducedEGProducer(); | ||
|
|
||
| virtual void produce(edm::Event& evt, const edm::EventSetup& es); | ||
|
|
||
| private: | ||
|
|
||
| //tokens for input collections | ||
| edm::EDGetTokenT<reco::PhotonCollection> photonT_; | ||
| edm::EDGetTokenT<reco::GsfElectronCollection> gsfElectronT_; | ||
| edm::EDGetTokenT<reco::ConversionCollection> conversionT_; | ||
| edm::EDGetTokenT<reco::ConversionCollection> singleConversionT_; | ||
|
|
||
| edm::EDGetTokenT<EcalRecHitCollection> barrelEcalHits_; | ||
| edm::EDGetTokenT<EcalRecHitCollection> endcapEcalHits_; | ||
| edm::EDGetTokenT<EcalRecHitCollection> preshowerEcalHits_; | ||
|
|
||
| edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef> > > photonPfCandMapT_; | ||
| edm::EDGetTokenT<edm::ValueMap<std::vector<reco::PFCandidateRef> > > gsfElectronPfCandMapT_; | ||
|
|
||
| std::vector<edm::EDGetTokenT<edm::ValueMap<bool> > > photonIdTs_; | ||
| std::vector<edm::EDGetTokenT<edm::ValueMap<float> > > gsfElectronIdTs_; | ||
|
|
||
| //names for output collections | ||
| std::string outPhotons_; | ||
| std::string outPhotonCores_; | ||
| std::string outGsfElectrons_; | ||
| std::string outGsfElectronCores_; | ||
| std::string outConversions_; | ||
| std::string outSingleConversions_; | ||
| std::string outSuperClusters_; | ||
| std::string outEBEEClusters_; | ||
| std::string outESClusters_; | ||
| std::string outEBRecHits_; | ||
| std::string outEERecHits_; | ||
| std::string outESRecHits_; | ||
| std::string outPhotonPfCandMap_; | ||
| std::string outGsfElectronPfCandMap_; | ||
| std::vector<std::string> outPhotonIds_; | ||
| std::vector<std::string> outGsfElectronIds_; | ||
|
|
||
| StringCutObjectSelector<reco::Photon> keepPhotonSel_; | ||
| StringCutObjectSelector<reco::Photon> slimRelinkPhotonSel_; | ||
| StringCutObjectSelector<reco::Photon> relinkPhotonSel_; | ||
| StringCutObjectSelector<reco::GsfElectron> keepGsfElectronSel_; | ||
| StringCutObjectSelector<reco::GsfElectron> slimRelinkGsfElectronSel_; | ||
| StringCutObjectSelector<reco::GsfElectron> relinkGsfElectronSel_; | ||
|
|
||
|
|
||
|
|
||
| }; | ||
| #endif | ||
|
|
||
|
|
45 changes: 45 additions & 0 deletions
45
RecoEgamma/EgammaPhotonProducers/python/reducedEgamma_cfi.py
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,45 @@ | ||
| import FWCore.ParameterSet.Config as cms | ||
|
|
||
| reducedEgamma = cms.EDProducer("ReducedEGProducer", | ||
| keepPhotons = cms.string("pt > 14 && hadTowOverEm()<0.15"), #keep in output | ||
| slimRelinkPhotons = cms.string("pt > 14 && hadTowOverEm()<0.15"), #keep only slimmed SuperCluster plus seed cluster | ||
| relinkPhotons = cms.string("(r9()>0.8 || chargedHadronIso()<20 || chargedHadronIso()<0.3*pt())"), #keep all associated clusters/rechits/conversions | ||
| keepGsfElectrons = cms.string(""), #keep in output | ||
| slimRelinkGsfElectrons = cms.string(""), #keep only slimmed SuperCluster plus seed cluster | ||
| relinkGsfElectrons = cms.string("pt>5"), #keep all associated clusters/rechits/conversions | ||
| photons = cms.InputTag("gedPhotons"), | ||
| gsfElectrons = cms.InputTag("gedGsfElectrons"), | ||
| conversions = cms.InputTag("allConversions"), | ||
| singleConversions = cms.InputTag("gedPhotonCore"), | ||
| barrelEcalHits = cms.InputTag("reducedEcalRecHitsEB"), | ||
| endcapEcalHits = cms.InputTag("reducedEcalRecHitsEE"), | ||
| preshowerEcalHits = cms.InputTag("reducedEcalRecHitsES"), | ||
| photonsPFValMap = cms.InputTag("particleBasedIsolation","gedPhotons"), | ||
| gsfElectronsPFValMap = cms.InputTag("particleBasedIsolation","gedGsfElectrons"), | ||
| photonIDSources = cms.VInputTag( | ||
| cms.InputTag("PhotonIDProdGED","PhotonCutBasedIDLoose"), | ||
| cms.InputTag("PhotonIDProdGED","PhotonCutBasedIDLooseEM"), | ||
| cms.InputTag("PhotonIDProdGED","PhotonCutBasedIDTight") | ||
| ), | ||
| photonIDOutput = cms.vstring( | ||
| "PhotonCutBasedIDLoose", | ||
| "PhotonCutBasedIDLooseEM", | ||
| "PhotonCutBasedIDTight", | ||
| ), | ||
| gsfElectronIDSources = cms.VInputTag( | ||
| cms.InputTag("eidLoose"), | ||
| cms.InputTag("eidRobustHighEnergy"), | ||
| cms.InputTag("eidRobustLoose"), | ||
| cms.InputTag("eidRobustTight"), | ||
| cms.InputTag("eidTight"), | ||
| ), | ||
| gsfElectronIDOutput = cms.vstring( | ||
| "eidLoose", | ||
| "eidRobustHighEnergy", | ||
| "eidRobustLoose", | ||
| "eidRobustTight", | ||
| "eidTight", | ||
| ), | ||
| ) | ||
|
|
||
|
|
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.
we still had this selection!? looks like a bug no?
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.
ah no it was the final suggestion from susy