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

[HGCAL] Reorganizing layer cluster plots into subfolders #33063

Merged
merged 7 commits into from Mar 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 14 additions & 5 deletions Validation/HGCalValidation/interface/HGVHistoProducerAlgo.h
Expand Up @@ -212,12 +212,21 @@ class HGVHistoProducerAlgo {
unsigned int layers,
std::vector<int> thicknesses);

void bookClusterHistos(DQMStore::IBooker& ibook,
Histograms& histograms,
unsigned int layers,
std::vector<int> thicknesses,
std::string pathtomatbudfile);
void bookClusterHistos_ClusterLevel(DQMStore::IBooker& ibook,
Histograms& histograms,
unsigned int layers,
std::vector<int> thicknesses,
std::string pathtomatbudfile);

void bookClusterHistos_LCtoCP_association(DQMStore::IBooker& ibook, Histograms& histograms, unsigned int layers);

void bookClusterHistos_CellLevel(DQMStore::IBooker& ibook,
Histograms& histograms,
unsigned int layers,
std::vector<int> thicknesses);

void bookMultiClusterHistos(DQMStore::IBooker& ibook, Histograms& histograms, unsigned int layers);

void layerClusters_to_CaloParticles(const Histograms& histograms,
edm::Handle<reco::CaloClusterCollection> clusterHandle,
const reco::CaloClusterCollection& clusters,
Expand Down
21 changes: 15 additions & 6 deletions Validation/HGCalValidation/plugins/HGCalValidator.cc
Expand Up @@ -150,12 +150,21 @@ void HGCalValidator::bookHistograms(DQMStore::IBooker& ibook,
//Booking histograms concerning with hgcal layer clusters
if (dolayerclustersPlots_) {
ibook.cd();
ibook.setCurrentFolder(dirName_ + "hgcalLayerClusters");
histoProducerAlgo_->bookClusterHistos(ibook,
histograms.histoProducerAlgo,
totallayers_to_monitor_,
thicknesses_to_monitor_,
cummatbudinxo_.fullPath());
ibook.setCurrentFolder(dirName_ + "hgcalLayerClusters/ClusterLevel");
histoProducerAlgo_->bookClusterHistos_ClusterLevel(ibook,
histograms.histoProducerAlgo,
totallayers_to_monitor_,
thicknesses_to_monitor_,
cummatbudinxo_.fullPath());
ibook.cd();
ibook.setCurrentFolder(dirName_ + "hgcalLayerClusters/LCtoCP_association");
histoProducerAlgo_->bookClusterHistos_LCtoCP_association(
ibook, histograms.histoProducerAlgo, totallayers_to_monitor_);

ibook.cd();
ibook.setCurrentFolder(dirName_ + "hgcalLayerClusters/CellLevel");
histoProducerAlgo_->bookClusterHistos_CellLevel(
ibook, histograms.histoProducerAlgo, totallayers_to_monitor_, thicknesses_to_monitor_);
}

//Booking histograms for multiclusters
Expand Down
Expand Up @@ -15,7 +15,7 @@
eff_layers.extend(["merge_phi_layer{:02d} 'LayerCluster Merge Rate vs #phi Layer{:02d} in z-' NumMerge_LayerCluster_Phi_perlayer{:02d} Denom_LayerCluster_Phi_perlayer{:02d}".format(i, i%maxlayerzm+1, i, i) if (i<maxlayerzm) else "merge_phi_layer{:02d} 'LayerCluster Merge Rate vs #phi Layer{:02d} in z+' NumMerge_LayerCluster_Phi_perlayer{:02d} Denom_LayerCluster_Phi_perlayer{:02d}".format(i, i%maxlayerzm+1, i, i) for i in range(maxlayerzp) ])

postProcessorHGCALlayerclusters= DQMEDHarvester('DQMGenericClient',
subDirs = cms.untracked.vstring('HGCAL/HGCalValidator/hgcalLayerClusters/'),
subDirs = cms.untracked.vstring('HGCAL/HGCalValidator/hgcalLayerClusters/LCtoCP_association'),
efficiency = cms.vstring(eff_layers),
resolution = cms.vstring(),
cumulativeDists = cms.untracked.vstring(),
Expand Down
135 changes: 89 additions & 46 deletions Validation/HGCalValidation/python/hgcalPlots.py
Expand Up @@ -1970,10 +1970,7 @@
hgcalLayerClustersPlotter = Plotter()
layerClustersLabel = 'Layer Clusters'

lc_general = [
# calculated "energy density" for cells in a) 120um, b) 200um, c) 300um, d) scint
# (one entry per rechit, in the appropriate histo)
_cellsenedens_thick,
lc_general_clusterlevel = [
# number of layer clusters per event in a) 120um, b) 200um, c) 300um, d) scint
# (one entry per event in each of the four histos)
_totclusternum_thick,
Expand All @@ -1985,14 +1982,23 @@
_energyclustered,
_mixedhitsclusters,
_longdepthbarycentre,
# SelectedCaloParticles plots
_SelectedCaloParticles,
# calculated "energy density" for cells in a) 120um, b) 200um, c) 300um, d) scint
# (one entry per rechit, in the appropriate histo)
_cellsenedens_thick
]
lc_zminus = [

lc_clusterlevel_zminus = [
# number of layer clusters per layer (one entry per event in each histo)
_totclusternum_layer_EE_zminus,
_totclusternum_layer_FH_zminus,
_totclusternum_layer_BH_zminus,
# Looking at the fraction of true energy that has been clustered; by layer and overall
_energyclustered_perlayer_EE_zminus,
_energyclustered_perlayer_FH_zminus,
_energyclustered_perlayer_BH_zminus
]

lc_cellevel_zminus = [
# For each layer cluster:
# number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
# NB: not all combinations exist; e.g. no 120um Si in layers with scint.
Expand All @@ -2009,20 +2015,11 @@
_cellsnum_perthick_perlayer_scint_EE_zminus,
_cellsnum_perthick_perlayer_scint_FH_zminus,
_cellsnum_perthick_perlayer_scint_BH_zminus,
# Looking at the fraction of true energy that has been clustered; by layer and overall
_energyclustered_perlayer_EE_zminus,
_energyclustered_perlayer_FH_zminus,
_energyclustered_perlayer_BH_zminus,
# Score of CaloParticles wrt Layer Clusters
_score_caloparticle_to_layerclusters_zminus,
# Score of LayerClusters wrt CaloParticles
_score_layercluster_to_caloparticles_zminus,
# Shared Energy between CaloParticle and LayerClusters
_sharedEnergy_caloparticle_to_layercluster_zminus,
# Shared Energy between LayerClusters and CaloParticle
_sharedEnergy_layercluster_to_caloparticle_zminus,
# Cell Association per Layer
_cell_association_table_zminus,
_cell_association_table_zminus
]

lc_cp_association_zminus = [
# Efficiency Plots
_efficiencies_zminus,
_efficiencies_zminus_eta,
Expand All @@ -2039,11 +2036,20 @@
_merges_zminus,
_merges_zminus_eta,
_merges_zminus_phi,
# Score of CaloParticles wrt Layer Clusters
_score_caloparticle_to_layerclusters_zminus,
# Score of LayerClusters wrt CaloParticles
_score_layercluster_to_caloparticles_zminus,
# Shared Energy between CaloParticle and LayerClusters
_sharedEnergy_caloparticle_to_layercluster_zminus,
# Shared Energy between LayerClusters and CaloParticle
_sharedEnergy_layercluster_to_caloparticle_zminus,
# Energy vs Score 2D plots CP to LC
_energyscore_cp2lc_zminus,
# Energy vs Score 2D plots LC to CP
_energyscore_lc2cp_zminus
]

lc_zminus_extended = [
# For each layer cluster:
# distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
Expand Down Expand Up @@ -2121,13 +2127,21 @@
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zminus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zminus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zminus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zminus
]
lc_zplus = [

lc_clusterlevel_zplus = [
# number of layer clusters per layer (one entry per event in each histo)
_totclusternum_layer_EE_zplus,
_totclusternum_layer_FH_zplus,
_totclusternum_layer_BH_zplus,
# Looking at the fraction of true energy that has been clustered; by layer and overall
_energyclustered_perlayer_EE_zplus,
_energyclustered_perlayer_FH_zplus,
_energyclustered_perlayer_BH_zplus
]

lc_cellevel_zplus = [
# number of cells in layer cluster, by layer - separate histos in each layer for 120um Si, 200/300um Si, Scint
_cellsnum_perthick_perlayer_120_EE_zplus,
_cellsnum_perthick_perlayer_120_FH_zplus,
Expand All @@ -2141,20 +2155,11 @@
_cellsnum_perthick_perlayer_scint_EE_zplus,
_cellsnum_perthick_perlayer_scint_FH_zplus,
_cellsnum_perthick_perlayer_scint_BH_zplus,
# Looking at the fraction of true energy that has been clustered; by layer and overall
_energyclustered_perlayer_EE_zplus,
_energyclustered_perlayer_FH_zplus,
_energyclustered_perlayer_BH_zplus,
# Score of CaloParticles wrt Layer Clusters
_score_caloparticle_to_layerclusters_zplus,
# Score of LayerClusters wrt CaloParticles
_score_layercluster_to_caloparticles_zplus,
# Shared Energy between CaloParticle and LayerClusters
_sharedEnergy_caloparticle_to_layercluster_zplus,
# Shared Energy between LayerClusters and CaloParticle
_sharedEnergy_layercluster_to_caloparticle_zplus,
# Cell Association per Layer
_cell_association_table_zplus,
_cell_association_table_zplus
]

lc_cp_association_zplus = [
# Efficiency Plots
_efficiencies_zplus,
_efficiencies_zplus_eta,
Expand All @@ -2170,10 +2175,19 @@
# Merge Rate Plots
_merges_zplus,
_merges_zplus_eta,
_merges_zplus_phi,
_merges_zplus_phi,
# Score of CaloParticles wrt Layer Clusters
_score_caloparticle_to_layerclusters_zplus,
# Score of LayerClusters wrt CaloParticles
_score_layercluster_to_caloparticles_zplus,
# Shared Energy between CaloParticle and LayerClusters
_sharedEnergy_caloparticle_to_layercluster_zplus,
# Shared Energy between LayerClusters and CaloParticle
_sharedEnergy_layercluster_to_caloparticle_zplus,
_energyscore_cp2lc_zplus,
_energyscore_lc2cp_zplus
]

lc_zplus_extended = [
# distance of cells from a) seed cell, b) max cell; and c), d): same with entries weighted by cell energy
_distancetomaxcell_perthickperlayer_120_EE_zplus,
Expand Down Expand Up @@ -2247,22 +2261,51 @@
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_300_BH_zplus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_EE_zplus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_FH_zplus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus,
_distancebetseedandmaxcellvsclusterenergy_perthickperlayer_scint_BH_zplus
]

def append_hgcalLayerClustersPlots(collection = "hgcalLayerClusters", name_collection = layerClustersLabel, extended = False):
print('extended : ',extended)
regions = ["General", "zminus", "zplus"]
plots_lc_zminus = lc_zminus
plots_lc_zplus = lc_zplus
plots_lc_general = lc_general
regions_ClusterLevel = ["General: Cluster Level", "Z-minus: Cluster Level", "Z-plus: Cluster Level"]
regions_CellLevel = ["Z-minus: Cell Level", "Z-plus: Cell Level"]
regions_LCtoCP_association = ["Z-minus: LC_CP association", "Z-plus: LC_CP association"]

plots_lc_general_clusterlevel = lc_general_clusterlevel
plots_lc_clusterlevel_zminus = lc_clusterlevel_zminus
plots_lc_cellevel_zminus = lc_cellevel_zminus
plots_lc_clusterlevel_zplus = lc_clusterlevel_zplus
plots_lc_cellevel_zplus = lc_cellevel_zplus
plots_lc_cp_association_zminus = lc_cp_association_zminus
plots_lc_cp_association_zplus = lc_cp_association_zplus

if extended :
plots_lc_zminus = lc_zminus + lc_zminus_extended
plots_lc_zplus = lc_zplus + lc_zplus_extended
setPlots = [plots_lc_general, plots_lc_zminus, plots_lc_zplus]
for reg, setPlot in zip(regions, setPlots):
#plots_lc_clusterlevel_zminus = lc_clusterlevel_zminus
#plots_lc_clusterlevel_zplus = lc_clusterlevel_zplus
plots_lc_cellevel_zminus = lc_cellevel_zminus + lc_zminus_extended
plots_lc_cellevel_zplus = lc_cellevel_zplus + lc_zplus_extended
#plots_lc_cp_association_zminus = lc_cp_association_zminus
#plots_lc_cp_association_zplus = lc_cp_association_zplus

setPlots_ClusterLevel = [plots_lc_general_clusterlevel, plots_lc_clusterlevel_zminus, plots_lc_clusterlevel_zplus]
setPlots_CellLevel = [plots_lc_cellevel_zminus, plots_lc_cellevel_zplus]
setPlots_LCtoCP_association = [plots_lc_cp_association_zminus, plots_lc_cp_association_zplus]
for reg, setPlot in zip(regions_ClusterLevel, setPlots_ClusterLevel):
hgcalLayerClustersPlotter.append(collection+"_"+reg, [
_hgcalFolders(collection + "/ClusterLevel")
], PlotFolder(
*setPlot,
loopSubFolders=False,
purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
for reg, setPlot in zip(regions_CellLevel, setPlots_CellLevel):
hgcalLayerClustersPlotter.append(collection+"_"+reg, [
_hgcalFolders(collection + "/CellLevel")
], PlotFolder(
*setPlot,
loopSubFolders=False,
purpose=PlotPurpose.Timing, page=layerClustersLabel, section=reg))
for reg, setPlot in zip(regions_LCtoCP_association, setPlots_LCtoCP_association):
hgcalLayerClustersPlotter.append(collection+"_"+reg, [
_hgcalFolders(collection)
_hgcalFolders(collection + "/LCtoCP_association")
], PlotFolder(
*setPlot,
loopSubFolders=False,
Expand Down