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

Spike cleaner fix #17859

Merged
merged 7 commits into from
Aug 4, 2017
Merged

Spike cleaner fix #17859

merged 7 commits into from
Aug 4, 2017

Conversation

knash
Copy link
Contributor

@knash knash commented Mar 9, 2017

Comparing the current HF PF spike cleaning recipe to that seen in 1 (slide 17), there seems to be a bug in the code such that the cleaning never occurs (would require a ~10^10 GeV spike) due to the fact that the rechit energy is summed in the numerator and denominator (L123,L137 of the original).

This PR attempts to fix the issue by explicitly finding the corresponding 9 neighbors (<=5 from L120 to L164) and the other <=4 from the loop starting at 171.

The code also would affect ECAL spikes which use the same cleaner. There, the changes only take out the rechit energy from the numerator without any additional summing required. This can also be motivated 1 (slide 8)

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2017

A new Pull Request was created by @knash for master.

It involves the following packages:

RecoParticleFlow/PFClusterProducer

@perrotta, @cmsbuild, @slava77, @davidlange6 can you please review it and eventually sign? Thanks.
@mmarionncern, @lgray, @rafaellopesdesa, @bachtis, @cbernet this is something you requested to watch as well.
@Muzaffar, @davidlange6, @smuzaffar you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Mar 9, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/18296/console Started: 2017/03/09 17:32
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/18298/console Started: 2017/03/09 17:38

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2017

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2017

Comparison job queued.

@slava77
Copy link
Contributor

slava77 commented Mar 9, 2017

@bachtis @bendavid @argiro @emanueledimarco
please comment on the impact of this PR on ECAL cleaning

@slava77
Copy link
Contributor

slava77 commented Mar 9, 2017

@knash
was this PR already discussed in a POG/DPG meeting?
Please provide a link to slides, preferably with some plots showing expected changes

Is there a skim of events affected by changes in this PR?
Please point to it for a more explicit check of performance.

Thank you.

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2017

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-17859/18298/summary.html

There are some workflows for which there are errors in the baseline:
25.0 step 5
The results for the comparisons for these workflows could be incomplete
This means most likely that the IB is having errors in the relvals.The error does NOT come from this pull request

@knash
Copy link
Contributor Author

knash commented Mar 9, 2017

@slava77

