21#include <TRootIOCtor.h>
31using std::setprecision;
33using std::ostringstream;
41 init_state.
Print(stream);
55 this->
Init(target_pdgc, probe_pdgc);
62 this->
Init(target_pdgc, probe_pdgc);
68 int target_pdgc = tgt.
Pdg();
69 this->
Init(target_pdgc, probe_pdgc);
76 this->
Copy(init_state);
98 fProbeP4 =
new TLorentzVector(0, 0, 0, 0);
99 fTgtP4 =
new TLorentzVector(0, 0, 0, 0);
109 double m = p->Mass();
110 double M = t->Mass();
114 fProbeP4 =
new TLorentzVector(0, 0, 0, m);
115 fTgtP4 =
new TLorentzVector(0, 0, 0, M);
156 this->
Init(tgt_pdgc, probe_pdgc);
164 this->
Init(tgt_pdgc, probe_pdgc);
169 int tgt_pdgc = this->
TgtPdg();
172 this->
Init(tgt_pdgc, probe_pdgc);
193 fTgtP4 -> SetE ( P4.E() );
194 fTgtP4 -> SetPx ( P4.Px() );
195 fTgtP4 -> SetPy ( P4.Py() );
196 fTgtP4 -> SetPz ( P4.Pz() );
202 int nucl =
fTgt->HitNucPdg();
211 int nucl =
fTgt->HitNucPdg();
220 int nucl =
fTgt->HitNucPdg();
229 int nucl =
fTgt->HitNucPdg();
239 int nucl =
fTgt->HitNucPdg();
249 int nucl =
fTgt->HitNucPdg();
259 int nucl =
fTgt->HitNucPdg();
269 int nucl =
fTgt->HitNucPdg();
297 assert(
fTgt->HitNucIsSet());
298 TLorentzVector * pnuc4 =
fTgt->HitNucP4Ptr();
301 double bx = pnuc4->Px() / pnuc4->Energy();
302 double by = pnuc4->Py() / pnuc4->Energy();
303 double bz = pnuc4->Pz() / pnuc4->Energy();
306 TLorentzVector * p4 =
new TLorentzVector(*
fTgtP4);
307 p4->Boost(-bx,-by,-bz);
315 TLorentzVector * p4 =
new TLorentzVector(*
fTgtP4);
320 LOG(
"Interaction",
pERROR) <<
"Uknown reference frame";
339 TLorentzVector * p4 =
new TLorentzVector(*
fProbeP4);
349 assert(
fTgt->HitNucP4Ptr() != 0 );
351 TLorentzVector * pnuc4 =
fTgt->HitNucP4Ptr();
355 double bx = pnuc4->Px() / pnuc4->Energy();
356 double by = pnuc4->Py() / pnuc4->Energy();
357 double bz = pnuc4->Pz() / pnuc4->Energy();
361 TLorentzVector * p4 =
new TLorentzVector(*
fProbeP4);
363 p4->Boost(-bx,-by,-bz);
372 TLorentzVector * p4 =
new TLorentzVector(*
fProbeP4);
379 LOG(
"Interaction",
pERROR) <<
"Uknown reference frame";
386 TLorentzVector * p4 = this->
GetProbeP4(ref_frame);
387 double E = p4->Energy();
397 TLorentzVector * p4 =
fTgt->HitNucP4Ptr();
400 double s = k4->Dot(*k4);
401 double E = TMath::Sqrt(s);
414 ostringstream init_state;
416 if (this->
Probe()->Mass() > 0) {
417 init_state <<
"dm_mass:" << this->
Probe()->Mass() <<
";";
420 init_state <<
"nu-pdg:" << this->
ProbePdg() <<
";";
422 init_state <<
"tgt-pdg:" << this->
Tgt().
Pdg() <<
";";
424 return init_state.str();
429 stream <<
"[-] [Init-State] " << endl;
431 stream <<
" |--> probe : "
433 <<
" (" << this->
Probe()->GetName() <<
")" << endl;
435 stream <<
" |--> nucl. target : "
436 <<
"Z = " <<
fTgt->Z()
437 <<
", A = " <<
fTgt->A()
438 <<
", PDG-Code = " <<
fTgt->Pdg();
442 stream <<
" (" << tgt->GetName() <<
")";
446 stream <<
" |--> hit nucleon : ";
447 int nuc_pdgc =
fTgt->HitNucPdg();
451 stream <<
"PDC-Code = " << nuc_pdgc <<
" (" << p->GetName() <<
")";
457 stream <<
" |--> hit quark : ";
458 int qrk_pdgc =
fTgt->HitQrkPdg();
462 stream <<
"PDC-Code = " << qrk_pdgc <<
" (" << p->GetName() <<
") ";
463 stream << (
fTgt->HitSeaQrk() ?
"[sea]" :
"[valence]");
469 stream <<
" |--> probe 4P : "
470 <<
"(E = " << setw(12) << setprecision(6) <<
fProbeP4->E()
471 <<
", Px = " << setw(12) << setprecision(6) <<
fProbeP4->Px()
472 <<
", Py = " << setw(12) << setprecision(6) <<
fProbeP4->Py()
473 <<
", Pz = " << setw(12) << setprecision(6) <<
fProbeP4->Pz()
476 stream <<
" |--> target 4P : "
477 <<
"(E = " << setw(12) << setprecision(6) <<
fTgtP4->E()
478 <<
", Px = " << setw(12) << setprecision(6) <<
fTgtP4->Px()
479 <<
", Py = " << setw(12) << setprecision(6) <<
fTgtP4->Py()
480 <<
", Pz = " << setw(12) << setprecision(6) <<
fTgtP4->Pz()
486 TLorentzVector * nuc_p4 =
fTgt->HitNucP4Ptr();
488 stream <<
" |--> nucleon 4P : "
489 <<
"(E = " << setw(12) << setprecision(6) << nuc_p4->E()
490 <<
", Px = " << setw(12) << setprecision(6) << nuc_p4->Px()
491 <<
", Py = " << setw(12) << setprecision(6) << nuc_p4->Py()
492 <<
", Pz = " << setw(12) << setprecision(6) << nuc_p4->Pz()
500 const Target & target = init_state.
Tgt();
509 return this->
Compare(init_state);
514 this->
Copy(init_state);
ClassImp(InitialState) namespace genie
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE,...
Initial State information.
bool IsDMBN(void) const
is anti-dark matter + neutron?
void SetProbePdg(int pdg_code)
int fProbePdg
probe PDG code
void SetPdgs(int tgt_pdgc, int probe_pdgc)
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
Target * fTgt
nuclear target
bool IsNuBarN(void) const
is anti-neutrino + neutron?
const Target & Tgt(void) const
bool operator==(const InitialState &i) const
equal?
bool IsNuP(void) const
is neutrino + proton?
string AsString(void) const
InitialState & operator=(const InitialState &i)
copy
bool IsNuN(void) const
is neutrino + neutron?
void Print(ostream &stream) const
void Copy(const InitialState &init_state)
void SetProbeP4(const TLorentzVector &P4)
TParticlePDG * Probe(void) const
bool IsDMN(void) const
is dark matter + neutron?
void SetTgtP4(const TLorentzVector &P4)
double CMEnergy() const
centre-of-mass energy (sqrt s)
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
double ProbeE(RefFrame_t rf) const
TLorentzVector * GetTgtP4(RefFrame_t rf=kRfLab) const
bool Compare(const InitialState &init_state) const
bool IsNuBarP(void) const
is anti-neutrino + proton?
bool IsDMBP(void) const
is anti-dark matter + proton?
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
void SetTgtPdg(int pdg_code)
bool IsDMP(void) const
is dark matter + proton?
static PDGLibrary * Instance(void)
TParticlePDG * Find(int pdgc, bool must_exist=true)
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
bool IsNeutrino(int pdgc)
int IonPdgCode(int A, int Z)
bool IsAntiQuark(int pdgc)
bool IsAntiDarkMatter(int pdgc)
bool IsDarkMatter(int pdgc)
bool IsNeutronOrProton(int pdgc)
bool IsAntiNeutrino(int pdgc)
THE MAIN GENIE PROJECT NAMESPACE
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
enum genie::ERefFrame RefFrame_t