22 #include <TGeoVolume.h>
23 #include <TGeoManager.h>
24 #include <TGeoShape.h>
25 #include <TGeoMedium.h>
26 #include <TGeoMaterial.h>
27 #include <TGeoMatrix.h>
29 #include <TObjArray.h>
30 #include <TLorentzVector.h>
34 #include <TPolyMarker3D.h>
37 #include "Framework/Conventions/GBuild.h"
51 using namespace genie;
52 using namespace genie::geometry;
53 using namespace genie::controls;
61 long int mxsegments = 0;
63 long int nswims[6] = { 0, 0, 0, 0, 0, 0};
64 long int nnever[6] = { 0, 0, 0, 0, 0, 0};
65 double dnvols[6] = { 0, 0, 0, 0, 0, 0};
66 double dnvols2[6] = { 0, 0, 0, 0, 0, 0};
67 bool accum_vol_stat =
false;
71 ROOTGeomAnalyzer::ROOTGeomAnalyzer(
string geometry_filename)
78 <<
"ROOTGeomAnalyzer ctor \"" << geometry_filename <<
"\"";
80 this->
Load(geometry_filename);
91 <<
"ROOTGeomAnalyzer ctor passed TGeoManager*";
103 <<
"ROOTGeomAnalyzer "
125 <<
"Computing the maximum path lengths for all materials";
128 LOG(
"GROOTGeom",
pFATAL) <<
"No ROOT geometry is loaded!!";
150 const TLorentzVector & x,
const TLorentzVector & p)
161 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
173 TVector3 udir = p.Vect().Unit();
174 TVector3 pos = x.Vect();
186 vector<int>::iterator itr;
194 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
196 <<
"Calculated path length for material: " << pdgc <<
" = " << pl;
208 const TLorentzVector & x,
const TLorentzVector & p)
217 TVector3 udir = p.Vect().Unit();
218 TVector3 pos = x.Vect();
228 std::vector<std::pair<double, const TGeoMaterial*>> MatLengthList;
233 for ( sitr = segments.begin(); sitr != segments.end(); ++sitr) {
236 MatLengthList.push_back(std::make_pair(pl,seg.
fMaterial));
239 return MatLengthList;
244 const TLorentzVector & x,
const TLorentzVector & p,
int tgtpdg)
251 <<
"Generating vtx in material: " << tgtpdg
252 <<
" along the input neutrino direction";
261 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
268 LOG(
"GROOTGeom",
pFATAL) <<
"No ROOT geometry is loaded!!";
274 TVector3 udir = p.Vect().Unit();
275 TVector3 pos = x.Vect();
284 if ( maxwgt_dist <= 0 ) {
286 <<
"The current trajectory does not cross the selected material!!";
292 double genwgt_dist(maxwgt_dist * rnd->
RndGeom().Rndm());
298 <<
"Max {L x Density x Weight} given (init,dir) = " << maxwgt_dist;
300 <<
"Generated 'distance' in selected material = " << genwgt_dist;
305 double mxddist = 0, mxdstep = 0;
320 for ( ; mitr != mitr_end; ++mitr ) {
321 const TGeoMaterial* mat = mitr->first;
322 double wgt = ( mat ) ? this->
GetWeight(mat,tgtpdg) : 0;
327 <<
" wgtmap[" << mat->GetName() <<
"] pdg " << tgtpdg <<
" wgt " << Form(
"%.6f",wgt);
337 for ( sitr = segments.begin(); sitr != segments.end(); ++sitr) {
341 double wgtstep = trimmed_step * wgtmap[mat];
342 double beyond = walked + wgtstep;
346 <<
" beyond " << beyond <<
" genwgt_dist " << genwgt_dist
347 <<
" trimmed_step " << trimmed_step <<
" wgtstep " << wgtstep;
350 if ( beyond > genwgt_dist ) {
355 <<
"Choose vertex pos walked=" << walked
356 <<
" beyond=" << beyond
357 <<
" wgtstep " << wgtstep
358 <<
" ( " << trimmed_step <<
"*" << wgtmap[mat] <<
")"
359 <<
" look for " << genwgt_dist
360 <<
" in " << seg.
fVolume->GetName() <<
" "
365 double frac = ( genwgt_dist - walked ) / wgtstep;
368 <<
"Hey, frac = " << frac <<
" ( > 1.0 ) "
369 << genwgt_dist <<
" " << walked <<
" " << wgtstep;
372 fGeometry -> SetCurrentPoint (pos[0],pos[1],pos[2]);
375 <<
"Choose vertex position in " << seg.
fVolume->GetName() <<
" "
383 <<
"The vertex was placed in volume: "
384 <<
fGeometry->GetCurrentVolume()->GetName()
391 <<
"Geometry volume was probably overshot";
393 <<
"No material with code = " << tgtpdg <<
" could be found at genwgt_dist="
394 << genwgt_dist <<
" (maxwgt_dist=" << maxwgt_dist <<
")";
397 <<
"retry placing vertex";
410 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
434 <<
"Geometry length units scale factor (geom units -> m): "
445 <<
"Geometry density units scale factor (geom units -> kgr/m3): "
486 if (name.size() == 0)
return;
493 LOG(
"GROOTGeom",
pWARN) <<
"Could not find volume: " << name.c_str();
494 LOG(
"GROOTGeom",
pWARN) <<
"Will not change the current top volume";
507 TGeoIterator next(
fGeometry->GetMasterVolume());
509 TString nodeName, volNameStr;
511 while ((node = next())) {
512 nodeName = node->GetVolume()->GetName();
513 if (nodeName == volName) {
515 fMasterToTop =
new TGeoHMatrix(*next.GetCurrentMatrix());
538 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
540 <<
"Scaling path-lengths from local units -> meters "
542 <<
" - scale = " << scaling_factor;
545 PathLengthList::iterator pliter;
546 for(pliter = pl.begin(); pliter != pl.end(); ++pliter)
548 int pdgc = pliter->first;
559 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
566 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
577 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
584 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
597 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
602 Double_t mast[3], top[3];
605 vec.SetXYZ(top[0], top[1], top[2]);
607 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
620 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
625 Double_t mast[3], top[3];
628 vec.SetXYZ(top[0], top[1], top[2]);
630 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
643 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
648 Double_t mast[3], top[3];
651 vec.SetXYZ(mast[0], mast[1], mast[2]);
653 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
665 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
670 Double_t mast[3], top[3];
673 vec.SetXYZ(mast[0], mast[1], mast[2]);
675 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
688 <<
"Initializing ROOT geometry driver & setting defaults";
720 LOG(
"GROOTGeom",
pNOTICE) <<
"Cleaning up...";
734 LOG(
"GROOTGeom",
pNOTICE) <<
"Loading geometry from: " << filename;
736 bool is_accessible = ! (gSystem->AccessPathName( filename.c_str() ));
737 if (!is_accessible) {
739 <<
"The ROOT geometry doesn't exist! Initialization failed!";
745 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,16,0)
746 if (TGeoManager::GetDefaultUnits() != TGeoManager::kRootUnits) {
747 #if ROOT_VERSION_CODE >= ROOT_VERSION(6,22,0)
748 TGeoManager::LockDefaultUnits(
false);
749 TGeoManager::SetDefaultUnits(TGeoManager::kRootUnits);
750 TGeoManager::LockDefaultUnits(
true);
752 TGeoManager::SetDefaultRootUnits();
757 TGeoManager * gm = TGeoManager::Import(filename.c_str());
768 <<
"A TGeoManager is being loaded to the geometry driver";
772 LOG(
"GROOTGeom",
pFATAL) <<
"Null TGeoManager! Aborting";
789 LOG(
"GROOTGeom",
pFATAL) <<
"Could not get top volume!!!";
798 #ifdef PRINT_MATERIALS
799 fGeometry->GetListOfMaterials()->Print();
817 LOG(
"GROOTGeom",
pFATAL) <<
"No ROOT geometry is loaded!!";
821 TObjArray * volume_list =
fGeometry->GetListOfVolumes();
824 <<
"Null list of geometry volumes. Can not find build target list!";
828 std::set<Int_t> seen_mat;
829 std::vector<TGeoVolume*> volvec;
831 int numVol = volume_list->GetEntries();
832 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
833 LOG(
"GROOTGeom",
pDEBUG) <<
"Number of volumes found: " << numVol;
836 for (
int ivol = 0; ivol < numVol; ivol++) {
837 TGeoVolume * volume = dynamic_cast <TGeoVolume *>(volume_list->At(ivol));
840 <<
"Got a null geometry volume!! Skiping current list element";
843 TGeoMaterial * mat = volume->GetMedium()->GetMaterial();
846 Int_t mat_indx = mat->GetIndex();
847 if ( seen_mat.find(mat_indx) != seen_mat.end() )
continue;
848 seen_mat.insert(mat_indx);
849 volvec.push_back(volume);
851 if (mat->IsMixture()) {
852 TGeoMixture * mixt = dynamic_cast <TGeoMixture*> (mat);
853 int Nelements = mixt->GetNelements();
854 for (
int i=0; i<Nelements; i++) {
873 int A = TMath::Nint(m->GetA());
874 int Z = TMath::Nint(m->GetZ());
883 const TGeoMixture *
const m,
int ielement)
const
885 int A = TMath::Nint(m->GetAmixt()[ielement]);
886 int Z = TMath::Nint(m->GetZmixt()[ielement]);
903 LOG(
"GROOTGeom",
pERROR) <<
"Null input material. Return weight = 0.";
909 LOG(
"GROOTGeom",
pERROR) <<
"Target doesn't exist. Return weight = 0.";
913 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
915 <<
"Curr. material: A/Z = " << mat->GetA() <<
" / " << mat->GetZ();
921 if (mat->IsMixture()) {
922 const TGeoMixture * mixt = dynamic_cast <
const TGeoMixture*> (mat);
924 LOG(
"GROOTGeom",
pERROR) <<
"Null input mixture. Return weight = 0.";
927 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
929 <<
"Material : " << mat->GetName()
930 <<
" is a mixture with " << mixt->GetNelements() <<
" elements";
939 if (ion_pdgc != pdgc)
return 0.;
942 weight = mat->GetDensity();
946 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
948 <<
"Weight[mat:" << mat->GetName() <<
"] = " << weight;
964 for (
int i = 0; i < mixt->GetNelements(); i++) {
965 double dw = (this->
GetWeight(mixt,i,pdgc));
971 for (
int j = 0; j < mixt->GetNelements(); j++) {
973 <<
"[" << j <<
"] Z = " << mixt->GetZmixt()[j]
974 <<
", A = " << mixt->GetAmixt()[j]
976 <<
"), w = " << mixt->GetWmixt()[j];
979 <<
"Material pdgc = " << pdgc <<
" appears " << nm
980 <<
" times (>1) in mixture = " << mixt->GetName();
1014 if (ion_pdgc != pdgc)
return 0.;
1016 double d = mixt->GetDensity();
1017 double w = mixt->GetWmixt()[ielement];
1024 for (
int i = 0; i < mixt->GetNelements(); i++) {
1025 wtot += (mixt->GetWmixt()[i]);
1031 double weight = d*w;
1043 <<
"Computing the maximum path lengths using the FLUX method";
1046 PathLengthList::const_iterator pl_iter;
1057 <<
"max path lengths with FLUX method forcing Enu=" << emax;
1060 while (iparticle < nparticles ) {
1064 LOG(
"GROOTGeom",
pWARN) <<
"Couldn't generate a flux neutrino";
1070 double ecurr = nup4.E();
1071 if ( ecurr > 0 ) nup4 *= (emax/ecurr);
1082 bool enters =
false;
1084 for (pl_iter = pl.begin(); pl_iter != pl.end(); ++pl_iter) {
1085 int pdgc = pl_iter->first;
1086 double pathlength = pl_iter->second;
1088 if ( pathlength > 0 ) {
1096 if (enters) iparticle++;
1108 <<
"Computing the maximum path lengths using the BOX method";
1109 #ifdef RWH_COUNTVOLS
1110 accum_vol_stat =
true;
1115 TLorentzVector nux4;
1116 TLorentzVector nup4;
1118 PathLengthList::const_iterator pl_iter;
1120 while ( (ok = this->
GenBoxRay(iparticle++,nux4,nup4)) ) {
1129 for (pl_iter = pllst.begin(); pl_iter != pllst.end(); ++pl_iter) {
1130 int pdgc = pl_iter->first;
1131 double pl = pl_iter->second;
1144 <<
"DensWeight \"" << (
fDensWeight?
"true":
"false")
1146 LOG(
"GROOTGeom",
pDEBUG) <<
"CurrMaxPathLengthList: "
1149 #ifdef RWH_COUNTVOLS
1153 for (
int j = 0; j < 6; ++j ) {
1154 long int ns = nswims[j];
1155 double x = dnvols[j];
1156 double x2 = dnvols2[j];
1157 if ( ns == 0 ) ns = 1;
1158 double avg = x / (double)ns;
1159 double rms = TMath::Sqrt((x2/(
double)ns) - avg*avg);
1161 <<
"RWH: nswim after BOX face " << j <<
" is " << ns
1162 <<
" avg " << avg <<
" rms " << rms
1163 <<
" never " << nnever[j];
1166 <<
"RWH: Max PathSegmentList size " << mxsegments;
1167 accum_vol_stat =
false;
1187 LOG(
"GROOTGeom",
pINFO) <<
"Box surface scanned: " << indx <<
" points/rays";
1195 TGeoBBox * box = (TGeoBBox *)TS;
1200 fox = (box->GetOrigin())[0];
1201 foy = (box->GetOrigin())[1];
1202 foz = (box->GetOrigin())[2];
1205 <<
"Box size (GU) :"
1206 <<
" x = " << 2*
fdx <<
", y = " << 2*
fdy <<
", z = " << 2*
fdz;
1208 <<
"Box origin (GU) :"
1209 <<
" x = " <<
fox <<
", y = " <<
foy <<
", z = " <<
foz;
1211 <<
"Will generate [" <<
fNPoints <<
"] random points / box surface";
1213 <<
"Will generate [" <<
fNRays <<
"] rays / point";
1215 #ifdef VALIDATE_CORNERS
1217 for (
int sz = -1; sz <= +1; ++sz) {
1218 for (
int sy = -1; sy <= +1; ++sy) {
1219 for (
int sx = -1; sx <= +1; ++sx) {
1220 if (sx == 0 || sy == 0 || sz == 0 )
continue;
1226 TVector3 pos2(master);
1231 <<
" [" << pos[0] <<
"," << pos[1] <<
"," << pos[2] <<
"] "
1233 <<
" [" << master[0] <<
"," << master[1] <<
"," << master[2] <<
"] "
1235 <<
" [" << pos2[0] <<
"," << pos2[1] <<
"," << pos2[2] <<
"] ";
1252 LOG(
"GROOTGeom",
pINFO) <<
"Box surface scanned: [TOP]";
1266 LOG(
"GROOTGeom",
pINFO) <<
"Box surface scanned: [LEFT]";
1280 LOG(
"GROOTGeom",
pINFO) <<
"Box surface scanned: [FRONT]";
1315 #ifdef RWH_COUNTVOLS
1319 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1322 <<
"GenBoxRay(topvol) "
1324 <<
" newpnt " << (
fnewpnt?
"true":
"false")
1340 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1342 <<
"GenBoxRay(master) "
1344 <<
" newpnt " << (
fnewpnt?
"true":
"false")
1354 const TVector3 &
r0,
const TVector3 & udir,
int pdgc)
1369 const TGeoMaterial * mat = 0;
1376 for ( ; itr != itr_end; ++itr ) {
1378 if ( ! mat )
continue;
1381 pl += (step*weight);
1384 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1386 <<
"PathLength[" << pdgc <<
"] = " << pl <<
" in curr geom units";
1414 bool found_vol (
false);
1415 bool keep_on (
true);
1420 const TGeoVolume * vol = 0;
1421 const TGeoMedium * med = 0;
1422 const TGeoMaterial * mat = 0;
1428 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1430 <<
"SwimOnce x [" << r0[0] <<
"," << r0[1] <<
"," << r0[2]
1431 <<
"] udir [" << udir[0] <<
"," << udir[1] <<
"," << udir[2];
1434 fGeometry -> SetCurrentDirection (udir[0],udir[1],udir[2]);
1435 fGeometry -> SetCurrentPoint (r0[0], r0[1], r0[2] );
1437 while (!found_vol || keep_on) {
1444 med = vol->GetMedium();
1445 mat = med->GetMaterial();
1446 ps_curr.
SetGeo(vol,med,mat);
1447 #ifdef PATHSEG_KEEP_PATH
1451 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1453 LOG(
"GROOTGeom",
pDEBUG) <<
"Current volume: " << vol->GetName()
1454 <<
" pos " <<
fGeometry->GetCurrentPoint()[0]
1455 <<
" " <<
fGeometry->GetCurrentPoint()[1]
1456 <<
" " <<
fGeometry->GetCurrentPoint()[2]
1457 <<
" dir " <<
fGeometry->GetCurrentDirection()[0]
1458 <<
" " <<
fGeometry->GetCurrentDirection()[1]
1459 <<
" " <<
fGeometry->GetCurrentDirection()[2]
1460 <<
"[path: " <<
fGeometry->GetPath() <<
"]";
1467 if (found_vol)
break;
1473 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1474 LOG(
"GROOTGeom",
pDEBUG) <<
"Outside ToNextBoundary step: " << step
1475 <<
" raydist: " << raydist;
1480 step = this->
Step();
1483 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1485 <<
"Stepping... [step size = " << step <<
"]";
1486 LOG(
"GROOTGeom",
pDEBUG) <<
"Outside step: " << step
1487 <<
" raydist: " << raydist;
1491 #ifdef RWH_COUNTVOLS
1492 if ( accum_vol_stat ) {
1497 if ( nnever[curface]%21 == 0 )
1499 <<
"curface " << curface <<
" " << nswims[curface]
1500 <<
" never " << nnever[curface]
1501 <<
" x [" << r0[0] <<
"," << r0[1] <<
"," << r0[2] <<
"] "
1502 <<
" p [" << udir[0] <<
"," << udir[1] <<
"," << udir[2] <<
"]";
1518 <<
"debug: step towards top volume: " << ps_curr;
1525 if (!found_vol) found_vol =
true;
1537 LOG(
"GROOTGeom",
pDEBUG) <<
"Current volume: " << vol->GetName()
1538 <<
" step " << step <<
" in " << mat->GetName();
1541 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1543 <<
"Cur med.: " << med->GetName() <<
", mat.: " << mat->GetName();
1545 <<
"Step = " << step;
1550 #ifdef RWH_COUNTVOLS
1551 if ( accum_vol_stat ) {
1553 dnvols[curface] += (double)nvolswim;
1554 dnvols2[curface] += (double)nvolswim * (
double)nvolswim;
1556 if ( ns > mxsegments ) mxsegments =
ns;
1561 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1570 double mxddist = 0, mxdstep = 0;
1605 TGeoVolume * vol =
fGeometry -> GetCurrentVolume();
1607 TGeoMaterial * mat = vol->GetMedium()->GetMaterial();
1608 if(mat->IsMixture()) {
1609 TGeoMixture * mixt = dynamic_cast <TGeoMixture*> (mat);
1610 for(
int i = 0; i < mixt->GetNelements(); i++) {
1612 if(tgtpdg == pdg)
return true;
1616 if(tgtpdg == pdg)
return true;
1619 LOG(
"GROOTGeom",
pWARN) <<
"Current volume is null!";
1645 step += this->
Step();
1648 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1656 <<
", Step = " << step;
1669 if (step > 9.99E29) {
1671 #ifdef __GENIE_LOW_LEVEL_MESG_ENABLED__
1672 LOG(
"GROOTGeom",
pINFO) <<
"Wow! Current step is dr = " << step;
1673 LOG(
"GROOTGeom",
pINFO) <<
"This trajectory isn't entering the detector";
virtual double MaxEnergy(void)=0
declare the max flux neutrino energy that can be generated (for init. purposes)
void ScalePathLength(int pdgc, double scale)
virtual int ScannerNParticles(void) const
virtual void SetMaxPlSafetyFactor(double sf)
TGeoManager * fGeometry
input detector geometry
double PathLength(int pdgc) const
void SetEnter(const TVector3 &p3enter, double raydist)
point of entry to geometry element
virtual double StepUntilEntering(void)
virtual double GetWeight(const TGeoMaterial *mat, int pdgc)
void SetPrintVerbose(bool doit=true)
string P4AsShortString(const TLorentzVector *p)
virtual void MaxPathLengthsFluxMethod(void)
virtual bool WeightWithDensity(void) const
virtual const PathLengthList & ComputeMaxPathLengths(void)
static RandomGen * Instance()
Access instance.
void CrossCheck(double &mxddist, double &mxdstep) const
virtual void CleanUp(void)
void SetPath(const char *path)
string BoolAsYNString(bool b)
StepRangeSet fStepRangeSet
collection of {steplo,stephi} pairs
bool fDensWeight
if true pathlengths are weighted with density [def:true]
virtual const TLorentzVector & Position(void)=0
returns the flux neutrino 4-position (note: expect SI rather than physical units) ...
void AddSegment(const PathSegment &ps)
virtual double StepToNextBoundary(void)
GFluxI * fFlux
a flux objects that can be used to scan the max path lengths
string P3AsString(const TVector3 *vec)
xmlNodePtr FindNode(xmlDocPtr xml_doc, string node_path)
virtual void Top2Master(TVector3 &v) const
double fLengthScale
conversion factor: input geometry length units -> meters
Object to be filled with the neutrino path-segments representing geometry volume steps (generally bou...
void SetPathLength(int pdgc, double pl)
bool ExistsInPDGCodeList(int pdg_code) const
static constexpr double ns
int fNRays
max path length scanner (box method): rays/point [def:200]
TVector3 * fCurrVertex
current generated vertex
bool IsSameStart(const TVector3 &pos, const TVector3 &dir) const
double fMaxPlSafetyFactor
factor that can multiply the computed max path lengths
virtual void SetScannerNParticles(int np)
string fTopVolumeName
input top vol [other than TGeoManager::GetTopVolume()]
void SetStep(Double_t step, bool setlimits=true)
step taken in the geometry element
A singleton holding random number generator classes. All random number generation in GENIE should tak...
virtual void SetDensityUnits(double du)
virtual const PDGCodeList & ListOfTargetNuclei(void)
implement the GeomAnalyzerI interface
virtual bool FindMaterialInCurrentVol(int pdgc)
virtual double MixtureWeightsSum(void) const
virtual double Step(void)
virtual const PathLengthList & ComputePathLengths(const TLorentzVector &x, const TLorentzVector &p)
Object to be filled with the neutrino path-length, for all detector geometry materials, when starting from a position x and travelling along the direction of the neutrino 4-momentum.
const TGeoMaterial * fMaterial
ref only ptr to TGeoMaterial
virtual int GetTargetPdgCode(const TGeoMaterial *const m) const
double foz
top vol size/origin (top vol units)
double fDensityScale
conversion factor: input geometry density units -> kgr/meters^3
virtual void MaxPathLengthsBoxMethod(void)
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
static constexpr double kilogram
int fNPoints
max path length scanner (box method): points/surface [def:200]
PathSegmentV_t::const_iterator PathSegVCItr_t
static constexpr double A
virtual bool GenBoxRay(int indx, TLorentzVector &x4, TLorentzVector &p4)
virtual double LengthUnits(void) const
virtual void SetScannerNRays(int nr)
static constexpr double meter3
const TGeoVolume * fVolume
ref only ptr to TGeoVolume
PDGCodeList * fCurrPDGCodeList
current list of target nuclei
virtual void SetWeightWithDensity(bool wt)
PathSegmentList * fCurrPathSegmentList
current list of path-segments
PathLengthList * fCurrMaxPathLengthList
current list of max path-lengths
void SetStartInfo(const TVector3 &pos=TVector3(0, 0, 1e37), const TVector3 &dir=TVector3(0, 0, 0))
virtual void Load(string geometry_filename)
Double_t GetSummedStepRange() const
get the sum of all the step range (in case step has been trimmed or split)
TRandom3 & RndGeom(void) const
rnd number generator used by geometry drivers
virtual double ComputePathLengthPDG(const TVector3 &r, const TVector3 &udir, int pdgc)
virtual void Local2SI(PathLengthList &pl) const
access to geometry coordinate/unit transforms for validation/test purposes
GeomVolSelectorI * fGeomVolSelector
optional path seg trimmer (owned)
const PathSegmentV_t & GetPathSegmentV(void) const
double fmxdstep
max errors in pathsegmentlist
virtual double DensityUnits(void) const
virtual void Initialize(void)
virtual void Master2TopDir(TVector3 &v) const
virtual void Clear(Option_t *opt)=0
reset state variables based on opt
virtual bool GenerateNext(void)=0
generate the next flux neutrino (return false in err)
virtual const TVector3 & GenerateVertex(const TLorentzVector &x, const TLorentzVector &p, int tgtpdg)
bool GetNeedPath() const
allow toggle on only
MaterialMap_t::const_iterator MaterialMapCItr_t
void SetCurrentRay(const TLorentzVector &x4, const TLorentzVector &p4)
configure for individual neutrino ray
PathLengthList * fCurrPathLengthList
current list of path-lengths
virtual PathSegmentList * GenerateTrimmedList(const PathSegmentList *untrimmed) const
static constexpr double meter
virtual void SetTopVolName(string nm)
void SetDoCrossCheck(bool doit=true)
TGeoHMatrix * fMasterToTop
matrix connecting master coordinates to top volume coordinates
bool fMasterToTopIsIdentity
is fMasterToTop matrix the identity matrix?
void SetGeo(const TGeoVolume *gvol, const TGeoMedium *gmed, const TGeoMaterial *gmat)
info about the geometry element
std::map< const TGeoMaterial *, Double_t > MaterialMap_t
TVector3 GetPosition(Double_t frac) const
calculate position within allowed ranges passed on fraction of total
virtual void SetScannerNPoints(int np)
set geometry driver's configuration options
virtual void SetScannerFlux(GFluxI *f)
const MaterialMap_t & GetMatStepSumMap(void) const
virtual void SetMixtureWeightsSum(double sum)
int IonPdgCode(int A, int Z)
virtual const TLorentzVector & Momentum(void)=0
returns the flux neutrino 4-momentum
void SetExit(const TVector3 &p3exit)
point of exit from geometry element
TGeoVolume * fTopVolume
top volume
virtual double MaxPlSafetyFactor(void) const
virtual void SetLengthUnits(double lu)
void AddPathLength(int pdgc, double pl)
virtual void Top2MasterDir(TVector3 &v) const
double fMixtWghtSum
norm of relative weights (<0 if explicit summing required)
Defines the GENIE Geometry Analyzer Interface.
virtual void BuildListOfTargetNuclei(void)
string X4AsString(const TLorentzVector *x)
virtual void SI2Local(TVector3 &v) const
bool fKeepSegPath
need to fill path segment "path"
std::list< PathSegment > PathSegmentV_t
static constexpr double m
string Vec3AsString(const TVector3 *vec)
void SetSI2Local(double scale)
set scale factor for SI to "raydist" units of PathSegmentList
virtual void SwimOnce(const TVector3 &r, const TVector3 &udir)
virtual void Master2Top(TVector3 &v) const
void push_back(int pdg_code)
void FillMatStepSum(void)
virtual std::vector< std::pair< double, const TGeoMaterial * > > ComputeMatLengths(const TLorentzVector &x, const TLorentzVector &p)
virtual bool WillNeverEnter(double step)