GENIEGenerator
Loading...
Searching...
No Matches
genie::geometry::GeomVolSelectorRockBox Class Reference

GENIE Interface for limiting vertex selection in the rock to a volume that depends (in part) on the neutrino p4. Uses GeomVolSelectorFiducial to possibly exclude an inner region. More...

#include <GeomVolSelectorRockBox.h>

Inheritance diagram for genie::geometry::GeomVolSelectorRockBox:
[legend]
Collaboration diagram for genie::geometry::GeomVolSelectorRockBox:
[legend]

Public Member Functions

 GeomVolSelectorRockBox ()
virtual ~GeomVolSelectorRockBox ()
void TrimSegment (PathSegment &segment) const
void BeginPSList (const PathSegmentList *untrimmed) const
void EndPSList () const
void SetRockBoxMinimal (Double_t *xyzmin, Double_t *xyzmax)
void SetRockBoxInclusion (Double_t *xyzmin, Double_t *xyzmax)
void SetMinimumWall (Double_t w)
void SetDeDx (Double_t dedx)
void SetExpandFromInclusion (bool how=false)
virtual void ConvertShapeMaster2Top (const ROOTGeomAnalyzer *rgeom)
Public Member Functions inherited from genie::geometry::GeomVolSelectorFiducial
 GeomVolSelectorFiducial ()
virtual ~GeomVolSelectorFiducial ()
void SetReverseFiducial (Bool_t reverse=true)
void AdoptFidShape (FidShape *shape)
void MakeSphere (Double_t x0, Double_t y0, Double_t z0, Double_t radius)
void MakeXCylinder (Double_t y0, Double_t z0, Double_t radius, Double_t xmin, Double_t xmax)
void MakeYCylinder (Double_t x0, Double_t z0, Double_t radius, Double_t ymin, Double_t ymax)
void MakeZCylinder (Double_t x0, Double_t y0, Double_t radius, Double_t zmin, Double_t zmax)
void MakeCylinder (Double_t *base, Double_t *axis, Double_t radius, Double_t *cap1, Double_t *cap2)
void MakeBox (Double_t *xyzmin, Double_t *xyzmax)
void MakeZPolygon (Int_t n, Double_t x0, Double_t y0, Double_t inradius, Double_t phi0deg, Double_t zmin, Double_t zmax)
Public Member Functions inherited from genie::geometry::GeomVolSelectorBasic
 GeomVolSelectorBasic ()
virtual ~GeomVolSelectorBasic ()
void SetVolumeSelection (string volstr)
void SetMediumSelection (string medstr)
void SetMaterialSelection (string matstr)
void SetPathSelection (string pathstr)
Public Member Functions inherited from genie::geometry::GeomVolSelectorI
virtual ~GeomVolSelectorI ()
virtual PathSegmentListGenerateTrimmedList (const PathSegmentList *untrimmed) const
void SetCurrentRay (const TLorentzVector &x4, const TLorentzVector &p4)
 configure for individual neutrino ray
void SetSI2Local (double scale)
 set scale factor for SI to "raydist" units of PathSegmentList
void SetRemoveEntries (bool rmset)
bool GetRemoveEntries ()
void SetNeedPath ()
bool GetNeedPath () const
 allow toggle on only
std::string GetName () const

Protected Member Functions

void MakeRockBox () const
Protected Member Functions inherited from genie::geometry::GeomVolSelectorBasic
void ParseSelection (const string &str, vector< string > &required, vector< string > &forbidden)
bool RejectString (const string &str, const vector< string > &required, const vector< string > &forbidden) const
Protected Member Functions inherited from genie::geometry::GeomVolSelectorI
 GeomVolSelectorI ()
 GeomVolSelectorI (std::string name)

Protected Attributes

Double_t fMinimalXYZMin [3]
Double_t fMinimalXYZMax [3]
 interior box lower corner
Double_t fMinimumWall
 interior box upper corner
Double_t fInclusionXYZMin [3]
 minimum distance around (XYZmin,XYZmax)
