49 using namespace genie;
77 TVector3 vtx(9999999.,999999.,999999.);
81 double A = nucltgt->
A();
87 TObjArrayIter piter(evrec);
94 LOG(
"Vtx",
pINFO) <<
"Setting vertex position for: " << p->
Name();
122 TVector3 vtx(999999.,999999.,999999.);
127 bool realistic = !uniform;
134 double R =
fR0 * TMath::Power(A, 1./3.);
146 LOG(
"Vtx",
pINFO) <<
"Setting vertex on the nuclear boundary";
147 double phi = 2*
kPi * rnd->
RndFsi().Rndm();
148 double cosphi = TMath::Cos(phi);
149 double sinphi = TMath::Sin(phi);
150 double costheta = -1 + 2 * rnd->
RndFsi().Rndm();
151 double sintheta =
TMath::Sqrt(1-costheta*costheta);
152 vtx.SetX(R*sintheta*cosphi);
153 vtx.SetY(R*sintheta*sinphi);
154 vtx.SetZ(R*costheta);
165 <<
"Generating vertex according to a realistic nuclear density profile";
170 for(
double r = 0;
r < rmax;
r+=dr) {
176 unsigned int iter = 0;
183 <<
"Couldn't generate a vertex position after " << iter <<
" iterations";
186 exception.
SetReason(
"Couldn't generate vertex");
191 double r = rmax * rnd->
RndFsi().Rndm();
192 double t = ymax * rnd->
RndFsi().Rndm();
196 <<
"y = " << y <<
" > ymax = " << ymax
197 <<
" for r = " << r <<
", A = " <<
A;
199 bool accept = (t <
y);
201 double phi = 2*
kPi * rnd->
RndFsi().Rndm();
202 double cosphi = TMath::Cos(phi);
203 double sinphi = TMath::Sin(phi);
204 double costheta = -1 + 2 * rnd->
RndFsi().Rndm();
205 double sintheta =
TMath::Sqrt(1-costheta*costheta);
206 vtx.SetX(r*sintheta*cosphi);
207 vtx.SetY(r*sintheta*sinphi);
208 vtx.SetZ(r*costheta);
218 <<
"Generating intranuclear vertex uniformly in volume";
219 while(vtx.Mag() >
R) {
220 vtx.SetX(-R + 2*R * rnd->
RndFsi().Rndm());
221 vtx.SetY(-R + 2*R * rnd->
RndFsi().Rndm());
222 vtx.SetZ(-R + 2*R * rnd->
RndFsi().Rndm());
230 <<
"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])
double fR0
parameter controlling nuclear sizes
TRandom3 & RndFsi(void) const
rnd number generator used by intranuclear cascade monte carlos
THE MAIN GENIE PROJECT NAMESPACE
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
::xsd::cxx::tree::exception< char > exception
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 IsNuElectronElastic(void) const
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
Misc GENIE control constants.
void Configure(const Registry &config)
void SwitchOnFastForward(void)
void SetReason(string reason)
Var Sqrt(const Var &v)
Use to take sqrt of a var.
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
bool IsCoherentElas(void) const
static const unsigned int kRjMaxIterations
GENIE's GHEP MC event record.
STDHEP-like event record entry that can fit a particle or a nucleus.
string Vec3AsString(const TVector3 *vec)
Root of GENIE utility namespaces.
void ProcessEventRecord(GHepRecord *event_rec) const
bool IsCoherent(void) const