Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
genie::InitialState Class Reference

Initial State information. More...

#include <InitialState.h>

Inheritance diagram for genie::InitialState:

Public Member Functions

 InitialState ()
 
 InitialState (int tgt_pdgc, int probe_pdgc)
 
 InitialState (int Z, int A, int probe_pdgc)
 
 InitialState (const Target &tgt, int probe_pdgc)
 
 InitialState (const InitialState &initial_state)
 
 InitialState (TRootIOCtor *)
 
 ~InitialState ()
 
TParticlePDG * Probe (void) const
 
int ProbePdg (void) const
 
int TgtPdg (void) const
 
const TargetTgt (void) const
 
TargetTgtPtr (void) const
 
TLorentzVector * GetTgtP4 (RefFrame_t rf=kRfLab) const
 
TLorentzVector * GetProbeP4 (RefFrame_t rf=kRfHitNucRest) const
 
double ProbeE (RefFrame_t rf) const
 
double CMEnergy () const
 centre-of-mass energy (sqrt s) More...
 
void SetPdgs (int tgt_pdgc, int probe_pdgc)
 
void SetProbePdg (int pdg_code)
 
void SetTgtPdg (int pdg_code)
 
void SetTgtP4 (const TLorentzVector &P4)
 
void SetProbeP4 (const TLorentzVector &P4)
 
void SetProbeE (double E)
 
bool IsNuP (void) const
 is neutrino + proton? More...
 
bool IsNuN (void) const
 is neutrino + neutron? More...
 
bool IsNuBarP (void) const
 is anti-neutrino + proton? More...
 
bool IsNuBarN (void) const
 is anti-neutrino + neutron? More...
 
bool IsDMP (void) const
 is dark matter + proton? More...
 
bool IsDMN (void) const
 is dark matter + neutron? More...
 
bool IsDMBP (void) const
 is anti-dark matter + proton? More...
 
bool IsDMBN (void) const
 is anti-dark matter + neutron? More...
 
void Reset (void)
 
void Copy (const InitialState &init_state)
 
bool Compare (const InitialState &init_state) const
 
string AsString (void) const
 
void Print (ostream &stream) const
 
bool operator== (const InitialState &i) const
 equal? More...
 
InitialStateoperator= (const InitialState &i)
 copy More...
 

Private Member Functions

void Init (void)
 
void Init (int target_pdgc, int probe_pdgc)
 
void CleanUp (void)
 

Private Attributes

int fProbePdg
 probe PDG code More...
 
TargetfTgt
 nuclear target More...
 
TLorentzVector * fProbeP4
 probe 4-momentum in LAB-frame More...
 
TLorentzVector * fTgtP4
 nuclear target 4-momentum in LAB-frame More...
 

Friends

ostream & operator<< (ostream &stream, const InitialState &i)
 print More...
 

Detailed Description

Initial State information.

Author
Costas Andreopoulos <constantinos.andreopoulos cern.ch> University of Liverpool & STFC Rutherford Appleton Laboratory

Changes required to implement the GENIE Boosted Dark Matter module were installed by Josh Berger (Univ. of Wisconsin)

Other minor changes / additions and fixes were installed by: Andy Furmanski (Univ. of Manchester) Joe Johnston (Univ of Pittsburgh)

May 02, 2004

Copyright (c) 2003-2020, The GENIE Collaboration For the full text of the license visit http://copyright.genie-mc.org

Definition at line 48 of file InitialState.h.

Constructor & Destructor Documentation

InitialState::InitialState ( )

Definition at line 46 of file InitialState.cxx.

46  :
47 TObject()
48 {
49  this->Init();
50 }
InitialState::InitialState ( int  tgt_pdgc,
int  probe_pdgc 
)

Definition at line 52 of file InitialState.cxx.

52  :
53 TObject()
54 {
55  this->Init(target_pdgc, probe_pdgc);
56 }
InitialState::InitialState ( int  Z,
int  A,
int  probe_pdgc 
)

Definition at line 58 of file InitialState.cxx.

58  :
59 TObject()
60 {
61  int target_pdgc = pdg::IonPdgCode(A,Z);
62  this->Init(target_pdgc, probe_pdgc);
63 }
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
#define A
Definition: memgrp.cpp:38
InitialState::InitialState ( const Target tgt,
int  probe_pdgc 
)

