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

Phase2-hgx112 Correct Reco geometry of post TDR definition and interface to DIGI+RECO codes #23303

Merged
merged 8 commits into from
Jun 5, 2018

Conversation

bsunanda
Copy link
Contributor

Simulation, Reconstruction geometry and numbering schemes for the new geometry are tested. Also changes are made to the DIGI and local RECO code to access data from new geometry

@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

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

It involves the following packages:

DataFormats/ForwardDetId
Geometry/CaloEventSetup
Geometry/CaloTopology
Geometry/HGCalCommonData
Geometry/HGCalGeometry
RecoLocalCalo/HGCalRecAlgos
RecoLocalCalo/HGCalRecProducers
SimCalorimetry/HGCalSimProducers

@perrotta, @civanch, @Dr15Jones, @ianna, @kpedro88, @cmsbuild, @mdhildreth, @slava77 can you please review it and eventually sign? Thanks.
@edjtscott, @vandreev11, @sethzenz, @felicepantaleo, @rovere, @argiro, @cseez, @pfs, @lgray, @kpedro88 this is something you requested to watch as well.
@davidlange6, @slava77, @fabiocos you are the release manager for this.

cms-bot commands are listed here

@bsunanda
Copy link
Contributor Author

@cmsbuild Please test

@cmsbuild
Copy link
Contributor

cmsbuild commented May 23, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/28147/console Started: 2018/05/23 23:58

@cmsbuild
Copy link
Contributor

@cmsbuild
Copy link
Contributor

Comparison job queued.

@cmsbuild
Copy link
Contributor

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 2155 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2901712
  • DQMHistoTests: Total failures: 117
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2901405
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

