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

A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems such as a nuclear target, a 'spectator' nuclear target with a Hit nucleon, a free nucleon or a free particle (eg a e- target in the inverse muon decay reaction) More...

#include <Target.h>

Inheritance diagram for genie::Target:

Public Member Functions

 Target ()
 
 Target (int pdgc)
 
 Target (int Z, int A)
 
 Target (int Z, int A, int hit_nucleon_pdgc)
 
 Target (const Target &tgt)
 
 Target (TRootIOCtor *)
 
 ~Target ()
 
void SetId (int pdgc)
 
void SetId (int Z, int A)
 
void SetHitNucPdg (int pdgc)
 
void SetHitNucP4 (const TLorentzVector &p4)
 
void SetHitNucPosition (double r)
 
void SetHitQrkPdg (int pdgc)
 
void SetHitSeaQrk (bool tf)
 
void ForceHitNucOnMassShell (void)
 
int Z (void) const
 
int N (void) const
 
int A (void) const
 
int Pdg (void) const
 
double Mass (void) const
 
double Charge (void) const
 
bool IsFreeNucleon (void) const
 
bool IsProton (void) const
 
bool IsNeutron (void) const
 
bool IsNucleus (void) const
 
bool IsParticle (void) const
 
bool IsValidNucleus (void) const
 
bool HitNucIsSet (void) const
 
bool HitQrkIsSet (void) const
 
bool HitSeaQrk (void) const
 
bool IsEvenEven (void) const
 
bool IsEvenOdd (void) const
 
bool IsOddOdd (void) const
 
int HitNucPdg (void) const
 
int HitQrkPdg (void) const
 
double HitNucMass (void) const
 
double HitNucPosition (void) const
 
const TLorentzVector & HitNucP4 (void) const
 
TLorentzVector * HitNucP4Ptr (void) const
 
void Reset (void)
 
void Copy (const Target &t)
 
bool Compare (const Target &t) const
 
string AsString (void) const
 
void Print (ostream &stream) const
 
bool operator== (const Target &t) const
 equal? More...
 
Targetoperator= (const Target &t)
 copy More...
 

Private Member Functions

void Init (void)
 
void CleanUp (void)
 
void ForceNucleusValidity (void)
 
bool ForceHitNucValidity (void)
 
void AutoSetHitNuc (void)
 

Private Attributes

int fZ
 nuclear target Z More...
 
int fA
 nuclear target A More...
 
int fTgtPDG
 nuclear target PDG code More...
 
int fHitNucPDG
 hit nucleon PDG code More...
 
int fHitQrkPDG
 hit quark PDG code More...
 
bool fHitSeaQrk
 hit quark from sea? More...
 
TLorentzVector * fHitNucP4
 hit nucleon 4p More...
 
double fHitNucRad
 hit nucleon position More...
 

Friends

ostream & operator<< (ostream &stream, const Target &t)
 print More...
 

Detailed Description

A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems such as a nuclear target, a 'spectator' nuclear target with a Hit nucleon, a free nucleon or a free particle (eg a e- target in the inverse muon decay reaction)

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

May 03, 2004

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

Definition at line 40 of file Target.h.

Constructor & Destructor Documentation

Target::Target ( )

Definition at line 41 of file Target.cxx.

41  :
42 TObject()
43 {
44  this->Init();
45 }
void Init(void)
Definition: Target.cxx:99
Target::Target ( int  pdgc)

Definition at line 47 of file Target.cxx.

47  :
48 TObject()
49 {
50  this->Init();
51  this->SetId(pdgc);
52 }
void SetId(int pdgc)
Definition: Target.cxx:149
void Init(void)
Definition: Target.cxx:99
Target::Target ( int  Z,
int  A 
)

Definition at line 54 of file Target.cxx.

54  :
55 TObject()
56 {
57  this->Init();
58  this->SetId(ZZ,AA);
59 }
void SetId(int pdgc)
Definition: Target.cxx:149
void Init(void)
Definition: Target.cxx:99
Target::Target ( int  Z,
int  A,
int  hit_nucleon_pdgc 
)

Definition at line 61 of file Target.cxx.

61  :
62 TObject()
63 {
64  this->Init();
65  this->SetId(ZZ,AA);
66  this->SetHitNucPdg(hit_nucleon_pdgc);
67 }
void SetId(int pdgc)
Definition: Target.cxx:149
void Init(void)
Definition: Target.cxx:99
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:171
Target::Target ( const Target tgt)

