Ability to create Regions in Gmad Input

Issue #91 resolved
Laurie Nevay created an issue

A Geant4 region is used to represent a series of range cuts. Volumes can be added to these assigning different levels of accuracy to different sections of the geometry. Volumes needn't be adjacent - ie the 'region' does not have to be contiguous - ambiguous naming.

Currently, there are the global range cuts that are assigned to the default region (prodCutPhotons etc) and there are precision ones (prodCutPhotonsP) as well as a special case that was added for the SQL geometry (prodCutPhotonsA). After tracking down (no comments) this was for an 'approximate region' for certain volumes in the external geometry.

Rather than duplicate members in the parser options.cc and .h and members and accessors in BDSGlobalConstants, we could provide a way for users to define their own regions and assign beam line components to them. Even external geometry could reference already created ones by name - so that different parts of the external geometry could belong to different regions.

Practically, this would involve another class for the parser with a few members (production cuts for Hadrons, Photons, Electrons & Positrons).

Example syntax would be:

precisionR: region, prodCutPhotons=1*mm, prodCutHadrons=1*m;

d1: drift, l=0.5*m, aper1=4*cm, region="precisionR";

Thoughts?

Comments (5)

  1. Laurie Nevay reporter

    There would probably need to be some class that creates and holds all the regions in the bdsim code base and the places that use these would need to be updated but this is relatively straightforward and I could do this bit.

  2. Jochem Snuverink

    I have created this in the parser. For ease of implementation, the keyword for the region had to be different from the element property, I named it "cutsregion" but this can be easily changed to something else:

    precisionR: cutsregion, prodCutPhotons=1*mm, prodCutHadrons=1*m;
    
    d1: drift, l=0.5*m, aper1=4*cm, region="precisionR";
    

    The BDSParser holds a vector of regions that can be accessed with:

    const std::vector<GMAD::Region> & regions = BDSParser::Instance()->GetRegions()
    
  3. Jochem Snuverink

    ".. and the places that use these would need to be updated but this is relatively straightforward and I could do this bit."

    I'll leave that to you then Laurie, closing this issue.

  4. Log in to comment