From 9e1bfd7558184c1198ac392ce907eb09e980bafd Mon Sep 17 00:00:00 2001 From: Oleksandr Zenaiev Date: Thu, 28 May 2020 12:16:28 +0200 Subject: [PATCH 1/2] switched to new clusters in resolution tests --- Hlt/RecoConf/python/RecoConf/standalone.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Hlt/RecoConf/python/RecoConf/standalone.py b/Hlt/RecoConf/python/RecoConf/standalone.py index 14be61152ea..15d6cd36342 100644 --- a/Hlt/RecoConf/python/RecoConf/standalone.py +++ b/Hlt/RecoConf/python/RecoConf/standalone.py @@ -200,17 +200,17 @@ def standalone_hlt2_calo_resolution_gamma(): data = [] # clusters resolution - data += monitor_calo_cluster_resolution( + data += monitor_calo_future_cluster_resolution( 'OverlapDef', calo["clusters"]["ecalClustersOverlap"], tableMCCaloClusters) - data += monitor_calo_cluster_resolution( + data += monitor_calo_future_cluster_resolution( 'OverlapNoCor', calo["clusters"]["ecalClustersOverlapNoCor"], tableMCCaloClusters) # NB notice _future_ in the next line, eventually should switch to _new_ everywhere data += monitor_calo_future_cluster_resolution( 'NoOverlap', calo["clusters"]["ecalClustersNoOverlap"], tableMCCaloClusters) - data += monitor_calo_cluster_resolution( + data += monitor_calo_future_cluster_resolution( 'OverlapFast', calo["clusters"]["ecalClustersOverlapFast"], tableMCCaloClusters) # photons resolution -- GitLab From 4c6b37d436e8f98d0a8ae328b4769e70418e2ebc Mon Sep 17 00:00:00 2001 From: Oleksandr Zenaiev Date: Thu, 28 May 2020 14:17:35 +0200 Subject: [PATCH 2/2] hlt2_reco_calo_resolution_gamma and hlt2_reco_calo_resolution_gammahlt2_reco_calo_resolution_pi0 fully adapted to new clusters and hypos, but crashing --- .../RecoConf/calorimeter_mc_checking.py | 44 +++++++++++++++---- Hlt/RecoConf/python/RecoConf/standalone.py | 29 ++++++------ 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/Hlt/RecoConf/python/RecoConf/calorimeter_mc_checking.py b/Hlt/RecoConf/python/RecoConf/calorimeter_mc_checking.py index 237fd21dc9d..84f6afcc32c 100644 --- a/Hlt/RecoConf/python/RecoConf/calorimeter_mc_checking.py +++ b/Hlt/RecoConf/python/RecoConf/calorimeter_mc_checking.py @@ -8,15 +8,12 @@ # granted to it by virtue of its status as an Intergovernmental Organization # # or submit itself to any jurisdiction. # ############################################################################### -from PyConf.Algorithms import CaloClusterResolution, CaloFutureClusterResolution, CaloHypoResolution +from PyConf.Algorithms import CaloClusterResolution, CaloFutureClusterResolution, CaloHypoResolution, CaloFutureHypoResolution def monitor_calo_future_cluster_resolution(tuplePrefix, clusters, tableMCCaloClusters): # look only at photons from Bd->K*gamma - # NB it works for "future" clusters - # (currently clusters before shower overlap, - # eventually all clusters will be "future") return [ CaloFutureClusterResolution( input=clusters, @@ -30,12 +27,10 @@ def monitor_calo_future_cluster_resolution(tuplePrefix, clusters, ] +# NB it works with legacy clusters, not in use anymore and eventually should be removed def monitor_calo_cluster_resolution(tuplePrefix, clusters, tableMCCaloClusters): # look only at photons from Bd->K*gamma - # NB it works for legacy clusters - # (currently clusters after shower overlap, - # eventually it should be out of use and removed) return [ CaloClusterResolution( input=clusters, @@ -49,9 +44,24 @@ def monitor_calo_cluster_resolution(tuplePrefix, clusters, ] +def monitor_calo_future_photon_resolution(tuplePrefix, photons, tableMCCaloClusters): + # look only at photons from Bd->K*gamma + return [ + CaloFutureHypoResolution( + input=photons, + inputRelations=tableMCCaloClusters, + tuplePrefix='photons' + tuplePrefix, + PDGID=[22], + PDGIDMother=[511, -511], + minMatchFraction=0.0, + minEnergy=0.0, + name="CaloHypoResolution" + tuplePrefix) + ] + + +# NB it works with legacy hypos, not in use anymore and eventually should be removed def monitor_calo_photon_resolution(tuplePrefix, photons, tableMCCaloClusters): # look only at photons from Bd->K*gamma - # NB photons are CaloHypos return [ CaloHypoResolution( input=photons, @@ -65,9 +75,25 @@ def monitor_calo_photon_resolution(tuplePrefix, photons, tableMCCaloClusters): ] +def monitor_calo_future_pi0_resolution(tuplePrefix, pi0, tableMCCaloClusters): + # look only at pi0 from Bd->pi+pi-pi0 + return [ + #CaloHypoResolution( + CaloFutureHypoResolution( + input=pi0, + inputRelations=tableMCCaloClusters, + tuplePrefix='pi0' + tuplePrefix, + PDGID=[111], # brother 211 & -211 + PDGIDMother=[511, -511], + minMatchFraction=0.0, + minEnergy=0.0, + name="CaloHypoResolution" + tuplePrefix) + ] + + +# NB it works with legacy hypos, not in use anymore and eventually should be removed def monitor_calo_pi0_resolution(tuplePrefix, pi0, tableMCCaloClusters): # look only at pi0 from Bd->pi+pi-pi0 - # NB pi0 are CaloHypos return [ CaloHypoResolution( input=pi0, diff --git a/Hlt/RecoConf/python/RecoConf/standalone.py b/Hlt/RecoConf/python/RecoConf/standalone.py index 15d6cd36342..dfda96ae57a 100644 --- a/Hlt/RecoConf/python/RecoConf/standalone.py +++ b/Hlt/RecoConf/python/RecoConf/standalone.py @@ -22,7 +22,8 @@ from .calorimeter_reconstruction import (make_calo, make_calo_resolution_gamma, make_calo_resolution_pi0) from .calorimeter_mc_checking import ( monitor_calo_cluster_resolution, monitor_calo_future_cluster_resolution, - monitor_calo_photon_resolution, monitor_calo_pi0_resolution) + monitor_calo_photon_resolution, monitor_calo_future_photon_resolution, + monitor_calo_pi0_resolution, monitor_calo_future_pi0_resolution) from PyConf.Algorithms import CaloFutureDigit2MCLinks2Table from PyConf.Algorithms import CaloClusterMCTruth from .mc_checking import get_track_checkers, get_best_tracks_checkers @@ -214,13 +215,13 @@ def standalone_hlt2_calo_resolution_gamma(): 'OverlapFast', calo["clusters"]["ecalClustersOverlapFast"], tableMCCaloClusters) # photons resolution - data += monitor_calo_photon_resolution('OverlapDef', calo["photons"], + data += monitor_calo_future_photon_resolution('OverlapDef', calo["photons"], tableMCCaloClusters) - data += monitor_calo_photon_resolution( + data += monitor_calo_future_photon_resolution( 'OverlapNoCor', calo["photonsOverlapNoCor"], tableMCCaloClusters) - data += monitor_calo_photon_resolution( + data += monitor_calo_future_photon_resolution( 'NoOverlap', calo["photonsNoOverlap"], tableMCCaloClusters) - data += monitor_calo_photon_resolution( + data += monitor_calo_future_photon_resolution( 'OverlapFast', calo["photonsOverlapFast"], tableMCCaloClusters) # print MC tree for B0 decays #data += [PrintMCTree(ParticleNames=['B0', 'B~0'])] @@ -244,26 +245,26 @@ def standalone_hlt2_calo_resolution_pi0(): Clusters=calo["clusters"]["ecalClustersNoOverlap"]).Output data = [] - data += monitor_calo_pi0_resolution( + data += monitor_calo_future_pi0_resolution( '-clusDef-pi0Def', calo["clusDef-pi0Def"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution( + data += monitor_calo_future_pi0_resolution( '-clusSOFast-pi0Def', calo["clusSOFast-pi0Def"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution( + data += monitor_calo_future_pi0_resolution( '-clusSONoCor-pi0Def', calo["clusSONoCor-pi0Def"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution('-clusSONoCor-pi0NoSO', + data += monitor_calo_future_pi0_resolution('-clusSONoCor-pi0NoSO', calo["clusSONoCor-pi0NoSO"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution('-clusSONoCor-pi0SOFast', + data += monitor_calo_future_pi0_resolution('-clusSONoCor-pi0SOFast', calo["clusSONoCor-pi0SOFast"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution('-clusSONoCor-pi0SONoCor', + data += monitor_calo_future_pi0_resolution('-clusSONoCor-pi0SONoCor', calo["clusSONoCor-pi0SONoCor"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution( + data += monitor_calo_future_pi0_resolution( '-clusNoSO-pi0Def', calo["clusNoSO-pi0Def"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution( + data += monitor_calo_future_pi0_resolution( '-clusNoSO-pi0NoSO', calo["clusNoSO-pi0NoSO"], tableMCCaloClusters) - data += monitor_calo_pi0_resolution( + data += monitor_calo_future_pi0_resolution( '-clusDef-pi0NoCor', calo["clusDef-pi0NoCor"], tableMCCaloClusters) # print MC tree for B0 decays #data += [PrintMCTree(ParticleNames=['B0', 'B~0'])] -- GitLab