Public Member Functions | Protected Member Functions | Static 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 "/cvmfs/nova.opensciencegrid.org/externals/genie/v3_00_06_p01/Linux64bit+2.6-2.12-e17-debug/GENIE-Generator/src/Tools/Geometry/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)
 
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 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)
 
void SetVolumeSelection (string volstr)
 
void SetMediumSelection (string medstr)
 
void SetMaterialSelection (string matstr)
 
void SetPathSelection (string pathstr)
 
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
 
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
 

Static Protected Member Functions

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)
 

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
 
Bool_t fSelectReverse
 
FidShapefShape
 select for "outside" fiducial? More...
 
const PathSegmentListfCurrPathSegmentList
 shape More...
 
RayIntercept fIntercept
 
vector< stringfRequiredVol
 
vector< stringfRequiredMed
 
vector< stringfRequiredMat
 
vector< stringfRequiredPath
 
vector< stringfForbiddenVol
 
vector< stringfForbiddenMed
 
vector< stringfForbiddenMat
 
vector< stringfForbiddenPath
 
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...
 

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-2019, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org or see $GENIE/LICENSE

Definition at line 40 of file GeomVolSelectorRockBox.h.

Constructor & Destructor Documentation

GeomVolSelectorRockBox::GeomVolSelectorRockBox ( )

Definition at line 26 of file GeomVolSelectorRockBox.cxx.

References fInclusionXYZMax, fInclusionXYZMin, fMinimalXYZMax, fMinimalXYZMin, genie::geometry::GeomVolSelectorI::fName, MECModelEnuComparisons::i, and genie::geometry::GeomVolSelectorFiducial::SetReverseFiducial().

28  , fExpandInclusion(false)
29  , fRockBoxShape(0), fROOTGeom(0)
30 {
31  fName = "RockBox";
32  // base class' fiducial volume always treated as reverse (if even exists)
33  this->SetReverseFiducial(true);
34 
35  for (int i=0; i<3; ++i) {
36  fMinimalXYZMin[i] = 0;
37  fMinimalXYZMax[i] = 0;
38  fInclusionXYZMin[i] = 0;
39  fInclusionXYZMax[i] = 0;
40  }
41 }
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 44 of file GeomVolSelectorRockBox.cxx.

References fRockBoxShape, and fROOTGeom.

45 {
46  if ( fRockBoxShape ) delete fRockBoxShape;
47  fRockBoxShape = 0;
48  fROOTGeom = 0; // was reference only
49 }
FidShape * fRockBoxShape
expand from minimal or inclusion box?
const ROOTGeomAnalyzer * fROOTGeom
shape changes for every nu ray

Member Function Documentation

void GeomVolSelectorFiducial::AdoptFidShape ( FidShape shape)
inherited
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 95 of file GeomVolSelectorRockBox.cxx.

References genie::geometry::GeomVolSelectorFiducial::BeginPSList(), genie::geometry::GeomVolSelectorFiducial::fCurrPathSegmentList, fInterceptRock, fRockBoxShape, genie::geometry::PathSegmentList::GetDirection(), genie::geometry::PathSegmentList::GetStartPos(), genie::geometry::FidShape::Intercept(), LOG, MakeRockBox(), and pFATAL.

96 {
97  // A new neutrino ray has been set, calculate the entrance/exit distances.
98 
100 
101  fCurrPathSegmentList = untrimmed;
102 
103  MakeRockBox();
104 
105  if ( ! fRockBoxShape ) {
106  LOG("GeomVolSel", pFATAL) << "no shape defined";
108  } else {
109  fInterceptRock =
112  }
113 
114  //cout << "BeginPSList: " << endl
115  // << " fid: " << fIntercept << endl
116  // << " rock: " << fInterceptRock << endl;
117 
118 }
const TVector3 & GetStartPos() const
#define pFATAL
Definition: Messenger.h:57
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:97
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 127 of file GeomVolSelectorRockBox.cxx.

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

128 {
130  fROOTGeom = rgeom; // stash away a copy
131 }
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 121 of file GeomVolSelectorRockBox.cxx.

122 {
123  // Completed current path segment list processsing
124 }
PathSegmentList * GeomVolSelectorI::GenerateTrimmedList ( const PathSegmentList untrimmed) const
virtualinherited

