File indexing completed on 2026-08-06 09:24:06
0001 namespace Herwig {
0002 using namespace ThePEG;
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 class HadronInfo {
0026
0027 public:
0028
0029
0030
0031
0032
0033
0034
0035
0036 HadronInfo(long idin=0, tPDPtr datain=tPDPtr(),
0037 double swtin=1., Energy massin=ZERO)
0038 : id(idin), ptrData(datain), swtef(swtin), wt(1.0), overallWeight(0.0),
0039 mass(massin)
0040 {}
0041
0042
0043
0044
0045 bool operator<(const HadronInfo &x) const {
0046 if(mass!=x.mass) return mass < x.mass;
0047 else return id < x.id;
0048 }
0049
0050
0051
0052
0053 long id;
0054
0055
0056
0057
0058 tPDPtr ptrData;
0059
0060
0061
0062
0063 double swtef;
0064
0065
0066
0067
0068 double wt;
0069
0070
0071
0072
0073 double overallWeight;
0074
0075
0076
0077
0078 Energy mass;
0079
0080
0081
0082
0083 void rescale(double x) const {
0084 const_cast<HadronInfo*>(this)->overallWeight *= x;
0085 }
0086
0087
0088
0089
0090 friend PersistentOStream & operator<< (PersistentOStream & os,
0091 const HadronInfo & hi ) {
0092 os << hi.id << hi.ptrData << hi.swtef << hi.wt
0093 << hi.overallWeight << ounit(hi.mass,GeV);
0094 return os;
0095 }
0096
0097
0098
0099
0100 friend ostream & operator<< (ostream & os, const HadronInfo & hi ) {
0101 os << std::scientific << std::showpoint
0102 << std::setprecision(4)
0103 << setw(2)
0104 << hi.id << '\t'
0105 << hi.swtef << '\t'
0106 << hi.wt << '\t'
0107 << hi.overallWeight << '\t'
0108 << ounit(hi.mass,GeV);
0109 return os;
0110 }
0111
0112
0113
0114
0115 friend PersistentIStream & operator>> (PersistentIStream & is,
0116 HadronInfo & hi ) {
0117 is >> hi.id >> hi.ptrData >> hi.swtef >> hi.wt
0118 >> hi.overallWeight >> iunit(hi.mass,GeV);
0119 return is;
0120 }
0121 };
0122
0123
0124
0125
0126
0127
0128
0129
0130 typedef set<HadronInfo> KupcoData;
0131
0132
0133
0134
0135
0136 typedef map<pair<long,long>,KupcoData> HadronTable;
0137 }