70 #include <TLorentzVector.h> 72 #include <TApplication.h> 73 #include <TPolyMarker3D.h> 86 using namespace genie;
110 #ifdef __GENIE_GEOM_DRIVERS_ENABLED__ 112 TApplication theApp(
"App", &argc, argv);
117 <<
"Creating a geometry driver for ROOT geometry at: " 127 <<
"Drawing the ROOT geometry";
128 geom_driver->
GetGeometry()->GetTopVolume()->Draw();
130 TPolyMarker3D * vtxp =
new TPolyMarker3D();
131 vtxp->SetMarkerColor(kRed);
132 vtxp->SetMarkerStyle(8);
133 vtxp->SetMarkerSize(0.4);
138 <<
"Computing max {density-weighted path lengths}";
141 LOG(
"test",
pINFO) <<
"Maximum math lengths: " << maxpl;
143 TFile
f(
"geomtest.root",
"recreate");
144 TNtupleD vtxnt(
"vtxnt",
"",
"x:y:z:A:Z");
146 TLorentzVector
x(0,0,0,0);
147 TLorentzVector
p(0,0,0,0);
159 <<
"Current path lengths: " << pl;
165 if (tpdg == -1)
continue;
166 LOG(
"test",
pINFO) <<
"Selected target material: " << tpdg;
171 <<
"Generated vtx: (x = " << vtx.X()
172 <<
", y = " << vtx.Y() <<
", z = " <<vtx.Z() <<
")";
175 vtxnt.Fill(vtx.X(),vtx.Y(),vtx.Z(),
177 vtxp->SetNextPoint(vtx.X(),vtx.Y(),vtx.Z());
181 <<
" *** Vertices generated so far: " <<
n;
194 <<
"*** You should have enabled the geometry drivers first!";
207 TVector3 vec = vec0.Orthogonal();
221 vec.Rotate(phi,vec0);
226 TLorentzVector xx(vec, 0.);
235 <<
" x = " << x.X() <<
", y = " << x.Y() <<
", z = " << x.Z();
237 <<
" px = " << p.X() <<
", py = " << p.Y() <<
", pz = " << p.Z();
253 for(pliter = pl.begin(); pliter != pl.end(); ++pliter) {
254 sum += pliter->second;
256 double cpl = sum * rnd->
RndFlux().Rndm();
258 for(pliter = pl.begin(); pliter != pl.end(); ++pliter) {
259 sum += pliter->second;
261 return pliter->first;
274 LOG(
"test",
pINFO) <<
"Getting ROOT geometry filename";
277 string base_dir =
string( gSystem->Getenv(
"GENIE") );
279 string(
"/data/geo/samples/BoxWithLArPbLayers.root");
286 LOG(
"test",
pDEBUG) <<
"Checking for input volume name";
289 LOG(
"test",
pDEBUG) <<
"Using the <master volume>";
294 LOG(
"test",
pINFO) <<
"Reading ray direction";
297 assert(dirv.
size() == 3);
300 LOG(
"test",
pINFO) <<
"No input ray direction - Using default";
306 LOG(
"test",
pINFO) <<
"Reading ray generation surface";
309 assert(rsv.
size() == 3);
312 LOG(
"test",
pINFO) <<
"No input ray generation surface - Using default";
318 LOG(
"test",
pINFO) <<
"Reading radius of ray generation area";
321 LOG(
"test",
pINFO) <<
"No input radius of ray generation area - Using default";
328 LOG(
"test",
pINFO) <<
"Getting number of vertices to generate";
336 LOG(
"test",
pINFO) <<
"Getting 'forced' target pdg";
346 <<
"\n Ray direction: (" 350 <<
"\n Ray generation surface : (" 354 <<
"\n Ray generation area radius : " <<
gOptRayR 355 <<
"\n Number of vertices : " <<
gOptNVtx
double PathLength(int pdgc) const
double ArgAsDouble(char opt)
bool AreAllZero(void) const
virtual const PathLengthList & ComputeMaxPathLengths(void)
string ArgAsString(char opt)
THE MAIN GENIE PROJECT NAMESPACE
static RandomGen * Instance()
Access instance.
int IonPdgCodeToA(int pdgc)
A singleton holding random number generator classes. All random number generation in GENIE should tak...
virtual const PathLengthList & ComputePathLengths(const TLorentzVector &x, const TLorentzVector &p)
TVector3 gOptRayDirection
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.
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
vector< double > ArgAsDoubleTokens(char opt, string delimeter)
string gOptRootGeomTopVol
A ROOT/GEANT4 geometry driver.
TVector3 kDefOptRaySurf(0, 0, 0)
void GetRandomRay(TLorentzVector &x, TLorentzVector &p)
virtual const TVector3 & GenerateVertex(const TLorentzVector &x, const TLorentzVector &p, int tgtpdg)
virtual void SetTopVolName(string nm)
int GetTargetMaterial(const PathLengthList &pl)
TVector3 kDefOptRayDirection(1, 0, 0)
int IonPdgCodeToZ(int pdgc)
void GetCommandLineArgs(int argc, char **argv)
Command line argument parser.
TRandom3 & RndFlux(void) const
rnd number generator used by flux drivers
int main(int argc, char **argv)
bool OptionExists(char opt)
was option set?
virtual TGeoManager * GetGeometry(void) const