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

Cross-correlation algorithm for the ECAL timing reconstruction #33119

Merged
merged 47 commits into from Mar 17, 2021

Conversation

nminafra
Copy link
Contributor

@nminafra nminafra commented Mar 9, 2021

This PR introduces a new algorithm for the timing reconstruction of ECAL. It looks for the maximum cross-correlation between the acquired pulse and a template with different time shifts.
This method uses the same pulse template ad the energy reconstruction, hence it doesn't need any parameter.
Also, Out-Of-Time (OOT) Pileup is mitigated by removing the OOT amplitudes using the result of the multi-fit algorithm.

The performance was discussed in various DPG meetings.
Some references with more details are available:
ECAL general meeting:
https://indico.cern.ch/event/1002949/contributions/4211423/attachments/2182555/3687212/ECALtiming_2021_2_2.pdf

Performance on Monte Carlo:
https://indico.cern.ch/event/966023/contributions/4135611/attachments/2163562/3652215/ecaldpg_121620.pdf

Description of the algorithm (called KUCC here) and performance on data:
https://indico.cern.ch/event/953451/contributions/4026342/attachments/2108199/3545710/ecaldpg_gentime.pdf

Notes for this PR:
this PR is including the code into the main repository, but the default Timing reco method will remain unchanged. It is, of course, possible to enable this method changing the "timingMethod" variable.

Example of test file:
RecoLocalCalo/EcalRecProducers/test/testEcalUncalibRechitProducerWithCC_cfg.py

@thomreis @jking79 @crogan

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2021

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33119/21462

  • This PR adds an extra 88KB to repository

@cmsbuild
Copy link
Contributor

cmsbuild commented Mar 9, 2021

A new Pull Request was created by @nminafra (Nicola Minafra) for master.

It involves the following packages:

RecoLocalCalo/EcalRecAlgos
RecoLocalCalo/EcalRecProducers

@perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@rchatter, @apsallid, @argiro, @thomreis, @simonepigazzini this is something you requested to watch as well.
@silviodonato, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@slava77
Copy link
Contributor

slava77 commented Mar 10, 2021

@cmsbuild please test

double computeTimeCC(const EcalDataFrame& dataFrame,
const std::vector<double>& amplitudes,
const EcalPedestals::Item* aped,
const EcalMGPAGainRatio* aGain,
const FullSampleVector& fullpulse,
EcalUncalibratedRecHit& uncalibRecHit,
float& errOnTime);
float errOnTime) const;
Copy link
Contributor

@slava77 slava77 Mar 16, 2021

Choose a reason for hiding this comment

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

Suggested change
float errOnTime) const;
float& errOnTime) const;

I noticed only now thanks to the static analyzer https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-74f75c/13543/llvm-analysis/report-9ba007.html#EndPath.

if (counter < MIN_NUM_OF_ITERATIONS || counter > MAX_NUM_OF_ITERATIONS - 1) {
tM = TIME_WHEN_NOT_CONVERGING * ecalPh1::Samp_Period;
//Negative error means that there was a problem with the CC
errOnTime = -targetTimePrecision_ / ecalPh1::Samp_Period;
Copy link
Contributor

Choose a reason for hiding this comment

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

BTW, I do not see a value assigned to errOnTime for normal conditions.
Is it intentional?

@nminafra
Copy link
Contributor Author

Thanks @slava77 for catching the reference pass. I rushed the correction too much!
errOnTime was not set, but indeed it would be more correct to set it to the minimization target if the minimization is successful.
I've also removed uncalibRecHit.setJitterError(0.); that is not needed here.

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-33119/21609

  • This PR adds an extra 28KB to repository

@cmsbuild
Copy link
Contributor

Pull request #33119 was updated. @perrotta, @jpata, @cmsbuild, @slava77 can you please check and sign again.

@slava77
Copy link
Contributor

slava77 commented Mar 16, 2021

@cmsbuild please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-74f75c/13556/summary.html
COMMIT: e10760c
CMSSW: CMSSW_11_3_X_2021-03-16-1100/slc7_amd64_gcc900
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week0/cms-sw/cmssw/33119/13556/install.sh to create a dev area with all the needed externals and cmssw changes.

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 0 differences found in the comparisons
  • DQMHistoTests: Total files compared: 37
  • DQMHistoTests: Total histograms compared: 2639881
  • DQMHistoTests: Total failures: 1
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2639858
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 36 files compared)
  • Checked 155 log files, 37 edm output root files, 37 DQM output files
  • TriggerResults: no differences found

@slava77
Copy link
Contributor

slava77 commented Mar 16, 2021

+1

for #33119 e10760c

  • code changes are in line with the PR description and the follow up review; the new feature (crossCorrelationMethod) is not enabled by default
  • jenkins tests pass and comparisons with the baseline show no differences
  • signoff is based on visual code review and the profiler reports provided in Cross-correlation algorithm for the ECAL timing reconstruction #33119 (comment) (the new way of computing the rechit time takes slightly smaller CPU time than the old/current default ratio method)

@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 will now be reviewed by the release team before it's merged. @silviodonato, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@qliphy
Copy link
Contributor

qliphy commented Mar 17, 2021

+1

@cmsbuild cmsbuild merged commit 4bcdf96 into cms-sw:master Mar 17, 2021
@nminafra
Copy link
Contributor Author

Thanks everyone and thanks @slava77 for all the improvements to the code.

Best regards,
Nicola

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.

None yet

7 participants