diff --git a/DPGAnalysis/HGCalNanoAOD/plugins/ObjectIndexFromAssociationProducer.cc b/DPGAnalysis/HGCalNanoAOD/plugins/ObjectIndexFromAssociationProducer.cc index dc2df9f170107..bdb1e69d7bbf8 100644 --- a/DPGAnalysis/HGCalNanoAOD/plugins/ObjectIndexFromAssociationProducer.cc +++ b/DPGAnalysis/HGCalNanoAOD/plugins/ObjectIndexFromAssociationProducer.cc @@ -24,6 +24,8 @@ typedef ObjectIndexFromAssociationTableProducer, reco::PFC CaloRecHitToPFCandIndexTableProducer; typedef ObjectIndexFromAssociationTableProducer, SimClusterCollection> CaloRecHitToBestSimClusterIndexTableProducer; +typedef ObjectIndexFromAssociationTableProducer, reco::CaloClusterCollection> + CaloRecHitToBestLayerClusterIndexTableProducer; typedef ObjectIndexFromAssociationTableProducer SimClusterToCaloParticleIndexTableProducer; typedef ObjectIndexFromAssociationTableProducer @@ -39,5 +41,6 @@ DEFINE_FWK_MODULE(SimClusterToCaloParticleIndexTableProducer); DEFINE_FWK_MODULE(SimClusterToSimClusterIndexTableProducer); DEFINE_FWK_MODULE(CaloRecHitToPFCandIndexTableProducer); DEFINE_FWK_MODULE(CaloRecHitToBestSimClusterIndexTableProducer); +DEFINE_FWK_MODULE(CaloRecHitToBestLayerClusterIndexTableProducer); DEFINE_FWK_MODULE(CaloRecHitToPFTruthParticleIndexTableProducer); DEFINE_FWK_MODULE(RecHitToTICLCandidateIndexTableProducer); diff --git a/DPGAnalysis/HGCalNanoAOD/python/hgcRecHits_cff.py b/DPGAnalysis/HGCalNanoAOD/python/hgcRecHits_cff.py index f378a107d2ecd..d8307e35f1c27 100644 --- a/DPGAnalysis/HGCalNanoAOD/python/hgcRecHits_cff.py +++ b/DPGAnalysis/HGCalNanoAOD/python/hgcRecHits_cff.py @@ -49,20 +49,6 @@ docString = cms.string("PFTICLCand with most associated energy in RecHit DetId") ) -hgcRecHitsToLayerClusters = cms.EDProducer("RecHitToLayerClusterAssociationProducer", - caloRecHits = cms.VInputTag("hgcRecHits"), - layerClusters = cms.InputTag("hgcalLayerClusters"), -) - -hgcRecHitsToLayerClusterTable = cms.EDProducer("HGCRecHitToLayerClusterIndexTableProducer", - cut = hgcRecHitsTable.cut, - src = hgcRecHitsTable.src, - objName = hgcRecHitsTable.name, - branchName = cms.string("LayerCluster"), - objMap = cms.InputTag("hgcRecHitsToLayerClusters:hgcRecHitsToLayerCluster"), - docString = cms.string("LayerCluster assigned largest RecHit fraction") -) - hgcRecHitsPositionTable = cms.EDProducer("HGCRecHitPositionTableProducer", src = hgcRecHitsTable.src, cut = hgcRecHitsTable.cut, @@ -76,7 +62,5 @@ +hgcRecHitsToPFCandTable +hgcRecHitsToPFTICLCands +hgcRecHitsToPFTICLCandTable - +hgcRecHitsToLayerClusters - +hgcRecHitsToLayerClusterTable +hgcRecHitsPositionTable ) diff --git a/DPGAnalysis/HGCalNanoAOD/python/layerClusters_cff.py b/DPGAnalysis/HGCalNanoAOD/python/layerClusters_cff.py index 555337ce94d5d..a1746eb9c7e3e 100644 --- a/DPGAnalysis/HGCalNanoAOD/python/layerClusters_cff.py +++ b/DPGAnalysis/HGCalNanoAOD/python/layerClusters_cff.py @@ -1,5 +1,6 @@ import FWCore.ParameterSet.Config as cms from PhysicsTools.NanoAOD.common_cff import P3Vars,Var +from DPGAnalysis.HGCalNanoAOD.hgcRecHits_cff import hgcRecHitsTable layerClusterTable = cms.EDProducer("SimpleCaloClusterFlatTableProducer", src = cms.InputTag("hgcalLayerClusters"), @@ -29,5 +30,31 @@ docString = cms.string("Index of SimCluster matched to LayerCluster") ) -layerClusterTables = cms.Sequence(layerClusterTable+layerClusterToSimClusterTable) +hgcRecHitsToLayerClusters = cms.EDProducer("RecHitToLayerClusterAssociationProducer", + caloRecHits = cms.VInputTag("hgcRecHits"), + layerClusters = cms.InputTag("hgcalLayerClusters"), +) + +hgcRecHitsToLayerClusterTable = cms.EDProducer("HGCRecHitToLayerClusterIndexTableProducer", + cut = hgcRecHitsTable.cut, + src = hgcRecHitsTable.src, + objName = hgcRecHitsTable.name, + branchName = cms.string("LayerCluster"), + objMap = cms.InputTag("hgcRecHitsToLayerClusters:hgcRecHitsToLayerCluster"), + docString = cms.string("LayerCluster assigned largest RecHit fraction") +) + +# For now there is only ever a 1 to 1 rechit to lc match +hgcRecHitsToBestLayerClusterTable = cms.EDProducer("CaloRecHitToBestLayerClusterIndexTableProducer", + cut = hgcRecHitsTable.cut, + src = hgcRecHitsTable.src, + objName = hgcRecHitsTable.name, + branchName = layerClusterTable.name, + objMap = cms.InputTag("hgcRecHitsToLayerClusters:hgcRecHitsToBestLayerCluster"), + docString = cms.string("LayerCluster to which the RecHit is associated") +) + + +layerClusterTables = cms.Sequence(layerClusterTable+layerClusterToSimClusterTable+ + hgcRecHitsToLayerClusters+hgcRecHitsToLayerClusterTable+hgcRecHitsToBestLayerClusterTable) diff --git a/DPGAnalysis/HGCalNanoAOD/python/nanoHGCML_cff.py b/DPGAnalysis/HGCalNanoAOD/python/nanoHGCML_cff.py index 929b28a87910b..d6c183c81c60e 100644 --- a/DPGAnalysis/HGCalNanoAOD/python/nanoHGCML_cff.py +++ b/DPGAnalysis/HGCalNanoAOD/python/nanoHGCML_cff.py @@ -29,7 +29,6 @@ nanoHGCMLSequence = cms.Sequence(nanoMetadata+ genVertexTable+genVertexT0Table+genParticleTable+ - layerClusterTables+ simTrackTables+hgcSimHitsSequence+trackerSimHitTables+ simClusterTables+ trackingParticleTables+ @@ -38,6 +37,7 @@ nanoHGCMLRecoSequence = cms.Sequence(hgcRecHitsSequence+ hgcRecHitSimAssociationSequence+ + layerClusterTables+ pfCandTable+pfTruth+ pfTICLCandTable+ ticlTables+