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-hgx111 Modify reco geometry/topology for post TDR HGCAL #23211

Merged
merged 8 commits into from May 22, 2018

Conversation

bsunanda
Copy link
Contributor

Now Reco Geometry/topology can handle the new geometry. No provision of finding neighbours yet

@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/CaloGeometry
Geometry/CaloTopology
Geometry/HGCalCommonData
Geometry/HGCalGeometry
SimG4CMS/Calo

@civanch, @Dr15Jones, @ianna, @mdhildreth, @cmsbuild, @kpedro88 can you please review it and eventually sign? Thanks.
@makortel, @rovere 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 15, 2018

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/27967/console Started: 2018/05/16 01:38

@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-23211/27967/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 6 differences found in the comparisons
  • DQMHistoTests: Total files compared: 30
  • DQMHistoTests: Total histograms compared: 2715235
  • DQMHistoTests: Total failures: 2218
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2712834
  • DQMHistoTests: Total skipped: 183
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 29 files compared)
  • Checked 124 log files, 14 edm output root files, 30 DQM output files

if (type == 0) {
subdet_ = HGCEE;
det_ = (int)HGCEE;
Copy link
Contributor

Choose a reason for hiding this comment

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

@bsunanda - this is potentially confusing. The integer type picked up from configuration file is not equal the integer in enumeration. It is unsafe because these enums defined in two different places:

enum ForwardSubdetector { ForwardEmpty=0, FastTime=1, BHM=2, HGCEE=3, HGCHEF=4, 
 HGCHEB=5, HGCHET=6, HGCTrigger=7 };
enum Detector {Tracker=1, Muon=2, Ecal=3, Hcal=4, Calo=5, Forward=6,
 VeryForward=7, HGCalEE=8, HGCalHSi=9, HGCalHSc=10,
 HGCalTrigger=11};

The logic as implemented:

if 0 then 3
else if 1 then 4
else if 2 then 8
else if 2 then 9 // which will never happen
else 10

IMHO, it would be safer to use strongly typed enum class.

@@ -73,6 +73,9 @@ class FlatTrd : public CaloCellGeometry {

void setPosition ( const GlobalPoint& p ) { m_global = p; setRefPoint(p); }

static const unsigned int ncorner_ = 8;
static constexpr unsigned int ncornerBy2_ = ncorner_/2;
Copy link
Contributor

Choose a reason for hiding this comment

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

4?

int HGCalDDDConstants::getLayer(double z, bool reco) const {
int lay = (int)(hgpar_->zLayerHex_.size());
double zz = std::abs(z);
for (unsigned int k=1; k<hgpar_->zLayerHex_.size(); ++k) {
Copy link
Contributor

Choose a reason for hiding this comment

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

std::find_if?

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 would like to check if z lies below 0.5*(z_i+z_i+1). I don't think std::find_if will not give that -it tries to equate or not-equate. Am I wrong on this?

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 use an arbitrary lambda in find_if(), but since this comparison requires two elements from the vector, I don't think find_if() will work.

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 use an outer variable to do the indexing, capturing it into the lambda.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, I see, a construction like this: https://stackoverflow.com/questions/3752019/how-to-get-the-index-of-a-value-in-a-vector-using-for-each

So the code here might be modified as follows (haven't tried to compile it):

unsigned k = 0;
auto it = std::find_if(hgpar_->zLayerHex_.begin()+1,hgpar_->zLayerHex_.end(),[&k,&zz,&hgpar_->zLayerHex_](double zLayer){ ++k; return zz < 0.5*(zLayerHex_[k-1]+zLayerHex_[k]); });
lay = k;

int cellV) const {
int indx = HGCalWaferIndex::waferIndex(layer,modU,modV);
auto itr = hgpar_->typesInLayers_.find(indx);
bool ok(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

perhaps, renaming it to:

bool result(false); 

would be less confusing when returning ok == false


bool HGCalDDDConstants::isValidTrap(int layer, int ieta, int iphi) const {
std::pair<int,float> indx = getIndex(layer,true);
bool ok(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

same here

@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-23211/28020/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 274 differences found in the comparisons
  • DQMHistoTests: Total files compared: 30
  • DQMHistoTests: Total histograms compared: 2740553
  • DQMHistoTests: Total failures: 105
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2740265
  • DQMHistoTests: Total skipped: 183
  • DQMHistoTests: Total Missing objects: 0
  • DQMHistoSizes: Histogram memory added: 0.0 KiB( 29 files compared)
  • Checked 124 log files, 14 edm output root files, 30 DQM output files

@kpedro88
Copy link
Contributor

@bsunanda there are some minor changes in clusters/PFCandidates and downstream objects for Phase2 workflows. It's not clear to me what would cause that in this PR. Do you know why it happens?

@bsunanda
Copy link
Contributor Author

There was a bug in the GeomID in HGCalDetId class which is fixed. It might be the cause for the changes. I found this bug while making geometry ID's of the new description

@kpedro88
Copy link
Contributor

Does this bug just affect decoding the IDs, or did it also enter the encoding of IDs? I would like to understand if this will cause an incompatibility with reading old files.

@bsunanda
Copy link
Contributor Author

bsunanda commented May 18, 2018 via email

@bsunanda
Copy link
Contributor Author

@kpedro88 @ianna @civanch Can you approve this PR at the earliest and if it gets integrated soon we can aim to have something by June release

@kpedro88
Copy link
Contributor

+1

@bsunanda
Copy link
Contributor Author

@ianna @civanch Can you approve this PR at the earliest and if it gets integrated soon we can aim to have something by June release

1 similar comment
@bsunanda
Copy link
Contributor Author

@ianna @civanch Can you approve this PR at the earliest and if it gets integrated soon we can aim to have something by June release

@civanch
Copy link
Contributor

civanch commented May 22, 2018

+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. @davidlange6, @slava77, @smuzaffar, @fabiocos (and backports should be raised in the release meeting by the corresponding L2)

@fabiocos
Copy link
Contributor

+1

@cmsbuild cmsbuild merged commit b2015f3 into cms-sw:master May 22, 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.

None yet

8 participants