Double_t fInclusionXYZMax [3]
 box within which events are always
Double_t fDeDx
 accepted
Bool_t fExpandInclusion
 how to scale from energy to distance
FidShapefRockBoxShape
 expand from minimal or inclusion box?
const ROOTGeomAnalyzerfROOTGeom
 shape changes for every nu ray
RayIntercept fInterceptRock
Protected Attributes inherited from genie::geometry::GeomVolSelectorFiducial
Bool_t fSelectReverse
FidShapefShape
 select for "outside" fiducial?
const PathSegmentListfCurrPathSegmentList
 shape
RayIntercept fIntercept
Protected Attributes inherited from genie::geometry::GeomVolSelectorBasic
vector< string > fRequiredVol
vector< string > fRequiredMed
vector< string > fRequiredMat
vector< string > fRequiredPath
vector< string > fForbiddenVol
vector< string > fForbiddenMed
vector< string > fForbiddenMat
vector< string > fForbiddenPath
Protected Attributes inherited from genie::geometry::GeomVolSelectorI
TLorentzVector fX4
 current neutrino ray's start position (global)
TLorentzVector fP4
 current neutrino ray's momentum (global)
double fScale
 SI->raydist scale factor.
bool fRemoveEntries
 whether selector should remove entries or set hi=lo
bool fNeedPath
 selector needs PathSegment "path" string
std::string fName
 volume selector name

Additional Inherited Members

Static Protected Member Functions inherited from genie::geometry::GeomVolSelectorFiducial
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)

Detailed Description

GENIE Interface for limiting vertex selection in the rock to a volume that depends (in part) on the neutrino p4. Uses GeomVolSelectorFiducial to possibly exclude an inner region.

Author
Robert Hatcher rhatc.nosp@m.her@.nosp@m.fnal..nosp@m.gov FNAL
Created:\n August 5, 2010
License:\n Copyright (c) 2003-2025, The GENIE Collaboration
For the full text of the license visit http://copyright.genie-mc.org

Definition at line 37 of file GeomVolSelectorRockBox.h.

Constructor & Destructor Documentation

◆ GeomVolSelectorRockBox()

GeomVolSelectorRockBox::GeomVolSelectorRockBox ( )

Definition at line 22 of file GeomVolSelectorRockBox.cxx.

24 , fExpandInclusion(false)
26{
27 fName = "RockBox";
28 // base class' fiducial volume always treated as reverse (if even exists)
29 this->SetReverseFiducial(true);
30
31 for (int i=0; i<3; ++i) {
32 fMinimalXYZMin[i] = 0;
33 fMinimalXYZMax[i] = 0;
34 fInclusionXYZMin[i] = 0;
35 fInclusionXYZMax[i] = 0;
36 }
37}
std::string fName
volume selector name
Bool_t fExpandInclusion
how to scale from energy to distance
FidShape * fRockBoxShape
expand from minimal or inclusion box?
Double_t fInclusionXYZMax[3]
box within which events are always
Double_t fInclusionXYZMin[3]
minimum distance around (XYZmin,XYZmax)
Double_t fMinimalXYZMax[3]
interior box lower corner
Double_t fMinimumWall
interior box upper corner
const ROOTGeomAnalyzer * fROOTGeom
shape changes for every nu ray

References fDeDx, fExpandInclusion, fInclusionXYZMax, fInclusionXYZMin, fMinimalXYZMax, fMinimalXYZMin, fMinimumWall, genie::geometry::GeomVolSelectorI::fName, fRockBoxShape, fROOTGeom, genie::geometry::GeomVolSelectorFiducial::GeomVolSelectorFiducial(), and genie::geometry::GeomVolSelectorFiducial::SetReverseFiducial().

◆ ~GeomVolSelectorRockBox()

GeomVolSelectorRockBox::~GeomVolSelectorRockBox ( )
virtual

Definition at line 40 of file GeomVolSelectorRockBox.cxx.

