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

Build GE0 in the Muon Reco Geometry #32490

Merged
merged 12 commits into from
Dec 25, 2020
Merged

Conversation

seulgi324
Copy link

@seulgi324 seulgi324 commented Dec 15, 2020

PR description:

I copied the ME0 layer builders into MuonGEMDetLayerGeometryBuilder.cc, so that GE0 can be used by the muon reconstruction.
(https://indico.cern.ch/event/982928/contributions/4139669/attachments/2158615/3649556/Dec%208th%202020_ME0toGE0_Seulgi%20Kim.pdf)

@jshlee @watson-ij

PR validation:

I ran the matrix 30621.0 for D66 (ME0) and 31021.0 for D67 (GE0) both of which finished without failure. For D66, this change didn't affect the muon reconstruction. In D67, we now see that gem rechits from GE0 are used by muons.

if this PR is a backport please specify the original PR and why you need to backport that PR:

Before submitting your pull requests, make sure you followed this checklist:

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32490/20407

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

RecoMuon/DetLayers

@perrotta, @jpata, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@bellan, @abbiendi, @Fedespring, @calderona, @HuguesBrun, @jhgoh, @trocino, @cericeci, @rociovilar 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

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d24bb7/11659/summary.html
CMSSW: CMSSW_11_3_X_2020-12-14-2300/slc7_amd64_gcc900

Comparison Summary

Summary:

  • No significant changes to the logs found
  • Reco comparison results: 8 differences found in the comparisons
  • DQMHistoTests: Total files compared: 36
  • DQMHistoTests: Total histograms compared: 2747284
  • DQMHistoTests: Total failures: 12
  • DQMHistoTests: Total nulls: 1
  • DQMHistoTests: Total successes: 2747249
  • DQMHistoTests: Total skipped: 22
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: -0.004 KiB( 35 files compared)
  • DQMHistoSizes: changed ( 312.0 ): -0.004 KiB MessageLogger/Warnings
  • Checked 153 log files, 37 edm output root files, 36 DQM output files

for (int endcap = -1; endcap <= 1; endcap += 2) {
int iendcap = (endcap == 1) ? 0 : 1; // +1: forward, -1: backward

// GE0
int station0 = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

This loop could be fully included in the next one, provided you start it from station = GEMDetId::minStationId0, and apply the few changes suggested below

vector<int> rolls0, rings0, chambers0;
for (int ring = GEMDetId::minRingId; ring <= GEMDetId::maxRingId; ++ring)
rings0.push_back(ring);
for (int chamber = GEMDetId::minChamberId + 1; chamber <= GEMDetId::maxChamberId / 2; chamber++)
Copy link
Contributor

Choose a reason for hiding this comment

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

End the loop at GEMDetId::maxChamberId / 2 if station = GEMDetId::minStationId0

rings0.push_back(ring);
for (int chamber = GEMDetId::minChamberId + 1; chamber <= GEMDetId::maxChamberId / 2; chamber++)
chambers0.push_back(chamber);
for (int roll = GEMDetId::minRollId + 1; roll <= GEMDetId::maxRollId - 6; ++roll)
Copy link
Contributor

Choose a reason for hiding this comment

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

End the loop at EMDetId::maxRollId - 6 if station = GEMDetId::minStationId0
(and maybe also explain why this "-6" comes out...)

@@ -49,6 +65,68 @@ pair<vector<DetLayer*>, vector<DetLayer*> > MuonGEMDetLayerGeometryBuilder::buil
return res_pair;
}

MuRingForwardLayer* MuonGEMDetLayerGeometryBuilder::buildLayer0(int endcap,
Copy link
Contributor

Choose a reason for hiding this comment

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

If I am not mistaken, buildLayer0 is identical to buildLayer and there is no need to duplicate them: the only difference is for bool isInFront, for which please see below.
All the comments below apply to buildLayer as well

vector<const ForwardDetRing*> frontRings, backRings;

LogTrace(metname) << "Starting to Build Layer ";
for (std::vector<int>::iterator ring = rings.begin(); ring != rings.end() - 2; ring++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Why "-2"? A comment is deserved, at least
Better to fill the vector with only the needed rings (and not saying "-2" after having filled them)


if (geomDet != nullptr) {
//ME0s do not currently have an arrangement of which are front and which are back, going to always return true
bool isInFront = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool isInFront = true;
bool isInFront = (station == GEMDetId::minStationId0) or isFront(gemId);;

// GE0
int station0 = 0;
for (int layer0 = GEMDetId::minLayerId + 1; layer0 <= GEMDetId::maxLayerId0; ++layer0) {
vector<int> rolls0, rings0, chambers0;
Copy link
Contributor

Choose a reason for hiding this comment

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

You can easily reserve the size of the vectors in advance

@cmsbuild
Copy link
Contributor

-code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32490/20439

  • This PR adds an extra 16KB 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-32490/20502

  • This PR adds an extra 24KB to repository

@cmsbuild
Copy link
Contributor

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

Copy link
Contributor

@perrotta perrotta left a comment

Choose a reason for hiding this comment

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

Thank you for having removed all duplications with your latest update. Now I just suggest to further fix a typo, and then there are two very minor suggestions, that you can implement if you agree with them.
Well, three suggestions: please also remove the unneded inclusion of

#include "Utilities/BinningTools/interface/ClusterizingHistogram.h"

chambers.push_back(chamber);
for (int roll = GEMDetId::minRollId + 1; roll <= GEMDetId::maxRollId; ++roll)
rolls.push_back(roll);
ForwardDetLayer* fowardLayer = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

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

Since you are introducing it, you can fix the typo: fowardLayer -> forwardLayer

Comment on lines 69 to 72
if (!backRings.empty() && !frontRings.empty() && st->station() != GEMDetId::minStationId0) {
fowardLayer = new MuRingForwardDoubleLayer(frontRings, backRings);
} else if (!frontRings.empty() && st->station() == GEMDetId::minStationId0) {
fowardLayer = new MuRingForwardLayer(frontRings);
Copy link
Contributor

@perrotta perrotta Dec 22, 2020

Choose a reason for hiding this comment

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

Suggested change
if (!backRings.empty() && !frontRings.empty() && st->station() != GEMDetId::minStationId0) {
fowardLayer = new MuRingForwardDoubleLayer(frontRings, backRings);
} else if (!frontRings.empty() && st->station() == GEMDetId::minStationId0) {
fowardLayer = new MuRingForwardLayer(frontRings);
if (!frontRings.empty()) {
if (st->station() == GEMDetId::minStationId0)
forwardLayer = new MuRingForwardLayer(frontRings) ;
else if (!backRings.empty())
forwardLayer = new MuRingForwardDoubleLayer(frontRings, backRings);
}

Comment on lines 28 to 30
for (int layer = GEMDetId::minLayerId + 1; layer <= GEMDetId::maxLayerId0; ++layer) {
if (st->station() != GEMDetId::minStationId0 && layer > GEMDetId::maxLayerId)
break;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
for (int layer = GEMDetId::minLayerId + 1; layer <= GEMDetId::maxLayerId0; ++layer) {
if (st->station() != GEMDetId::minStationId0 && layer > GEMDetId::maxLayerId)
break;
const int maxLayerId = st->station() == GEMDetId::minStationId0? GEMDetId::maxLayerId0 : GEMDetId::maxLayerId;
for (int layer = GEMDetId::minLayerId + 1; layer <= maxLayerId; ++layer) {

@perrotta
Copy link
Contributor

While the geometry with ME0 (D66) is unchanged, in the the one with GE0 (D67) one can notice the effect of the inclusion of GE0 in the muon reconstruction, as expected and stated in the PR description.

The number of degrees of freedom in the muon fits increases:

image

with some limited propagation to the muon track parameters, e.g.

image
image

(examples from workflow 31021)

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-32490/20573

  • This PR adds an extra 16KB to repository

@cmsbuild
Copy link
Contributor

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

@perrotta
Copy link
Contributor

please test

@cmsbuild
Copy link
Contributor

+1

Summary: https://cmssdt.cern.ch/SDT/jenkins-artifacts/pull-request-integration/PR-d24bb7/11867/summary.html
CMSSW: CMSSW_11_3_X_2020-12-23-2300/slc7_amd64_gcc900

Comparison Summary

@slava77 comparisons for the following workflows were not done due to missing matrix map:

  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-d24bb7/1325.81_TTbar_13_106Xv1NanoAODINPUT+TTbar_13_106Xv1NanoAODINPUT+NANOEDMMC2017_106XMiniAODv1+HARVESTNANOAODMC2017_106XMiniAODv1
  • /data/cmsbld/jenkins/workspace/compare-root-files-short-matrix/data/PR-d24bb7/136.8523_RunJetHT2018C_nanoULremini+RunJetHT2018C_nanoULremini+NANOEDM2018_106Xv2+HARVESTNANOAOD2018_106Xv2

Summary:

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

@perrotta
Copy link
Contributor

+1

  • GE0 included in the Phase2 muon reco, when available
  • Jenkins tests pass, and show no differences in standard workflow
  • A few reconstructed muons updated with GE0 in the Phase2 workflows which include it

@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 Dec 25, 2020

+1

@cmsbuild cmsbuild merged commit bf306a6 into cms-sw:master Dec 25, 2020
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.

4 participants