-
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
Run2-hcx155 Correct access to HcalGeometry from TauDiscriminationAgainstCaloMuon #20523
Conversation
The code-checks are being triggered in jenkins. |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/PR-20523/709 Code check has found code style and quality issues which could be resolved by applying a patch in https://cmssdt.cern.ch/SDT/code-checks/PR-20523/709/git-diff.patch You can run |
please test |
4 similar comments
please test |
please test |
please test |
please test |
@bsunanda please apply the fixes spotted by the code-cheks |
The code-checks are being triggered in jenkins. |
-code-checks Logs: https://cmssdt.cern.ch/SDT/code-checks/PR-20523/728 Code check has found code style and quality issues which could be resolved by applying a patch in https://cmssdt.cern.ch/SDT/code-checks/PR-20523/728/git-diff.patch You can run |
The code-checks are being triggered in jenkins. |
+code-checks |
@cmsbuild Please test |
The tests are being triggered in jenkins. |
+1 The following merge commits were also included on top of IB + this PR after doing git cms-merge-topic: |
Comparison job queued. |
Comparison is ready Comparison Summary:
|
@@ -280,8 +270,7 @@ double TauDiscriminationAgainstCaloMuon<TauType, TauDiscriminator>::discriminate | |||
|
|||
const CaloSubdetectorGeometry* ebGeometry = caloGeometry_->getSubdetectorGeometry(DetId::Ecal, EcalBarrel); | |||
const CaloSubdetectorGeometry* eeGeometry = caloGeometry_->getSubdetectorGeometry(DetId::Ecal, EcalEndcap); | |||
const CaloSubdetectorGeometry* hbGeometry = caloGeometry_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel); | |||
const CaloSubdetectorGeometry* heGeometry = caloGeometry_->getSubdetectorGeometry(DetId::Hcal, HcalEndcap); | |||
const HcalGeometry* hcGeometry = (HcalGeometry*)(caloGeometry_->getSubdetectorGeometry(DetId::Hcal, HcalBarrel)); |
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.
wouldn't it make more sense to change the interface of CaloGeometry to add getSubdetectorGeometry(det)
so that we do not have this counter-intuitive code which semantically looks like HcalBarrel subdetector is selected, while in reality it's all of Hcal.
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.
i agree with @slava77 comment - this is a very confusing (and hacky) function call.. how can this be cleaned up?
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.
I shall think about it. It is not a very easy solution - there are detectors which has one geometry for all sub detectors while there are detectors which have different geometry for each sub detector. I shall try to see if something can be done in near future. But that has to be a separate PR and this PR is simply a bug fix
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 would seem a simple solution is to add a getDetectorGeometry and implement getSubdetectorGeometry only when relevant (throwing an exception otherwise). That way you don't have to find these "bugs" (rather, code that didn't follow an interface change that didn't change the interface itself) one by one
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.
David EcalBarrelGeometry, HcalGeometry, .. all are derived from CaloSubDetectorGeometry and depending on the detector/subdetector the functionalities are somewhat different. I do not think what you are suggesting makes sense
+1
|
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. @davidlange6, @slava77, @smuzaffar (and backports should be raised in the release meeting by the corresponding L2) |
@davidlange6 |
@davidlange6 |
@slava77 @davidlange6 Please approve this - I do not foresee any improvement in near future |
+1 |
There is only one geometry for Hcal for all components (HB,HE,HF,HO) -> HcalGeometry