-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Adapt Alpaka-based PF Clustering to read Hcal thresholds from GT #43574
Conversation
cms-bot internal usage |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43574/38207
|
A new Pull Request was created by @jsamudio for master. It involves the following packages:
@cmsbuild, @jfernan2, @mandrenguyen can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
type pf |
assign heterogeneous |
@@ -14,6 +14,7 @@ namespace reco { | |||
using PFRecHitsNeighbours = Eigen::Matrix<int32_t, 8, 1>; | |||
GENERATE_SOA_LAYOUT(PFRecHitSoALayout, | |||
SOA_COLUMN(uint32_t, detId), | |||
SOA_COLUMN(uint32_t, denseId), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see where this is stored (PFRecHitProducerKernel.dev.cc
lines 100 and 118), but where is it used ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used to set the threshold for the PFRecHit later in PFClusterSoAProducerKernel.dev.cc
.
SOA_SCALAR(float, seedPt2ThresholdEB), | ||
SOA_SCALAR(float, seedPt2ThresholdEE), | ||
SOA_COLUMN(float, seedEThresholdEB_vec), | ||
SOA_COLUMN(float, seedEThresholdEE_vec), | ||
SOA_COLUMN(float, topoEThresholdEB_vec), | ||
SOA_COLUMN(float, topoEThresholdEE_vec), | ||
SOA_SCALAR(float, seedPt2ThresholdHB), | ||
SOA_SCALAR(float, seedPt2ThresholdHE), | ||
SOA_COLUMN(float, seedEThresholdHB_vec), | ||
SOA_COLUMN(float, seedEThresholdHE_vec), | ||
SOA_COLUMN(float, topoEThresholdHB_vec), | ||
SOA_COLUMN(float, topoEThresholdHE_vec), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
are these variable specific to HCAL ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
@@ -65,6 +70,7 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { | |||
desc.add<edm::InputTag>("PFRecHitsLabelIn"); | |||
desc.add<edm::ESInputTag>("pfClusterParams"); | |||
desc.add<edm::InputTag>("recHitsSource"); | |||
desc.add<bool>("usePFThresholdsFromDB", "True"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't this be
desc.add<bool>("usePFThresholdsFromDB", "True"); | |
desc.add<bool>("usePFThresholdsFromDB", true); |
?
@@ -180,12 +186,18 @@ class LegacyPFClusterProducer : public edm::stream::EDProducer<> { | |||
const edm::ESGetToken<reco::PFClusterParamsHostCollection, JobConfigurationGPURecord> pfClusParamsToken_; | |||
const edm::EDPutTokenT<reco::PFClusterCollection> legacyPfClustersToken_; | |||
const edm::EDGetTokenT<reco::PFRecHitCollection> recHitsLabel_; | |||
const edm::ESGetToken<HcalPFCuts, HcalPFCutsRcd> hcalCutsToken_; | |||
bool cutsFromDB; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool cutsFromDB; | |
const bool cutsFromDB_; |
hcalCutsToken_(esConsumes<HcalPFCuts, HcalPFCutsRcd>(edm::ESInputTag("", "withTopo"))) { | ||
cutsFromDB = config.getParameter<bool>("usePFThresholdsFromDB"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hcalCutsToken_(esConsumes<HcalPFCuts, HcalPFCutsRcd>(edm::ESInputTag("", "withTopo"))) { | |
cutsFromDB = config.getParameter<bool>("usePFThresholdsFromDB"); | |
hcalCutsToken_(esConsumes<HcalPFCuts, HcalPFCutsRcd>(edm::ESInputTag("", "withTopo"))), | |
cutsFromDB_(config.getParameter<bool>("usePFThresholdsFromDB")) { |
if (cutsFromDB) { | ||
paramPF = &setup.getData(hcalCutsToken_); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a local variable, it doesn't need to be a member variable:
if (cutsFromDB) { | |
paramPF = &setup.getData(hcalCutsToken_); | |
} | |
HcalPFCuts const* paramPF = cutsFromDB_ ? &setup.getData(hcalCutsToken_) : nullptr; |
if constexpr (std::is_same_v<CAL, HCAL>) | ||
desc.add<bool>("usePFThresholdsFromDB", "True"); | ||
else // only needs to be true for HBHE | ||
desc.add<bool>("usePFThresholdsFromDB", "False"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if constexpr (std::is_same_v<CAL, HCAL>) | |
desc.add<bool>("usePFThresholdsFromDB", "True"); | |
else // only needs to be true for HBHE | |
desc.add<bool>("usePFThresholdsFromDB", "False"); | |
if constexpr (std::is_same_v<CAL, HCAL>) | |
desc.add<bool>("usePFThresholdsFromDB", true); | |
else // only needs to be true for HBHE | |
desc.add<bool>("usePFThresholdsFromDB", false); |
rhENormInv = 0.; | ||
printf("Rechit %d has invalid layer %d!\n", i, pfRecHits[i].layer()); | ||
if (topology.cutsFromDB()) { | ||
rhENormInv = (1. / topology[pfRecHits[i].denseId()].noiseThreshold()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rhENormInv = (1. / topology[pfRecHits[i].denseId()].noiseThreshold()); | |
rhENormInv = (1.f / topology[pfRecHits[i].denseId()].noiseThreshold()); |
should avoid to do the division in double precision.
Can you check if the results are OK ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation looks okay when I make this change.
printf("Rechit %d has invalid layer %d!\n", i, pfRecHits[i].layer()); | ||
|
||
if (topology.cutsFromDB()) { | ||
rhENormInv = (1. / topology[pfRecHits[i].denseId()].noiseThreshold()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rhENormInv = (1. / topology[pfRecHits[i].denseId()].noiseThreshold()); | |
rhENormInv = (1.f / topology[pfRecHits[i].denseId()].noiseThreshold()); |
From the @cms-sw/heterogeneous-l2 point of view, the only comment I have is about using The others are general C++ and CMSSW comments. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-43574/38226
|
+heterogeneous |
please test |
+1 Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-f64c79/36530/summary.html Comparison SummarySummary:
|
+1 |
This pull request is fully signed and it will be integrated in one of the next master IBs (tests are also fine). This pull request will now be reviewed by the release team before it's merged. @antoniovilela, @sextonkennedy, @rappoccio (and backports should be raised in the release meeting by the corresponding L2) |
+1 |
PR description:
This is a follow up to #43130. It is the adaptation of the Alpaka-based
PFRecHitSoAProducer
andPFClusterSoAProducer
to read Hcal thresholds from GT similar to #43025. Included are some fixes to naming conventions that were missed in the initial implementation of #43130.PR validation:
PR was validated using local testing of cluster-level comparison and PF Jet Response comparison as in #43130. The results are consistent between Alpaka and Legacy for the entire variety of configurations: Alpaka CPU and GPU backends with
usePFThresholdsFromDB
set totrue
orfalse
.The basic suite of tests,
runTheMatrix.py -l limited -i all --ibeos
, has also been passed.If this PR is a backport please specify the original PR and why you need to backport that PR. If this PR will be backported please specify to which release cycle the backport is meant for:
PR is not a backport.
@hatakeyamak @swagata87