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

HGCalWaferValidation: refinements and D86 geometry validation fix #36502

Merged
merged 3 commits into from
Dec 17, 2021

Conversation

imranyusuff
Copy link
Contributor

@imranyusuff imranyusuff commented Dec 15, 2021

PR description:

Changelog Tue, 14 Dmr 2021 by Imran Yusuff:

  • Further tidying the code
  • Now uses the first line of the flat file to determine flat file type (single number means new format)
  • Separate out shape and rotation matching operation into functions
  • Fixed validation for D86 geometry (especially in rotation for type-3 layers)

PR validation:

Now correctly validates wafer with layerType = 3:

... snip ...
ROTATION ERROR: (33,12,3)  ( 0 != 5 (0) )  name=hgcalwafer:HGCalHEWafer0Coarse2
ROTATION ERROR: (33,12,9)  ( 0 != 5 (0) )  name=hgcalwafer:HGCalHEWafer0Coarse2
ROTATION ERROR: (33,-3,9)  ( 0 != 5 (0) )  name=hgcalwafer:HGCalHEWafer0Coarse2
ROTATION ERROR: (33,-9,3)  ( 0 != 5 (0) )  name=hgcalwafer:HGCalHEWafer0Coarse2
ROTATION ERROR: (33,-9,-12)  ( 0 != 5 (0) )  name=hgcalwafer:HGCalHEWafer0Coarse2
ROTATION ERROR: (33,-3,-12)  ( 0 != 5 (0) )  name=hgcalwafer:HGCalHEWafer0Coarse2

*** ERROR COUNTS ***
Missing         :  0
Thickness error :  0
Pos-x error     :  0
Pos-y error     :  0
Shape error     :  0
Rotation error  :  6
Unaccounted     :  0

Total wafers processed from geotxtfile = 13545

There are at least one wafer error.
%MSG-i DDCompactViewImpl:  AfterModEndJob 15-Dec-2021 04:28:58 CET EndJob
DDD transient representation has been destructed.
%MSG

However, there still remain 6 rotation errors, all on layer number 33.

Testing with D77 and D83 geometries produced unchanged results.

No other bugs found during testing.

(- Imran -)

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36502/27377

  • This PR adds an extra 20KB to repository

Code check has found code style and quality issues which could be resolved by applying following patch(s)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36502/27378

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

  • Validation/HGCalValidation (dqm)

@emanueleusai, @ahmad3213, @cmsbuild, @jfernan2, @pmandrik, @pbo0, @rvenditti can you please review it and eventually sign? Thanks.
@vandreev11, @sethzenz, @bsunanda, @rovere, @lgray, @cseez, @apsallid, @pfs, @lecriste, @hatakeyamak, @ebrondol this is something you requested to watch as well.
@perrotta, @dpiparo, @qliphy you are the release manager for this.

cms-bot commands are listed here

@jfernan2
Copy link
Contributor

@imranyusuff can you please add yourself along with your github username in the comments filed to the HGCAL Validation developers e-group to keep track of the people working on it?
https://twiki.cern.ch/twiki/bin/viewauth/CMS/DQMContacts#HGCAL
Thanks

@imranyusuff
Copy link
Contributor Author

@imranyusuff can you please add yourself along with your github username in the comments filed to the HGCAL Validation developers e-group to keep track of the people working on it?
https://twiki.cern.ch/twiki/bin/viewauth/CMS/DQMContacts#HGCAL
Thanks

Hi, I have just done that and is now waiting approval.

if (geoThickClass == 0 && fileThickness == 120)
return true;
if (geoThickClass == 1 && fileThickness == 200)
return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

aren't these ifs else if ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Given the return statements, else if would act exactly the same

: waferShapeStr == "2" ? HGCalTypes::WaferPartialType::WaferChopTwoM
: waferShapeStr == "3" ? HGCalTypes::WaferPartialType::WaferSemi2
: waferShapeStr == "4" ? HGCalTypes::WaferPartialType::WaferSemi2
: waferShapeStr == "5" ? HGCalTypes::WaferPartialType::WaferFive2
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this kind of structures are oreferred over else ifs, I let experts to comment
@perrotta @qliphy

Copy link
Contributor

Choose a reason for hiding this comment

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

Same comment applies here, both for the if and for the map.
Also, labelling evolution as new and old will tell us nothing the moment we have more than 2 versions. It would be better to either express is clearly with version numbers or use other labels.

: shapeStr == "am" ? HGCalTypes::WaferPartialType::WaferHalf2
: shapeStr == "b" ? HGCalTypes::WaferPartialType::WaferFive
: shapeStr == "bm" ? HGCalTypes::WaferPartialType::WaferFive2
: shapeStr == "c" ? HGCalTypes::WaferPartialType::WaferThree
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure if this kind of structures are oreferred over else ifs, I let experts to comment
@perrotta @qliphy

