17 #ifndef Pythia8_HISubCollisionModel_H 18 #define Pythia8_HISubCollisionModel_H 20 #include "Pythia8/Pythia.h" 21 #include "Pythia8/HINucleusModel.h" 61 ( abs(
proj->
id()) == 2112? 2: 0 );}
97 double T12In = 0.0,
double T21In = 0.0,
double T22In = 0.0)
98 : subCollisionsSave(subCollisionsIn), TSave({TIn, T12In, T21In, T22In}) {}
101 bool empty()
const {
return subCollisionsSave.empty(); }
105 double T(
unsigned i = 0)
const {
return TSave[i]; }
108 multiset<SubCollision>::const_iterator
begin()
const {
109 return subCollisionsSave.begin(); }
110 multiset<SubCollision>::const_iterator end()
const {
111 return subCollisionsSave.end(); }
116 multiset<SubCollision> subCollisionsSave;
120 vector<double> TSave = {};
150 SigEst(): sig(8, 0.0), dsig2(8, 0.0), fsig(8, false),
151 avNDb(0.0), davNDb2(0.0) {}
159 NInt(100000), NPop(20), sigFuzz(0.2), impactFudge(1),
160 fitPrint(true), avNDb(1.0),
161 projPtr(), targPtr(), sigTotPtr(), settingsPtr(), infoPtr(), rndmPtr() {}
167 static shared_ptr<SubCollisionModel> create(
int model);
170 virtual bool init(
int idAIn,
int idBIn,
double eCMIn);
178 sigTotPtr = &sigTotIn;
179 settingsPtr = &settingsIn;
189 double sigTot()
const {
return sigTarg[0]; }
192 double sigEl()
const {
return sigTarg[6]; }
195 double sigCDE()
const {
return sigTarg[5]; }
198 double sigSDE()
const {
return sigTarg[3] + sigTarg[4]; }
207 double sigDDE()
const {
return sigTarg[2]; }
210 double sigND()
const {
return sigTarg[1]; }
213 double bSlope()
const {
return sigTarg[7]; }
216 double avNDB()
const {
return avNDb; }
222 double Chi2(
const SigEst & sigs,
int npar)
const;
225 void setKinematics(
double eCMIn);
228 void setIDA(
int idA);
231 bool evolve(
int nGenerations,
double eCM,
int idANow);
234 int nParms()
const {
return parmSave.size(); }
238 for (
size_t i = 0; i < parmSave.size(); ++i)
239 parmSave[i] = parmIn[i];
243 vector<double>
getParm()
const {
return parmSave; }
246 virtual vector<double> minParm()
const = 0;
249 virtual vector<double> defParm()
const = 0;
252 virtual vector<double> maxParm()
const = 0;
259 virtual SigEst getSig()
const = 0;
265 vector<double> sigTarg, sigErr;
271 bool saveParms(
string fileName)
const;
272 bool loadParms(
string fileName);
301 bool doVarECM, doVarBeams;
302 double eMin, eMax, eSave;
334 vector<double>
minParm()
const override {
return vector<double>(); }
335 vector<double>
defParm()
const override {
return vector<double>(); }
336 vector<double>
maxParm()
const override {
return vector<double>(); }
370 vector<double>
minParm()
const override {
return vector<double>(); }
371 vector<double>
defParm()
const override {
return vector<double>(); }
372 vector<double>
maxParm()
const override {
return vector<double>(); }
379 s.
sig[3] = sigSDEP();
380 s.
sig[4] = sigSDET();
406 sigd(parmSave[nParmIn]), alpha(parmSave[nParmIn + 1]) {}
417 virtual SigEst getSig()
const override;
422 virtual double pickRadiusProj()
const = 0;
423 virtual double pickRadiusTarg()
const = 0;
437 double opacity(
double sig)
const {
439 if ( opacityMode == 1 ) sig = 1.0/sig;
440 return sig > numeric_limits<double>::epsilon() ?
441 pow(-expm1(-1.0/sig), alpha) : 1.0;
448 double sig = M_PI*
pow2(p[0] + t[0]);
449 double grey = opacity(sig);
450 return sig/grey > b*b*2.0*M_PI? grey: 0.0;
472 vector<double>
minParm()
const override {
return { 0.01, 1.0, 0.0 }; }
473 vector<double>
defParm()
const override {
return { 2.15, 17.24, 0.33 }; }
475 return { 60.00, 60.0, (opacityMode == 0? 20.0: 2.0 ) }; }
480 double pickRadiusTarg()
const override {
return rndmPtr->gamma(k0, r0()); }
490 return sqrt(sigTot() / (M_PI * (2.0 * k0 + 4.0 * k0 * k0)));
519 virtual Vec4 generate(
double & weight)
const;
525 return forceUnitWeight? M_PI*
pow2(width()*cut): 2.0*M_PI *
pow2(width());
529 void width(
double widthIn) { widthSave = widthIn; }
532 double width()
const {
return widthSave; }
540 double widthSave = 0.0;
547 bool forceUnitWeight =
false;
576 kProj(parmSave[0]), kTarg(parmSave[1]),
577 rProj(parmSave[2]), rTarg(parmSave[3]) {}
586 return { 0.01, 0.01, 0.10, 0.10, 1.00, 0.00 }; }
588 return { 1.00, 1.00, 0.54, 0.54, 17.24, 0.33 }; }
590 return { 2.00, 2.00, 4.00, 4.00, 20.00, 2.00 }; }
595 double pickRadiusTarg()
const override {
return pickRadius(kTarg, rTarg); }
607 double pickRadius(
double k0,
double r0)
const {
608 double logSig = log(M_PI *
pow2(r0)) + k0 * rndmPtr->gauss();
609 return sqrt(exp(logSig) / M_PI);
vector< int > idAList
The list of particles that have been fitted.
Definition: HISubCollisionModel.h:306
constexpr double pow2(const double &x)
Powers of small integers - for balance speed/code clarity.
Definition: PythiaStdlib.h:182
CollisionType type
The type of collision.
Definition: HISubCollisionModel.h:77
bool failed
Whether the subcollision failed, i.e. has a failed excitation.
Definition: HISubCollisionModel.h:80
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:335
Definition: HISubCollisionModel.h:460
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:474
int nParms() const
Get the number of free parameters for the model.
Definition: HISubCollisionModel.h:234
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:587
double T(unsigned i=0) const
Definition: HISubCollisionModel.h:105
FluctuatingSubCollisionModel(int nParmIn, int modein)
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:404
virtual ~FluctuatingSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:410
double sigSDE() const
The target single diffractive excitation cross section (both sides).
Definition: HISubCollisionModel.h:198
SigEst()
Constructor for zeros.
Definition: HISubCollisionModel.h:150
Nucleon * targ
The target nucleon.
Definition: HISubCollisionModel.h:67
Definition: HINucleusModel.h:152
Logger * loggerPtr
Pointer to the logger.
Definition: Info.h:86
Definition: HISubCollisionModel.h:359
double avNDb
Definition: HISubCollisionModel.h:288
virtual ~BlackSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:331
vector< double > getParm() const
Get the current parameters of this model.
Definition: HISubCollisionModel.h:243
double bSlope() const
The target elastic b-slope parameter.
Definition: HISubCollisionModel.h:213
Definition: SigmaTotal.h:141
void initPtr(NucleusModel &projIn, NucleusModel &targIn, SigmaTotal &sigTotIn, Settings &settingsIn, Info &infoIn, Rndm &rndmIn)
Initialize the pointers.
Definition: HISubCollisionModel.h:173
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:336
void width(double widthIn)
Set the width (in femtometers).
Definition: HISubCollisionModel.h:529
Both excited but with central diffraction.
Definition: HISubCollisionModel.h:42
LogNormalSubCollisionModel(int modeIn=0)
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:574
int NInt
Definition: HISubCollisionModel.h:281
double bp
Definition: HISubCollisionModel.h:74
vector< double > State
The state of a nucleon is a general vector of doubles.
Definition: HINucleusModel.h:41
map< int, vector< LogInterpolator > > subCollParmsMap
Mapping id -> interpolator, one entry for each particle.
Definition: HISubCollisionModel.h:313
double sigND() const
The target non-diffractive (absorptive) cross section.
Definition: HISubCollisionModel.h:210
BlackSubCollisionModel()
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:328
virtual SigEst getSig() const override
Get cross sections used by this model.
Definition: HISubCollisionModel.h:339
vector< double > parmSave
Saved parameters.
Definition: HISubCollisionModel.h:277
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:589
double avNDb
Definition: HISubCollisionModel.h:147
double sigCDE() const
The target central diffractive excitation cross section.
Definition: HISubCollisionModel.h:195
Definition: HINucleusModel.h:28
Definition: HINucleusModel.h:187
virtual double xSecScale() const
Definition: HISubCollisionModel.h:524
Definition: HISubCollisionModel.h:502
multiset< SubCollision >::const_iterator begin() const
Iterators over the subcollisions.
Definition: HISubCollisionModel.h:108
double avNDB() const
Return the average non-diffractive impact parameter.
Definition: HISubCollisionModel.h:216
The SubCollisionSet gives a set of subcollisions between two nuclei.
Definition: HISubCollisionModel.h:88
NucleusModel * projPtr
Info from the controlling HeavyIons object.
Definition: HISubCollisionModel.h:291
The target is diffractively excited.
Definition: HISubCollisionModel.h:40
vector< bool > fsig
Which cross sections were actually fitted.
Definition: HISubCollisionModel.h:143
double width() const
Get the width.
Definition: HISubCollisionModel.h:532
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:371
vector< double > dsig2
The estimated error (squared)
Definition: HISubCollisionModel.h:140
Definition: HISubCollisionModel.h:323
virtual ~ImpactParameterGenerator()
Virtual destructor.
Definition: HISubCollisionModel.h:511
bool empty() const
Reset the subcollisions.
Definition: HISubCollisionModel.h:101
Definition: HISubCollisionModel.h:130
double sigDDE() const
The target double diffractive excitation cross section.
Definition: HISubCollisionModel.h:207
virtual ~DoubleStrikmanSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:469
virtual SigEst getSig() const override
Get cross sections used by this model.
Definition: HISubCollisionModel.h:375
SubCollision()
Default constructor.
Definition: HISubCollisionModel.h:52
SubCollision(Nucleon &projIn, Nucleon &targIn, double bIn, double bpIn, CollisionType typeIn)
Constructor with configuration.
Definition: HISubCollisionModel.h:46
vector< LogInterpolator > * subCollParms
Definition: HISubCollisionModel.h:310
This is an elastic scattering.
Definition: HISubCollisionModel.h:38
void setParm(const vector< double > &parmIn)
Set the parameters of this model.
Definition: HISubCollisionModel.h:237
virtual ~NaiveSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:367
Definition: HISubCollisionModel.h:30
Internal class to report cross section estimates.
Definition: HISubCollisionModel.h:135
int id() const
Accessor functions:
Definition: HINucleusModel.h:52
DoubleStrikmanSubCollisionModel(int modeIn=0)
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:465
int nucleons() const
Definition: HISubCollisionModel.h:60
Both projectile and target are diffractively excited.
Definition: HISubCollisionModel.h:41
virtual ~SubCollisionModel()
Virtual destructor.
Definition: HISubCollisionModel.h:164
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:473
double sigEl() const
The target elastic cross section.
Definition: HISubCollisionModel.h:192
SubCollisionSet(multiset< SubCollision > subCollisionsIn, double TIn, double T12In=0.0, double T21In=0.0, double T22In=0.0)
Constructor with subcollisions.
Definition: HISubCollisionModel.h:96
Definition: HISubCollisionModel.h:569
CollisionType
This defines the type of a binary nucleon collison.
Definition: HISubCollisionModel.h:35
double pickRadiusProj() const override
Pick a radius for the nucleon, depending on the specific model.
Definition: HISubCollisionModel.h:594
vector< double > minParm() const override
Get the minimum and maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:370
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
double sigSDET() const
The target single diffractive excitation cross section (target).
Definition: HISubCollisionModel.h:204
Definition: HISubCollisionModel.h:399
virtual ~LogNormalSubCollisionModel()
Virtual destructor.
Definition: HISubCollisionModel.h:580
SubCollisionModel(int nParm)
Definition: HISubCollisionModel.h:157
double sigTot() const
The target total nucleon-nucleon cross section.
Definition: HISubCollisionModel.h:189
bool operator<(const SubCollision &s) const
Used to order sub-collisions in a set.
Definition: HISubCollisionModel.h:56
int idASave
For variable energies.
Definition: HISubCollisionModel.h:300
double sigSDEP() const
The target single diffractive excitation cross section (projectile).
Definition: HISubCollisionModel.h:201
Nucleon * proj
The projectile nucleon.
Definition: HISubCollisionModel.h:64
This is not a collision.
Definition: HISubCollisionModel.h:37
vector< double > minParm() const override
virtual SigEst getSig() const override;
Definition: HISubCollisionModel.h:585
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:372
vector< double > minParm() const override
Get the minimum and maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:334
vector< double > sig
The cross sections (tot, nd, dd, sdp, sdt, cd, el, bslope).
Definition: HISubCollisionModel.h:137
double pickRadiusProj() const override
Pick a radius for the nucleon, depending on the specific model.
Definition: HISubCollisionModel.h:479
vector< double > minParm() const override
Get the minimum and maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:472
Definition: Settings.h:196
double b
The impact parameter distance between the nucleons in femtometer.
Definition: HISubCollisionModel.h:70
NaiveSubCollisionModel()
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:364
The projectile is diffractively excited.
Definition: HISubCollisionModel.h:39
int opacityMode
Optional mode for opacity.
Definition: HISubCollisionModel.h:426