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] Run HGCalValidator only on the hard scatterer event and correcting the mess from merging #27478
[HGCal] Run HGCalValidator only on the hard scatterer event and correcting the mess from merging #27478
Changes from 4 commits
f3afa7f
058b709
61209fe
fbb4c3c
7e6ca2d
32bc595
f6755e4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,18 @@ void HGCalValidator::dqmAnalyze(const edm::Event& event, | |
histoProducerAlgo_->fill_info_histos(histograms.histoProducerAlgo, totallayers_to_monitor_); | ||
} | ||
|
||
//Consider CaloParticles coming from the hard scatterer, excluding the PU contribution. | ||
std::vector<CaloParticle> caloParticlesFromHardScat; | ||
for (auto& it_caloPart : caloParticles) { | ||
if (it_caloPart.g4Tracks()[0].eventId().event() != 0 or it_caloPart.g4Tracks()[0].eventId().bunchCrossing() != 0) { | ||
LogDebug("HGCalValidator") << "Excluding CaloParticles from event: " | ||
<< it_caloPart.g4Tracks()[0].eventId().event() | ||
<< " with BX: " << it_caloPart.g4Tracks()[0].eventId().bunchCrossing() << std::endl; | ||
continue; | ||
} | ||
caloParticlesFromHardScat.push_back(it_caloPart); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is making a copy of each hard-scatter caloparticle. Some alternatives:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hi @kpedro88 , Using pointers or the selected indices has far reaching consequences to the whole package since the input to the vast There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's fine for now, but if the memory usage becomes concerning, these alternatives should be revisited. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @apsallid move the filter on the CaloParticles where you actually use them, i.e. one level down the stack. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rovere i tested that but for some reason it is really slow. Maybe because we need that check in 5 different places while the code in these places will loop in any case through all CaloParticles which is of the order of 10000. By reducing the collection to ~200 CaloParticles once in the beginning we gain speed. I do not know what else to think. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @apsallid doesn't sound like a good explanation. Are you sure, by any chance, you left some part of the code w/o the selection? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @apsallid otherwise use the vector of indices down the stack, so that you don't need to loop over and over and make the very same selection. |
||
} | ||
|
||
// ############################################## | ||
// fill caloparticles histograms | ||
// ############################################## | ||
|
@@ -224,7 +236,8 @@ void HGCalValidator::dqmAnalyze(const edm::Event& event, | |
w, | ||
clusters, | ||
densities, | ||
caloParticles, | ||
// caloParticles, | ||
caloParticlesFromHardScat, | ||
hitMap, | ||
cummatbudg, | ||
totallayers_to_monitor_, | ||
|
@@ -237,8 +250,13 @@ void HGCalValidator::dqmAnalyze(const edm::Event& event, | |
|
||
if (domulticlustersPlots_) { | ||
w++; | ||
histoProducerAlgo_->fill_multi_cluster_histos( | ||
histograms.histoProducerAlgo, w, multiClusters, caloParticles, hitMap, totallayers_to_monitor_); | ||
histoProducerAlgo_->fill_multi_cluster_histos(histograms.histoProducerAlgo, | ||
w, | ||
multiClusters, | ||
// caloParticles, | ||
caloParticlesFromHardScat, | ||
hitMap, | ||
totallayers_to_monitor_); | ||
} | ||
|
||
//General Info | ||
|
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.
could be const auto?