Definition at line 65 of file InitialState.cxx.

65  :
66 TObject()
67 {
68  int target_pdgc = tgt.Pdg();
69  this->Init(target_pdgc, probe_pdgc);
70 }
int Pdg(void) const
Definition: Target.h:71
InitialState::InitialState ( const InitialState initial_state)

Definition at line 72 of file InitialState.cxx.

72  :
73 TObject()
74 {
75  this->Init();
76  this->Copy(init_state);
77 }
void Copy(const InitialState &init_state)
InitialState::InitialState ( TRootIOCtor *  )

Definition at line 79 of file InitialState.cxx.

79  :
80 TObject(),
81 fProbePdg(0),
82 fTgt(0),
83 fProbeP4(0),
84 fTgtP4(0)
85 {
86 
87 }
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
int fProbePdg
probe PDG code
Definition: InitialState.h:109
InitialState::~InitialState ( )

Definition at line 89 of file InitialState.cxx.

90 {
91  this->CleanUp();
92 }

Member Function Documentation

string InitialState::AsString ( void  ) const

Definition at line 408 of file InitialState.cxx.

409 {
410 // Code-ify the interaction in a string to be used as (part of a) keys
411 // Template:
412 // nu_pdg:code;tgt-pdg:code;
413 
414  ostringstream init_state;
415 
416  if (this->Probe()->Mass() > 0) {
417  init_state << "dm_mass:" << this->Probe()->Mass() << ";";
418  }
419  else {
420  init_state << "nu-pdg:" << this->ProbePdg() << ";";
421  }
422  init_state << "tgt-pdg:" << this->Tgt().Pdg() << ";";
423 
424  return init_state.str();
425 }
int Pdg(void) const
Definition: Target.h:71
TParticlePDG * Probe(void) const
double Mass(Resonance_t res)
resonance mass (GeV)
int ProbePdg(void) const
Definition: InitialState.h:64
const Target & Tgt(void) const
Definition: InitialState.h:66
void InitialState::CleanUp ( void  )
private

Definition at line 118 of file InitialState.cxx.

119 {
120  delete fTgt;
121  delete fProbeP4;
122  delete fTgtP4;
123 }
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
double InitialState::CMEnergy ( ) const

centre-of-mass energy (sqrt s)

Definition at line 394 of file InitialState.cxx.

395 {
396  TLorentzVector * k4 = this->GetProbeP4(kRfLab);
397  TLorentzVector * p4 = fTgt->HitNucP4Ptr();
398 
399  *k4 += *p4; // now k4 represents centre-of-mass 4-momentum
400  double s = k4->Dot(*k4); // dot-product with itself
401  double E = TMath::Sqrt(s);
402 
403  delete k4;
404 
405  return E;
406 }
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
E
Definition: 018_def.c:13
static QCString * s
Definition: config.cpp:1042
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
bool InitialState::Compare ( const InitialState init_state) const

Definition at line 497 of file InitialState.cxx.

498 {
499  int probe = init_state.ProbePdg();
500  const Target & target = init_state.Tgt();
501 
502  bool equal = (fProbePdg == probe) && (*fTgt == target);
503 
504  return equal;
505 }
Target * fTgt
nuclear target
Definition: InitialState.h:110
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int ProbePdg(void) const
Definition: InitialState.h:64
int fProbePdg
probe PDG code
Definition: InitialState.h:109
const Target & Tgt(void) const
Definition: InitialState.h:66
void InitialState::Copy ( const InitialState init_state)

Definition at line 131 of file InitialState.cxx.

132 {
133  fProbePdg = init_state.fProbePdg;
134 
135  fTgt->Copy(*init_state.fTgt);
136 
137  this -> SetProbeP4 ( *init_state.fProbeP4 );
138  this -> SetTgtP4 ( *init_state.fTgtP4 );
139 }
void SetTgtP4(const TLorentzVector &P4)
void SetProbeP4(const TLorentzVector &P4)
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
void Copy(const Target &t)
Definition: Target.cxx:116
int fProbePdg
probe PDG code
Definition: InitialState.h:109
TLorentzVector * InitialState::GetProbeP4 ( RefFrame_t  rf = kRfHitNucRest) const

Definition at line 325 of file InitialState.cxx.

