Target.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::Target
5 
6 \brief A Neutrino Interaction Target. Is a transparent encapsulation of
7  quite different physical systems such as a nuclear target, a
8  'spectator' nuclear target with a Hit nucleon, a free nucleon or
9  a free particle (eg a e- target in the inverse muon decay reaction)
10 
11 \author Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
12  University of Liverpool & STFC Rutherford Appleton Laboratory
13 
14 \created May 03, 2004
15 
16 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
17  For the full text of the license visit http://copyright.genie-mc.org
18 */
19 //____________________________________________________________________________
20 
21 #ifndef _TARGET_H_
22 #define _TARGET_H_
23 
24 #include <ostream>
25 #include <string>
26 
27 #include <TLorentzVector.h>
28 #include <TObject.h>
29 
30 using std::ostream;
31 using std::string;
32 
33 class TRootIOCtor;
34 
35 namespace genie {
36 
37 class Target;
38 ostream & operator << (ostream & stream, const Target & t);
39 
40 class Target : public TObject {
41 
42 using TObject::Print; // suppress clang 'hides overloaded virtual function [-Woverloaded-virtual]' warnings
43 using TObject::Compare;
44 using TObject::Copy;
45 
46 public:
47  Target();
48  Target(int pdgc);
49  Target(int Z, int A);
50  Target(int Z, int A, int hit_nucleon_pdgc);
51  Target(const Target & tgt);
52  Target(TRootIOCtor*);
53  ~Target();
54 
55  //-- Set target properties
56 
57  void SetId (int pdgc);
58  void SetId (int Z, int A);
59  void SetHitNucPdg (int pdgc);
60  void SetHitNucP4 (const TLorentzVector & p4);
61  void SetHitNucPosition (double r);
62  void SetHitQrkPdg (int pdgc);
63  void SetHitSeaQrk (bool tf);
64  void ForceHitNucOnMassShell (void);
65 
66  //-- Query target information
67 
68  int Z (void) const { return fZ; }
69  int N (void) const { return fA-fZ; }
70  int A (void) const { return fA; }
71  int Pdg (void) const { return fTgtPDG; }
72  double Mass (void) const;
73  double Charge (void) const;
74  bool IsFreeNucleon (void) const;
75  bool IsProton (void) const;
76  bool IsNeutron (void) const;
77  bool IsNucleus (void) const;
78  bool IsParticle (void) const;
79  bool IsValidNucleus (void) const;
80  bool HitNucIsSet (void) const;
81  bool HitQrkIsSet (void) const;
82  bool HitSeaQrk (void) const;
83  bool IsEvenEven (void) const;
84  bool IsEvenOdd (void) const;
85  bool IsOddOdd (void) const;
86  int HitNucPdg (void) const;
87  int HitQrkPdg (void) const;
88  double HitNucMass (void) const;
89  double HitNucPosition (void) const { return fHitNucRad; }
90 
91  const TLorentzVector & HitNucP4 (void) const { return *this->HitNucP4Ptr(); }
92  TLorentzVector * HitNucP4Ptr (void) const;
93 
94  //-- Copy, reset, compare, print itself and build string code
95  void Reset (void);
96  void Copy (const Target & t);
97  bool Compare (const Target & t) const;
98  string AsString (void) const;
99  void Print (ostream & stream) const;
100 
101  bool operator == (const Target & t) const; ///< equal?
102  Target & operator = (const Target & t); ///< copy
103  friend ostream & operator << (ostream & stream, const Target & t); ///< print
104 
105 private:
106 
107  //-- Methods for Target initialization and clean up
108  void Init (void);
109  void CleanUp (void);
110 
111  //-- Methods assuring nucleus & hit nucleon validity
112  void ForceNucleusValidity (void);
113  bool ForceHitNucValidity (void);
114  void AutoSetHitNuc (void);
115 
116  //-- Private data members
117  int fZ; ///< nuclear target Z
118  int fA; ///< nuclear target A
119  int fTgtPDG; ///< nuclear target PDG code
120  int fHitNucPDG; ///< hit nucleon PDG code
121  int fHitQrkPDG; ///< hit quark PDG code
122  bool fHitSeaQrk; ///< hit quark from sea?
123  TLorentzVector * fHitNucP4; ///< hit nucleon 4p
124  double fHitNucRad; ///< hit nucleon position
125 
126 ClassDef(Target,2)
127 };
128 
129 } // genie namespace
130 
131 #endif // _TARGET_H_
Target & operator=(const Target &t)
copy
Definition: Target.cxx:441
string AsString(void) const
Definition: Target.cxx:383
bool HitSeaQrk(void) const
Definition: Target.cxx:299
void AutoSetHitNuc(void)
Definition: Target.cxx:373
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
int HitNucPdg(void) const
Definition: Target.cxx:304
bool IsNeutron(void) const
Definition: Target.cxx:267
std::string string
Definition: nybbler.cc:12
int fZ
nuclear target Z
Definition: Target.h:117
int A(void) const
Definition: Target.h:70
int HitQrkPdg(void) const
Definition: Target.cxx:242
bool operator==(const Target &t) const
equal?
Definition: Target.cxx:436
double HitNucMass(void) const
Definition: Target.cxx:233
bool IsNucleus(void) const
Definition: Target.cxx:272
int Pdg(void) const
Definition: Target.h:71
void SetHitNucP4(const TLorentzVector &p4)
Definition: Target.cxx:189
void SetHitQrkPdg(int pdgc)
Definition: Target.cxx:184
void SetHitNucPosition(double r)
Definition: Target.cxx:210
Definition: tf_graph.h:23
double Mass(void) const
Definition: Target.cxx:224
void SetId(int pdgc)
Definition: Target.cxx:149
void Init(void)
Definition: Target.cxx:99
double Charge(void) const
Definition: Target.cxx:215
bool IsValidNucleus(void) const
Definition: Target.cxx:309
int fHitNucPDG
hit nucleon PDG code
Definition: Target.h:120
friend ostream & operator<<(ostream &stream, const Target &t)
print
int fHitQrkPDG
hit quark PDG code
Definition: Target.h:121
void CleanUp(void)
Definition: Target.cxx:111
bool IsEvenEven(void) const
Definition: Target.cxx:322
const TLorentzVector & HitNucP4(void) const
Definition: Target.h:91
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:40
int Z(void) const
Definition: Target.h:68
bool IsOddOdd(void) const
Definition: Target.cxx:340
int fTgtPDG
nuclear target PDG code
Definition: Target.h:119
bool IsEvenOdd(void) const
Definition: Target.cxx:332
void Reset(void)
Definition: Target.cxx:93
int N(void) const
Definition: Target.h:69
TLorentzVector * HitNucP4Ptr(void) const
Definition: Target.cxx:247
bool Compare(const Target &t) const
Definition: Target.cxx:422
bool HitNucIsSet(void) const
Definition: Target.cxx:283
bool HitQrkIsSet(void) const
Definition: Target.cxx:292
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
void SetHitNucPdg(int pdgc)
Definition: Target.cxx:171
double HitNucPosition(void) const
Definition: Target.h:89
double fHitNucRad
hit nucleon position
Definition: Target.h:124
TLorentzVector * fHitNucP4
hit nucleon 4p
Definition: Target.h:123
void Copy(const Target &t)
Definition: Target.cxx:116
void SetHitSeaQrk(bool tf)
Definition: Target.cxx:195
void Print(ostream &stream) const
Definition: Target.cxx:399
bool fHitSeaQrk
hit quark from sea?
Definition: Target.h:122
bool IsProton(void) const
Definition: Target.cxx:262
bool IsParticle(void) const
Definition: Target.cxx:277
bool ForceHitNucValidity(void)
Definition: Target.cxx:350
void ForceNucleusValidity(void)
Definition: Target.cxx:362
bool IsFreeNucleon(void) const
Definition: Target.cxx:257
void ForceHitNucOnMassShell(void)
Definition: Target.cxx:200
int fA
nuclear target A
Definition: Target.h:118