41{
42 if ( fRockBoxShape ) delete fRockBoxShape;
43 fRockBoxShape = 0;
44 fROOTGeom = 0; // was reference only
45}

References fRockBoxShape, and fROOTGeom.

Member Function Documentation

◆ BeginPSList()

void GeomVolSelectorRockBox::BeginPSList ( const PathSegmentList * untrimmed) const
virtual

Every derived version must also respond to a signal that starts a new path segment list processing and ends it. In general they can simply ignore the signal. If the derived class needs to cache something, make it mutable

Reimplemented from genie::geometry::GeomVolSelectorFiducial.

Definition at line 91 of file GeomVolSelectorRockBox.cxx.

92{
93 // A new neutrino ray has been set, calculate the entrance/exit distances.
94
96
97 fCurrPathSegmentList = untrimmed;
98
100
101 if ( ! fRockBoxShape ) {
102 LOG("GeomVolSel", pFATAL) << "no shape defined";
103 fInterceptRock = RayIntercept();
104 } else {
106 fRockBoxShape->Intercept(fCurrPathSegmentList->GetStartPos(),
107 fCurrPathSegmentList->GetDirection());
108 }
109
110 //cout << "BeginPSList: " << endl
111 // << " fid: " << fIntercept << endl
112 // << " rock: " << fInterceptRock << endl;
113
114}
#define pFATAL
Definition Messenger.h:56
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Definition Messenger.h:96
const PathSegmentList * fCurrPathSegmentList
shape
void BeginPSList(const PathSegmentList *untrimmed) const

References genie::geometry::GeomVolSelectorFiducial::BeginPSList(), genie::geometry::GeomVolSelectorFiducial::fCurrPathSegmentList, fInterceptRock, fRockBoxShape, LOG, MakeRockBox(), and pFATAL.

◆ ConvertShapeMaster2Top()

void GeomVolSelectorRockBox::ConvertShapeMaster2Top ( const ROOTGeomAnalyzer * rgeom)
virtual

Reimplemented from genie::geometry::GeomVolSelectorFiducial.

Definition at line 123 of file GeomVolSelectorRockBox.cxx.

124{
126 fROOTGeom = rgeom; // stash away a copy
127}
virtual void ConvertShapeMaster2Top(const ROOTGeomAnalyzer *rgeom)

References genie::geometry::GeomVolSelectorFiducial::ConvertShapeMaster2Top(), and fROOTGeom.

◆ EndPSList()

void GeomVolSelectorRockBox::EndPSList ( ) const
virtual

Reimplemented from genie::geometry::GeomVolSelectorFiducial.

Definition at line 117 of file GeomVolSelectorRockBox.cxx.

118{
119 // Completed current path segment list processsing
120}

◆ MakeRockBox()

void GeomVolSelectorRockBox::MakeRockBox ( ) const
protected

Definition at line 162 of file GeomVolSelectorRockBox.cxx.