326 {
327 // Return the probe 4-momentum in the specified reference frame
328 // Note: the caller adopts the TLorentzVector object
329 
330  switch (ref_frame) {
331 
332  //------------------ NUCLEAR TARGET REST FRAME:
333  case (kRfTgtRest) :
334  {
335  // for now assure that the target nucleus is always at rest
336  // and it is only the struck nucleons that can move:
337  // so the [target rest frame] = [LAB frame]
338 
339  TLorentzVector * p4 = new TLorentzVector(*fProbeP4);
340  return p4;
341  }
342 
343  //------------------ STRUCK NUCLEON REST FRAME:
344  case (kRfHitNucRest) :
345  {
346  // make sure that 'struck nucleon' properties were set in
347  // the nuclear target object
348 
349  assert( fTgt->HitNucP4Ptr() != 0 );
350 
351  TLorentzVector * pnuc4 = fTgt->HitNucP4Ptr();
352 
353  // compute velocity vector (px/E, py/E, pz/E)
354 
355  double bx = pnuc4->Px() / pnuc4->Energy();
356  double by = pnuc4->Py() / pnuc4->Energy();
357  double bz = pnuc4->Pz() / pnuc4->Energy();
358 
359  // BOOST
360 
361  TLorentzVector * p4 = new TLorentzVector(*fProbeP4);
362 
363  p4->Boost(-bx,-by,-bz);
364 
365  return p4;
366 
367  break;
368  }
369  //------------------ LAB:
370  case (kRfLab) :
371  {
372  TLorentzVector * p4 = new TLorentzVector(*fProbeP4);
373  return p4;
374 
375  break;
376  }
377  default:
378 
379  LOG("Interaction", pERROR) << "Uknown reference frame";
380  }
381  return 0;
382 }
#define pERROR
Definition: Messenger.h:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
TLorentzVector * InitialState::GetTgtP4 ( RefFrame_t  rf = kRfLab) const

Definition at line 275 of file InitialState.cxx.

276 {
277 // Return the target 4-momentum in the specified reference frame
278 // Note: the caller adopts the TLorentzVector object
279 
280  switch (ref_frame) {
281 
282  //------------------ NUCLEAR TARGET REST FRAME:
283  case (kRfTgtRest) :
284  {
285  // for now make sure that the target nucleus is always at
286  // rest and it is only the struck nucleons that can move:
287  // so the [target rest frame] = [LAB frame]
288 
289  return this->GetTgtP4(kRfLab);
290  }
291 
292  //------------------ STRUCK NUCLEON REST FRAME:
293  case (kRfHitNucRest) :
294  {
295  // make sure that 'struck nucleon' properties were set in
296  // the nuclear target object
297  assert(fTgt->HitNucIsSet());
298  TLorentzVector * pnuc4 = fTgt->HitNucP4Ptr();
299 
300  // compute velocity vector (px/E, py/E, pz/E)
301  double bx = pnuc4->Px() / pnuc4->Energy();
302  double by = pnuc4->Py() / pnuc4->Energy();
303  double bz = pnuc4->Pz() / pnuc4->Energy();
304 
305  // BOOST
306  TLorentzVector * p4 = new TLorentzVector(*fTgtP4);
307  p4->Boost(-bx,-by,-bz);
308 
309  return p4;
310  break;
311  }
312  //------------------ LAB:
313  case (kRfLab) :
314  {
315  TLorentzVector * p4 = new TLorentzVector(*fTgtP4);
316  return p4;
317  break;
318  }
319  default:
320  LOG("Interaction", pERROR) << "Uknown reference frame";
321  }
322  return 0;
323 }
#define pERROR
Definition: Messenger.h:59
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
bool HitNucIsSet(void) const
Definition: Target.cxx:283
TLorentzVector * GetTgtP4(RefFrame_t rf=kRfLab) const
void InitialState::Init ( void  )
private

Definition at line 94 of file InitialState.cxx.

95 {
96  fProbePdg = 0;
97  fTgt = new Target();
98  fProbeP4 = new TLorentzVector(0, 0, 0, 0);
99  fTgtP4 = new TLorentzVector(0, 0, 0, 0);
100 }
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
int fProbePdg
probe PDG code
Definition: InitialState.h:109
void InitialState::Init ( int  target_pdgc,
int  probe_pdgc 
)
private

Definition at line 102 of file InitialState.cxx.

