Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

proto_evgen::TargetVolume Class Reference

#include <TargetVolume.h>

List of all members.

Public Member Functions

 TargetVolume (double worldX1, double worldX2, double worldY1, double worldY2, double worldZ1, double worldZ2, double totalmass)
void SetRandomNumberGenerator (TRandom *rand)
void SetGeometry (const geo::Geometry *geo)
void RandomVertex (double *xyz)

Public Attributes

TRandom * fRndm
const geo::GeometryfGeo
double fMass
double fX [2]
double fY [2]
double fZ [2]


Constructor & Destructor Documentation

TargetVolume::TargetVolume double  worldX1,
double  worldX2,
double  worldY1,
double  worldY2,
double  worldZ1,
double  worldZ2,
double  totalmass
 

Definition at line 8 of file TargetVolume.cxx.

References fMass, fX, fY, and fZ.

00012 {
00013   fX[0] = worldX1;
00014   fX[1] = worldX2;
00015   fY[0] = worldY1;
00016   fY[1] = worldY2;
00017   fZ[0] = worldZ1;
00018   fZ[1] = worldZ2;
00019   fMass = totalmass;
00020 }


Member Function Documentation

void TargetVolume::RandomVertex double *  xyz  ) 
 

Definition at line 38 of file TargetVolume.cxx.

References fGeo, fRndm, fX, fY, fZ, and geo::Geometry::Material().

Referenced by main().

00039 {
00040   const double rhomax = 3.0; // g/cc
00041   
00042   while (1) {
00043     // Choose a random location inside the volume
00044     fRndm->RndmArray(3,xyz);
00045     xyz[0] = fX[0]+xyz[0]*(fX[1]-fX[0]);
00046     xyz[1] = fY[0]+xyz[1]*(fY[1]-fY[0]);
00047     xyz[2] = fZ[0]+xyz[2]*(fZ[1]-fZ[0]);
00048     
00049     // Based on its density, accept or reject the point
00050     double rho = fGeo->Material(xyz[0],xyz[1],xyz[2])->GetDensity();
00051     if (rho/rhomax < fRndm->Rndm()) return;
00052   }
00053 }

void TargetVolume::SetGeometry const geo::Geometry geo  ) 
 

Definition at line 31 of file TargetVolume.cxx.

References fGeo.

Referenced by main().

00032 {
00033   fGeo = geo;
00034 }

void TargetVolume::SetRandomNumberGenerator TRandom *  rand  ) 
 

Definition at line 24 of file TargetVolume.cxx.

References fRndm.

Referenced by main().

00025 {
00026   fRndm = rand;
00027 }


Member Data Documentation

const geo::Geometry* proto_evgen::TargetVolume::fGeo
 

Definition at line 19 of file TargetVolume.h.

Referenced by RandomVertex(), and SetGeometry().

double proto_evgen::TargetVolume::fMass
 

Definition at line 20 of file TargetVolume.h.

Referenced by TargetVolume().

TRandom* proto_evgen::TargetVolume::fRndm
 

Definition at line 18 of file TargetVolume.h.

Referenced by RandomVertex(), and SetRandomNumberGenerator().

double proto_evgen::TargetVolume::fX[2]
 

Definition at line 21 of file TargetVolume.h.

Referenced by RandomVertex(), and TargetVolume().

double proto_evgen::TargetVolume::fY[2]
 

Definition at line 22 of file TargetVolume.h.

Referenced by RandomVertex(), and TargetVolume().

double proto_evgen::TargetVolume::fZ[2]
 

Definition at line 23 of file TargetVolume.h.

Referenced by RandomVertex(), and TargetVolume().


The documentation for this class was generated from the following files:
Generated on Sun Mar 15 04:45:27 2009 for NOvA Offline by  doxygen 1.3.9.1