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

Properly compute PFRecHit position for HGCAL #20631

Merged
merged 1 commit into from Sep 27, 2017

Conversation

rovere
Copy link
Contributor

@rovere rovere commented Sep 22, 2017

The current CaloGeometry of HGCAL is not capable of handling
the full granularity of the detector. Hence, for all the
detids belonging to the same wafer, the mid position of the
wafer is returned, instead of the more accurate pad's
position. This PR introduces a small adapter for the HGCAL
CaloCell that internally stores the correct position for
each pad and returns it via the usual interface. No changes
are required anywhere in the code except for the code
responsible to import HGCAL RecHit as PFRecHits. This is a
hack that will disappear as soon as a proper CaloGeometry
for the HGCAL detector is in place.

Forward port of #20630

The current CaloGeometry of HGCAL is not capable of handling
the full granularity of the detector. Hence, for all the
detids belonging to the same wafer, the mid position of the
wafer is returned, instead of the more accurate pad's
position. This PR introduces a small adapter for the HGCAL
CaloCell that internally stores the correct position for
each pad and returns it via the usual interface. No changes
are required anywhere in the code except for the code
responsible to import HGCAL RecHit as PFRecHits. This is a
hack that will disappear as soon as a proper CaloGeometry
for the HGCAL detector is in place.
@cmsbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@rovere
Copy link
Contributor Author

rovere commented Sep 22, 2017

The reason to develop this PR surfaced at one of the last UPSG meeting, where an extremely poor agreement between the SC and the linked gsf track has been shown for electrons in HGCAL slide 7 at this link.
In particular, the kind of matching that we currently have in release for HGCAL (red) and the current detector(run2 2017, blue) in the endcap is the following:

h_ele_detacl_propout_endcaps

This PR, when run on ZEE sample, 0PU, will restore a more proper situation:

deltaetaeleclpropout_frommulticl_barrelblack_endcappred_endcapmazure
deltaphieleclpropout_barrelblack_endcappred_endcapmazure

@cmsbuild
Copy link
Contributor

+code-checks

Logs: https://cmssdt.cern.ch/SDT/code-checks/PR-20631/919

@cmsbuild
Copy link
Contributor

A new Pull Request was created by @rovere (Marco Rovere) for master.

It involves the following packages:

Geometry/CaloGeometry
RecoParticleFlow/PFClusterProducer

@perrotta, @civanch, @Dr15Jones, @ianna, @mdhildreth, @cmsbuild, @slava77 can you please review it and eventually sign? Thanks.
@ghellwig, @mmarionncern, @felicepantaleo, @lgray, @seemasharmafnal, @cbernet, @bachtis this is something you requested to watch as well.
@davidlange6, @slava77 you are the release manager for this.

cms-bot commands are listed here

@rovere
Copy link
Contributor Author

rovere commented Sep 22, 2017

@malgeri @cseez @beaudett @artlbv this is something you could be interested in.

@slava77
Copy link
Contributor

slava77 commented Sep 22, 2017

@cmsbuild please test

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 22, 2017

The tests are being triggered in jenkins.
https://cmssdt.cern.ch/jenkins/job/ib-any-integration/23176/console Started: 2017/09/22 17:39

@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-20631/23176/summary.html

Comparison Summary:

  • No significant changes to the logs found
  • Reco comparison results: 972 differences found in the comparisons
  • DQMHistoTests: Total files compared: 26
  • DQMHistoTests: Total histograms compared: 2691683
  • DQMHistoTests: Total failures: 224
  • DQMHistoTests: Total nulls: 0
  • DQMHistoTests: Total successes: 2691270
  • DQMHistoTests: Total skipped: 189
  • DQMHistoTests: Total Missing objects: 0
  • Checked 107 log files, 15 edm output root files, 26 DQM output files

@kpedro88
Copy link
Contributor

assign upgrade

@cmsbuild
Copy link
Contributor

New categories assigned: upgrade

@kpedro88 you have been requested to review this Pull request/Issue and eventually sign? Thanks

