InitialState.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \class genie::InitialState
5 
6 \brief Initial State information
7 
8 \author Costas Andreopoulos <constantinos.andreopoulos \at cern.ch>
9  University of Liverpool & STFC Rutherford Appleton Laboratory
10 
11  Changes required to implement the GENIE Boosted Dark Matter module
12  were installed by Josh Berger (Univ. of Wisconsin)
13 
14  Other minor changes / additions and fixes were installed by:
15  Andy Furmanski (Univ. of Manchester)
16  Joe Johnston (Univ of Pittsburgh)
17 
18 \created May 02, 2004
19 
20 \cpright Copyright (c) 2003-2020, The GENIE Collaboration
21  For the full text of the license visit http://copyright.genie-mc.org
22 */
23 //____________________________________________________________________________
24 
25 #ifndef _INITIAL_STATE_H_
26 #define _INITIAL_STATE_H_
27 
28 #include <iostream>
29 #include <string>
30 
31 #include <TParticlePDG.h>
32 #include <TLorentzVector.h>
33 #include <TObject.h>
34 
37 
38 using std::ostream;
39 using std::string;
40 
41 class TRootIOCtor;
42 
43 namespace genie {
44 
45 class InitialState;
46 ostream & operator << (ostream & stream, const InitialState & i);
47 
48 class InitialState : public TObject {
49 
50 public:
51  using TObject::Print; // suppress clang 'hides overloaded virtual function [-Woverloaded-virtual]' warnings
52  using TObject::Copy; //
53  using TObject::Compare; //
54 
55  InitialState();
56  InitialState(int tgt_pdgc, int probe_pdgc);
57  InitialState(int Z, int A, int probe_pdgc);
58  InitialState(const Target & tgt, int probe_pdgc);
59  InitialState(const InitialState & initial_state);
60  InitialState(TRootIOCtor*);
61  ~InitialState();
62 
63  TParticlePDG * Probe (void) const;
64  int ProbePdg (void) const { return fProbePdg; }
65  int TgtPdg (void) const;
66  const Target & Tgt (void) const { return *fTgt; }
67  Target * TgtPtr (void) const { return fTgt; }
68  TLorentzVector * GetTgtP4 (RefFrame_t rf = kRfLab) const;
69  TLorentzVector * GetProbeP4 (RefFrame_t rf = kRfHitNucRest) const;
70  double ProbeE (RefFrame_t rf) const;
71  double CMEnergy () const; ///< centre-of-mass energy (sqrt s)
72 
73  void SetPdgs (int tgt_pdgc, int probe_pdgc);
74  void SetProbePdg (int pdg_code);
75  void SetTgtPdg (int pdg_code);
76  void SetTgtP4 (const TLorentzVector & P4); // in LAB-frame
77  void SetProbeP4 (const TLorentzVector & P4); // in LAB-frame
78  void SetProbeE (double E); // in LAB-frame (0,0,E,E)
79 
80  bool IsNuP (void) const; ///< is neutrino + proton?
81  bool IsNuN (void) const; ///< is neutrino + neutron?
82  bool IsNuBarP (void) const; ///< is anti-neutrino + proton?
83  bool IsNuBarN (void) const; ///< is anti-neutrino + neutron?
84  bool IsDMP (void) const; ///< is dark matter + proton?
85  bool IsDMN (void) const; ///< is dark matter + neutron?
86  bool IsDMBP (void) const; ///< is anti-dark matter + proton?
87  bool IsDMBN (void) const; ///< is anti-dark matter + neutron?
88 
89  //-- Copy, reset, compare, print itself and build string code
90  void Reset (void);
91  void Copy (const InitialState & init_state);
92  bool Compare (const InitialState & init_state) const;
93  string AsString (void) const;
94  void Print (ostream & stream) const;
95 
96  //-- Overloaded operators
97  bool operator == (const InitialState & i) const; ///< equal?
98  InitialState & operator = (const InitialState & i); ///< copy
99  friend ostream & operator << (ostream & stream, const InitialState & i); ///< print
100 
101 private:
102 
103  //-- Methods for InitialState initialization and clean up
104  void Init (void);
105  void Init (int target_pdgc, int probe_pdgc);
106  void CleanUp (void);
107 
108  //-- Private data members
109  int fProbePdg; ///< probe PDG code
110  Target * fTgt; ///< nuclear target
111  TLorentzVector * fProbeP4; ///< probe 4-momentum in LAB-frame
112  TLorentzVector * fTgtP4; ///< nuclear target 4-momentum in LAB-frame
113 
115 };
116 
117 } // namespace
118 
119 #endif // _INITIAL_STATE_H_
void SetTgtP4(const TLorentzVector &P4)
bool IsNuBarN(void) const
is anti-neutrino + neutron?
void SetProbeP4(const TLorentzVector &P4)
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:25
void SetTgtPdg(int pdg_code)
std::string string
Definition: nybbler.cc:12
bool IsNuN(void) const
is neutrino + neutron?
TParticlePDG * Probe(void) const
void SetProbeE(double E)
bool Compare(const InitialState &init_state) const
enum genie::ERefFrame RefFrame_t
bool operator==(const InitialState &i) const
equal?
bool IsDMN(void) const
is dark matter + neutron?
bool IsDMBP(void) const
is anti-dark matter + proton?
bool IsNuP(void) const
is neutrino + proton?
void Copy(const InitialState &init_state)
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
int ProbePdg(void) const
Definition: InitialState.h:64
string AsString(void) const
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:112
void SetPdgs(int tgt_pdgc, int probe_pdgc)
bool IsDMP(void) const
is dark matter + proton?
bool IsDMBN(void) const
is anti-dark matter + neutron?
void Print(ostream &stream) const
friend ostream & operator<<(ostream &stream, const InitialState &i)
print
ostream & operator<<(ostream &stream, const AlgConfigPool &config_pool)
TLorentzVector * GetTgtP4(RefFrame_t rf=kRfLab) const
double CMEnergy() const
centre-of-mass energy (sqrt s)
int TgtPdg(void) const
bool IsNuBarP(void) const
is anti-neutrino + proton?
Target * TgtPtr(void) const
Definition: InitialState.h:67
InitialState & operator=(const InitialState &i)
copy
int fProbePdg
probe PDG code
Definition: InitialState.h:109
void SetProbePdg(int pdg_code)
const Target & Tgt(void) const
Definition: InitialState.h:66
double ProbeE(RefFrame_t rf) const
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
Initial State information.
Definition: InitialState.h:48