24 using namespace genie;
57 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding final state photon";
63 const TLorentzVector & p4nuc_lab = *(nuc->
P4());
64 TVector3
beta = p4nuc_lab.BoostVector();
68 const TLorentzVector & p4v_lab = *(nu->
P4());
71 TLorentzVector p4v_nrf = p4v_lab;
72 p4v_nrf.Boost(-1.*beta);
76 double costheta_gamma = -1.0 + 2.0 * rnd->
RndKine().Rndm();
77 double phi_gamma = 2.0 *
kPi * rnd->
RndKine().Rndm();
80 double efrac_gamma = rnd->
RndKine().Rndm();
83 double Ev_nrf = p4v_nrf.Energy();
84 double Egamma_nrf = Ev_nrf * efrac_gamma;
88 double sintheta_gamma = TMath::Sqrt(1-TMath::Power(costheta_gamma,2));
89 double pgamma_nrf_p = Egamma_nrf * costheta_gamma;
90 double pgamma_nrf_t = Egamma_nrf * sintheta_gamma;
91 double px = pgamma_nrf_t * TMath::Sin(phi_gamma);
92 double py = pgamma_nrf_t * TMath::Cos(phi_gamma);
93 double pz = pgamma_nrf_p;
96 TVector3 unit_nudir = p4v_nrf.Vect().Unit();
99 TVector3 p3gamma_nrf(px,py,pz);
100 p3gamma_nrf.RotateUz(unit_nudir);
103 TLorentzVector p4gamma_lab(p3gamma_nrf, Egamma_nrf);
104 p4gamma_lab.Boost(beta);
107 const TLorentzVector & vtx = *(nu->
X4());
117 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding final state neutrino";
124 const TLorentzVector & vtx = *(nu->
X4());
126 const TLorentzVector & p4nu_lab = *(nu->
P4());
127 const TLorentzVector & p4gamma_lab = *(gamma->
P4());
128 TLorentzVector p4_lab = p4nu_lab - p4gamma_lab;
144 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding recoil nucleon";
148 bool is_nuclear_target = (tgt_nucleus!=0);
155 int pdgc = hitnuc->
Pdg();
158 const TLorentzVector & p4n = *(hitnuc->
P4());
159 TLorentzVector p4(p4n);
163 if (is_nuclear_target) {
164 double p = p4.Vect().Mag();
166 double E = TMath::Sqrt(m*m+p*p);
172 const TLorentzVector & vtx = *(neutrino->
X4());
180 <<
"Adding recoil baryon [pdgc = " << pdgc <<
"]";
192 LOG(
"AMNuGammaGenerator",
pINFO) <<
"Adding final state nucleus";
198 <<
"No nucleus in the initial state - no remnant nucleus to add in the f/s";
209 int npdgc = rec_nucleon->
Pdg();
211 int A = nucleus->
A();
212 int Z = nucleus->
Z();
219 <<
"No particle with [A = " << A <<
", Z = " << Z
220 <<
", pdgc = " << ipdgc <<
"] in PDGLibrary!";
225 double Mf = remnant->Mass();
226 double Mf2 = TMath::Power(Mf,2);
227 double px = -1.* rec_nucleon->
Px();
228 double py = -1.* rec_nucleon->
Py();
229 double pz = -1.* rec_nucleon->
Pz();
230 double E = TMath::Sqrt(Mf2 + rec_nucleon->
P4()->Vect().Mag2());
231 E += (hit_nucleon->
P4()->E() - rec_nucleon->
P4()->E());
235 <<
"Adding nucleus [A = " << A <<
", Z = " << Z
236 <<
", pdgc = " << ipdgc <<
"]";
239 ipdgc,
kIStStableFinalState, mom,-1,-1,-1, px,py,pz,E, 0,0,0,0);
virtual GHepParticle * Particle(int position) const
double beta(double KE, const simb::MCParticle *part)
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
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
double gamma(double KE, const simb::MCParticle *part)
void AddRecoilNucleon(GHepRecord *event_rec) const
static PDGLibrary * Instance(void)
const TLorentzVector * X4(void) const
virtual GHepParticle * HitNucleon(void) const
int IonPdgCode(int A, int Z)
virtual void AddParticle(const GHepParticle &p)
TParticlePDG * Find(int pdgc, bool must_exist=true)
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
enum genie::EGHepStatus GHepStatus_t
double Py(void) const
Get Py.