From 0aefba1ef0605883d06a8332d2849d5840d29942 Mon Sep 17 00:00:00 2001 From: Wahid Redjeb Date: Tue, 23 Sep 2025 11:38:19 +0200 Subject: [PATCH 1/2] add GPU-CPU difference plots --- .../plugins/PFHcalGPUComparisonTask.cc | 33 ++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc b/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc index cf53e07b2cbff..75b1afa2c6d9b 100644 --- a/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc +++ b/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc @@ -80,6 +80,14 @@ class PFHcalGPUComparisonTask : public hcaldqm::DQTask { MonitorElement* pfCluster_Phi_HostvsDevice_; MonitorElement* pfCluster_DuplicateMatches_HostvsDevice_; + MonitorElement* pfCluster_Multiplicity_Diff_HostvsDevice_; + MonitorElement* pfCluster_Energy_Diff_HostvsDevice_; + MonitorElement* pfCluster_RecHitMultiplicity_Diff_HostvsDevice_; + MonitorElement* pfCluster_Layer_Diff_HostvsDevice_; + MonitorElement* pfCluster_Depth_Diff_HostvsDevice_; + MonitorElement* pfCluster_Eta_Diff_HostvsDevice_; + MonitorElement* pfCluster_Phi_Diff_HostvsDevice_; + std::string pfCaloGPUCompDir_; }; @@ -129,6 +137,21 @@ void PFHcalGPUComparisonTask::bookHistograms(DQMStore::IBooker& ibooker, edm::Ru histo = "pfCluster_DuplicateMatches_HostvsDevice"; histoAxis = "pfCluster_Duplicates_HostvsDevice;Cluster Duplicates Host;Cluster Duplicates Device"; pfCluster_DuplicateMatches_HostvsDevice_ = ibooker.book1I(histo, histoAxis, 100, 0., 1000); + + pfCluster_Multiplicity_Diff_HostvsDevice_ = ibooker.book1D( + "MultiplicityDiff", "PFCluster Multiplicity Difference; (Reference - Target);#entries", 100, -2, 2); + pfCluster_Energy_Diff_HostvsDevice_ = + ibooker.book1D("EnergyDiff", "PFCluster Energy Difference; (Reference - Target);#entries", 100, -2, 2); + pfCluster_RecHitMultiplicity_Diff_HostvsDevice_ = ibooker.book1D( + "RHMultiplicityDiff", "PFCluster RecHit Multiplicity Difference; (Reference - Target);#entries", 100, -2, 2); + pfCluster_Layer_Diff_HostvsDevice_ = + ibooker.book1D("LayerDiff", "PFCluster Layer Difference; (Reference - Target);#entries", 100, -2, 2); + pfCluster_Depth_Diff_HostvsDevice_ = + ibooker.book1D("DepthDiff", "PFCluster Depth Difference; (Reference - Target);#entries", 100, -2, 2); + pfCluster_Eta_Diff_HostvsDevice_ = + ibooker.book1D("EtaDiff", "PFCluster #eta Difference; (Reference - Target);#entries", 100, -0.5, 0.5); + pfCluster_Phi_Diff_HostvsDevice_ = + ibooker.book1D("PhiDiff", "PFCluster #phi Difference; (Reference - Target);#entries", 100, -0.5, 0.5); } void PFHcalGPUComparisonTask::_resetMonitors(hcaldqm::UpdateFreq uf) { DQTask::_resetMonitors(uf); } @@ -148,7 +171,7 @@ void PFHcalGPUComparisonTask::_process(edm::Event const& event, edm::EventSetup LOGVERB("PFCaloGPUComparisonTask") << " PFCluster multiplicity " << pfClusters_ref->size() << " " << pfClusters_target->size(); pfCluster_Multiplicity_HostvsDevice_->Fill((float)pfClusters_ref->size(), (float)pfClusters_target->size()); - + pfCluster_Multiplicity_Diff_HostvsDevice_->Fill((float)pfClusters_ref->size() - (float)pfClusters_target->size()); // // Find matching PF cluster pairs std::vector matched_idx; @@ -192,6 +215,14 @@ void PFHcalGPUComparisonTask::_process(edm::Event const& event, edm::EventSetup pfCluster_Depth_HostvsDevice_->Fill(pfClusters_ref->at(i).depth(), pfClusters_target->at(j).depth()); pfCluster_RecHitMultiplicity_HostvsDevice_->Fill((float)pfClusters_ref->at(i).recHitFractions().size(), (float)pfClusters_target->at(j).recHitFractions().size()); + pfCluster_Energy_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).energy() - pfClusters_target->at(j).energy()); + pfCluster_RecHitMultiplicity_Diff_HostvsDevice_->Fill((float)pfClusters_ref->at(i).recHitFractions().size() - + (float)pfClusters_target->at(j).recHitFractions().size()); + pfCluster_Layer_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).layer() - pfClusters_target->at(j).layer()); + pfCluster_Depth_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).depth() - pfClusters_target->at(j).depth()); + ; + pfCluster_Eta_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).eta() - pfClusters_target->at(j).eta()); + pfCluster_Phi_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).phi() - pfClusters_target->at(j).phi()); } } } From e27001935ebf40028d7fbaf30a0dd06e916e72a5 Mon Sep 17 00:00:00 2001 From: Wahid Redjeb Date: Wed, 24 Sep 2025 10:25:57 +0200 Subject: [PATCH 2/2] use deltaPhi --- DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc b/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc index 75b1afa2c6d9b..1b3e17343422b 100644 --- a/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc +++ b/DQM/PFTasks/plugins/PFHcalGPUComparisonTask.cc @@ -25,6 +25,7 @@ #include "DataFormats/HcalDetId/interface/HcalSubdetector.h" #include "DataFormats/Math/interface/Vector3D.h" #include "DataFormats/Math/interface/deltaR.h" +#include "DataFormats/Math/interface/deltaPhi.h" #include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" #include "DataFormats/ParticleFlowReco/interface/PFBlock.h" #include "DataFormats/ParticleFlowReco/interface/PFBlockElementCluster.h" @@ -222,7 +223,8 @@ void PFHcalGPUComparisonTask::_process(edm::Event const& event, edm::EventSetup pfCluster_Depth_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).depth() - pfClusters_target->at(j).depth()); ; pfCluster_Eta_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).eta() - pfClusters_target->at(j).eta()); - pfCluster_Phi_Diff_HostvsDevice_->Fill(pfClusters_ref->at(i).phi() - pfClusters_target->at(j).phi()); + pfCluster_Phi_Diff_HostvsDevice_->Fill( + reco::deltaPhi(pfClusters_ref->at(i).phi(), pfClusters_target->at(j).phi())); } } }