Definition at line 69 of file Target.cxx.

69  :
70 TObject()
71 {
72  this->Init();
73  this->Copy(tgt);
74 }
void Init(void)
Definition: Target.cxx:99
void Copy(const Target &t)
Definition: Target.cxx:116
Target::Target ( TRootIOCtor *  )

Definition at line 76 of file Target.cxx.

76  :
77 TObject(),
78 fZ(0),
79 fA(0),
80 fTgtPDG(0),
81 fHitNucPDG(0),
82 fHitSeaQrk(false),
83 fHitNucP4(0)
84 {
85 
86 }
int fZ
nuclear target Z
Definition: Target.h:117
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
int fA
nuclear target A
Definition: Target.h:118
Target::~Target ( )

Definition at line 88 of file Target.cxx.

89 {
90  this->CleanUp();
91 }
void CleanUp(void)
Definition: Target.cxx:111

Member Function Documentation

int genie::Target::A ( void  ) const
inline

Definition at line 70 of file Target.h.

70 { return fA; }
int fA
nuclear target A
Definition: Target.h:118
string Target::AsString ( void  ) const

Definition at line 383 of file Target.cxx.

384 {
385  ostringstream s;
386 
387  s << this->Pdg();
388  if(this->HitNucIsSet())
389  s << "[N=" << this->HitNucPdg() << "]";
390  if(this->HitQrkIsSet()) {
391  s << "[q=" << this->HitQrkPdg();
392  s << (this->HitSeaQrk() ? "(s)" : "(v)");
393  s << "]";
394  }
395 
396  return s.str();
397 }
bool HitSeaQrk(void) const
Definition: Target.cxx:299
int HitNucPdg(void) const
Definition: Target.cxx:304
int HitQrkPdg(void) const
Definition: Target.cxx:242
int Pdg(void) const
Definition: Target.h:71
bool HitNucIsSet(void) const
Definition: Target.cxx:283
bool HitQrkIsSet(void) const
Definition: Target.cxx:292
static QCString * s
Definition: config.cpp:1042
void Target::AutoSetHitNuc ( void  )
private

Definition at line 373 of file Target.cxx.

374 {
375 // for free nucleon targets -> (auto)set struck nucleon = target
376 
377  if( this->IsFreeNucleon() ) {
378  if( this->IsProton() ) this->SetHitNucPdg(kPdgProton);
379  else this->SetHitNucPdg(kPdgNeutron);
380  }
381 }
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:171
const int kPdgProton
Definition: PDGCodes.h:81
bool IsProton(void) const
Definition: Target.cxx:262
const int kPdgNeutron
Definition: PDGCodes.h:83
bool IsFreeNucleon(void) const
Definition: Target.cxx:257
double Target::Charge ( void  ) const

Definition at line 215 of file Target.cxx.

216 {
217 // Shortcut for commonly used code for extracting the nucleus charge from PDG
218 //
219  TParticlePDG * p = PDGLibrary::Instance()->Find(fTgtPDG);
220  if(p) return p->Charge() / 3.; // in +e
221  return 0;
222 }
p
Definition: test.py:223
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
void Target::CleanUp ( void  )
private

Definition at line 111 of file Target.cxx.

112 {
113  delete fHitNucP4;
114 }
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
bool Target::Compare ( const Target t) const

Definition at line 422 of file Target.cxx.

423 {
424  int tgt_pdg = target.Pdg();
425  int struck_nuc_pdg = target.HitNucPdg();
426  int struck_qrk_pdg = target.HitQrkPdg();
427  bool struck_sea_qrk = target.HitSeaQrk();
428 
429  bool equal = ( fTgtPDG == tgt_pdg ) &&
430  ( fHitNucPDG == struck_nuc_pdg ) &&
431  ( fHitQrkPDG == struck_qrk_pdg ) &&
432  ( fHitSeaQrk == struck_sea_qrk );
433  return equal;
434 }
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
void Target::Copy ( const Target t)

Definition at line 116 of file Target.cxx.