create and return a new PathSegmentList from the old list relinquishes ownership of returned object

Definition at line 57 of file GeomVolSelectorI.cxx.

References genie::geometry::PathSegmentList::AddSegment(), genie::geometry::GeomVolSelectorI::BeginPSList(), genie::geometry::GeomVolSelectorI::EndPSList(), genie::geometry::GeomVolSelectorI::fRemoveEntries, genie::geometry::PathSegmentList::GetDirection(), genie::geometry::PathSegmentList::GetPathSegmentV(), genie::geometry::PathSegmentList::GetStartPos(), genie::geometry::PathSegment::GetSummedStepRange(), nd_projection_maker::ps, genie::geometry::PathSegmentList::SetStartInfo(), and genie::geometry::GeomVolSelectorI::TrimSegment().

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

58 {
59  this->BeginPSList(untrimmed);
60 
61  PathSegmentList* trimmed = new PathSegmentList();
62  trimmed->SetStartInfo(untrimmed->GetStartPos(),untrimmed->GetDirection());
63 
65  untrimmed->GetPathSegmentV();
67  genie::geometry::PathSegmentList::PathSegVCItr_t sitr_end = segments.end();
68 
69  for ( ; sitr != sitr_end ; ++sitr ) {
70  PathSegment ps = *sitr; // new PathSegment is a copy of old
71  this->TrimSegment(ps);
72  if ( fRemoveEntries && ps.GetSummedStepRange() == 0 ) continue; // remove null segments
73  // now put (adjusted) entry on trimmed list
74  trimmed->AddSegment(ps);
75  }
76 
77  this->EndPSList();
78 
79  return trimmed;
80 }
const TVector3 & GetStartPos() const
virtual void TrimSegment(PathSegment &segment) const =0
virtual void BeginPSList(const PathSegmentList *untrimmed) const =0
void AddSegment(const PathSegment &ps)
Object to be filled with the neutrino path-segments representing geometry volume steps (generally bou...
const TVector3 & GetDirection() const
PathSegmentV_t::const_iterator PathSegVCItr_t
bool fRemoveEntries
whether selector should remove entries or set hi=lo
void SetStartInfo(const TVector3 &pos=TVector3(0, 0, 1e37), const TVector3 &dir=TVector3(0, 0, 0))
Double_t GetSummedStepRange() const
get the sum of all the step range (in case step has been trimmed or split)
const PathSegmentV_t & GetPathSegmentV(void) const
virtual void EndPSList() const =0
std::list< PathSegment > PathSegmentV_t
std::string genie::geometry::GeomVolSelectorI::GetName ( ) const
inlineinherited
bool genie::geometry::GeomVolSelectorI::GetNeedPath ( ) const
inlineinherited

allow toggle on only

Definition at line 65 of file GeomVolSelectorI.h.

References genie::geometry::GeomVolSelectorI::fNeedPath.

Referenced by genie::geometry::ROOTGeomAnalyzer::SwimOnce().

65 { return fNeedPath; }
bool fNeedPath
selector needs PathSegment "path" string
bool genie::geometry::GeomVolSelectorI::GetRemoveEntries ( )
inlineinherited

Definition at line 62 of file GeomVolSelectorI.h.

References genie::geometry::GeomVolSelectorI::fRemoveEntries.

62 { return fRemoveEntries; }
bool fRemoveEntries
whether selector should remove entries or set hi=lo
void GeomVolSelectorFiducial::MakeBox ( Double_t *  xyzmin,
Double_t *  xyzmax 
)
inherited

Definition at line 219 of file GeomVolSelectorFiducial.cxx.

References genie::geometry::GeomVolSelectorFiducial::AdoptFidShape(), calib::j, and genie::geometry::FidPolyhedron::push_back().

Referenced by CreateFidSelection(), CreateRockBoxSelection(), and SetRockBoxMinimal().

220 {
221  // This sets parameters for a box
222 
223  double boxXYZmin[3], boxXYZmax[3];
224  for ( int j = 0; j < 3; ++j ) {
225  boxXYZmin[j] = TMath::Min(xyzmin[j],xyzmax[j]);
226  boxXYZmax[j] = TMath::Max(xyzmin[j],xyzmax[j]);
227  }
228 
229  FidPolyhedron* poly = new FidPolyhedron();
230  // careful about sign of "d" vs. direction normal
231  PlaneParam pln0(-1,0,0, boxXYZmin[0]); poly->push_back(pln0);
232  PlaneParam pln1(0,-1,0, boxXYZmin[1]); poly->push_back(pln1);
233  PlaneParam pln2(0,0,-1, boxXYZmin[2]); poly->push_back(pln2);
234  PlaneParam pln3(+1,0,0,-boxXYZmax[0]); poly->push_back(pln3);
235  PlaneParam pln4(0,+1,0,-boxXYZmax[1]); poly->push_back(pln4);
236  PlaneParam pln5(0,0,+1,-boxXYZmax[2]); poly->push_back(pln5);
237 
238  AdoptFidShape(poly);
239 }
const double j
Definition: BetheBloch.cxx:29
void push_back(const PlaneParam &pln)
Definition: FidShape.h:141
void GeomVolSelectorFiducial::MakeCylinder ( Double_t *  base,
Double_t *  axis,
Double_t  radius,
Double_t *  cap1,
Double_t *  cap2 
)
inherited

Definition at line 210 of file GeomVolSelectorFiducial.cxx.

References genie::geometry::GeomVolSelectorFiducial::AdoptFidShape().

Referenced by genie::geometry::GeomVolSelectorFiducial::MakeZCylinder().

212 {
213  // This sets parameters for a cylinder
214  AdoptFidShape(new FidCylinder(TVector3(base),TVector3(axis),radius,
215  PlaneParam(cap1),PlaneParam(cap2)));
216 }
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
Double_t radius
void GeomVolSelectorRockBox::MakeRockBox ( ) const
protected

Definition at line 166 of file GeomVolSelectorRockBox.cxx.

References genie::geometry::FidShape::ConvertMaster2Top(), om::cout, allTimeWatchdog::endl, energy, genie::geometry::GeomVolSelectorFiducial::fCurrPathSegmentList, fDeDx, fExpandInclusion, fInclusionXYZMax, fInclusionXYZMin, fMinimalXYZMax, fMinimalXYZMin, fMinimumWall, genie::geometry::GeomVolSelectorI::fP4, fRockBoxShape, fROOTGeom, genie::geometry::GeomVolSelectorFiducial::fShape, genie::geometry::PathSegmentList::GetDirection(), calib::j, and genie::geometry::FidPolyhedron::push_back().

Referenced by BeginPSList().

167 {
168  // This sets parameters for a box
169 
170  // expanded box
171  double energy = fP4.Energy();
172  double boxXYZMin[3], boxXYZMax[3];
173  for ( int j = 0; j < 3; ++j ) {
174  double dmin = 0, dmax = 0;
175  double dircos = fCurrPathSegmentList->GetDirection()[j];
176  if ( dircos > 0 ) dmin = dircos*energy/fDeDx; // pad upstream
177  else dmax = -dircos*energy/fDeDx;
178 
179 //#define RWH_DEBUG
180 #ifdef RWH_DEBUG
181  cout << "MakeRockBox [" << j << "] wall " << fMinimumWall
182  << " dm " << dmin << " " << dmax << " dircos " << dircos
183  << " e " << energy << " dedx " << fDeDx << endl;
184 #endif
185 
186  if ( fExpandInclusion ) {
187  boxXYZMin[j] = fInclusionXYZMin[j] - dmin;
188  boxXYZMax[j] = fInclusionXYZMax[j] + dmax;
189  } else {
190  boxXYZMin[j] = TMath::Min(fMinimalXYZMin[j]-dmin,fInclusionXYZMin[j]);
191  boxXYZMax[j] = TMath::Max(fMinimalXYZMax[j]+dmin,fInclusionXYZMax[j]);
192  }
193  }
194 
195  FidPolyhedron* poly = new FidPolyhedron();
196  // careful about sign of "d" vs. direction normal
197  PlaneParam pln0(-1,0,0, boxXYZMin[0]); poly->push_back(pln0);
198  PlaneParam pln1(0,-1,0, boxXYZMin[1]); poly->push_back(pln1);
199  PlaneParam pln2(0,0,-1, boxXYZMin[2]); poly->push_back(pln2);
200  PlaneParam pln3(+1,0,0,-boxXYZMax[0]); poly->push_back(pln3);
201  PlaneParam pln4(0,+1,0,-boxXYZMax[1]); poly->push_back(pln4);
202  PlaneParam pln5(0,0,+1,-boxXYZMax[2]); poly->push_back(pln5);
203 
204  if ( fRockBoxShape ) delete fRockBoxShape;
205  fRockBoxShape = poly;
206 
207 #ifdef RWH_DEBUG
208  static bool first = true;
209  if ( first ) {
210  cout << "MakeRockBox first Minimal min ["
211  << fMinimalXYZMin[0] << ","
212  << fMinimalXYZMin[1] << ","
213  << fMinimalXYZMin[2] << "]"
214  << " max ["
215  << fMinimalXYZMax[0] << ","
216  << fMinimalXYZMax[1] << ","
217  << fMinimalXYZMax[2] << "]" << endl;
218  cout << "MakeRockBox first Inclusion min ["
219  << fInclusionXYZMin[0] << ","
220  << fInclusionXYZMin[1] << ","
221  << fInclusionXYZMin[2] << "]"
222  << " max ["
223  << fInclusionXYZMax[0] << ","
224  << fInclusionXYZMax[1] << ","
225  << fInclusionXYZMax[2] << "]" << endl;
226  first = false;
227  }
228  cout << "MakeRockBox this ray using min ["
229  << boxXYZMin[0] << ","
230  << boxXYZMin[1] << ","
231  << boxXYZMin[2] << "]"
232  << " max ["
233  << boxXYZMax[0] << ","
234  << boxXYZMax[1] << ","
235  << boxXYZMax[2] << "]" << endl;
236  cout << "rock before:" << *fRockBoxShape << endl;
237 #endif
238 
240 
241 #ifdef RWH_DEBUG
242  cout << "rock after: " << *fRockBoxShape << endl;
243  cout << "fid after: " << *fShape << endl;
244 #endif
245 
246 }
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
double energy
Definition: plottest35.C:25
FidShape * fRockBoxShape
expand from minimal or inclusion box?
Double_t fInclusionXYZMax[3]
box within which events are always
const double j
Definition: BetheBloch.cxx:29
OStream cout
Definition: OStream.cxx:6
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:141
Double_t fMinimalXYZMax[3]
interior box lower corner
const PathSegmentList * fCurrPathSegmentList
shape
void GeomVolSelectorFiducial::MakeSphere ( Double_t  x0,
Double_t  y0,
Double_t  z0,
Double_t  radius 
)
inherited
void GeomVolSelectorFiducial::MakeZCylinder ( Double_t  x0,
Double_t  y0,
Double_t  radius,
Double_t  zmin,
Double_t  zmax 
)
inherited

Definition at line 198 of file GeomVolSelectorFiducial.cxx.

References allInOneTrainingPlots::axis, and genie::geometry::GeomVolSelectorFiducial::MakeCylinder().

Referenced by CreateFidSelection().

200 {
201  // This sets parameters for a cylinder parallel to the z-axis
202  Double_t base[] = { x0, y0, 0 };
203  Double_t axis[] = { 0, 0, 1 };
204  Double_t cap1[] = { 0, 0, -1, zmin };
205  Double_t cap2[] = { 0, 0, +1, -zmax }; // note sign change
206  this->MakeCylinder(base,axis,radius,cap1,cap2);
207 }
void MakeCylinder(Double_t *base, Double_t *axis, Double_t radius, Double_t *cap1, Double_t *cap2)
const XML_Char int const XML_Char int const XML_Char * base
Definition: expat.h:331
Double_t radius
void GeomVolSelectorFiducial::MakeZPolygon ( Int_t  n,
Double_t  x0,
Double_t  y0,
Double_t  inradius,
Double_t  phi0deg,
Double_t  zmin,
Double_t  zmax 
)
inherited

Definition at line 242 of file GeomVolSelectorFiducial.cxx.

References genie::geometry::GeomVolSelectorFiducial::AdoptFidShape(), dx, dy, getGoodRuns4SAM::n, and genie::geometry::FidPolyhedron::push_back().

Referenced by CreateFidSelection().

244 {
245  // phi=0 will put flat face towards +x
246  // inscribed radius
247 
248  FidPolyhedron* poly = new FidPolyhedron();
249 
250  Double_t dphir = TMath::TwoPi()/n;
251  Double_t phi0r = phi0deg * TMath::DegToRad();
252  for ( int iface = 0; iface < n; ++iface ) {
253  Double_t dx = TMath::Cos(dphir*iface + phi0r);
254  Double_t dy = TMath::Sin(dphir*iface + phi0r);
255  PlaneParam face(dx,dy,0,-inradius-dx*x0-dy*y0); poly->push_back(face);
256  }
257  PlaneParam plnz1(0,0,-1, zmin); poly->push_back(plnz1);
258  PlaneParam plnz2(0,0,+1,-zmax); poly->push_back(plnz2);
259 
260  AdoptFidShape(poly);
261 }
double dy[NP][NC]
double dx[NP][NC]
void push_back(const PlaneParam &pln)
Definition: FidShape.h:141
Bool_t GeomVolSelectorFiducial::NewStepPairs ( Bool_t  selectReverse,
Double_t  raydist,
Double_t  slo,
Double_t  shi,
const RayIntercept intercept,
Bool_t &  split,
StepRange step1,
StepRange step2 
)
staticprotectedinherited

Definition at line 91 of file GeomVolSelectorFiducial.cxx.

References genie::geometry::RayIntercept::fDistIn, and genie::geometry::RayIntercept::fDistOut.

Referenced by TrimSegment(), and genie::geometry::GeomVolSelectorFiducial::TrimSegment().

96 {
97  // modifying a step based on a range
98  // there seem to be six possible cases:
99  // step: |===| {slo,shi}
100  //
101  // range: in out
102  // # # normal reverse
103  // 0 |===| # # {0,0} {slo,shi}
104  // 1 |==#==| # {in,shi} {slo,in}
105  // 2 |==#========#==| {in,out} {slo,in}+{out,shi}
106  // 3 # |==| # {slo,shi} {0,0}
107  // 4 # |==#==| {slo,out} {out,shi}
108  // 5 # # |====| {0,0} {slo,shi}
109  // # #
110  //
111  bool ismodified = true;
112  step1 = StepRange(slo,shi);
113  split = false;
114  // dist in/out are relative to the ray origin
115  Double_t sdistin = intercept.fDistIn - raydist;
116  Double_t sdistout = intercept.fDistOut - raydist;
117  // do remaining calculations relative to steps within this segment
118  if ( slo < sdistin ) {
119  if ( shi < sdistin ) {
120  // case 0
121  if ( selectReverse ) { ismodified = false; }
122  else { step1 = StepRange(0,0); }
123  } else if ( shi < sdistout ) {
124  // case 1
125  if ( selectReverse ) { step1.second = sdistin; }
126  else { step1.first = sdistin; }
127  } else {
128  // case 2
129  if ( selectReverse ) { split = true;
130  step1 = StepRange(slo,sdistin);
131  step2 = StepRange(sdistout,shi); }
132  else { step1 = StepRange(sdistin,sdistout); }
133  }
134  } else if ( slo < sdistout ) {
135  if ( shi < sdistout ) {
136  // case 3
137  if ( selectReverse ) { step1 = StepRange(0,0); }
138  else { ismodified = false; }
139  } else {
140  // case 4
141  if ( selectReverse ) { step1.first = sdistout; }
142  else { step1.second = sdistout; }
143  }
144  } else {
145  // case 5
146  if ( selectReverse ) { ismodified = false; }
147  else { step1 = StepRange(0,0); }
148  }
149 
150  return ismodified;
151 }
void split(double tt, double *fr)
std::pair< Double_t, Double_t > StepRange
Double_t fDistOut
distance along ray to enter fid volume
Definition: FidShape.h:52
void GeomVolSelectorBasic::ParseSelection ( const string str,
vector< string > &  required,
vector< string > &  forbidden 
)
protectedinherited

Definition at line 120 of file GeomVolSelectorBasic.cxx.

References MECModelEnuComparisons::i, getGoodRuns4SAM::n, and genie::utils::str::Split().

Referenced by genie::geometry::GeomVolSelectorBasic::SetMaterialSelection(), genie::geometry::GeomVolSelectorBasic::SetMediumSelection(), genie::geometry::GeomVolSelectorBasic::SetPathSelection(), and genie::geometry::GeomVolSelectorBasic::SetVolumeSelection().

123 {
124  required.clear();
125  forbidden.clear();
126  vector<string> pieces = genie::utils::str::Split(strall,":;,");
127  size_t n = pieces.size();
128  for ( size_t i = 0; i < n; ++i ) {
129  string& strone = pieces[i];
130  if ( strone == "" ) continue; // reject null strings
131  if ( strone.find("-") == 0 ) forbidden.push_back(strone.substr(1,std::string::npos));
132  else if ( strone.find("+") == 0 ) required.push_back(strone.substr(1,std::string::npos));
133  else required.push_back(strone);
134  }
135 }
vector< string > Split(string input, string delim)
Definition: StringUtils.cxx:42
bool GeomVolSelectorBasic::RejectString ( const string str,
const vector< string > &  required,
const vector< string > &  forbidden 
) const
protectedinherited

Definition at line 137 of file GeomVolSelectorBasic.cxx.

References modifyFHiCL::found.

Referenced by genie::geometry::GeomVolSelectorBasic::TrimSegment().

140 {
141  bool reject = false;
142 
143  // must have at least one of the required elements (if there are any)
144  size_t nrequired = required.size();
145  if ( nrequired > 0 ) {
146  bool found = false;
147  for (size_t jr = 0; jr < nrequired; ++jr) {
148  if ( str.find(required[jr]) != std::string::npos ) {
149  found = true;
150  break; // found at least one case, so we're good
151  }
152  }
153  if ( ! found ) reject = true;
154  }
155 
156  // can not have any of the forbidden elements
157  size_t nforbidden = forbidden.size();
158  if ( nforbidden > 0 ) {
159  for (size_t jf = 0; jf < nforbidden; ++jf) {
160  if ( str.find(forbidden[jf]) != std::string::npos ) {
161  reject = true;
162  break; // found at least one case, so we can reject
163  }
164  }
165  }
166 
167  return reject;
168 }
void genie::geometry::GeomVolSelectorI::SetCurrentRay ( const TLorentzVector &  x4,
const TLorentzVector &  p4 
)
inlineinherited

configure for individual neutrino ray

Definition at line 55 of file GeomVolSelectorI.h.

References genie::geometry::GeomVolSelectorI::fP4, genie::geometry::GeomVolSelectorI::fX4, and make_associated_cosmic_defs::p4.

Referenced by genie::geometry::ROOTGeomAnalyzer::ComputePathLengths().

56  { fX4 = x4; fP4 = p4; }
TLorentzVector fP4
current neutrino ray&#39;s momentum (global)
TLorentzVector fX4
current neutrino ray&#39;s start position (global)
void genie::geometry::GeomVolSelectorRockBox::SetDeDx ( Double_t  dedx)
inline

Definition at line 62 of file GeomVolSelectorRockBox.h.

Referenced by CreateRockBoxSelection().

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

Definition at line 63 of file GeomVolSelectorRockBox.h.

Referenced by CreateRockBoxSelection().

63 { fExpandInclusion = how; }
Bool_t fExpandInclusion
how to scale from energy to distance
void GeomVolSelectorBasic::SetMaterialSelection ( string  matstr)
inherited
void GeomVolSelectorBasic::SetMediumSelection ( string  medstr)
inherited
void GeomVolSelectorRockBox::SetMinimumWall ( Double_t  w)

Definition at line 157 of file GeomVolSelectorRockBox.cxx.

References fInclusionXYZMax, fInclusionXYZMin, fMinimalXYZMax, fMinimalXYZMin, fMinimumWall, calib::j, and w.

Referenced by CreateRockBoxSelection().

158 {
159  fMinimumWall = w;
160  for ( int j = 0; j < 3; ++j ) {
163  }
164 }
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
const double j
Definition: BetheBloch.cxx:29
Float_t w
Definition: plot.C:20
Double_t fMinimalXYZMax[3]
interior box lower corner
void genie::geometry::GeomVolSelectorI::SetNeedPath ( )
inlineinherited

Definition at line 64 of file GeomVolSelectorI.h.

References genie::geometry::GeomVolSelectorI::fNeedPath.

Referenced by genie::geometry::GeomVolSelectorBasic::SetPathSelection().

64 { fNeedPath = true; } /// allow toggle *on* only
bool fNeedPath
selector needs PathSegment "path" string
void GeomVolSelectorBasic::SetPathSelection ( string  pathstr)
inherited

Definition at line 59 of file GeomVolSelectorBasic.cxx.

References genie::geometry::GeomVolSelectorBasic::fForbiddenPath, genie::geometry::GeomVolSelectorBasic::fRequiredPath, LOG, genie::geometry::GeomVolSelectorBasic::ParseSelection(), pFATAL, and genie::geometry::GeomVolSelectorI::SetNeedPath().

60 {
62  if ( fRequiredPath.size() > 0 || fForbiddenPath.size() > 0 ) {
63 #ifdef PATHSEG_KEEP_PATH
64  SetNeedPath();
65 #else
66  LOG("GeomVolSelectorBasic", pFATAL)
67  << "PathSegment is not defined to hold fPathString -- selectors can not cut on it";
68 #endif
69  }
70 }
#define pFATAL
Definition: Messenger.h:57
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:97
void ParseSelection(const string &str, vector< string > &required, vector< string > &forbidden)
void genie::geometry::GeomVolSelectorI::SetRemoveEntries ( bool  rmset)
inlineinherited

Definition at line 61 of file GeomVolSelectorI.h.

References genie::geometry::GeomVolSelectorI::fRemoveEntries.

Referenced by CreateFidSelection(), and CreateRockBoxSelection().

61 { fRemoveEntries = rmset; }
bool fRemoveEntries
whether selector should remove entries or set hi=lo
void genie::geometry::GeomVolSelectorFiducial::SetReverseFiducial ( Bool_t  reverse = true)
inlineinherited
void GeomVolSelectorRockBox::SetRockBoxInclusion ( Double_t *  xyzmin,
Double_t *  xyzmax 
)

Definition at line 146 of file GeomVolSelectorRockBox.cxx.

References fInclusionXYZMax, fInclusionXYZMin, and calib::j.

148 {
149  // This sets parameters for the inclusion (outer) box
150 
151  for ( int j = 0; j < 3; ++j ) {
152  fInclusionXYZMin[j] = TMath::Min(xyzmin[j],xyzmax[j]);
153  fInclusionXYZMax[j] = TMath::Max(xyzmax[j],xyzmax[j]);
154  }
155 }
Double_t fInclusionXYZMin[3]
minimum distance around (XYZmin,XYZmax)
Double_t fInclusionXYZMax[3]
box within which events are always
const double j
Definition: BetheBloch.cxx:29
void GeomVolSelectorRockBox::SetRockBoxMinimal ( Double_t *  xyzmin,
Double_t *  xyzmax 
)

Definition at line 133 of file GeomVolSelectorRockBox.cxx.

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

Referenced by CreateRockBoxSelection().

135 {
136  // This sets parameters for a minimal box
137 
138  for ( int j = 0; j < 3; ++j ) {
139  fMinimalXYZMin[j] = TMath::Min(xyzmin[j],xyzmax[j]);
140  fMinimalXYZMax[j] = TMath::Max(xyzmax[j],xyzmax[j]);
141  }
142  // create the default inner (exclusion) box
144 }
const double j
Definition: BetheBloch.cxx:29
void MakeBox(Double_t *xyzmin, Double_t *xyzmax)
Double_t fMinimalXYZMax[3]
interior box lower corner
void genie::geometry::GeomVolSelectorI::SetSI2Local ( double  scale)
inlineinherited

set scale factor for SI to "raydist" units of PathSegmentList

Definition at line 59 of file GeomVolSelectorI.h.

References genie::geometry::GeomVolSelectorI::fScale, and scale.

Referenced by genie::geometry::ROOTGeomAnalyzer::ComputePathLengths().

59 { fScale = scale; }
Double_t scale
Definition: plot.C:25
double fScale
SI->raydist scale factor.
void GeomVolSelectorBasic::SetVolumeSelection ( string  volstr)
inherited

Selections are string based, elements are specified as a list of items separated by comma, semicolon or colons. Elements that start with "-" are rejections; elements that start with "+" (or nothing) are required, e.g. "+N276B,-air0"

Definition at line 47 of file GeomVolSelectorBasic.cxx.

References genie::geometry::GeomVolSelectorBasic::fForbiddenVol, genie::geometry::GeomVolSelectorBasic::fRequiredVol, and genie::geometry::GeomVolSelectorBasic::ParseSelection().

48 {
50 }
void ParseSelection(const string &str, vector< string > &required, vector< string > &forbidden)
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 52 of file GeomVolSelectorRockBox.cxx.

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

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

Member Data Documentation

const PathSegmentList* genie::geometry::GeomVolSelectorFiducial::fCurrPathSegmentList
mutableprotectedinherited
Double_t genie::geometry::GeomVolSelectorRockBox::fDeDx
protected

accepted

Definition at line 80 of file GeomVolSelectorRockBox.h.

Referenced by MakeRockBox().

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

how to scale from energy to distance

Definition at line 81 of file GeomVolSelectorRockBox.h.

Referenced by MakeRockBox().

vector<string> genie::geometry::GeomVolSelectorBasic::fForbiddenMat
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fForbiddenMed
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fForbiddenPath
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fForbiddenVol
protectedinherited
Double_t genie::geometry::GeomVolSelectorRockBox::fInclusionXYZMax[3]
protected

box within which events are always

Definition at line 79 of file GeomVolSelectorRockBox.h.

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

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

minimum distance around (XYZmin,XYZmax)

Definition at line 78 of file GeomVolSelectorRockBox.h.

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

RayIntercept genie::geometry::GeomVolSelectorFiducial::fIntercept
mutableprotectedinherited
RayIntercept genie::geometry::GeomVolSelectorRockBox::fInterceptRock
mutableprotected

Definition at line 88 of file GeomVolSelectorRockBox.h.

Referenced by BeginPSList(), and TrimSegment().

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

interior box lower corner

Definition at line 76 of file GeomVolSelectorRockBox.h.

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

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

interior box upper corner

Definition at line 77 of file GeomVolSelectorRockBox.h.

Referenced by MakeRockBox(), and SetMinimumWall().

std::string genie::geometry::GeomVolSelectorI::fName
protectedinherited
bool genie::geometry::GeomVolSelectorI::fNeedPath
protectedinherited
TLorentzVector genie::geometry::GeomVolSelectorI::fP4
protectedinherited

current neutrino ray's momentum (global)

Definition at line 75 of file GeomVolSelectorI.h.

Referenced by MakeRockBox(), and genie::geometry::GeomVolSelectorI::SetCurrentRay().

bool genie::geometry::GeomVolSelectorI::fRemoveEntries
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fRequiredMat
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fRequiredMed
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fRequiredPath
protectedinherited
vector<string> genie::geometry::GeomVolSelectorBasic::fRequiredVol
protectedinherited
FidShape* genie::geometry::GeomVolSelectorRockBox::fRockBoxShape
mutableprotected

expand from minimal or inclusion box?

Definition at line 83 of file GeomVolSelectorRockBox.h.

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

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

shape changes for every nu ray

Definition at line 85 of file GeomVolSelectorRockBox.h.

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

double genie::geometry::GeomVolSelectorI::fScale
protectedinherited

SI->raydist scale factor.

Definition at line 76 of file GeomVolSelectorI.h.

Referenced by genie::geometry::GeomVolSelectorI::SetSI2Local().

Bool_t genie::geometry::GeomVolSelectorFiducial::fSelectReverse
protectedinherited
FidShape* genie::geometry::GeomVolSelectorFiducial::fShape
protectedinherited
TLorentzVector genie::geometry::GeomVolSelectorI::fX4
protectedinherited

current neutrino ray's start position (global)

Definition at line 74 of file GeomVolSelectorI.h.

Referenced by genie::geometry::GeomVolSelectorI::SetCurrentRay().


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