103 {
104  TParticlePDG * t = PDGLibrary::Instance()->Find(target_pdgc);
105  TParticlePDG * p = PDGLibrary::Instance()->Find(probe_pdgc );
106 
107  assert(t && p);
108 
109  double m = p->Mass();
110  double M = t->Mass();
111 
112  fProbePdg = probe_pdgc;
113  fTgt = new Target(target_pdgc);
114  fProbeP4 = new TLorentzVector(0, 0, 0, m);
115  fTgtP4 = new TLorentzVector(0, 0, 0, M);
116 }
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
p
Definition: test.py:223
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
int fProbePdg
probe PDG code
Definition: InitialState.h:109
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
bool InitialState::IsDMBN ( void  ) const

is anti-dark matter + neutron?

Definition at line 265 of file InitialState.cxx.

266 {
267 // Check if DM - neutron interaction
268  int prob = fProbePdg;
269  int nucl = fTgt->HitNucPdg();
270  bool isdn = pdg::IsAntiDarkMatter(prob) && pdg::IsNeutron(nucl);
271 
272  return isdn;
273 }
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
bool IsAntiDarkMatter(int pdgc)
Definition: PDGUtils.cxx:130
Target * fTgt
nuclear target
Definition: InitialState.h:110
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsDMBP ( void  ) const

is anti-dark matter + proton?

Definition at line 255 of file InitialState.cxx.

256 {
257 // Check if DM - proton interaction
258  int prob = fProbePdg;
259  int nucl = fTgt->HitNucPdg();
260  bool isdp = pdg::IsAntiDarkMatter(prob) && pdg::IsProton(nucl);
261 
262  return isdp;
263 }
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
bool IsAntiDarkMatter(int pdgc)
Definition: PDGUtils.cxx:130
Target * fTgt
nuclear target
Definition: InitialState.h:110
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsDMN ( void  ) const

is dark matter + neutron?

Definition at line 245 of file InitialState.cxx.

246 {
247 // Check if DM - neutron interaction
248  int prob = fProbePdg;
249  int nucl = fTgt->HitNucPdg();
250  bool isdn = pdg::IsDarkMatter(prob) && pdg::IsNeutron(nucl);
251 
252  return isdn;
253 }
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:124
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
Target * fTgt
nuclear target
Definition: InitialState.h:110
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsDMP ( void  ) const

is dark matter + proton?

Definition at line 235 of file InitialState.cxx.

236 {
237 // Check if DM - proton interaction
238  int prob = fProbePdg;
239  int nucl = fTgt->HitNucPdg();
240  bool isdp = pdg::IsDarkMatter(prob) && pdg::IsProton(nucl);
241 
242  return isdp;
243 }
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsDarkMatter(int pdgc)
Definition: PDGUtils.cxx:124
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
Target * fTgt
nuclear target
Definition: InitialState.h:110
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsNuBarN ( void  ) const

is anti-neutrino + neutron?

Definition at line 226 of file InitialState.cxx.

227 {
228  int prob = fProbePdg;
229  int nucl = fTgt->HitNucPdg();
230  bool isvbn = pdg::IsAntiNeutrino(prob) && pdg::IsNeutron(nucl);
231 
232  return isvbn;
233 }
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
Target * fTgt
nuclear target
Definition: InitialState.h:110
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsNuBarP ( void  ) const

is anti-neutrino + proton?

Definition at line 217 of file InitialState.cxx.

218 {
219  int prob = fProbePdg;
220  int nucl = fTgt->HitNucPdg();
221  bool isvbp = pdg::IsAntiNeutrino(prob) && pdg::IsProton(nucl);
222 
223  return isvbp;
224 }
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
Target * fTgt
nuclear target
Definition: InitialState.h:110
bool IsAntiNeutrino(int pdgc)
Definition: PDGUtils.cxx:115
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsNuN ( void  ) const

is neutrino + neutron?

Definition at line 208 of file InitialState.cxx.