117 {
118  fTgtPDG = tgt.fTgtPDG;
119 
120  if( pdg::IsIon(fTgtPDG) ) {
121 
122  fZ = tgt.fZ; // copy A,Z
123  fA = tgt.fA;
124  fHitNucPDG = tgt.fHitNucPDG; // struck nucleon PDG
125  fHitQrkPDG = tgt.fHitQrkPDG; // struck quark PDG
126  fHitSeaQrk = tgt.fHitSeaQrk; // struck quark is from sea?
127 
128  //// valgrind warns about this ... try something else
129  // (*fHitNucP4) = (*tgt.fHitNucP4);
130  const TLorentzVector& p4 = *(tgt.fHitNucP4);
131  // *fHitNucP4 = p4; // nope
132  //// this works for valgrind
133  fHitNucP4->SetX(p4.X());
134  fHitNucP4->SetY(p4.Y());
135  fHitNucP4->SetZ(p4.Z());
136  fHitNucP4->SetT(p4.T());
137 
138  fHitNucRad = tgt.fHitNucRad;
139 
140  // look-up the nucleus in the isotopes chart
141  this->ForceNucleusValidity();
142 
143  // make sure the hit nucleus constituent object is either
144  // a nucleon (p or n) or a di-nucleon cluster (p+p, p+n, n+n)
145  this->ForceHitNucValidity();
146  }
147 }
int fZ
nuclear target Z
Definition: Target.h:117
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:39
double fHitNucRad
hit nucleon position
Definition: Target.h:124
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
bool ForceHitNucValidity(void)
Definition: Target.cxx:350
void ForceNucleusValidity(void)
Definition: Target.cxx:362
int fA
nuclear target A
Definition: Target.h:118
void Target::ForceHitNucOnMassShell ( void  )

Definition at line 200 of file Target.cxx.

201 {
202  if(this->HitNucIsSet()) {
203  double m = this->HitNucMass();
204  double p = this->HitNucP4Ptr()->P();
205  double e = TMath::Sqrt(p*p+m*m);
206  this->HitNucP4Ptr()->SetE(e);
207  }
208 }
double HitNucMass(void) const
Definition: Target.cxx:233
const double e
p
Definition: test.py:223
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
bool HitNucIsSet(void) const
Definition: Target.cxx:283
bool Target::ForceHitNucValidity ( void  )
private

Definition at line 350 of file Target.cxx.

351 {
352 // resets the struck nucleon pdg-code if it is found not to be a valid one
353 
354  bool valid =
357  (fHitNucPDG==0); /* not set */
358 
359  return valid;
360 }
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:343
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
bool Is2NucleonCluster(int pdgc)
Definition: PDGUtils.cxx:399
void Target::ForceNucleusValidity ( void  )
private

Definition at line 362 of file Target.cxx.

363 {
364 // resets the target pdg-code if it is found not to be a valid one
365 
366  if( ! this->IsValidNucleus() ) {
367  LOG("Target", pWARN) << "Invalid target -- Reseting to Z = 0, A = 0";
368  fZ = 0;
369  fA = 0;
370  }
371 }
int fZ
nuclear target Z
Definition: Target.h:117
bool IsValidNucleus(void) const
Definition: Target.cxx:309
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pWARN
Definition: Messenger.h:60
int fA
nuclear target A
Definition: Target.h:118
bool Target::HitNucIsSet ( void  ) const

Definition at line 283 of file Target.cxx.

284 {
285  bool ok =
288 
289  return ok;
290 }
bool IsNucleon(int pdgc)
Definition: PDGUtils.cxx:343
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
bool Is2NucleonCluster(int pdgc)
Definition: PDGUtils.cxx:399
double Target::HitNucMass ( void  ) const

Definition at line 233 of file Target.cxx.

234 {
235  if(!fHitNucPDG) {
236  LOG("Target", pWARN) << "Returning struck nucleon mass = 0";
237  return 0;
238  }
239  return PDGLibrary::Instance()->Find(fHitNucPDG)->Mass();
240 }
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pWARN
Definition: Messenger.h:60
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
const TLorentzVector& genie::Target::HitNucP4 ( void  ) const
inline

Definition at line 91 of file Target.h.

91 { return *this->HitNucP4Ptr(); }
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
TLorentzVector * Target::HitNucP4Ptr ( void  ) const

Definition at line 247 of file Target.cxx.