if ((mode_ == HGCalGeometryMode::Hexagon8) ||
(mode_ == HGCalGeometryMode::Hexagon8Full)) {
auto itr = hgpar_->typesInLayers_.find(HGCalWaferIndex::waferIndex(layer,waferU,waferV));
int type = ((itr == hgpar_->typesInLayers_.end() ? 2 :
Copy link
Contributor

Choose a reason for hiding this comment

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

magic number 2 -> descriptive constant

} else if ((mode_ == HGCalGeometryMode::Hexagon) ||
(mode_ == HGCalGeometryMode::HexagonFull)) {
int type = (((waferU>=0)&&(waferU<(int)(hgpar_->waferTypeL_.size()))) ?
hgpar_->waferTypeL_[waferU] : 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

also for magic number 0

mytrf.hr = hr;
trforms.emplace_back(mytrf);
trformUse.emplace_back(false);
auto ktr = trforms.find(std::pair<int,int>(lay,zside));
Copy link
Contributor

Choose a reason for hiding this comment

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

use make_pair

mytrf.subsec= 0;
mytrf.h3v = h3v;
mytrf.hr = hr;
trforms[std::pair<int,int>(lay,zside)] = mytrf;
Copy link
Contributor

Choose a reason for hiding this comment

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

use make_pair

trforms.emplace_back(mytrf);
trformUse.emplace_back(false);
auto ktr = trforms.find(std::pair<int,int>(lay,zside));
if (ktr == trforms.end()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

could avoid temporary ktr since it's only checked here

} else {
throw cms::Exception("InvalidRecHit")
<< "HGCalRecHitSimpleAlgo encountered a non-HGCal det id: " << baseid.det() << ' ' << baseid.subdetId() << ' ' << baseid.rawId();
}

HGCalDetId hid(uncalibRH.id());
// HGCalDetId hid(uncalibRH.id());
Copy link
Contributor

Choose a reason for hiding this comment

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

delete commented-out code

@@ -53,6 +55,22 @@ namespace {
return ddd;
}

inline const HGCalDDDConstants* get_ddd(const CaloSubdetectorGeometry* geom,
const HGCSiliconDetId& detid) {
const HGCalGeometry* hg = dynamic_cast<const HGCalGeometry*>(geom);
Copy link
Contributor

Choose a reason for hiding this comment

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

doing this dynamic_cast for every DetID seems suboptimal. Can the ddd constant pointers be kept as class members?

Copy link
Contributor

Choose a reason for hiding this comment

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

why cannot you just get a handle to the constants from an event setup?

Copy link
Contributor

Choose a reason for hiding this comment

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

it looks like the response to this comment on the dynamic_cast is "it was there before" for the other methods.
However, I agree that this can be improved.
A somewhat daring way is to use a reinterpret_cast

Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not use a reinterpret_cast. A static_cast would be sufficient.

int layer;
switch (type) {
case(DetId::HGCalEE): {
auto geomEE = dynamic_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(type,ForwardSubdetector::ForwardEmpty));
Copy link
Contributor

Choose a reason for hiding this comment

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

this function could also profit from the optimization suggested above

@@ -208,3 +211,13 @@ def HGCal_setEndOfLifeNoise(digitizer,process):
values = cms.vdouble([x for x in endOfLifeNoises])
)

def HGCal_setPostTDRGeometry(digitizer,process):
Copy link
Contributor

Choose a reason for hiding this comment

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

we should introduce a modifier for this (I don't see a way around it)

HGCalTestNumbering::unpackHexagonIndex(simId, subdet, zp, layer, sec, subsec, cell);
//sec is wafer and subsec is celltyp
//skip this hit if after ganging it is not valid
std::pair<int,int> recoLayerCell=dddConst.simToReco(cell,layer,sec,topo.detectorType());
Copy link
Contributor

Choose a reason for hiding this comment

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

auto

@kpedro88
Copy link
Contributor

@bsunanda is this PR expected to cause the changes observed in existing 2023 workflows?

@@ -53,6 +55,22 @@ namespace {
return ddd;
}

inline const HGCalDDDConstants* get_ddd(const CaloSubdetectorGeometry* geom,
const HGCSiliconDetId& detid) {
const HGCalGeometry* hg = dynamic_cast<const HGCalGeometry*>(geom);
Copy link
Contributor

Choose a reason for hiding this comment

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

why cannot you just get a handle to the constants from an event setup?

unsigned int wmaxFH = 1 + (geomFH->topology().dddConstants()).waferMax();
unsigned int wmaxEE(0), wmaxFH(0);
if (mode_ == 0) {
auto geomEE = dynamic_cast<const HGCalGeometry*>(geom_->getSubdetectorGeometry(DetId::Forward,ForwardSubdetector::HGCEE));
Copy link
Contributor

Choose a reason for hiding this comment

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

get it from an event setup?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

RecHitTools is Marco's code. I just added what changes to be made for the new geometry. I do not want to change the design of this. Later Marco can take care of the changes in the RecHitTools code

Copy link
Contributor

Choose a reason for hiding this comment

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

@rovere FYI

} else if (id.det() == DetId::HGCalEE || id.det() == DetId::HGCalHSi) {
const HGCSiliconDetId hid(id);
auto ddd = get_ddd(geom,hid);
thick = ddd->cellThick(hid.layer(),hid.waferU(),hid.waferV());
Copy link
Contributor

Choose a reason for hiding this comment

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

if getSiThickness is used very often, it's better to store its record in an event setup

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thickness depends on the wafer position. Again I am not changing the coding style there.

@cmsbuild
Copy link
Contributor

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

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 31
  • DQMHistoTests: Total histograms compared: 2902471
  • DQMHistoTests: Total failures: 25
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2902256
  • DQMHistoTests: Total skipped: 190
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 30 files compared)
  • Checked 128 log files, 14 edm output root files, 31 DQM output files

@kpedro88
Copy link
Contributor

+1
followup items:

@bsunanda
Copy link
Contributor Author

@civanch @ianna @slava77 @perrotta Please approve this PR

@bsunanda
Copy link
Contributor Author

@slava77 @ianna @civanch @fabiocos Could you please approve & integrate this at the earliest. Many work is waiting which are waiting for this

@slava77
Copy link
Contributor

slava77 commented May 31, 2018

+1

for #23303 4758834

  • code changes are in line with the PR description and the follow up review; behavior of the code currently used in the standard [jenkins tested] workflows is not affected
  • jenkins tests pass and comparisons with the baseline show no differences

@bsunanda
Copy link
Contributor Author

bsunanda commented Jun 2, 2018

@ianna @civanch @fabiocos Please approve and merge this PR at the earliest

@bsunanda
Copy link
Contributor Author

bsunanda commented Jun 5, 2018

@ianna @civanch @fabiocos Please approve and merge this PR at the earliest. We are stuck of progressing - please try to do this

@ianna
Copy link
Contributor

ianna commented Jun 5, 2018

+1

@civanch
Copy link
Contributor

civanch commented Jun 5, 2018

+1

@fabiocos
Copy link
Contributor

fabiocos commented Jun 5, 2018

+operations

addition of a Modifier to manage a specific HGCal scenario configuration

@fabiocos
Copy link
Contributor

fabiocos commented Jun 5, 2018

+1

changes in comparison look unrelated to this PR

@cmsbuild
Copy link
Contributor

cmsbuild commented Jun 5, 2018

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 be automatically merged.

@cmsbuild cmsbuild merged commit 020159e into cms-sw:master Jun 5, 2018
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.

9 participants