@perrotta
Copy link
Contributor

@rovere : I miss the point why you need to cache the whole caloCells_ vector if you only need one thisCell at once...

@rovere
Copy link
Contributor Author

rovere commented Sep 26, 2017

@perrotta I build one PFRecHit at a time, but each time the PFRecHit stores internally the pointer to thisCell, so I need to keep track of each of them.

@ianna
Copy link
Contributor

ianna commented Sep 27, 2017

@rovere - you could delegate this tracking to a smart pointer :-)

@rovere
Copy link
Contributor Author

rovere commented Sep 27, 2017

@ianna no, I cannot.
The owner of the vector has a lifetime that spans the full job and will never call any delete on the pointers.
I cannot/do not want to change the interface of the PFRecHit to accept a smart pointer, also because the ordinary pointers point to "static" geometry CaloCell that are not rebuilt every single time.

@ianna
Copy link
Contributor

ianna commented Sep 27, 2017

+1

ok, we'll come back to this question when geometry has been migrated to smart pointers.

@kpedro88
Copy link
Contributor

+1
(though the memory implications for high PU are unfortunate)

@perrotta
Copy link
Contributor

+1

  • The fix is needed, and this PR does the job
  • The memory Issue should né addressed at some point, however

@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 (and backports should be raised in the release meeting by the corresponding L2)

@slava77
Copy link
Contributor

slava77 commented Sep 27, 2017

I ran also with 4 threads and I see a 1.5GB increment in the memory peak.
"averaging" with Marco's numbers, it looks like we can expect about 0.5 GB/thread needed.
IIUC, even in PU200 the occupancy is still much smaller than 1/threads (4 in my test) to allow static pre-computation of caloCell positions in the full geometry.

@kpedro88
what is the current memory use in the production environment (no DQM/Validation, write AODSIM)?
My last tests for that were in 930pre1 and back then 4-thread job peaked just under 8GB.

@kpedro88
Copy link
Contributor

@slava77 I'm not sure about production memory usage for 930. We've been looking at relvals so far, which have much higher memory usage.


class CaloCellGeometryHGCALAdapter : public FlatTrd {
public:
explicit CaloCellGeometryHGCALAdapter (const FlatTrd * f, GlobalPoint p) : FlatTrd(*f), position_(p) {}
Copy link
Contributor

Choose a reason for hiding this comment

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

why is a copy of the FlatTrd object needed here (rather than keeping the pointer) - sorry to add noise.

Copy link
Contributor

Choose a reason for hiding this comment

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

@davidlange6 the PFRecHit has a member CaloCellGeometry const * caloCell_. We have to provide it with something equivalent - this new class inherits from FlatTrd which inherits from CaloCellGeometry, but returns the correct position. I thought about it for a while and couldn't come up with a better hack (i.e. without changing the PFRecHit class).

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok so why does this not work? [I think the savings is not so substantial as CaloCellGeometry is the majority of the size of FlatTrd so lets save the question for later

class CaloCellGeometryHGCalAdapter : public CaloCellGeometry {

public:
...

private:
const FlatTrd *trd_;
GlobalPoint position_;

@davidlange6
Copy link
Contributor

davidlange6 commented Sep 27, 2017 via email

@kpedro88
Copy link
Contributor

@davidlange6 what would such a class look like? It still has to inherit from and behave like FlatTrd - all the memory for its members will be allocated even if we keep a pointer to the original instead of copying.

@rovere
Copy link
Contributor Author

rovere commented Sep 27, 2017 via email

@davidlange6
Copy link
Contributor

davidlange6 commented Sep 27, 2017 via email

@kpedro88
Copy link
Contributor

@bsunanda is working on a real fix. It will be much more involved, but should avoid the memory implications here.

@slava77
Copy link
Contributor

slava77 commented Sep 27, 2017 via email

@rovere
Copy link
Contributor Author

rovere commented Sep 27, 2017 via email

@davidlange6
Copy link
Contributor

merge

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

7 participants