14 using namespace genie;
15 using namespace genie::geometry;
17 #include <TGeoVolume.h>
18 #include <TGeoMaterial.h>
19 #include <TGeoMedium.h>
22 GeomVolSelectorFiducial::GeomVolSelectorFiducial()
24 , fShape(0), fCurrPathSegmentList(0)
62 for ( ; srs_itr != srs_end; ++srs_itr ) {
63 Double_t slo = srs_itr->first;
64 Double_t shi = srs_itr->second;
71 bool nonzerostep = ( step1.first != step1.second );
73 modifiedStepRangeSet.push_back(step1);
75 modifiedStepRangeSet.push_back(step2);
88 Double_t slo, Double_t shi,
107 bool ismodified =
true;
111 Double_t sdistin = intercept.
fDistIn - raydist;
112 Double_t sdistout = intercept.
fDistOut - raydist;
114 if ( slo < sdistin ) {
115 if ( shi < sdistin ) {
117 if ( selectReverse ) { ismodified =
false; }
119 }
else if ( shi < sdistout ) {
121 if ( selectReverse ) { step1.second = sdistin; }
122 else { step1.first = sdistin; }
125 if ( selectReverse ) { split =
true;
128 else { step1 =
StepRange(sdistin,sdistout); }
130 }
else if ( slo < sdistout ) {
131 if ( shi < sdistout ) {
133 if ( selectReverse ) { step1 =
StepRange(0,0); }
134 else { ismodified =
false; }
137 if ( selectReverse ) { step1.first = sdistout; }
138 else { step1.second = sdistout; }
142 if ( selectReverse ) { ismodified =
false; }
159 LOG(
"GeomVolSel",
pFATAL) <<
"no shape defined";
195 Double_t xmin, Double_t xmax)
198 Double_t base[] = { 0, y0, z0 };
199 Double_t axis[] = { 1, 0, 0 };
200 Double_t cap1[] = { -1, 0, 0, xmin };
201 Double_t cap2[] = { +1, 0, 0, -xmax };
207 Double_t ymin, Double_t ymax)
210 Double_t base[] = { x0, 0, z0 };
211 Double_t axis[] = { 0, 1, 0 };
212 Double_t cap1[] = { 0, -1, 0, ymin };
213 Double_t cap2[] = { 0, +1, 0, -ymax };
219 Double_t zmin, Double_t zmax)
222 Double_t base[] = { x0, y0, 0 };
223 Double_t axis[] = { 0, 0, 1 };
224 Double_t cap1[] = { 0, 0, -1, zmin };
225 Double_t cap2[] = { 0, 0, +1, -zmax };
231 Double_t* cap1, Double_t* cap2)
243 double boxXYZmin[3], boxXYZmax[3];
244 for (
int j = 0; j < 3; ++j ) {
245 boxXYZmin[j] = TMath::Min(xyzmin[j],xyzmax[j]);
246 boxXYZmax[j] = TMath::Max(xyzmin[j],xyzmax[j]);
263 Double_t phi0deg, Double_t zmin, Double_t zmax)
270 Double_t dphir = TMath::TwoPi()/n;
271 Double_t phi0r = phi0deg * TMath::DegToRad();
272 for (
int iface = 0; iface < n; ++iface ) {
273 Double_t dx = TMath::Cos(dphir*iface + phi0r);
274 Double_t dy = TMath::Sin(dphir*iface + phi0r);
Some simple volumes that know how to calculate where a ray intercepts them.
void MakeSphere(Double_t x0, Double_t y0, Double_t z0, Double_t radius)
const TVector3 & GetStartPos() const
void TrimSegment(PathSegment &segment) const
std::vector< StepRange > StepRangeSet
void MakeZCylinder(Double_t x0, Double_t y0, Double_t radius, Double_t zmin, Double_t zmax)
Bool_t fIsHit
distance along ray to exit fid volume
StepRangeSet fStepRangeSet
collection of {steplo,stephi} pairs
void MakeCylinder(Double_t *base, Double_t *axis, Double_t radius, Double_t *cap1, Double_t *cap2)
void MakeXCylinder(Double_t y0, Double_t z0, Double_t radius, Double_t xmin, Double_t xmax)
virtual void ConvertShapeMaster2Top(const ROOTGeomAnalyzer *rgeom)
Object to be filled with the neutrino path-segments representing geometry volume steps (generally bou...
const TVector3 & GetDirection() const
void AdoptFidShape(FidShape *shape)
virtual ~GeomVolSelectorFiducial()
std::string fName
volume selector name
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void MakeYCylinder(Double_t x0, Double_t z0, Double_t radius, Double_t ymin, Double_t ymax)
bool fRemoveEntries
whether selector should remove entries or set hi=lo
void MakeZPolygon(Int_t n, Double_t x0, Double_t y0, Double_t inradius, Double_t phi0deg, Double_t zmin, Double_t zmax)
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 constexpr double ps
Double_t fRayDist
distance from start of ray
virtual RayIntercept Intercept(const TVector3 &start, const TVector3 &dir) const =0
virtual void ConvertMaster2Top(const ROOTGeomAnalyzer *rgeom)=0
Double_t fDistOut
distance along ray to enter fid volume
void TrimSegment(PathSegment &segment) const
static Bool_t NewStepPairs(Bool_t selectReverse, Double_t raydist, Double_t slo, Double_t shi, const RayIntercept &intercept, Bool_t &split, StepRange &step1, StepRange &step2)
void BeginPSList(const PathSegmentList *untrimmed) const
void MakeBox(Double_t *xyzmin, Double_t *xyzmax)
FidShape * fShape
select for "outside" fiducial?
void push_back(const PlaneParam &pln)
void BeginPSList(const PathSegmentList *untrimmed) const
const PathSegmentList * fCurrPathSegmentList
shape