Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
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:
genie::geometry::GeomVolSelectorFiducial genie::geometry::GeomVolSelectorBasic genie::geometry::GeomVolSelectorI

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 More...
 
void SetSI2Local (double scale)
 set scale factor for SI to "raydist" units of PathSegmentList More...
 
void SetRemoveEntries (bool rmset)
 
bool GetRemoveEntries ()
 
void SetNeedPath ()
 
bool GetNeedPath () const
 allow toggle on only More...
 
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 More...
 
Double_t fMinimumWall
 interior box upper corner More...
 
Double_t fInclusionXYZMin [3]
 minimum distance around (XYZmin,XYZmax) More...
 
Double_t fInclusionXYZMax [3]
 box within which events are always More...
 
Double_t fDeDx
 accepted More...
 
Bool_t fExpandInclusion
 how to scale from energy to distance More...
 
FidShapefRockBoxShape
 expand from minimal or inclusion box? More...
 
const ROOTGeomAnalyzerfROOTGeom
 shape changes for every nu ray More...
 
RayIntercept fInterceptRock
 
- Protected Attributes inherited from genie::geometry::GeomVolSelectorFiducial
Bool_t fSelectReverse
 
FidShapefShape
 select for "outside" fiducial? More...
 
const PathSegmentListfCurrPathSegmentList
 shape More...
 
RayIntercept fIntercept
 
- Protected Attributes inherited from genie::geometry::GeomVolSelectorBasic
vector< stringfRequiredVol
 
vector< stringfRequiredMed
 
vector< stringfRequiredMat
 
vector< stringfRequiredPath
 
vector< stringfForbiddenVol
 
vector< stringfForbiddenMed
 
vector< stringfForbiddenMat
 
vector< stringfForbiddenPath
 
- Protected Attributes inherited from genie::geometry::GeomVolSelectorI
TLorentzVector fX4
 current neutrino ray's start position (global) More...
 
TLorentzVector fP4
 current neutrino ray's momentum (global) More...
 
double fScale
 SI->raydist scale factor. More...
 
bool fRemoveEntries
 whether selector should remove entries or set hi=lo More...
 
bool fNeedPath
 selector needs PathSegment "path" string More...
 
std::string fName
 volume selector name More...
 

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

August 5, 2010

Copyright (c) 2003-2020, 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 ( )

Definition at line 22 of file GeomVolSelectorRockBox.cxx.

24  , fExpandInclusion(false)
25  , fRockBoxShape(0), fROOTGeom(0)
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 }
Double_t fInclusionXYZMin[3]
minimum distance around (XYZmin,XYZmax)
Double_t fMinimumWall
interior box upper corner
std::string fName
volume selector name
FidShape * fRockBoxShape
expand from minimal or inclusion box?
Double_t fInclusionXYZMax[3]
box within which events are always
const ROOTGeomAnalyzer * fROOTGeom
shape changes for every nu ray
Bool_t fExpandInclusion
how to scale from energy to distance
Double_t fMinimalXYZMax[3]
interior box lower corner
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 }
FidShape * fRockBoxShape
expand from minimal or inclusion box?
const ROOTGeomAnalyzer * fROOTGeom
shape changes for every nu ray

Member Function Documentation

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 
99  MakeRockBox();
100 
101  if ( ! fRockBoxShape ) {
102  LOG("GeomVolSel", pFATAL) << "no shape defined";
104  } else {
108  }
109 
110  //cout << "BeginPSList: " << endl
111  // << " fid: " << fIntercept << endl
112  // << " rock: " << fInterceptRock << endl;
113 
114 }
const TVector3 & GetStartPos() const
#define pFATAL
Definition: Messenger.h:56
const TVector3 & GetDirection() const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
FidShape * fRockBoxShape
expand from minimal or inclusion box?
virtual RayIntercept Intercept(const TVector3 &start, const TVector3 &dir) const =0
void BeginPSList(const PathSegmentList *untrimmed) const
const PathSegmentList * fCurrPathSegmentList
shape
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)
const ROOTGeomAnalyzer * fROOTGeom
shape changes for every nu ray
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 }
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 
236 
237 #ifdef RWH_DEBUG
238  cout << "rock after: " << *fRockBoxShape << endl;
239  cout << "fid after: " << *fShape << endl;
240 #endif
241 
242 }
TLorentzVector fP4
current neutrino ray&#39;s momentum (global)
const TVector3 & GetDirection() const
Double_t fInclusionXYZMin[3]
minimum distance around (XYZmin,XYZmax)
Double_t fMinimumWall
interior box upper corner
FidShape * fRockBoxShape
expand from minimal or inclusion box?
Double_t fInclusionXYZMax[3]
box within which events are always
const ROOTGeomAnalyzer * fROOTGeom
shape changes for every nu ray
virtual void ConvertMaster2Top(const ROOTGeomAnalyzer *rgeom)=0
Bool_t fExpandInclusion
how to scale from energy to distance
FidShape * fShape
select for "outside" fiducial?
void push_back(const PlaneParam &pln)
Definition: FidShape.h:140
QTextStream & endl(QTextStream &s)
Double_t fMinimalXYZMax[3]
interior box lower corner
const PathSegmentList * fCurrPathSegmentList
shape
void genie::geometry::GeomVolSelectorRockBox::SetDeDx ( Double_t  dedx)
inline

Definition at line 59 of file GeomVolSelectorRockBox.h.

59 { fDeDx = dedx; }
void genie::geometry::GeomVolSelectorRockBox::SetExpandFromInclusion ( bool  how = false)
inline

Definition at line 60 of file GeomVolSelectorRockBox.h.

60 { fExpandInclusion = how; }
Bool_t fExpandInclusion
how to scale from energy to distance
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 }
Double_t fInclusionXYZMin[3]
minimum distance around (XYZmin,XYZmax)
Double_t fMinimumWall
interior box upper corner
Double_t fInclusionXYZMax[3]
box within which events are always
Double_t fMinimalXYZMax[3]
interior box lower corner
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 }
Double_t fInclusionXYZMin[3]
minimum distance around (XYZmin,XYZmax)
Double_t fInclusionXYZMax[3]
box within which events are always
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)
Double_t fMinimalXYZMax[3]
interior box lower corner
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 }
intermediate_table::iterator iterator
void TrimSegment(PathSegment &segment) const
std::vector< StepRange > StepRangeSet
Bool_t fIsHit
distance along ray to exit fid volume
Definition: FidShape.h:52
bool fRemoveEntries
whether selector should remove entries or set hi=lo
std::pair< Double_t, Double_t > StepRange
static constexpr double ps
Definition: Units.h:99
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)
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 split(std::string const &s, char c, OutIter dest)
Definition: split.h:35

Member Data Documentation

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

accepted

Definition at line 77 of file GeomVolSelectorRockBox.h.

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

how to scale from energy to distance

Definition at line 78 of file GeomVolSelectorRockBox.h.

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

box within which events are always

Definition at line 76 of file GeomVolSelectorRockBox.h.

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

minimum distance around (XYZmin,XYZmax)

Definition at line 75 of file GeomVolSelectorRockBox.h.

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

Definition at line 85 of file GeomVolSelectorRockBox.h.

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

interior box lower corner

Definition at line 73 of file GeomVolSelectorRockBox.h.

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

Definition at line 72 of file GeomVolSelectorRockBox.h.

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

interior box upper corner

Definition at line 74 of file GeomVolSelectorRockBox.h.

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

expand from minimal or inclusion box?

Definition at line 80 of file GeomVolSelectorRockBox.h.

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

shape changes for every nu ray

Definition at line 82 of file GeomVolSelectorRockBox.h.


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