248 {
249  if(!fHitNucP4) {
250  LOG("Target", pWARN) << "Returning NULL struck nucleon 4-momentum";
251  return 0;
252  }
253 
254  return fHitNucP4;
255 }
#define LOG(stream, priority)
A macro that returns the requested log4cpp::Category appending a string (using the FILE...
Definition: Messenger.h:96
#define pWARN
Definition: Messenger.h:60
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
int Target::HitNucPdg ( void  ) const

Definition at line 304 of file Target.cxx.

305 {
306  return fHitNucPDG;
307 }
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
double genie::Target::HitNucPosition ( void  ) const
inline

Definition at line 89 of file Target.h.

89 { return fHitNucRad; }
double fHitNucRad
hit nucleon position
Definition: Target.h:124
bool Target::HitQrkIsSet ( void  ) const

Definition at line 292 of file Target.cxx.

293 {
294  return (
296  );
297 }
bool IsAntiQuark(int pdgc)
Definition: PDGUtils.cxx:255
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
bool IsQuark(int pdgc)
Definition: PDGUtils.cxx:247
int Target::HitQrkPdg ( void  ) const

Definition at line 242 of file Target.cxx.

243 {
244  return fHitQrkPDG;
245 }
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
bool Target::HitSeaQrk ( void  ) const

Definition at line 299 of file Target.cxx.

300 {
301  return fHitSeaQrk;
302 }
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
void Target::Init ( void  )
private

Definition at line 99 of file Target.cxx.

100 {
101  fZ = 0;
102  fA = 0;
103  fTgtPDG = 0;
104  fHitNucPDG = 0;
105  fHitQrkPDG = 0;
106  fHitSeaQrk = false;
107  fHitNucP4 = new TLorentzVector(0,0,0,kNucleonMass);
108  fHitNucRad = 0.;
109 }
static const double kNucleonMass
Definition: Constants.h:77
int fZ
nuclear target Z
Definition: Target.h:117
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
double fHitNucRad
hit nucleon position
Definition: Target.h:124
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
int fA
nuclear target A
Definition: Target.h:118
bool Target::IsEvenEven ( void  ) const

Definition at line 322 of file Target.cxx.

323 {
324  if( this->IsNucleus() ) {
325  int NN = this->N();
326  int ZZ = this->Z();
327  if( NN % 2 == 0 && ZZ % 2 == 0 ) return true;
328  }
329  return false;
330 }
bool IsNucleus(void) const
Definition: Target.cxx:272
int Z(void) const
Definition: Target.h:68
int N(void) const
Definition: Target.h:69
bool Target::IsEvenOdd ( void  ) const

Definition at line 332 of file Target.cxx.

333 {
334  if( this->IsNucleus() ) {
335  if(! this->IsEvenEven() && ! this->IsOddOdd() ) return true;
336  }
337  return false;
338 }
bool IsNucleus(void) const
Definition: Target.cxx:272
bool IsEvenEven(void) const
Definition: Target.cxx:322
bool IsOddOdd(void) const
Definition: Target.cxx:340
bool Target::IsFreeNucleon ( void  ) const

Definition at line 257 of file Target.cxx.

258 {
259  return (fA == 1 && (fZ == 0 || fZ == 1));
260 }
int fZ
nuclear target Z
Definition: Target.h:117
int fA
nuclear target A
Definition: Target.h:118
bool Target::IsNeutron ( void  ) const

Definition at line 267 of file Target.cxx.

268 {
269  return (fA == 1 && fZ == 0);
270 }
int fZ
nuclear target Z
Definition: Target.h:117
int fA
nuclear target A
Definition: Target.h:118
bool Target::IsNucleus ( void  ) const

Definition at line 272 of file Target.cxx.

273 {
274  return (fA > 1); // IsValidNucleus() was ensured when A,Z were set
275 }
int fA
nuclear target A
Definition: Target.h:118
bool Target::IsOddOdd ( void  ) const

Definition at line 340 of file Target.cxx.

341 {
342  if( this->IsNucleus() ) {
343  int NN = this->N();
344  int ZZ = this->Z();
345  if( NN % 2 == 1 && ZZ % 2 == 1 ) return true;
346  }
347  return false;
348 }
bool IsNucleus(void) const
Definition: Target.cxx:272
int Z(void) const
Definition: Target.h:68
int N(void) const
Definition: Target.h:69
bool Target::IsParticle ( void  ) const

Definition at line 277 of file Target.cxx.

278 {
279  TParticlePDG * p = PDGLibrary::Instance()->Find(fTgtPDG);
280  return (p && fA==0 && fZ==0);
281 }
int fZ
nuclear target Z
Definition: Target.h:117
p
Definition: test.py:223
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
int fA
nuclear target A
Definition: Target.h:118
bool Target::IsProton ( void  ) const

Definition at line 262 of file Target.cxx.

263 {
264  return (fA == 1 && fZ == 1);
265 }
int fZ
nuclear target Z
Definition: Target.h:117
int fA
nuclear target A
Definition: Target.h:118
bool Target::IsValidNucleus ( void  ) const

Definition at line 309 of file Target.cxx.

310 {
311  //-- it is valid if it is a free nucleon...
312  if(this->IsFreeNucleon()) return true;
313 
314  //-- ... or a nucleus that can be found in the MINOS ion PDG extensions
315  int pdg_code = pdg::IonPdgCode(fA, fZ);
316  TParticlePDG * p = PDGLibrary::Instance()->Find(pdg_code);
317  if(p) return true;
318 
319  return false;
320 }
int fZ
nuclear target Z
Definition: Target.h:117
p
Definition: test.py:223
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
bool IsFreeNucleon(void) const
Definition: Target.cxx:257
int fA
nuclear target A
Definition: Target.h:118
double Target::Mass ( void  ) const

Definition at line 224 of file Target.cxx.

225 {
226 // Shortcut for commonly used code for extracting the nucleus mass from PDG
227 //
228  TParticlePDG * p = PDGLibrary::Instance()->Find(fTgtPDG);
229  if(p) return p->Mass(); // in GeV
230  return 0.;
231 }
p
Definition: test.py:223
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
int genie::Target::N ( void  ) const
inline

Definition at line 69 of file Target.h.

69 { return fA-fZ; }
int fZ
nuclear target Z
Definition: Target.h:117
int fA
nuclear target A
Definition: Target.h:118
Target & Target::operator= ( const Target t)

copy

Definition at line 441 of file Target.cxx.

442 {
443  this->Copy(target);
444  return (*this);
445 }
void Copy(const Target &t)
Definition: Target.cxx:116
bool Target::operator== ( const Target t) const

equal?

Definition at line 436 of file Target.cxx.

437 {
438  return this->Compare(target);
439 }
bool Compare(const Target &t) const
Definition: Target.cxx:422
int genie::Target::Pdg ( void  ) const
inline

Definition at line 71 of file Target.h.

71 { return fTgtPDG; }
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
void Target::Print ( ostream &  stream) const

Definition at line 399 of file Target.cxx.

400 {
401  stream << " target PDG code = " << fTgtPDG << endl;
402 
403  if( this->IsNucleus() || this->IsFreeNucleon() ) {
404  stream << " Z = " << fZ << ", A = " << fA << endl;
405  }
406 
407  if( this->HitNucIsSet() ) {
408  TParticlePDG * p = PDGLibrary::Instance()->Find(fHitNucPDG);
409  stream << " struck nucleon = " << p->GetName()
410  << ", P4 = " << utils::print::P4AsString(fHitNucP4) << endl;
411  }
412 
413  if( this->HitQrkIsSet() ) {
414  TParticlePDG * q = PDGLibrary::Instance()->Find(fHitQrkPDG);
415  stream << " struck quark = " << q->GetName()
416  << " (from sea: "
418  << ")";
419  }
420 }
bool HitSeaQrk(void) const
Definition: Target.cxx:299
int fZ
nuclear target Z
Definition: Target.h:117
string BoolAsYNString(bool b)
Definition: PrintUtils.cxx:108
bool IsNucleus(void) const
Definition: Target.cxx:272
string P4AsString(const TLorentzVector *p)
Definition: PrintUtils.cxx:27
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
p
Definition: test.py:223
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
bool HitNucIsSet(void) const
Definition: Target.cxx:283
bool HitQrkIsSet(void) const
Definition: Target.cxx:292
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
QTextStream & endl(QTextStream &s)
bool IsFreeNucleon(void) const
Definition: Target.cxx:257
int fA
nuclear target A
Definition: Target.h:118
void Target::Reset ( void  )

Definition at line 93 of file Target.cxx.

94 {
95  this->CleanUp();
96  this->Init();
97 }
void Init(void)
Definition: Target.cxx:99
void CleanUp(void)
Definition: Target.cxx:111
void Target::SetHitNucP4 ( const TLorentzVector &  p4)

Definition at line 189 of file Target.cxx.

190 {
191  if(fHitNucP4) delete fHitNucP4;
192  fHitNucP4 = new TLorentzVector(p4);
193 }
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
void Target::SetHitNucPdg ( int  pdgc)

Definition at line 171 of file Target.cxx.

172 {
173  fHitNucPDG = nucl_pdgc;
174  bool is_valid = this->ForceHitNucValidity(); // p, n or a di-nucleon
175 
176  // If it is a valid struck nucleon pdg code, initialize its 4P:
177  // at-rest + on-mass-shell
178  if(is_valid) {
179  double M = PDGLibrary::Instance()->Find(nucl_pdgc)->Mass();
180  fHitNucP4->SetPxPyPzE(0,0,0,M);
181  }
182 }
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
constexpr bool is_valid(IDNumber_t< L > const id) noexcept
Definition: IDNumber.h:113
static PDGLibrary * Instance(void)
Definition: PDGLibrary.cxx:57
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
TParticlePDG * Find(int pdgc, bool must_exist=true)
Definition: PDGLibrary.cxx:75
bool ForceHitNucValidity(void)
Definition: Target.cxx:350
void Target::SetHitNucPosition ( double  r)

Definition at line 210 of file Target.cxx.

211 {
212  fHitNucRad = r;
213 }
double fHitNucRad
hit nucleon position
Definition: Target.h:124
void Target::SetHitQrkPdg ( int  pdgc)

Definition at line 184 of file Target.cxx.

185 {
186  if(pdg::IsQuark(pdgc) || pdg::IsAntiQuark(pdgc)) fHitQrkPDG = pdgc;
187 }
bool IsAntiQuark(int pdgc)
Definition: PDGUtils.cxx:255
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
bool IsQuark(int pdgc)
Definition: PDGUtils.cxx:247
void Target::SetHitSeaQrk ( bool  tf)

Definition at line 195 of file Target.cxx.

196 {
197  fHitSeaQrk = tf;
198 }
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
void Target::SetId ( int  pdgc)

Definition at line 149 of file Target.cxx.

150 {
151  fTgtPDG = pdgc;
152  if( pdg::IsIon(pdgc) ) {
153  fZ = pdg::IonPdgCodeToZ(pdgc);
154  fA = pdg::IonPdgCodeToA(pdgc);
155  }
156 
157  this->ForceNucleusValidity(); // search at the isotopes chart
158  //this->AutoSetHitNuc(); // struck nuc := tgt for free nucleon tgt
159 }
int fZ
nuclear target Z
Definition: Target.h:117
int IonPdgCodeToA(int pdgc)
Definition: PDGUtils.cxx:60
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
bool IsIon(int pdgc)
Definition: PDGUtils.cxx:39
int IonPdgCodeToZ(int pdgc)
Definition: PDGUtils.cxx:52
void ForceNucleusValidity(void)
Definition: Target.cxx:362
int fA
nuclear target A
Definition: Target.h:118
void Target::SetId ( int  Z,
int  A 
)

Definition at line 161 of file Target.cxx.

162 {
163  fTgtPDG = pdg::IonPdgCode(AA,ZZ);
164  fZ = ZZ;
165  fA = AA;
166 
167  this->ForceNucleusValidity(); // search at the isotopes chart
168  //this->AutoSetHitNuc(); // struck nuc := tgt for free nucleon tgt
169 }
int fZ
nuclear target Z
Definition: Target.h:117
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
int IonPdgCode(int A, int Z)
Definition: PDGUtils.cxx:68
void ForceNucleusValidity(void)
Definition: Target.cxx:362
int fA
nuclear target A
Definition: Target.h:118
int genie::Target::Z ( void  ) const
inline

Definition at line 68 of file Target.h.

68 { return fZ; }
int fZ
nuclear target Z
Definition: Target.h:117

Friends And Related Function Documentation

ostream& operator<< ( ostream &  stream,
const Target t 
)
friend

print

Member Data Documentation

int genie::Target::fA
private

nuclear target A

Definition at line 118 of file Target.h.

TLorentzVector* genie::Target::fHitNucP4
private

hit nucleon 4p

Definition at line 123 of file Target.h.

int genie::Target::fHitNucPDG
private

hit nucleon PDG code

Definition at line 120 of file Target.h.

double genie::Target::fHitNucRad
private

hit nucleon position

Definition at line 124 of file Target.h.

int genie::Target::fHitQrkPDG
private

hit quark PDG code

Definition at line 121 of file Target.h.

bool genie::Target::fHitSeaQrk
private

hit quark from sea?

Definition at line 122 of file Target.h.

int genie::Target::fTgtPDG
private

nuclear target PDG code

Definition at line 119 of file Target.h.

int genie::Target::fZ
private

nuclear target Z

Definition at line 117 of file Target.h.


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