Skip to content
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

Add best layer cluster match #26

Open
wants to merge 1 commit into
base: pepr_CMSSW_12_0_0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ typedef ObjectIndexFromAssociationTableProducer<edm::View<CaloRecHit>, reco::PFC
CaloRecHitToPFCandIndexTableProducer;
typedef ObjectIndexFromAssociationTableProducer<edm::View<CaloRecHit>, SimClusterCollection>
CaloRecHitToBestSimClusterIndexTableProducer;
typedef ObjectIndexFromAssociationTableProducer<edm::View<CaloRecHit>, reco::CaloClusterCollection>
CaloRecHitToBestLayerClusterIndexTableProducer;
typedef ObjectIndexFromAssociationTableProducer<SimClusterCollection, CaloParticleCollection>
SimClusterToCaloParticleIndexTableProducer;
typedef ObjectIndexFromAssociationTableProducer<SimClusterCollection, SimClusterCollection>
Expand All @@ -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);
16 changes: 0 additions & 16 deletions DPGAnalysis/HGCalNanoAOD/python/hgcRecHits_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -76,7 +62,5 @@
+hgcRecHitsToPFCandTable
+hgcRecHitsToPFTICLCands
+hgcRecHitsToPFTICLCandTable
+hgcRecHitsToLayerClusters
+hgcRecHitsToLayerClusterTable
+hgcRecHitsPositionTable
)
29 changes: 28 additions & 1 deletion DPGAnalysis/HGCalNanoAOD/python/layerClusters_cff.py
Original file line number Diff line number Diff line change
@@ -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"),
Expand Down Expand Up @@ -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)

2 changes: 1 addition & 1 deletion DPGAnalysis/HGCalNanoAOD/python/nanoHGCML_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

nanoHGCMLSequence = cms.Sequence(nanoMetadata+
genVertexTable+genVertexT0Table+genParticleTable+
layerClusterTables+
simTrackTables+hgcSimHitsSequence+trackerSimHitTables+
simClusterTables+
trackingParticleTables+
Expand All @@ -38,6 +37,7 @@

nanoHGCMLRecoSequence = cms.Sequence(hgcRecHitsSequence+
hgcRecHitSimAssociationSequence+
layerClusterTables+
pfCandTable+pfTruth+
pfTICLCandTable+
ticlTables+
Expand Down