Hello, this fix was discussed in a DPG-PH JetMET meeting (https://indico.cern.ch/event/611068/) but without further details. This has been tested on a skim that exhibits anomalously energetic jets, of which one (out of ~30) was triggered (but for an ECAL spike). We wanted to start this now, but can put together a higher statistics study as well.

This cleaning should be redundant to a similar spike cleaning cut that is already applied, so we do not expect much of a change.

@argiro
Copy link
Contributor

argiro commented Mar 10, 2017

Hi, I am not very familiar with this piece of code. Ecal has its own flagging of spikes that I thought was used by PF. Perhaps @lgray , @Sam-Harper could comment ?

@slava77
Copy link
Contributor

slava77 commented Mar 13, 2017

@knash
once you have the file with affected events, please post the location.
Based on your slides p10 it looks like there are many events affected, (not sure though if this fix is the one that matches the plot on p10)


int comp = std::abs(hitlayer-13);
const HcalDetId& detid = (HcalDetId)rechit.detId();
std::vector<uint32_t> RawDetIds;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use lower case initial for local variables

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, this will be included in the next version


//Fix needed for HF
float compsumE = 0.0;
if ((hitlayer==12 or hitlayer==11))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can these magic numbers be get from some configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This says to only apply the fix only to the HF layers. I think this should be hard coded, as any other values would be buggy

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

11 -> PFLayer::HF_EM
12 -> PFLayer::HF_HAD

int curphiL = hphi-predphi;
int curphiH = hphi+predphi;

if (predphi>abs(hphi) or predphi>abs(72-hphi))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this "72" magic number be get from some configuration?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a product of the HF valid phi numbering range (1-72). I think this needs to be hardcoded as well

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let it hardcoded. But please extract it from the "HF valid phi numbering range", whenever it is stored/defined. So that if it gets ever modified you don't have to modify several hidden lines of code here and there.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My frame of reference for this range (and most of these methods) is here

https://github.com/cms-sw/cmssw/blob/CMSSW_9_1_X/RecoLocalCalo/HcalRecAlgos/src/HcalHF_S9S1algorithm.cc

Here, the "magic" numbers 39,4,72 are not from an exterior definition. I will look further however

{
int predphi =2;

int comp = std::abs(hitlayer-13);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"13" here is quite likely "12+1", where "12" can be extracted from some enum or configured list

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, this is just selecting the Hcaldetid depth which is a statement that the HF_EM companion energy is from the HF_Had and vice versa.

I will change this to an if statement as there are only two possible comp values

@perrotta
Copy link
Contributor

ping : @bachtis @bendavid @argiro @emanueledimarco @lgray @Sam-Harper
Can someone please comment on the impact of this PR on ECAL cleaning?

float compsumE = 0.0;
if ((hitlayer==12 or hitlayer==11))
{
int predphi =2;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello, I would put the declaration below together with the condition under which predphi is set to 4.

All in all, I cannot understand what this code is doing, would be nice to add a few comments, in particular a general comment explaining the problem you want to solve and how you can solve it ("Fix needed for HF" is too generic). When I understand better, I'll be able to comment further.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, in the next version there will be more verbose comments.

This section checks if a rechit is from the HF region and if so it adds additional energy from the companion rechits (ie HF_Had <-> HF_EM) to the total surrounding energy

@cmsbuild
Copy link
Contributor

Comparison is ready
https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-17859/21500/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 23
  • DQMHistoTests: Total histograms compared: 2022761
  • DQMHistoTests: Total failures: 102
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2022493
  • DQMHistoTests: Total skipped: 166
  • DQMHistoTests: Total Missing objects: 0
  • Checked 93 log files, 14 edm output root files, 23 DQM output files

@perrotta
Copy link
Contributor

+1
reco is fine with the latest changes
The summary remains the same as in #17859 (comment)

@cmsbuild
Copy link
Contributor

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 requires discussion in the ORP meeting before it's merged. @davidlange6, @smuzaffar

@knash
Copy link
Contributor Author

knash commented Jul 17, 2017

@fwyzard: Hello, should I be attempting these HLT tests or is there an expert that should do this instead?

There should be exactly no change from this, so I think that the comparison should be pretty straight forward and also a good closure test.

@fwyzard
Copy link
Contributor

fwyzard commented Jul 18, 2017

As I've written earlier

The Jets/MET trigger conveners (@milosdjordjevic and Aruna) and HCAL trigger contact (@souravdey1986) should be able to help with the comparison.

.A

@Martin-Grunewald
Copy link
Contributor

Any progress on this matter?

@knash
Copy link
Contributor Author

knash commented Jul 26, 2017

Hello, I have been attempting to contact the experts. Perhaps there is an example config that compares an in-development HLT menu?

@perrotta
Copy link
Contributor

By the way, @Martin-Grunewald : after the latest updates in the HLT menu, does this PR still affects it? Isn't it already disabled ECAL/HF spyke cleaning in it?

If so (but please confirm) then we can probably just merge this PR and use the forthcoming results of the performance studies to decide whether to re-enable it in HLT.

@Martin-Grunewald
Copy link
Contributor

Martin-Grunewald commented Jul 27, 2017

All instances of PFClusterProducer have the recHitCleaners empty, so from this side all is done.
https://its.cern.ch/jira/browse/CMSHLT-1441

@perrotta
Copy link
Contributor

perrotta commented Jul 28, 2017 via email

@knash
Copy link
Contributor Author

knash commented Aug 1, 2017

Hello, quick question.
Looking at the following cms-tsg-storm@bc8ad99 (only way I know how to inspect the HLT changes) all I can see is the ecal spike cleaning changes in the HLT. Are there any HFHAD changes ? From what I could tell, hltParticleFlowClusterHF already did not call spike cleaning.

As a side note, this PR should not be merged unless the spike cleaner is taken out of the HLT at the same time, but from what I can see, the only changes were to the ECAL clusters. Since this has already been tested, is there any point in running the HLT test?

@perrotta
Copy link
Contributor

perrotta commented Aug 1, 2017

@knash : you can check the menu currently dumped in cmssw in
https://raw.githubusercontent.com/cms-sw/cmssw/master/HLTrigger/Configuration/python/HLT_FULL_cff.py

If you do so, you can realize that the ECAL cleaning is still included in the PFClusterProducer hltParticleFlowClusterECALUncorrectedForMuonsMFNoVtx, see recHitCleaners in that module instantiation. This was a bug, fixed in the HLT menu n ConfDB.

The HLT menu now in CMSSW is /dev/CMSSW_9_2_0/HLT/V347: the bug is correctly fixed in the latest version in the master, /dev/CMSSW_9_2_0/HLT/V365 (it was already fixed since V349, indeed)

@knash
Copy link
Contributor Author

knash commented Aug 1, 2017

@perrotta: Thanks, ok so then you mean https://its.cern.ch/jira/browse/CMSHLT-1242 did not remove all of the spike cleaning as it should have?

My issue was that there is no HF spike cleaning, only ECAL. The ECAL portion is tested in a separate in a separate PR (#18438). Shouldn't this HLT test be performed in that PR identical to the original tests?

@Martin-Grunewald
Copy link
Contributor

I state again: in the recent HLt menus, the recHitCleaners PSet is EMPTY for all instances of PFClusterProducer. Also, as far as I know, the question was never about ecal spike cleaning - that removal was uncontroversial. This issue is/was only about the HF.

@davidlange6
Copy link
Contributor

+1

@Martin-Grunewald
Copy link
Contributor

@knash
Would this need a backport to 92X?

@cmsbuild cmsbuild merged commit dd94c88 into cms-sw:master Aug 4, 2017
@knash
Copy link
Contributor Author

knash commented Aug 4, 2017

@Martin-Grunewald Hello, Could you elaborate a bit? I'm not sure exactly the logic that goes into this decision. If it helps, this PR itself should not affect data taking whatsoever. There is a small effect from the ECAL double spikes, but that is already implemented

@Martin-Grunewald
Copy link
Contributor

Yes, but MC production is done with 92X.

@knash
Copy link
Contributor Author

knash commented Aug 8, 2017

Hmm, well there was interest in testing this cleaning for the current iteration, so I suppose this should be backported.
@mariadalfonso: can you confirm?

@mariadalfonso
Copy link
Contributor

@knash

Generally would be good to have all the bug-fixes in this round of MC as well.

However:
The impact will be null due to the bug (for recHit energy < 10^10) as well
The HF noise is not simulated in the MC, so MC cannot be use to re-design this filter and we will use data directly (we will re-reco all with 93X)

Any "particle flow noise filter" re-design would be done for the 2018 so that we can better use this HF detector up to the 2025!
For the time being the S9/S1 discussed here at pf-level is already applied in 2017 data at HFrecHit cleaning thanks to this PR #19532 and was already in place in Run1 and 2015/2016.

Maria

@knash
Copy link
Contributor Author

knash commented Aug 15, 2017

@mariadalfonso
Thanks for clarifying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.