File indexing completed on 2025-01-18 10:06:25
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef Pythia8_HIInfo_H
0014 #define Pythia8_HIInfo_H
0015
0016 #include "Pythia8/Pythia.h"
0017 #include "Pythia8/HIBasics.h"
0018 #include "Pythia8/HISubCollisionModel.h"
0019
0020 namespace Pythia8 {
0021
0022
0023
0024
0025
0026
0027 class HIInfo {
0028
0029 public:
0030
0031 friend class HeavyIons;
0032 friend class Angantyr;
0033
0034
0035 HIInfo()
0036 : idProjSave(0), idTargSave(0), bSave(0.0), NSave(0), NAccSave(0),
0037 sigmaTotSave(0.0), sigmaNDSave(0.0), sigErr2TotSave(0.0),
0038 sigErr2NDSave(0.0), avNDbSave(0.0), weightSave(0.0), weightSumSave(0.0),
0039 nCollSave(10, 0), nProjSave(10, 0), nTargSave(10, 0), nFailSave(0),
0040 subCollisionsPtrSave(nullptr) {}
0041
0042
0043 double b() const {
0044 return bSave;
0045 }
0046
0047
0048 double phi() const {
0049 return phiSave;
0050 }
0051
0052
0053 double sigmaTot() const {
0054 return sigmaTotSave/millibarn;
0055 }
0056
0057
0058 double sigmaTotErr() const {
0059 return sqrt(sigErr2TotSave/max(1.0, double(NSave)))/millibarn;
0060 }
0061
0062
0063
0064 double sigmaND() const {
0065 return sigmaNDSave/millibarn;
0066 }
0067
0068
0069 double sigmaNDErr() const {
0070 return sqrt(sigErr2NDSave/max(1.0, double(NSave)));
0071 }
0072
0073
0074
0075 double avNDb() const {
0076 return avNDbSave;
0077 }
0078
0079
0080 long nAttempts() const {
0081 return NSave;
0082 }
0083
0084
0085 long nAccepted() const {
0086 return NAccSave;
0087 }
0088
0089
0090 int nCollTot() const { return nCollSave[0]; }
0091
0092
0093
0094 int nCollND() const { return nCollSave[1]; }
0095
0096
0097 int nCollNDTot() const { return nProjSave[1] + nTargSave[1] - nCollSave[1]; }
0098
0099
0100
0101 int nCollSDP() const { return nCollSave[2]; }
0102
0103
0104
0105 int nCollSDT() const { return nCollSave[3]; }
0106
0107
0108
0109 int nCollDD() const { return nCollSave[4]; }
0110
0111
0112
0113 int nCollCD() const { return nCollSave[5]; }
0114
0115
0116 int nCollEL() const { return nCollSave[6]; }
0117
0118
0119 int nPartProj() const { return nProjSave[0]; }
0120
0121
0122
0123 int nAbsProj() const { return nProjSave[1]; }
0124
0125
0126
0127 int nDiffProj() const { return nProjSave[2]; }
0128
0129
0130
0131 int nElProj() const { return nProjSave[3]; }
0132
0133
0134
0135 int nPartTarg() const { return nTargSave[0]; }
0136
0137
0138
0139 int nAbsTarg() const { return nTargSave[1]; }
0140
0141
0142
0143 int nDiffTarg() const { return nTargSave[2]; }
0144
0145
0146
0147 int nElTarg() const { return nTargSave[3]; }
0148
0149
0150 double weight() const { return weightSave; }
0151
0152
0153 double weightSum() const { return weightSumSave; }
0154
0155
0156 int nFail() const {
0157 return nFailSave;
0158 }
0159
0160
0161 void failedExcitation() {
0162 ++nFailSave;
0163 }
0164
0165 private:
0166
0167
0168
0169 void addAttempt(double T, double bin, double phiin, double bweight);
0170
0171
0172 void reweight(double w) {
0173 weightSave *= w;
0174 }
0175
0176
0177 void select(Info & in) {
0178 primInfo = in;
0179 primInfo.hiInfo = this;
0180 }
0181
0182
0183 void accept();
0184
0185
0186 void reject() {}
0187
0188
0189 int addSubCollision(const SubCollision & c);
0190
0191
0192 int addProjectileNucleon(const Nucleon & n);
0193 int addTargetNucleon(const Nucleon & n);
0194
0195
0196 int idProjSave, idTargSave;
0197
0198
0199 double bSave;
0200 double phiSave;
0201
0202
0203 long NSave, NAccSave;
0204 double sigmaTotSave, sigmaNDSave, sigErr2TotSave, sigErr2NDSave;
0205 double avNDbSave;
0206 double weightSave, weightSumSave;
0207
0208
0209
0210 vector<int> nCollSave, nProjSave, nTargSave;
0211
0212
0213
0214 map<int,double> sumPrimW, sumPrimW2;
0215 map<int,int> NPrim;
0216 map<int,string> NamePrim;
0217
0218
0219 Info primInfo;
0220
0221
0222 int nFailSave;
0223
0224 public:
0225
0226
0227 const SubCollisionSet* subCollisionsPtr() { return subCollisionsPtrSave; }
0228
0229 private:
0230
0231
0232 void setSubCollisions(const SubCollisionSet* subCollisionsPtrIn) {
0233 subCollisionsPtrSave = subCollisionsPtrIn; }
0234
0235
0236
0237 const SubCollisionSet* subCollisionsPtrSave;
0238
0239 };
0240
0241
0242
0243
0244
0245
0246
0247
0248 class HIUserHooks {
0249
0250 public:
0251
0252
0253 HIUserHooks(): idProjSave(0), idTargSave(0) {}
0254
0255
0256 virtual ~HIUserHooks() {}
0257
0258
0259 virtual void init(int idProjIn, int idTargIn) {
0260 idProjSave = idProjIn;
0261 idTargSave = idTargIn;
0262 }
0263
0264
0265 virtual bool hasImpactParameterGenerator() const { return false; }
0266 virtual shared_ptr<ImpactParameterGenerator> impactParameterGenerator()
0267 const { return nullptr; }
0268
0269
0270 virtual bool hasProjectileModel() const { return false; }
0271 virtual shared_ptr<NucleusModel> projectileModel() const { return nullptr; }
0272 virtual bool hasTargetModel() const { return false; }
0273 virtual shared_ptr<NucleusModel> targetModel() const { return nullptr; }
0274
0275
0276
0277 virtual bool hasSubCollisionModel() { return false; }
0278 virtual shared_ptr<SubCollisionModel> subCollisionModel() { return nullptr; }
0279
0280
0281 virtual bool hasEventOrdering() const { return false; }
0282 virtual double eventOrdering(const Event &, const Info &) { return -1; }
0283
0284
0285
0286 virtual bool canFixIsoSpin() const { return false; }
0287 virtual bool fixIsoSpin(EventInfo &) { return false; }
0288
0289
0290 virtual bool canShiftEvent() const { return false; }
0291 virtual EventInfo & shiftEvent(EventInfo & ei) const { return ei; }
0292
0293
0294
0295 bool canAddNucleonExcitation() const { return false; }
0296 bool addNucleonExcitation(EventInfo &, EventInfo &, bool) const {
0297 return false; }
0298
0299
0300 virtual bool canForceHadronLevel() const { return false; }
0301 virtual bool forceHadronLevel(Pythia &) { return false; }
0302
0303
0304
0305
0306 virtual bool canFindRecoilers() const { return false; }
0307 virtual vector<int>
0308 findRecoilers(const Event &, bool , int , int ,
0309 const Vec4 & , const Vec4 & ) const {
0310 return vector<int>();
0311 }
0312
0313 protected:
0314
0315
0316
0317 int idProjSave, idTargSave;
0318
0319 };
0320
0321
0322
0323 }
0324
0325 #endif