Skip to content
Snippets Groups Projects

add angle conditioning

Merged Frank Gaede requested to merge angle_cond into main
2 unresolved threads
  • extend Geometry interface with localDirection(G4FastTrack const& aFastTrack) - to compute the local direction in a right handed coordinate system where the z-axis points into the calorimeter, normal to the calorimeter planes
  • add localDir to ModelInterface::prepareInput(...) and ModelInterface::convertOutput(...) to allow for angular conditioning on one or two angles
  • implement this in RegularGridBIBAEModel
    • using condition angle as local theta (polar angle) and rotate output of inference model by local azimuth angle phi
  • use angular conditioning in Par04VAE
  • add property CorrectForAngle to geometry models PolyhedraBarrelGeometry and EndcapGeometry
    • use true for GAN and Par04VAE, false for BIB-AE
Edited by Frank Gaede

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
19 23
20 24 public:
21 25 virtual ~GeometryInterface(){};
22
23 26
24 /** convert the local spacepoints to global spacepoints
27 /** compute local direction in coordinate system that has the z-axis pointing into the calorimeter,
28 * normal to the layers
29 */
30 virtual G4ThreeVector localDirection(G4FastTrack const& aFastTrack) = 0;
  • Suggested change
    30 virtual G4ThreeVector localDirection(G4FastTrack const& aFastTrack) = 0;
    30 virtual G4ThreeVector localDirection(G4FastTrack const& aFastTrack) const = 0;

    Since it doesn't mutate any internal state we might as well mark it as such. It looks like we haven't been doing this consistently for other methods which also fit this description, so maybe we should go over this again at some point.

  • It actually does change internal state on the first call - via PolehedraBarrelGeometry::phiSector(). Would have to move the call initialize() to the FastShowerModel ...

  • Neither the phiSector nor the localDirection should depend on anything that is set up in initialize, right?

    Additionally, can we put the things that are in initialize into the constructor? That would entirely remove any mutable state from the geometry.

  • Good point, indeed we can compute the phiSector and localDirection w/o the initialize, as this is only needed for the actual layer positions. Not sure if we can call the initialize in the c'tor as the geometry construction might have not yet been done. Could give it a try, however, as this would clearly simplify things...

  • Frank Gaede changed this line in version 4 of the diff

    changed this line in version 4 of the diff

  • Please register or sign in to reply
    • I am not yet entirely sure if I like the design of singling out the local direction in a separate API and changing other APIs to consume the result of that. Technically we could probably hide that and keep the APIs slightly more general. However, I do see the advantage of not having to compute this over and over again.

      I would suggest to keep the interfaces as proposed and revisit later, once we have a more complete picture.

    • Yep, not super elegant. Did not come up with a better way and preserve the separation of concerns between model and geometry though. Yes, let's keep it for now and see how things evolve w/ other models ...

    • PS: with the models currently implemented, it looks like the actual parameters needed in the call are (energy, localDirection) only. After all that is what we train our models on. Global position and momentum direction or anything else from G4FastTrack might not be needed. Let's see...

    • Please register or sign in to reply
  • Frank Gaede added 2 commits

    added 2 commits

    • 5b476a52 - condition on angle in Par04ExampleVAE
    • 44c87dec - add property CorrectForAngles to geometry models

    Compare with previous version

  • Frank Gaede changed the description

    changed the description

  • Frank Gaede added 1 commit

    added 1 commit

    • 2bd1548d - initialize the geometry models in the c'tor

    Compare with previous version

  • Frank Gaede added 1 commit

    added 1 commit

    • 3b9a9107 - make geometry methods const where applicable

    Compare with previous version

  • Thomas Madlener approved this merge request

    approved this merge request

  • Thomas Madlener mentioned in commit 8d528355

    mentioned in commit 8d528355

  • Please register or sign in to reply
    Loading