GeomVolSelectorFiducial.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::geometry::GeomVolSelectorFiducial
5 
6 \brief GENIE Interface for user-defined volume selector functors
7  Trim path segments based on the intersection with a cylinder, box
8  or sphere as well as everything the Basic selector can do.
9 
10  Assumes that the fiducial volume is defined in the same coords
11  and units as the PathSegmentList ("top vol") and that the ray
12  always starts outside the defined volume. (If not user should
13  cap the fid volume just down from the flux window or use the
14  SetUpstreamZ() in the flux driver to push the ray back to make it so).
15 
16 \author Robert Hatcher <rhatcher@fnal.gov>
17  FNAL
18 
19 \created July 14, 2010
20 
21 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
22  For the full text of the license visit http://copyright.genie-mc.org
23 */
24 //____________________________________________________________________________
25 
26 #ifndef _GEOM_VOL_SELECTOR_FIDUCIAL_H_
27 #define _GEOM_VOL_SELECTOR_FIDUCIAL_H_
28 
29 #include <string>
30 #include <vector>
31 
32 #include "TMath.h"
33 #include "TLorentzVector.h"
37 
38 using namespace std;
39 
40 namespace genie {
41 namespace geometry {
42 
44 
45 public :
47  virtual ~GeomVolSelectorFiducial();
48 
49  //
50  // define the missing part of the GeomVolSelectorI interface:
51  //
52  void TrimSegment(PathSegment& segment) const;
53  void BeginPSList(const PathSegmentList* untrimmed) const;
54  void EndPSList() const;
55 
56  // allow the selection to be reversed (i.e. exclude "fid" region)
57  void SetReverseFiducial(Bool_t reverse=true) { fSelectReverse = reverse; }
58 
59  //
60  // set fiducial volume parameter (call only one)
61  // in "top vol" coordinates and units
62  //
63  void AdoptFidShape(FidShape* shape);
64  void MakeSphere(Double_t x0, Double_t y0, Double_t z0, Double_t radius);
65  void MakeXCylinder(Double_t y0, Double_t z0, Double_t radius, Double_t xmin, Double_t xmax);
66  void MakeYCylinder(Double_t x0, Double_t z0, Double_t radius, Double_t ymin, Double_t ymax);
67  void MakeZCylinder(Double_t x0, Double_t y0, Double_t radius, Double_t zmin, Double_t zmax);
68  void MakeCylinder(Double_t* base, Double_t* axis, Double_t radius, Double_t* cap1, Double_t* cap2);
69  void MakeBox(Double_t* xyzmin, Double_t* xyzmax);
70  void MakeZPolygon(Int_t n, Double_t x0, Double_t y0, Double_t inradius, Double_t phi0deg, Double_t zmin, Double_t zmax);
71 
72  // by default shapes are assumed to be in "top vol" coordinates
73  // in the case where they are entered in master coordinates
74  // ask the configured shape to convert itself
75  // (do this only once for any shape definition)
76  virtual void ConvertShapeMaster2Top(const ROOTGeomAnalyzer* rgeom);
77 
78 protected:
79 
80  static Bool_t NewStepPairs(Bool_t selectReverse,
81  Double_t raydist, Double_t slo, Double_t shi,
82  const RayIntercept& intercept, Bool_t& split,
83  StepRange& step1, StepRange& step2);
84 
85  Bool_t fSelectReverse; /// select for "outside" fiducial?
86 
87  FidShape* fShape; /// shape
88 
89  // values calculated during BeginPSList():
90  mutable const PathSegmentList* fCurrPathSegmentList; // reference only, for ray info
91  mutable RayIntercept fIntercept; // current intercept parameters
92 
93 };
94 
95 } // geometry namespace
96 } // genie namespace
97 
98 #endif // _GEOM_VOL_SELECTOR_FIDUCIAL_H_
Some simple volumes that know how to calculate where a ray intercepts them.
Definition: FidShape.h:90
GENIE Interface for user-defined volume selector functors Trim path segments based on the intersectio...
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
STL namespace.
Object to be filled with the neutrino path-segments representing geometry volume steps (generally bou...
std::void_t< T > n
A ROOT/GEANT4 geometry driver.
GENIE Interface for user-defined volume selector functors This basic version allows configurations th...
std::pair< Double_t, Double_t > StepRange
static unsigned int reverse(QString &chars, unsigned char *level, unsigned int a, unsigned int b)
Definition: qstring.cpp:11649
void split(std::string const &s, char c, OutIter dest)
Definition: split.h:35
FidShape * fShape
select for "outside" fiducial?
const PathSegmentList * fCurrPathSegmentList
shape