44 using namespace genie;
77 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding final state photon";
83 const TLorentzVector & p4nuc_lab = *(nuc->
P4());
84 TVector3
beta = p4nuc_lab.BoostVector();
88 const TLorentzVector & p4v_lab = *(nu->
P4());
91 TLorentzVector p4v_nrf = p4v_lab;
92 p4v_nrf.Boost(-1.*beta);
96 double costheta_gamma = -1.0 + 2.0 * rnd->
RndKine().Rndm();
97 double phi_gamma = 2.0 *
kPi * rnd->
RndKine().Rndm();
100 double efrac_gamma = rnd->
RndKine().Rndm();
103 double Ev_nrf = p4v_nrf.Energy();
104 double Egamma_nrf = Ev_nrf * efrac_gamma;
108 double sintheta_gamma =
TMath::Sqrt(1-TMath::Power(costheta_gamma,2));
109 double pgamma_nrf_p = Egamma_nrf * costheta_gamma;
110 double pgamma_nrf_t = Egamma_nrf * sintheta_gamma;
111 double px = pgamma_nrf_t * TMath::Sin(phi_gamma);
112 double py = pgamma_nrf_t * TMath::Cos(phi_gamma);
113 double pz = pgamma_nrf_p;
116 TVector3 unit_nudir = p4v_nrf.Vect().Unit();
119 TVector3 p3gamma_nrf(px,py,pz);
120 p3gamma_nrf.RotateUz(unit_nudir);
123 TLorentzVector p4gamma_lab(p3gamma_nrf, Egamma_nrf);
124 p4gamma_lab.Boost(beta);
127 const TLorentzVector & vtx = *(nu->
X4());
137 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding final state neutrino";
144 const TLorentzVector & vtx = *(nu->
X4());
146 const TLorentzVector & p4nu_lab = *(nu->
P4());
147 const TLorentzVector & p4gamma_lab = *(gamma->
P4());
148 TLorentzVector p4_lab = p4nu_lab - p4gamma_lab;
164 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding recoil nucleon";
168 bool is_nuclear_target = (tgt_nucleus!=0);
175 int pdgc = hitnuc->
Pdg();
178 const TLorentzVector & p4n = *(hitnuc->
P4());
179 TLorentzVector
p4(p4n);
183 if (is_nuclear_target) {
184 double p = p4.Vect().Mag();
192 const TLorentzVector & vtx = *(neutrino->
X4());
200 <<
"Adding recoil baryon [pdgc = " << pdgc <<
"]";
212 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding final state nucleus";
218 <<
"No nucleus in the initial state - no remnant nucleus to add in the f/s";
229 int npdgc = rec_nucleon->
Pdg();
231 int A = nucleus->
A();
232 int Z = nucleus->
Z();
239 <<
"No particle with [A = " << A <<
", Z = " << Z
240 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
245 double Mf = remnant->Mass();
246 double Mf2 = TMath::Power(Mf,2);
247 double px = -1.* rec_nucleon->
Px();
248 double py = -1.* rec_nucleon->
Py();
249 double pz = -1.* rec_nucleon->
Pz();
251 E += (hit_nucleon->
P4()->E() - rec_nucleon->
P4()->E());
255 <<
"Adding nucleus [A = " << A <<
", Z = " << Z
256 <<
", pdgc = " << ipdgc <<
"]";
259 ipdgc,
kIStStableFinalState, mom,-1,-1,-1, px,py,pz,E, 0,0,0,0);
virtual GHepParticle * Particle(int position) const
THE MAIN GENIE PROJECT NAMESPACE
static RandomGen * Instance()
Access instance.
const TLorentzVector * P4(void) const
Defines the EventRecordVisitorI interface. Concrete implementations of this interface use the 'Visito...
int FirstDaughter(void) const
enum genie::EGHepStatus GHepStatus_t
virtual int HitNucleonPosition(void) const
void AddTargetRemnant(GHepRecord *event_rec) const
A singleton holding random number generator classes. All random number generation in GENIE should tak...
void AddPhoton(GHepRecord *event_rec) const
double Pz(void) const
Get Pz.
double Px(void) const
Get Px.
virtual GHepParticle * Probe(void) const
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
void AddFinalStateNeutrino(GHepRecord *event_rec) const
virtual GHepParticle * TargetNucleus(void) const
TRandom3 & RndKine(void) const
rnd number generator used by kinematics generators
void AddRecoilNucleon(GHepRecord *event_rec) const
static PDGLibrary * Instance(void)
Var Sqrt(const Var &v)
Use to take sqrt of a var.
const TLorentzVector * X4(void) const
virtual GHepParticle * HitNucleon(void) const
TParticlePDG * Find(int pdgc)
int IonPdgCode(int A, int Z)
assert(nhit_max >=nhit_nbins)
virtual void AddParticle(const GHepParticle &p)
void ProcessEventRecord(GHepRecord *event_rec) const
GENIE's GHEP MC event record.
Most commonly used PDG codes. A set of utility functions to handle PDG codes is provided in PDGUtils...
STDHEP-like event record entry that can fit a particle or a nucleus.
virtual int TargetNucleusPosition(void) const
double Py(void) const
Get Py.