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 <costas.andreopoulos \at stfc.ac.uk>
9  University of Liverpool & STFC Rutherford Appleton Lab
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-2019, The GENIE Collaboration
21  For the full text of the license visit http://copyright.genie-mc.org
22  or see $GENIE/LICENSE
23 */
24 //____________________________________________________________________________
25 
26 #ifndef _INITIAL_STATE_H_
27 #define _INITIAL_STATE_H_
28 
29 #include <iostream>
30 #include <string>
31 
32 #include <TParticlePDG.h>
33 #include <TLorentzVector.h>
34 #include <TObject.h>
35 
38 
39 using std::ostream;
40 using std::string;
41 
42 class TRootIOCtor;
43 
44 namespace genie {
45 
46 class InitialState;
47 ostream & operator << (ostream & stream, const InitialState & i);
48 
49 class InitialState : public TObject {
50 
51 public:
52  using TObject::Print; // suppress clang 'hides overloaded virtual function [-Woverloaded-virtual]' warnings
53  using TObject::Copy; //
54  using TObject::Compare; //
55 
56  InitialState();
57  InitialState(int tgt_pdgc, int probe_pdgc);
58  InitialState(int Z, int A, int probe_pdgc);
59  InitialState(const Target & tgt, int probe_pdgc);
60  InitialState(const InitialState & initial_state);
61  InitialState(TRootIOCtor*);
62  ~InitialState();
63 
64  TParticlePDG * Probe (void) const;
65  int ProbePdg (void) const { return fProbePdg; }
66  int TgtPdg (void) const;
67  const Target & Tgt (void) const { return *fTgt; }
68  Target * TgtPtr (void) const { return fTgt; }
69  TLorentzVector * GetTgtP4 (RefFrame_t rf = kRfLab) const;
70  TLorentzVector * GetProbeP4 (RefFrame_t rf = kRfHitNucRest) const;
71  double ProbeE (RefFrame_t rf) const;
72  double CMEnergy () const; ///< centre-of-mass energy (sqrt s)
73 
74  void SetPdgs (int tgt_pdgc, int probe_pdgc);
75  void SetProbePdg (int pdg_code);
76  void SetTgtPdg (int pdg_code);
77  void SetTgtP4 (const TLorentzVector & P4); // in LAB-frame
78  void SetProbeP4 (const TLorentzVector & P4); // in LAB-frame
79  void SetProbeE (double E); // in LAB-frame (0,0,E,E)
80 
81  bool IsNuP (void) const; ///< is neutrino + proton?
82  bool IsNuN (void) const; ///< is neutrino + neutron?
83  bool IsNuBarP (void) const; ///< is anti-neutrino + proton?
84  bool IsNuBarN (void) const; ///< is anti-neutrino + neutron?
85  bool IsDMP (void) const; ///< is dark matter + proton?
86  bool IsDMN (void) const; ///< is dark matter + neutron?
87 
88  //-- Copy, reset, compare, print itself and build string code
89  void Reset (void);
90  void Copy (const InitialState & init_state);
91  bool Compare (const InitialState & init_state) const;
92  string AsString (void) const;
93  void Print (ostream & stream) const;
94 
95  //-- Overloaded operators
96  bool operator == (const InitialState & i) const; ///< equal?
97  InitialState & operator = (const InitialState & i); ///< copy
98  friend ostream & operator << (ostream & stream, const InitialState & i); ///< print
99 
100 private:
101 
102  //-- Methods for InitialState initialization and clean up
103  void Init (void);
104  void Init (int target_pdgc, int probe_pdgc);
105  void CleanUp (void);
106 
107  //-- Private data members
108  int fProbePdg; ///< probe PDG code
109  Target * fTgt; ///< nuclear target
110  TLorentzVector * fProbeP4; ///< probe 4-momentum in LAB-frame
111  TLorentzVector * fTgtP4; ///< nuclear target 4-momentum in LAB-frame
112 
113 ClassDef(InitialState,1)
114 };
115 
116 } // namespace
117 
118 #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: GeneratorBase.h:8
void SetTgtPdg(int pdg_code)
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?
void Compare(const std::vector< TH1 * > &hs)
bool IsDMN(void) const
is dark matter + neutron?
Float_t Z
Definition: plot.C:38
bool IsNuP(void) const
is neutrino + proton?
void Copy(const InitialState &init_state)
Float_t E
Definition: plot.C:20
Target * fTgt
nuclear target
Definition: InitialState.h:109
TLorentzVector * fProbeP4
probe 4-momentum in LAB-frame
Definition: InitialState.h:110
A Neutrino Interaction Target. Is a transparent encapsulation of quite different physical systems suc...
Definition: Target.h:41
int ProbePdg(void) const
Definition: InitialState.h:65
string AsString(void) const
TLorentzVector * fTgtP4
nuclear target 4-momentum in LAB-frame
Definition: InitialState.h:111
void SetPdgs(int tgt_pdgc, int probe_pdgc)
bool IsDMP(void) const
is dark matter + proton?
void Print(ostream &stream) const
void Print(std::string prefix, std::string name, std::string suffix="")
Definition: nue_pid_effs.C:68
static const double A
Definition: Units.h:82
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:68
InitialState & operator=(const InitialState &i)
copy
int fProbePdg
probe PDG code
Definition: InitialState.h:108
void SetProbePdg(int pdg_code)
const Target & Tgt(void) const
Definition: InitialState.h:67
double ProbeE(RefFrame_t rf) const
TLorentzVector * GetProbeP4(RefFrame_t rf=kRfHitNucRest) const
Initial State information.
Definition: InitialState.h:49
enum BeamMode string