Skip to content
Snippets Groups Projects
Select Git revision
  • 9a69cae4bc534b2c2d25a107d1c2946ee52b9ad9
  • master default protected
  • drich-two-mirrors
  • 148-hcal-geometry-development
  • 144-irt-geometry
  • deathvalley-acts-dd4hep-plugin
  • canyonlands-acts-dd4hep-plugin
  • adjust-barrel-emcalo-geometry
  • 148-hcal-geometry-development-wdconinc-suggestion
  • WorkingGemTrd_MLmodel_andAnalysis
  • 144-test-small-sensor-overlap
  • 59-detailed-forward-gem-trd
  • vdesai-master-patch-09582
  • mriganka-branch02
  • zdemirog-master-patch-64142
  • weibin-master-patch-37475
  • vanekjan-master-patch-74522
  • lkosarzew-master-patch-25029
  • swapneshkhade-master-patch-16755
  • mlavinsky-master-patch-10431
  • niveditharam-master-patch-05822
  • deathvalley-v1.1
  • deathvalley-v1.0-1.5T
  • deathvalley-v1.0
  • canyonlands-v2.2
  • canyonlands-v2.1
  • canyonlands-v2.0
  • canyonlands-v1.2
  • canyonlands-v1.1
  • acadia-v2.1
  • canyonlands-v1.0
  • acadia-v2.0
  • acadia-v1.1
  • acadia-v1.0
  • acadia-v1.0-alpha
  • v0.2.0
  • v0.1.0
37 results

GeometryHelpers.h

Blame
  • GeometryHelpers.h 1.03 KiB
    #pragma once
    #include <vector>
    #include "Math/Point2D.h"
    
    // some utility functions that can be shared
    namespace athena::geo {
    
    using Point =  ROOT::Math::XYPoint;
    
    /** Fill rectangles in a ring (disk).
     *
     * @param ref  2D reference point.
     * @param sx   x side length
     * @param sy   y side length
     * @param rmin inner radius of disk
     * @param rmax  outer radius of disk to fill
     * @param phmin  phi min
     * @param phmax phi max
     */
    std::vector<Point> fillRectangles(Point ref, double sx, double sy, double rmin, double rmax,
                                      double phmin = -M_PI, double phmax = M_PI);
    // fill squares in a ring
    inline std::vector<Point> fillSquares(Point ref, double size, double rmin, double rmax,
                                          double phmin = -M_PI, double phmax = M_PI)
    {
        return fillRectangles(ref, size, size, rmin, rmax, phmin, phmax);
    }
    
    std::vector<Point> fillHexagons(Point ref, double lside, double rmin, double rmax,
                                    double phmin = -M_PI, double phmax = M_PI);
    
    } // athena::geo