163{
164 // This sets parameters for a box
165
166 // expanded box
167 double energy = fP4.Energy();
168 double boxXYZMin[3], boxXYZMax[3];
169 for ( int j = 0; j < 3; ++j ) {
170 double dmin = 0, dmax = 0;
171 double dircos = fCurrPathSegmentList->GetDirection()[j];
172 if ( dircos > 0 ) dmin = dircos*energy/fDeDx; // pad upstream
173 else dmax = -dircos*energy/fDeDx;
174
175//#define RWH_DEBUG
176#ifdef RWH_DEBUG
177 cout << "MakeRockBox [" << j << "] wall " << fMinimumWall
178 << " dm " << dmin << " " << dmax << " dircos " << dircos
179 << " e " << energy << " dedx " << fDeDx << endl;
180#endif
181
182 if ( fExpandInclusion ) {
183 boxXYZMin[j] = fInclusionXYZMin[j] - dmin;
184 boxXYZMax[j] = fInclusionXYZMax[j] + dmax;
185 } else {
186 boxXYZMin[j] = TMath::Min(fMinimalXYZMin[j]-dmin,fInclusionXYZMin[j]);
187 boxXYZMax[j] = TMath::Max(fMinimalXYZMax[j]+dmin,fInclusionXYZMax[j]);
188 }
189 }
190
191 FidPolyhedron* poly = new FidPolyhedron();
192 // careful about sign of "d" vs. direction normal
193 PlaneParam pln0(-1,0,0, boxXYZMin[0]); poly->push_back(pln0);
194 PlaneParam pln1(0,-1,0, boxXYZMin[1]); poly->push_back(pln1);
195 PlaneParam pln2(0,0,-1, boxXYZMin[2]); poly->push_back(pln2);
196 PlaneParam pln3(+1,0,0,-boxXYZMax[0]); poly->push_back(pln3);
197 PlaneParam pln4(0,+1,0,-boxXYZMax[1]); poly->push_back(pln4);
198 PlaneParam pln5(0,0,+1,-boxXYZMax[2]); poly->push_back(pln5);
199
200 if ( fRockBoxShape ) delete fRockBoxShape;
201 fRockBoxShape = poly;
202
203#ifdef RWH_DEBUG
204 static bool first = true;
205 if ( first ) {
206 cout << "MakeRockBox first Minimal min ["
207 << fMinimalXYZMin[0] << ","
208 << fMinimalXYZMin[1] << ","
209 << fMinimalXYZMin[2] << "]"
210 << " max ["
211 << fMinimalXYZMax[0] << ","
212 << fMinimalXYZMax[1] << ","
213 << fMinimalXYZMax[2] << "]" << endl;
214 cout << "MakeRockBox first Inclusion min ["
215 << fInclusionXYZMin[0] << ","
216 << fInclusionXYZMin[1] << ","
217 << fInclusionXYZMin[2] << "]"
218 << " max ["
219 << fInclusionXYZMax[0] << ","
220 << fInclusionXYZMax[1] << ","
221 << fInclusionXYZMax[2] << "]" << endl;
222 first = false;
223 }
224 cout << "MakeRockBox this ray using min ["
225 << boxXYZMin[0] << ","
226 << boxXYZMin[1] << ","
227 << boxXYZMin[2] << "]"
228 << " max ["
229 << boxXYZMax[0] << ","
230 << boxXYZMax[1] << ","
231 << boxXYZMax[2] << "]" << endl;
232 cout << "rock before:" << *fRockBoxShape << endl;
233#endif
234
235 if ( fROOTGeom ) fRockBoxShape->ConvertMaster2Top(fROOTGeom);
236
237#ifdef RWH_DEBUG
238 cout << "rock after: " << *fRockBoxShape << endl;
239 cout << "fid after: " << *fShape << endl;
240#endif
241
242}
void push_back(const PlaneParam &pln)
Definition FidShape.h:140
FidShape * fShape
select for "outside" fiducial?
TLorentzVector fP4
current neutrino ray's momentum (global)

References genie::geometry::GeomVolSelectorFiducial::fCurrPathSegmentList, fDeDx, fExpandInclusion, fInclusionXYZMax, fInclusionXYZMin, fMinimalXYZMax, fMinimalXYZMin, fMinimumWall, genie::geometry::GeomVolSelectorI::fP4, fRockBoxShape, fROOTGeom, genie::geometry::GeomVolSelectorFiducial::fShape, and genie::geometry::FidPolyhedron::push_back().

Referenced by BeginPSList().

◆ SetDeDx()

void genie::geometry::GeomVolSelectorRockBox::SetDeDx ( Double_t dedx)
inline

Definition at line 59 of file GeomVolSelectorRockBox.h.

59{ fDeDx = dedx; }

References fDeDx.

Referenced by CreateRockBoxSelection().

◆ SetExpandFromInclusion()

void genie::geometry::GeomVolSelectorRockBox::SetExpandFromInclusion ( bool how = false)
inline

Definition at line 60 of file GeomVolSelectorRockBox.h.

