28 using namespace genie;
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.);
125 LOG(
"Vtx",
pINFO) <<
"Setting vertex on the nuclear boundary";
126 double phi = 2*
kPi * rnd->
RndFsi().Rndm();
127 double cosphi = TMath::Cos(phi);
128 double sinphi = TMath::Sin(phi);
129 double costheta = -1 + 2 * rnd->
RndFsi().Rndm();
130 double sintheta = TMath::Sqrt(1-costheta*costheta);
131 vtx.SetX(R*sintheta*cosphi);
132 vtx.SetY(R*sintheta*sinphi);
133 vtx.SetZ(R*costheta);
144 <<
"Generating vertex according to a realistic nuclear density profile";
149 for(
double r = 0;
r < rmax;
r+=dr) {
155 unsigned int iter = 0;
162 <<
"Couldn't generate a vertex position after " << iter <<
" iterations";
165 exception.
SetReason(
"Couldn't generate vertex");
170 double r = rmax * rnd->
RndFsi().Rndm();
171 double t = ymax * rnd->
RndFsi().Rndm();
175 <<
"y = " << y <<
" > ymax = " << ymax
176 <<
" for r = " << r <<
", A = " <<
A;
178 bool accept = (t <
y);
180 double phi = 2*
kPi * rnd->
RndFsi().Rndm();
181 double cosphi = TMath::Cos(phi);
182 double sinphi = TMath::Sin(phi);
183 double costheta = -1 + 2 * rnd->
RndFsi().Rndm();
184 double sintheta = TMath::Sqrt(1-costheta*costheta);
185 vtx.SetX(r*sintheta*cosphi);
186 vtx.SetY(r*sintheta*sinphi);
187 vtx.SetZ(r*costheta);
197 <<
"Generating intranuclear vertex uniformly in volume";
198 while(vtx.Mag() >
R) {
199 vtx.SetX(-R + 2*R * rnd->
RndFsi().Rndm());
200 vtx.SetY(-R + 2*R * rnd->
RndFsi().Rndm());
201 vtx.SetZ(-R + 2*R * rnd->
RndFsi().Rndm());
209 <<
"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
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
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)
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
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
cet::coded_exception< error, detail::translate > exception