Navigation Menu

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

Support for spherical op.det. in geometry (issue #25003) #11

Merged
merged 3 commits into from Oct 7, 2020

Conversation

PetrilloAtWork
Copy link
Contributor

@PetrilloAtWork PetrilloAtWork commented Oct 3, 2020

This should solve issue #25003.
I tested it on ICARUS code by running the geometry test (which is not expected to exercise the change) and checking the geometry dump.
I would like SBND to check this commit as well, since SBND has both bar- and hemisphere-shaped photodetectors.

Also added geo::OpDetGet::isSphere() and a lower level shape type interface.
This should solve Redmine issue #25003.
@FNALbuild
Copy link
Contributor

A new Pull Request was created by @PetrilloAtWork (Gianluca Petrillo) for develop.

It involves the following packages:

larcorealg

@LArSoft/level-1-managers, @LArSoft/level-2-managers can you please review it and eventually sign? Thanks.

cms-bot commands are listed here

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

Pull request #11 was updated. @LArSoft/level-1-managers, @LArSoft/level-2-managers can you please check and sign again.

@FNALbuild
Copy link
Contributor

@pgreen135
Copy link

pgreen135 commented Oct 5, 2020

@PetrilloAtWork I had a go using this for SBND with the opDets in OpFastScintillation.cxx (~line 251):
for (size_t const i : util::counter(fPVS->NOpChannels())) { geo::OpDetGeo const& opDet = geom.OpDetGeoFromOpDet(i);
The opDets are a mixture of bars (arapucas) and spheres (pmts), but for every opDet isBar(), isSphere() and isDisk() all return false. In the previous version isBar() was working when called like this, so something seems to be an issue in this implementation.

@lgarren lgarren added this to Under discussion in LArSoft pull requests Oct 5, 2020
@lgarren lgarren moved this from Under discussion to Awaiting triage in LArSoft pull requests Oct 5, 2020
@knoepfel knoepfel moved this from Awaiting triage to Under discussion in LArSoft pull requests Oct 5, 2020
@PetrilloAtWork
Copy link
Contributor Author

I should have fixed the bug. Even if I have tested this change with sbndcode, I would appreciate cross testing.

@pgreen135
Copy link

@PetrilloAtWork I've repeated my tests in SBND and this appears to be working properly now, at least with bars and spheres. Re Kyle's comment - in the case of spheres isBar() is indeed correctly returning false in my tests.

@FNALbuild
Copy link
Contributor

Pull request #11 was updated. @LArSoft/level-1-managers, @LArSoft/level-2-managers can you please check and sign again.

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

@lgarren lgarren moved this from Under discussion to Approval in progress in LArSoft pull requests Oct 6, 2020
@lgarren
Copy link
Member

lgarren commented Oct 6, 2020

trigger build

@FNALbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

The code-checks are being triggered in jenkins.

@FNALbuild
Copy link
Contributor

@lgarren
Copy link
Member

lgarren commented Oct 6, 2020

trigger build

@FNALbuild
Copy link
Contributor

The tests are being triggered in jenkins.

@PetrilloAtWork
Copy link
Contributor Author

PetrilloAtWork commented Oct 6, 2020

Err... ok 🙄
I feel like Clang is telling me "Warning: typeid() is operating exactly as everybody should expect it to!".
I have pushed the "fix" (which AFAIK does exactly the same as before, while trying also to impress Clang).

I request a C++ expert review of this part of the code (@knoepfel?) with particular attention to typeid here, since usually Clang is smarter than me.
The context is that TGeoShape is base class of all shapes in ROOT geometry, Shape() returns a pointer to a polymorphically-aware class derived from TGeoShape, and my code was supposed to access and test the exact type of that derived class.
I think that *Shape() (and in the new code *shape) return the glvalue that typeid() needs, but I need cross checks.
At least it seems to work...

Thanks, Lynn, for reporting it to me.


P.S. For SBND folks: you may be already aware of that, anyway geo::OpDetGeo::ThetaZ() for the arapuca bars is broken (returns nan). I suspect the reason is that, as any reasonable person would, the bars are described in GDML with the longest side aligned with z. If that's the problem, changing the definition so that z is aligned to the thickness (i.e. toward the TPC after the final rotation) would fix ThetaZ(), and also break (or at least change) HalfL(), which would then report half the thickness. A real fix requires additional coding in the geometry builder to provide the object with contextual information ("where is the TPC") which OpDeTGeo normally does not have.

@FNALbuild
Copy link
Contributor

+LArSoft tests OK on slf7 for c7:prof
for details see
https://lar-ci-history.fnal.gov/LarCI/app/view_builds/index?offset=0&builds=lar_ci/9672&builds=
+build

@FNALbuild
Copy link
Contributor

+LArSoft tests OK on slf7 for e19:prof
for details see
https://lar-ci-history.fnal.gov/LarCI/app/view_builds/index?offset=0&builds=lar_ci/9671&builds=
+build

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@FNALbuild
Copy link
Contributor

@knoepfel
Copy link
Member

knoepfel commented Oct 7, 2020

@PetrilloAtWork, I agree the warning emitted by Clang is over-cautious. Regardless, your commit does address the issue.

On a side note: the fact that the user has to ask what shape is represented by an OpDetGeo object indicates a broken abstraction. The class should be well enough encapsulated that such questions are not necessary when using the object. Someday, when everyone has the time, we should reconsider the OpDetGeo design. But it is not this day...

@knoepfel
Copy link
Member

knoepfel commented Oct 7, 2020

approve

@FNALbuild
Copy link
Contributor

This pull request is fully signed and it will be merged to develop and built in the next LArSoft release after it passes the integration tests.

@lgarren lgarren merged commit 05cf894 into LArSoft:develop Oct 7, 2020
LArSoft pull requests automation moved this from Approval in progress to Merged into develop Oct 7, 2020
@lgarren lgarren moved this from Merged into develop to Included in release in LArSoft pull requests Oct 13, 2020
@PetrilloAtWork PetrilloAtWork deleted the feature/gp_issue25003 branch October 23, 2020 04:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
LArSoft pull requests
Included in release
Development

Successfully merging this pull request may close these issues.

None yet

5 participants