60{ fExpandInclusion = how; }

References fExpandInclusion.

Referenced by CreateRockBoxSelection().

◆ SetMinimumWall()

void GeomVolSelectorRockBox::SetMinimumWall ( Double_t w)

Definition at line 153 of file GeomVolSelectorRockBox.cxx.

154{
155 fMinimumWall = w;
156 for ( int j = 0; j < 3; ++j ) {
159 }
160}

References fInclusionXYZMax, fInclusionXYZMin, fMinimalXYZMax, fMinimalXYZMin, and fMinimumWall.

Referenced by CreateRockBoxSelection().

◆ SetRockBoxInclusion()

void GeomVolSelectorRockBox::SetRockBoxInclusion ( Double_t * xyzmin,
Double_t * xyzmax )

Definition at line 142 of file GeomVolSelectorRockBox.cxx.

144{
145 // This sets parameters for the inclusion (outer) box
146
147 for ( int j = 0; j < 3; ++j ) {
148 fInclusionXYZMin[j] = TMath::Min(xyzmin[j],xyzmax[j]);
149 fInclusionXYZMax[j] = TMath::Max(xyzmax[j],xyzmax[j]);
150 }
151}

References fInclusionXYZMax, and fInclusionXYZMin.

◆ SetRockBoxMinimal()

void GeomVolSelectorRockBox::SetRockBoxMinimal ( Double_t * xyzmin,
Double_t * xyzmax )

Definition at line 129 of file GeomVolSelectorRockBox.cxx.

131{
132 // This sets parameters for a minimal box
133
134 for ( int j = 0; j < 3; ++j ) {
135 fMinimalXYZMin[j] = TMath::Min(xyzmin[j],xyzmax[j]);
136 fMinimalXYZMax[j] = TMath::Max(xyzmax[j],xyzmax[j]);
137 }
138 // create the default inner (exclusion) box
140}
void MakeBox(Double_t *xyzmin, Double_t *xyzmax)

References fMinimalXYZMax, fMinimalXYZMin, and genie::geometry::GeomVolSelectorFiducial::MakeBox().

Referenced by CreateRockBoxSelection().

◆ TrimSegment()

void GeomVolSelectorRockBox::TrimSegment ( PathSegment & segment) const
virtual

This is the method every derived version must implement To reject a segment outright: segment.fStepRangeSet.clear()

so a miss means blindly accept all segments

Reimplemented from genie::geometry::GeomVolSelectorFiducial.

Definition at line 48 of file GeomVolSelectorRockBox.cxx.

49{
50 // First trim the segment based on the ray vs. cylinder or box
51 // Then trim futher according to the Basic parameters
52
53 if ( ! fInterceptRock.fIsHit ) {
54 // want in rock box, ray misses => reject all segments
55 ps.fStepRangeSet.clear(); //
56 } else {
57 // ray hit rock box volume, some segments steps need rejection, some need splitting...
58 // check the steps in this segment
59 Double_t dist = ps.fRayDist;
60 StepRangeSet::iterator srs_itr = ps.fStepRangeSet.begin();
61 StepRangeSet::iterator srs_end = ps.fStepRangeSet.end();
62 StepRangeSet modifiedStepRangeSet;
63 Bool_t ismod = false;
64
65 // loop over steps within this segement
66 for ( ; srs_itr != srs_end; ++srs_itr ) {
67 Double_t slo = srs_itr->first;
68 Double_t shi = srs_itr->second;
69 Bool_t split = false;
70 StepRange step1, step2;
71 // determine new trimmed or split steps
72 ismod |= NewStepPairs(false,dist,slo,shi,
73 fInterceptRock,split,step1,step2);
74 // build up new step list
75 bool nonzerostep = ( step1.first != step1.second );
76 if ( nonzerostep || ! fRemoveEntries ) {
77 modifiedStepRangeSet.push_back(step1);
78 if (split) {
79 modifiedStepRangeSet.push_back(step2);
80 }
81 }
82 } // loop over step range set elements
83 if ( ismod ) ps.fStepRangeSet = modifiedStepRangeSet;
84
85 } // fIsHit
86
88}
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)
bool fRemoveEntries
whether selector should remove entries or set hi=lo
std::pair< Double_t, Double_t > StepRange
std::vector< StepRange > StepRangeSet

