herwig is hosted by Hepforge, IPPP Durham
Herwig 7.3.0
HadronInfo.h
1namespace Herwig {
2using namespace ThePEG;
3
25 class HadronInfo {
26
27 public:
28
36 HadronInfo(long idin=0, tPDPtr datain=tPDPtr(),
37 double swtin=1., Energy massin=ZERO)
38 : id(idin), ptrData(datain), swtef(swtin), wt(1.0), overallWeight(0.0),
39 mass(massin)
40 {}
41
45 bool operator<(const HadronInfo &x) const {
46 if(mass!=x.mass) return mass < x.mass;
47 else return id < x.id;
48 }
49
53 long id;
54
59
63 double swtef;
64
68 double wt;
69
74
78 Energy mass;
79
83 void rescale(double x) const {
84 const_cast<HadronInfo*>(this)->overallWeight *= x;
85 }
86
91 const HadronInfo & hi ) {
92 os << hi.id << hi.ptrData << hi.swtef << hi.wt
93 << hi.overallWeight << ounit(hi.mass,GeV);
94 return os;
95 }
96
100 friend ostream & operator<< (ostream & os, const HadronInfo & hi ) {
101 os << std::scientific << std::showpoint
102 << std::setprecision(4)
103 << setw(2)
104 << hi.id << '\t'
105 << hi.swtef << '\t'
106 << hi.wt << '\t'
107 << hi.overallWeight << '\t'
108 << ounit(hi.mass,GeV);
109 return os;
110 }
111
116 HadronInfo & hi ) {
117 is >> hi.id >> hi.ptrData >> hi.swtef >> hi.wt
118 >> hi.overallWeight >> iunit(hi.mass,GeV);
119 return is;
120 }
121 };
122
130 typedef set<HadronInfo> KupcoData;
132
136 typedef map<pair<long,long>,KupcoData> HadronTable;
137}
Class used to store all the hadron information for easy access.
Definition: HadronInfo.h:25
long id
The hadrons id.
Definition: HadronInfo.h:53
friend PersistentIStream & operator>>(PersistentIStream &is, HadronInfo &hi)
Friend method used to read in the value of a table element.
Definition: HadronInfo.h:115
bool operator<(const HadronInfo &x) const
Comparision operator on mass.
Definition: HadronInfo.h:45
void rescale(double x) const
Rescale the weight for a given hadron.
Definition: HadronInfo.h:83
tPDPtr ptrData
pointer to ParticleData, to get the spin, etc...
Definition: HadronInfo.h:58
double wt
mixing factor
Definition: HadronInfo.h:68
HadronInfo(long idin=0, tPDPtr datain=tPDPtr(), double swtin=1., Energy massin=ZERO)
Constructor.
Definition: HadronInfo.h:36
friend PersistentOStream & operator<<(PersistentOStream &os, const HadronInfo &hi)
Friend method used to print the value of a table element.
Definition: HadronInfo.h:90
double swtef
singlet/decuplet/orbital factor
Definition: HadronInfo.h:63
double overallWeight
(2*J+1)*wt*swtef
Definition: HadronInfo.h:73
Energy mass
The hadrons mass.
Definition: HadronInfo.h:78
-*- C++ -*-
map< pair< long, long >, KupcoData > HadronTable
The hadron table type.
Definition: HadronInfo.h:136
set< HadronInfo > KupcoData
Type defs.
Definition: HadronInfo.h:130
ThePEG::Ptr< ParticleData >::transient_pointer tPDPtr
IUnit< T, UT > iunit(T &t, const UT &ut)
constexpr ZeroUnit ZERO
OUnit< T, UT > ounit(const T &t, const UT &ut)