28 using namespace genie;
29 using namespace genie::utils;
30 using namespace genie::controls;
31 using namespace genie::constants;
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 / "
TVector3 GenerateVertex(const Interaction *in, double A) const
int fVtxGenMethod
vtx generation method (0: uniform, 1: according to nuclear density [def])
bool IsPhotonResonance(void) const
double fR0
parameter controlling nuclear sizes
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
virtual Interaction * Summary(void) const
static RandomGen * Instance()
Access instance.
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
double Density(double r, int A, double ring=0.)
bool IsInverseMuDecay(void) const
bool IsCoherentProduction(void) const
bool IsIMDAnnihilation(void) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
string Name(void) const
Name that corresponds to the PDG code.
Summary information for an interaction.
void SetPosition(const TLorentzVector &v4)
An exception thrown by EventRecordVisitorI when the normal processing sequence has to be disrupted (f...
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
bool IsCoherentElastic(void) const
bool IsNuElectronElastic(void) const
static constexpr double A
A class encapsulating an enumeration of interaction types (EM, Weak-CC, Weak-NC) and scattering types...
virtual void Configure(const Registry &config)
virtual GHepParticle * TargetNucleus(void) const
bool IsPhotonCoherent(void) const
void Configure(const Registry &config)
void SwitchOnFastForward(void)
void SetReason(string reason)
A registry. Provides the container for algorithm configuration parameters.
bool IsPseudoParticle(int pdgc)
const ProcessInfo & ProcInfo(void) const
bool GetParam(const RgKey &name, T &p, bool is_top_call=true) const
static const unsigned int kRjMaxIterations
bool IsGlashowResonance(void) const
GENIE's GHEP MC event record.
STDHEP-like event record entry that can fit a particle or a nucleus.
string Vec3AsString(const TVector3 *vec)
void ProcessEventRecord(GHepRecord *event_rec) const