References fInterceptRock, genie::geometry::PathSegment::fRayDist, genie::geometry::GeomVolSelectorI::fRemoveEntries, genie::geometry::PathSegment::fStepRangeSet, genie::geometry::GeomVolSelectorFiducial::NewStepPairs(), and genie::geometry::GeomVolSelectorFiducial::TrimSegment().

Member Data Documentation

◆ fDeDx

Double_t genie::geometry::GeomVolSelectorRockBox::fDeDx
protected

accepted

Definition at line 77 of file GeomVolSelectorRockBox.h.

Referenced by GeomVolSelectorRockBox(), MakeRockBox(), and SetDeDx().

◆ fExpandInclusion

Bool_t genie::geometry::GeomVolSelectorRockBox::fExpandInclusion
protected

how to scale from energy to distance

Definition at line 78 of file GeomVolSelectorRockBox.h.

Referenced by GeomVolSelectorRockBox(), MakeRockBox(), and SetExpandFromInclusion().

◆ fInclusionXYZMax

Double_t genie::geometry::GeomVolSelectorRockBox::fInclusionXYZMax[3]
protected

box within which events are always

Definition at line 76 of file GeomVolSelectorRockBox.h.

Referenced by GeomVolSelectorRockBox(), MakeRockBox(), SetMinimumWall(), and SetRockBoxInclusion().

◆ fInclusionXYZMin

Double_t genie::geometry::GeomVolSelectorRockBox::fInclusionXYZMin[3]
protected

minimum distance around (XYZmin,XYZmax)

Definition at line 75 of file GeomVolSelectorRockBox.h.

Referenced by GeomVolSelectorRockBox(), MakeRockBox(), SetMinimumWall(), and SetRockBoxInclusion().

◆ fInterceptRock

RayIntercept genie::geometry::GeomVolSelectorRockBox::fInterceptRock
mutableprotected

Definition at line 85 of file GeomVolSelectorRockBox.h.

Referenced by BeginPSList(), and TrimSegment().

◆ fMinimalXYZMax

Double_t genie::geometry::GeomVolSelectorRockBox::fMinimalXYZMax[3]
protected

interior box lower corner

Definition at line 73 of file GeomVolSelectorRockBox.h.

Referenced by GeomVolSelectorRockBox(), MakeRockBox(), SetMinimumWall(), and SetRockBoxMinimal().

◆ fMinimalXYZMin

Double_t genie::geometry::GeomVolSelectorRockBox::fMinimalXYZMin[3]
protected

◆ fMinimumWall

Double_t genie::geometry::GeomVolSelectorRockBox::fMinimumWall
protected

interior box upper corner

Definition at line 74 of file GeomVolSelectorRockBox.h.

Referenced by GeomVolSelectorRockBox(), MakeRockBox(), and SetMinimumWall().

◆ fRockBoxShape

FidShape* genie::geometry::GeomVolSelectorRockBox::fRockBoxShape
mutableprotected

expand from minimal or inclusion box?

Definition at line 80 of file GeomVolSelectorRockBox.h.

Referenced by BeginPSList(), GeomVolSelectorRockBox(), MakeRockBox(), and ~GeomVolSelectorRockBox().

◆ fROOTGeom

const ROOTGeomAnalyzer* genie::geometry::GeomVolSelectorRockBox::fROOTGeom
protected

shape changes for every nu ray

Definition at line 82 of file GeomVolSelectorRockBox.h.

Referenced by ConvertShapeMaster2Top(), GeomVolSelectorRockBox(), MakeRockBox(), and ~GeomVolSelectorRockBox().


The documentation for this class was generated from the following files: