-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Conversation
The code-checks are being triggered in jenkins. |
+code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/cms-sw-PR-23303/4798 |
A new Pull Request was created by @bsunanda for master. It involves the following packages: DataFormats/ForwardDetId @perrotta, @civanch, @Dr15Jones, @ianna, @kpedro88, @cmsbuild, @mdhildreth, @slava77 can you please review it and eventually sign? Thanks. cms-bot commands are listed here |
@cmsbuild Please test |
The tests are being triggered in jenkins. |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
if ((mode_ == HGCalGeometryMode::Hexagon8) || | ||
(mode_ == HGCalGeometryMode::Hexagon8Full)) { | ||
auto itr = hgpar_->typesInLayers_.find(HGCalWaferIndex::waferIndex(layer,waferU,waferV)); | ||
int type = ((itr == hgpar_->typesInLayers_.end() ? 2 : |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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()) { |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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): |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto
@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); |
There was a problem hiding this comment.
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)); |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Comparison is ready Comparison Summary:
|
+1
|
+1 |
+1 |
+operations addition of a Modifier to manage a specific HGCal scenario configuration |
+1 changes in comparison look unrelated to this PR |
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. |
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