56 TVector3 vtx(9999999.,999999.,999999.);
60 double A = nucltgt->
A();
66 TObjArrayIter piter(evrec);
73 LOG(
"Vtx",
pINFO) <<
"Setting vertex position for: " << p->
Name();
101 TVector3 vtx(999999.,999999.,999999.);
106 bool realistic = !uniform;
113 double R =
fR0 * TMath::Power(A, 1./3.);
128 LOG(
"Vtx",
pINFO) <<
"Setting vertex on the nuclear boundary";
129 double phi = 2*
kPi * rnd->
RndFsi().Rndm();
130 double cosphi = TMath::Cos(phi);
131 double sinphi = TMath::Sin(phi);
132 double costheta = -1 + 2 * rnd->
RndFsi().Rndm();
133 double sintheta = TMath::Sqrt(1-costheta*costheta);
134 vtx.SetX(R*sintheta*cosphi);
135 vtx.SetY(R*sintheta*sinphi);
136 vtx.SetZ(R*costheta);
147 <<
"Generating vertex according to a realistic nuclear density profile";
152 for(
double r = 0; r < rmax; r+=dr) {
158 unsigned int iter = 0;
165 <<
"Couldn't generate a vertex position after " << iter <<
" iterations";
168 exception.
SetReason(
"Couldn't generate vertex");
173 double r = rmax * rnd->
RndFsi().Rndm();
174 double t = ymax * rnd->
RndFsi().Rndm();
178 <<
"y = " << y <<
" > ymax = " << ymax
179 <<
" for r = " << r <<
", A = " << A;
181 bool accept = (t < y);
183 double phi = 2*
kPi * rnd->
RndFsi().Rndm();
184 double cosphi = TMath::Cos(phi);
185 double sinphi = TMath::Sin(phi);
186 double costheta = -1 + 2 * rnd->
RndFsi().Rndm();
187 double sintheta = TMath::Sqrt(1-costheta*costheta);
188 vtx.SetX(r*sintheta*cosphi);
189 vtx.SetY(r*sintheta*sinphi);
190 vtx.SetZ(r*costheta);
200 <<
"Generating intranuclear vertex uniformly in volume";
201 while(vtx.Mag() > R) {
202 vtx.SetX(-R + 2*R * rnd->
RndFsi().Rndm());
203 vtx.SetY(-R + 2*R * rnd->
RndFsi().Rndm());
204 vtx.SetZ(-R + 2*R * rnd->
RndFsi().Rndm());
212 <<
"Generated vtx @ r = " << vtx.Mag() <<
" fm / "
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
virtual void Configure(const Registry &config)
STDHEP-like event record entry that can fit a particle or a nucleus.
string Name(void) const
Name that corresponds to the PDG code.
void SetPosition(const TLorentzVector &v4)
GENIE's GHEP MC event record.
virtual GHepParticle * TargetNucleus(void) const
virtual Interaction * Summary(void) const
Summary information for an interaction.
const ProcessInfo & ProcInfo(void) const
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
bool IsPhotonResonance(void) const
bool IsNuElectronElastic(void) const
bool IsInverseMuDecay(void) const
bool IsCoherentElastic(void) const
bool IsPhotonCoherent(void) const
bool IsCoherentProduction(void) const
bool IsIMDAnnihilation(void) const
bool IsGlashowResonance(void) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
static RandomGen * Instance()
Access instance.
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
A registry. Provides the container for algorithm configuration parameters.
void Configure(const Registry &config)
double fR0
parameter controlling nuclear sizes
TVector3 GenerateVertex(const Interaction *in, double A) const
int fVtxGenMethod
vtx generation method (0: uniform, 1: according to nuclear density [def])
void ProcessEventRecord(GHepRecord *event_rec) const
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
void SwitchOnFastForward(void)
void SetReason(string reason)
Misc GENIE control constants.
static const unsigned int kRjMaxIterations
bool IsPseudoParticle(int pdgc)
Simple functions for loading and reading nucleus dependent keys from config files.
double Density(double r, int A, double ring=0.)
string Vec3AsString(const TVector3 *vec)
Root of GENIE utility namespaces.
THE MAIN GENIE PROJECT NAMESPACE