Copy link
Contributor

Choose a reason for hiding this comment

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

To be honest, it is the first time I see these long chains. Tabbed as such it is still quite readable, in my opinion (it wouldn't be with a different indentation, though). I've personally nothing against it,

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer this way because:

  • Makes things more readable, in table-like form
  • Allows assignment to a const, which makes things more robust

Copy link
Contributor

Choose a reason for hiding this comment

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

Surely the changed code is more readable

Copy link
Contributor

Choose a reason for hiding this comment

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

I kind of agree with the comment from @jfernan2
From the performance point of view, there's no gain.
From the readability, the if-else is definitely more readable.
On a related note, instead of having this huge cascade of cases, would it make sense to have a map that, given the shapeStr will return the correct WaferPartialType? This would make the code even more readable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You mean define a constant std::map within this module?

Then we would need 3 maps for that. One for old format mapping and DD, one for newer format low-density mapping and another one for newer format high-density mapping.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, a std::map would do the job perfectly.
Keep in mind that the handling of the old format is just temporary and, as soon as we converge on something close to final, we can simply drop the rest.

Thanks!

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! Will implement this now.

@jfernan2
Copy link
Contributor

please test

@rovere
Copy link
Contributor

rovere commented Dec 15, 2021

assign hgcal-dpg

@cmsbuild
Copy link
Contributor

New categories assigned: hgcal-dpg

@felicepantaleo,@rovere,@pfs,@cseez you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ab9735/21286/summary.html
COMMIT: 75cf070
CMSSW: CMSSW_12_3_X_2021-12-14-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36502/21286/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: 3 differences found in the comparisons
  • DQMHistoTests: Total files compared: 42
  • DQMHistoTests: Total histograms compared: 3250719
  • DQMHistoTests: Total failures: 5
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 3250691
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.004 KiB( 41 files compared)
  • DQMHistoSizes: changed ( 312.0 ): 0.004 KiB MessageLogger/Warnings
  • Checked 177 log files, 37 edm output root files, 42 DQM output files
  • TriggerResults: no differences found

@imranyusuff
Copy link
Contributor Author

@rovere now I have implemented std::maps for wafer shape code mapping. But for now I have not made a check yet for invalid codes which might cause std::out_of_range exception. Do you think it is important to make such a check, in case an invalid DD entry or flat file is given?

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-36502/27426

  • This PR adds an extra 20KB to repository

@cmsbuild
Copy link
Contributor

Pull request #36502 was updated. @pfs, @cseez, @felicepantaleo, @emanueleusai, @ahmad3213, @cmsbuild, @jfernan2, @rovere, @pmandrik, @pbo0, @rvenditti can you please check and sign again.

@jfernan2
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-ab9735/21346/summary.html
COMMIT: 1735785
CMSSW: CMSSW_12_3_X_2021-12-16-2300/slc7_amd64_gcc10
User test area: For local testing, you can use /cvmfs/cms-ci.cern.ch/week1/cms-sw/cmssw/36502/21346/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: 2853 differences found in the comparisons
  • DQMHistoTests: Total files compared: 42
  • DQMHistoTests: Total histograms compared: 3250719
  • DQMHistoTests: Total failures: 2522
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 3248175
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 41 files compared)
  • Checked 177 log files, 37 edm output root files, 42 DQM output files
  • TriggerResults: found differences in 1 / 41 workflows

@jfernan2
Copy link
Contributor

+1

waferInfo.shapeCode = HGCalTypes::WaferPartialType::WaferChopTwo;
else if (shapeStr == "gm")
waferInfo.shapeCode = HGCalTypes::WaferPartialType::WaferChopTwoM;
waferInfo.shapeCode = waferShapeMapDD.at(shapeStr);
Copy link
Contributor

Choose a reason for hiding this comment

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

at has bounds-checking and, therefore, is slower. Since this is not reconstruction code, we can skip that for now and eventually use the direct [] access operator for later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I did try to use [] first but failed to compile because it cannot accept const std::map.

@rovere
Copy link
Contributor

rovere commented Dec 17, 2021

@jfernan2 do you understand the 2522 differences?

@jfernan2
Copy link
Contributor

They are ONLY in wf 11634.7 which is misbehaving in all the PRs active around at present:
https://cmssdt.cern.ch/SDT/jenkins-artifacts/baseLineComparisons/CMSSW_12_3_X_2021-12-16-2300+ab9735/47547/dqm-histo-comparison-summary.html

@rovere
Copy link
Contributor

rovere commented Dec 17, 2021

Thanks a lot for the info!

@rovere
Copy link
Contributor

rovere commented Dec 17, 2021

+1

@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. @perrotta, @dpiparo, @qliphy (and backports should be raised in the release meeting by the corresponding L2)

@perrotta
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit 2b7e9b6 into cms-sw:master Dec 17, 2021
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.

6 participants