209 {
210  int prob = fProbePdg;
211  int nucl = fTgt->HitNucPdg();
212  bool isvn = pdg::IsNeutrino(prob) && pdg::IsNeutron(nucl);
213 
214  return isvn;
215 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsNeutron(int pdgc)
Definition: PDGUtils.cxx:338
Target * fTgt
nuclear target
Definition: InitialState.h:110
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
bool InitialState::IsNuP ( void  ) const

is neutrino + proton?

Definition at line 199 of file InitialState.cxx.

200 {
201  int prob = fProbePdg;
202  int nucl = fTgt->HitNucPdg();
203  bool isvp = pdg::IsNeutrino(prob) && pdg::IsProton(nucl);
204 
205  return isvp;
206 }
bool IsNeutrino(int pdgc)
Definition: PDGUtils.cxx:107
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsProton(int pdgc)
Definition: PDGUtils.cxx:333
Target * fTgt
nuclear target
Definition: InitialState.h:110
std::string nucl(const std::string &A, const std::string &elem)
Definition: TruthText.cxx:114
int fProbePdg
probe PDG code
Definition: InitialState.h:109
InitialState & InitialState::operator= ( const InitialState i)

copy

Definition at line 512 of file InitialState.cxx.

513 {
514  this->Copy(init_state);
515  return (*this);
516 }
void Copy(const InitialState &init_state)
bool InitialState::operator== ( const InitialState i) const

equal?

Definition at line 507 of file InitialState.cxx.

508 {
509  return this->Compare(init_state);
510 }
bool Compare(const InitialState &init_state) const
void InitialState::Print ( ostream &  stream) const

Definition at line 427 of file InitialState.cxx.

428 {
429  stream << "[-] [Init-State] " << endl;
430 
431  stream << " |--> probe : "
432  << "PDG-code = " << fProbePdg
433  << " (" << this->Probe()->GetName() << ")" << endl;
434 
435  stream << " |--> nucl. target : "
436  << "Z = " << fTgt->Z()
437  << ", A = " << fTgt->A()
438  << ", PDG-Code = " << fTgt->Pdg();
439 
440  TParticlePDG * tgt = PDGLibrary::Instance()->Find( fTgt->Pdg() );
441  if(tgt) {
442  stream << " (" << tgt->GetName() << ")";
443  }
444  stream << endl;
445 
446  stream << " |--> hit nucleon : ";
447  int nuc_pdgc = fTgt->HitNucPdg();
448 
449  if ( pdg::IsNeutronOrProton(nuc_pdgc) ) {
450  TParticlePDG * p = PDGLibrary::Instance()->Find(nuc_pdgc);
451  stream << "PDC-Code = " << nuc_pdgc << " (" << p->GetName() << ")";
452  } else {
453  stream << "no set";
454  }
455  stream << endl;
456 
457  stream << " |--> hit quark : ";
458  int qrk_pdgc = fTgt->HitQrkPdg();
459 
460  if ( pdg::IsQuark(qrk_pdgc) || pdg::IsAntiQuark(qrk_pdgc)) {
461  TParticlePDG * p = PDGLibrary::Instance()->Find(qrk_pdgc);
462  stream << "PDC-Code = " << qrk_pdgc << " (" << p->GetName() << ") ";
463  stream << (fTgt->HitSeaQrk() ? "[sea]" : "[valence]");
464  } else {
465  stream << "no set";
466  }
467  stream << endl;
468 
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()
474  << ")"
475  << endl;
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()
481  << ")"
482  << endl;
483 
484  if ( pdg::IsNeutronOrProton(nuc_pdgc) ) {
485 
486  TLorentzVector * nuc_p4 = fTgt->HitNucP4Ptr();
487 
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()
493  << ")";
494  }
495 }
bool HitSeaQrk(void) const
Definition: Target.cxx:299
int HitNucPdg(void) const
Definition: Target.cxx:304
int A(void) const
Definition: Target.h:70
int HitQrkPdg(void) const
Definition: Target.cxx:242
int Pdg(void) const
Definition: Target.h:71
bool IsAntiQuark(int pdgc)
Definition: PDGUtils.cxx:255
TParticlePDG * Probe(void) const
Q_EXPORT QTSManip setprecision(int p)
Definition: qtextstream.h:343
Target * fTgt
nuclear target
Definition: InitialState.h:110
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
p
Definition: test.py:223
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
int Z(void) const
Definition: Target.h:68
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
bool IsQuark(int pdgc)
Definition: PDGUtils.cxx:247
bool IsNeutronOrProton(int pdgc)
Definition: PDGUtils.cxx:348
int fProbePdg
probe PDG code
Definition: InitialState.h:109
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
QTextStream & endl(QTextStream &s)
TParticlePDG * InitialState::Probe ( void  ) const

Definition at line 147 of file InitialState.cxx.

148 {
149  TParticlePDG * p = PDGLibrary::Instance()->Find(fProbePdg);
150  return p;
151 }
p
Definition: test.py:223
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
int fProbePdg
probe PDG code
Definition: InitialState.h:109
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
double InitialState::ProbeE ( RefFrame_t  rf) const

Definition at line 384 of file InitialState.cxx.

385 {
386  TLorentzVector * p4 = this->GetProbeP4(ref_frame);
387  double E = p4->Energy();
388 
389  delete p4;
390  return E;
391 }
E
Definition: 018_def.c:13
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
int genie::InitialState::ProbePdg ( void  ) const
inline

Definition at line 64 of file InitialState.h.

64 { return fProbePdg; }
int fProbePdg
probe PDG code
Definition: InitialState.h:109
void InitialState::Reset ( void  )

Definition at line 125 of file InitialState.cxx.

126 {
127  this->CleanUp();
128  this->Init();
129 }
void InitialState::SetPdgs ( int  tgt_pdgc,
int  probe_pdgc 
)

Definition at line 153 of file InitialState.cxx.

154 {
155  this->CleanUp();
156  this->Init(tgt_pdgc, probe_pdgc);
157 }
void InitialState::SetProbeE ( double  E)

Definition at line 175 of file InitialState.cxx.

176 {
177  fProbeP4 -> SetE ( E );
178  fProbeP4 -> SetPx ( 0.);
179  fProbeP4 -> SetPy ( 0.);
180  fProbeP4 -> SetPz ( E );
181 }
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
void InitialState::SetProbeP4 ( const TLorentzVector &  P4)

Definition at line 183 of file InitialState.cxx.

184 {
185  fProbeP4 -> SetE ( P4.E() );
186  fProbeP4 -> SetPx ( P4.Px() );
187  fProbeP4 -> SetPy ( P4.Py() );
188  fProbeP4 -> SetPz ( P4.Pz() );
189 }
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:111
void InitialState::SetProbePdg ( int  pdg_code)

Definition at line 167 of file InitialState.cxx.

168 {
169  int tgt_pdgc = this->TgtPdg();
170 
171  this->CleanUp();
172  this->Init(tgt_pdgc, probe_pdgc);
173 }
int TgtPdg(void) const
void InitialState::SetTgtP4 ( const TLorentzVector &  P4)

Definition at line 191 of file InitialState.cxx.

192 {
193  fTgtP4 -> SetE ( P4.E() );
194  fTgtP4 -> SetPx ( P4.Px() );
195  fTgtP4 -> SetPy ( P4.Py() );
196  fTgtP4 -> SetPz ( P4.Pz() );
197 }
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
void InitialState::SetTgtPdg ( int  pdg_code)

Definition at line 159 of file InitialState.cxx.

160 {
161  int probe_pdgc = this->ProbePdg();
162 
163  this->CleanUp();
164  this->Init(tgt_pdgc, probe_pdgc);
165 }
int ProbePdg(void) const
Definition: InitialState.h:64
const Target& genie::InitialState::Tgt ( void  ) const
inline

Definition at line 66 of file InitialState.h.

66 { return *fTgt; }
Target * fTgt
nuclear target
Definition: InitialState.h:110
int InitialState::TgtPdg ( void  ) const

Definition at line 141 of file InitialState.cxx.

142 {
143  assert(fTgt);
144  return fTgt->Pdg();
145 }
int Pdg(void) const
Definition: Target.h:71
Target * fTgt
nuclear target
Definition: InitialState.h:110
Target* genie::InitialState::TgtPtr ( void  ) const
inline

Definition at line 67 of file InitialState.h.

67 { return fTgt; }
Target * fTgt
nuclear target
Definition: InitialState.h:110

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const InitialState i 
)
friend

print

Member Data Documentation

TLorentzVector* genie::InitialState::fProbeP4
private

probe 4-momentum in LAB-frame

Definition at line 111 of file InitialState.h.

int genie::InitialState::fProbePdg
private

probe PDG code

Definition at line 109 of file InitialState.h.

Target* genie::InitialState::fTgt
private

nuclear target

Definition at line 110 of file InitialState.h.

TLorentzVector* genie::InitialState::fTgtP4
private

nuclear target 4-momentum in LAB-frame

Definition at line 112 of file InitialState.h.


The documentation for this class was generated from the following files: