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

PPS: follow-up geometry fixes #31297

Closed
jan-kaspar opened this issue Aug 31, 2020 · 18 comments
Closed

PPS: follow-up geometry fixes #31297

jan-kaspar opened this issue Aug 31, 2020 · 18 comments

Comments

@jan-kaspar
Copy link
Contributor

jan-kaspar commented Aug 31, 2020

This issue is to list the suggested fixes in PPS geometry code that

@cmsbuild
Copy link
Contributor

A new Issue was created by @jan-kaspar .

@Dr15Jones, @dpiparo, @silviodonato, @smuzaffar, @makortel, @qliphy can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

@ghugo83
Copy link
Contributor

ghugo83 commented Aug 31, 2020

As mentioned by @markotel, there are issues in PPS legacy code which should be addressed (usual memory management issues, like pointed-to objects not deleted, etc). They have been there for several years in legacy code.

They do not lead to any regression nor crash from any test after move of PPS to DD4hep (quite independent from this).
Though, it would be good anyway to have a clean PPS package (also a clean CMSSW actually...).

Here are the points to address, as (mostly) mentioned by @makortel (links to lines already in master):

@jan-kaspar
Copy link
Contributor Author

Many thanks @ghugo83 !

@jan-kaspar
Copy link
Contributor Author

jan-kaspar commented Sep 3, 2020

@silviodonato
Copy link
Contributor

assign geometry

@cmsbuild
Copy link
Contributor

cmsbuild commented Sep 4, 2020

New categories assigned: geometry

@Dr15Jones,@cvuosalo,@mdhildreth,@makortel,@ianna,@civanch you have been requested to review this Pull request/Issue and eventually sign? Thanks

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 4, 2020

Finished cleaning all these points.
Except the following: I do not understand which object would be double-deleted, in legacy code in:

std::unique_ptr<CTPPSGeometry> PPSGeometryESProducer::produceRealTG(const VeryForwardRealGeometryRecord& iRecord) {
  auto const& gD = iRecord.get(dgdRealToken_);

  return std::make_unique<CTPPSGeometry>(&gD, verbosity_);
}

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 4, 2020

@makortel you said:

This will lead to double-delete. If an ESProduct is intended to be forwarded as such, it should be done as
return std::shared<CTPPSGeometry const>(&gD, edm::do_nothing_deleter());

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 4, 2020

But which object would be double-deleted?
&gd is a raw, observing pointer to a DetGeomDesc.
We have a unique_ptr to a CTPPSGeometry object.

Sorry for asking explanation ;p But maybe you thought that &gD was the forward of a CTPPSGeometry object?

@makortel
Copy link
Contributor

makortel commented Sep 4, 2020

@ghugo83 Sorry, you're right, I got confused. The two objects (gD and the return value of produceRealTG()) are indeed separate. Sorry for the noise.

@jan-kaspar
Copy link
Contributor Author

So if I understand correctly, @ghugo83's set of fixes is complete (many thanks!). When would it be a good time to issue this PR (having all the other developments going on in parallel)?

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 4, 2020

@jan-kaspar
Am there: https://github.com/cms-sw/cmssw/compare/master...ghugo83:parallel_oldDD_DD4hep?expand=1

Basically this afternoon, I have:

  • integrated the fixes mentioned in this page.
  • moved out the custom constructor from PDetGeomDesc.
  • restored old DD and made all the changes to have old DD and DD4hep in parallel (that was obviously the very heavy part).

Evth compiles and runs.
I still need to re-do all the tests on DetIds / coords on all volumes, and fix accordingly.
But ok there is just one hour left haha

@jan-kaspar
Copy link
Contributor Author

@ghugo83 Huge thanks! Do I understand correctly that you plan to propose one big PR will all the fixes and improvements?

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 7, 2020

@jan-kaspar The small fixes, mentioned in the context of port to DD4hep, are included in #31383
This new PR does not touch old DD scenario, and instead add DD4hep capability in parallel.

@jan-kaspar
Copy link
Contributor Author

Many thanks @ghugo83 - does this mean that this issue can be closed? Or is some more work needed for the old DD scenarios?

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 8, 2020

Yes I would say can be closed, first 4 points are addressed.
Only cheeky point is the 5th point, which was not compulsory. I must say I have used ESGetToken in the ESProducer, but in the Analyzer, I have kept the legacy way of getting CompactView:

 ESHandle<SetupData> pSetup;
 iSetup.get<SetupRecord>().get(pSetup);

@ghugo83
Copy link
Contributor

ghugo83 commented Sep 8, 2020

Ok I have just fully addressed the 5th point as well. Will push the commit shortly.
As soon as the commit is pushed, I guess you can close this issue, as absolutely all points here have been looked at and addressed (except point 4 which was not relevant).

@jan-kaspar
Copy link
Contributor Author

Thanks @ghugo83 !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants