17 #ifndef Pythia8_HISubCollisionModel_H 18 #define Pythia8_HISubCollisionModel_H 20 #include "Pythia8/Pythia.h" 21 #include "Pythia8/HINucleusModel.h" 60 ( abs(
proj->
id()) == 2112? 2: 0 );}
93 : subCollisionsSave(subCollisionsIn), TSave(TIn) {}
96 bool empty()
const {
return subCollisionsSave.empty(); }
99 double T()
const {
return TSave; }
102 multiset<SubCollision>::const_iterator
begin()
const {
103 return subCollisionsSave.begin(); }
104 multiset<SubCollision>::const_iterator end()
const {
105 return subCollisionsSave.end(); }
110 multiset<SubCollision> subCollisionsSave;
141 SigEst(): sig(8, 0.0), dsig2(8, 0.0), fsig(8, false),
142 avNDb(0.0), davNDb2(0.0) {}
149 NInt(100000), NPop(20), sigFuzz(0.2), impactFudge(1),
151 projPtr(), targPtr(), sigTotPtr(), settingsPtr(), infoPtr(), rndmPtr() {}
157 static shared_ptr<SubCollisionModel> create(
int model);
160 virtual bool init(
int idAIn,
int idBIn,
double eCMIn);
168 sigTotPtr = &sigTotIn;
169 settingsPtr = &settingsIn;
179 double sigTot()
const {
return sigTarg[0]; }
182 double sigEl()
const {
return sigTarg[6]; }
185 double sigCDE()
const {
return sigTarg[5]; }
188 double sigSDE()
const {
return sigTarg[3] + sigTarg[4]; }
197 double sigDDE()
const {
return sigTarg[2]; }
200 double sigND()
const {
return sigTarg[1]; }
203 double bSlope()
const {
return sigTarg[7]; }
206 double avNDB()
const {
return avNDb; }
212 double Chi2(
const SigEst & sigs,
int npar)
const;
215 void setKinematics(
double eCMIn);
218 void setIDA(
int idA);
221 bool evolve(
int nGenerations,
double eCM);
224 int nParms()
const {
return parmSave.size(); }
228 for (
size_t i = 0; i < parmSave.size(); ++i)
229 parmSave[i] = parmIn[i];
233 vector<double>
getParm()
const {
return parmSave; }
236 virtual vector<double> minParm()
const = 0;
239 virtual vector<double> defParm()
const = 0;
242 virtual vector<double> maxParm()
const = 0;
249 virtual SigEst getSig()
const = 0;
255 vector<double> sigTarg, sigErr;
261 bool saveParms(
string fileName)
const;
262 bool loadParms(
string fileName);
291 bool doVarECM, doVarBeams;
292 double eMin, eMax, eSave;
324 vector<double>
minParm()
const override {
return vector<double>(); }
325 vector<double>
defParm()
const override {
return vector<double>(); }
326 vector<double>
maxParm()
const override {
return vector<double>(); }
360 vector<double>
minParm()
const override {
return vector<double>(); }
361 vector<double>
defParm()
const override {
return vector<double>(); }
362 vector<double>
maxParm()
const override {
return vector<double>(); }
369 s.
sig[3] = sigSDEP();
370 s.
sig[4] = sigSDET();
396 sigd(parmSave[nParmIn]), alpha(parmSave[nParmIn + 1]),
397 opacityMode(modein) {}
407 virtual SigEst getSig()
const override;
412 virtual double pickRadiusProj()
const = 0;
413 virtual double pickRadiusTarg()
const = 0;
427 double opacity(
double sig)
const {
429 if ( opacityMode == 1 ) sig = 1.0/sig;
430 return sig > numeric_limits<double>::epsilon() ?
431 pow(-expm1(-1.0/sig), alpha) : 1.0;
438 double sig = M_PI*
pow2(p[0] + t[0]);
439 double grey = opacity(sig);
440 return sig/grey > b*b*2.0*M_PI? grey: 0.0;
462 vector<double>
minParm()
const override {
return { 0.01, 1.0, 0.0 }; }
463 vector<double>
defParm()
const override {
return { 2.15, 17.24, 0.33 }; }
464 vector<double>
maxParm()
const override {
return { 60.00, 60.0, 20.0 }; }
469 double pickRadiusTarg()
const override {
return rndmPtr->gamma(k0, r0()); }
479 return sqrt(sigTot() / (M_PI * (2.0 * k0 + 4.0 * k0 * k0)));
498 : widthSave(0.0), collPtr(0), projPtr(0), targPtr(0),
499 settingsPtr(0), rndmPtr(0) {}
510 virtual Vec4 generate(
double & weight)
const;
513 void width(
double widthIn) { widthSave = widthIn; }
516 double width()
const {
return widthSave; }
553 kProj(parmSave[0]), kTarg(parmSave[1]),
554 rProj(parmSave[2]), rTarg(parmSave[3]) {}
563 return { 0.01, 0.01, 0.10, 0.10, 1.00, 0.00 }; }
565 return { 1.00, 1.00, 0.54, 0.54, 17.24, 0.33 }; }
567 return { 2.00, 2.00, 4.00, 4.00, 20.00, 2.00 }; }
572 double pickRadiusTarg()
const override {
return pickRadius(kTarg, rTarg); }
584 double pickRadius(
double k0,
double r0)
const {
585 double logSig = log(M_PI *
pow2(r0)) + k0 * rndmPtr->gauss();
586 return sqrt(exp(logSig) / M_PI);
vector< int > idAList
The list of particles that have been fitted.
Definition: HISubCollisionModel.h:296
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:76
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:325
Definition: HISubCollisionModel.h:450
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:464
int nParms() const
Get the number of free parameters for the model.
Definition: HISubCollisionModel.h:224
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:564
FluctuatingSubCollisionModel(int nParmIn, int modein)
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:394
virtual ~FluctuatingSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:400
double sigSDE() const
The target single diffractive excitation cross section (both sides).
Definition: HISubCollisionModel.h:188
SigEst()
Constructor for zeros.
Definition: HISubCollisionModel.h:141
Nucleon * targ
The target nucleon.
Definition: HISubCollisionModel.h:66
Definition: HINucleusModel.h:152
Logger * loggerPtr
Pointer to the logger.
Definition: Info.h:86
Definition: HISubCollisionModel.h:349
double avNDb
Definition: HISubCollisionModel.h:278
virtual ~BlackSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:321
vector< double > getParm() const
Get the current parameters of this model.
Definition: HISubCollisionModel.h:233
double bSlope() const
The target elastic b-slope parameter.
Definition: HISubCollisionModel.h:203
Info * infoPtr
Pointers from the controlling HeavyIons object.
Definition: HISubCollisionModel.h:529
Definition: SigmaTotal.h:141
void initPtr(NucleusModel &projIn, NucleusModel &targIn, SigmaTotal &sigTotIn, Settings &settingsIn, Info &infoIn, Rndm &rndmIn)
Initialize the pointers.
Definition: HISubCollisionModel.h:163
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:326
void width(double widthIn)
Set the width (in femtometers).
Definition: HISubCollisionModel.h:513
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:551
int NInt
Definition: HISubCollisionModel.h:271
double bp
Definition: HISubCollisionModel.h:73
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:303
SubCollisionSet(multiset< SubCollision > subCollisionsIn, double TIn)
Constructor with subcollisions.
Definition: HISubCollisionModel.h:92
double sigND() const
The target non-diffractive (absorptive) cross section.
Definition: HISubCollisionModel.h:200
BlackSubCollisionModel()
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:318
virtual SigEst getSig() const override
Get cross sections used by this model.
Definition: HISubCollisionModel.h:329
vector< double > parmSave
Saved parameters.
Definition: HISubCollisionModel.h:267
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:566
double avNDb
Definition: HISubCollisionModel.h:138
double sigCDE() const
The target central diffractive excitation cross section.
Definition: HISubCollisionModel.h:185
Definition: HINucleusModel.h:28
Definition: HINucleusModel.h:187
Definition: HISubCollisionModel.h:491
multiset< SubCollision >::const_iterator begin() const
Iterators over the subcollisions.
Definition: HISubCollisionModel.h:102
double avNDB() const
Return the average non-diffractive impact parameter.
Definition: HISubCollisionModel.h:206
The SubCollisionSet gives a set of subcollisions between two nuclei.
Definition: HISubCollisionModel.h:84
NucleusModel * projPtr
Info from the controlling HeavyIons object.
Definition: HISubCollisionModel.h:281
The target is diffractively excited.
Definition: HISubCollisionModel.h:40
vector< bool > fsig
Which cross sections were actually fitted.
Definition: HISubCollisionModel.h:134
double width() const
Get the width.
Definition: HISubCollisionModel.h:516
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:361
vector< double > dsig2
The estimated error (squared)
Definition: HISubCollisionModel.h:131
Definition: HISubCollisionModel.h:313
virtual ~ImpactParameterGenerator()
Virtual destructor.
Definition: HISubCollisionModel.h:502
bool empty() const
Reset the subcollisions.
Definition: HISubCollisionModel.h:96
Definition: HISubCollisionModel.h:121
double sigDDE() const
The target double diffractive excitation cross section.
Definition: HISubCollisionModel.h:197
virtual ~DoubleStrikmanSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:459
virtual SigEst getSig() const override
Get cross sections used by this model.
Definition: HISubCollisionModel.h:365
SubCollision()
Default constructor.
Definition: HISubCollisionModel.h:51
SubCollision(Nucleon &projIn, Nucleon &targIn, double bIn, double bpIn, CollisionType typeIn)
Constructor with configuration.
Definition: HISubCollisionModel.h:46
vector< LogInterpolator > * subCollParms
Definition: HISubCollisionModel.h:300
This is an elastic scattering.
Definition: HISubCollisionModel.h:38
void setParm(const vector< double > &parmIn)
Set the parameters of this model.
Definition: HISubCollisionModel.h:227
virtual ~NaiveSubCollisionModel() override
Virtual destructor.
Definition: HISubCollisionModel.h:357
Definition: HISubCollisionModel.h:30
Internal class to report cross section estimates.
Definition: HISubCollisionModel.h:126
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:455
int nucleons() const
Definition: HISubCollisionModel.h:59
Both projectile and target are diffractively excited.
Definition: HISubCollisionModel.h:41
virtual ~SubCollisionModel()
Virtual destructor.
Definition: HISubCollisionModel.h:154
vector< double > defParm() const override
Get the default parameter values for this model.
Definition: HISubCollisionModel.h:463
double sigEl() const
The target elastic cross section.
Definition: HISubCollisionModel.h:182
Definition: HISubCollisionModel.h:546
double T() const
The summed elastic amplitude.
Definition: HISubCollisionModel.h:99
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:571
vector< double > minParm() const override
Get the minimum and maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:360
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:194
Definition: HISubCollisionModel.h:389
virtual ~LogNormalSubCollisionModel()
Virtual destructor.
Definition: HISubCollisionModel.h:557
SubCollisionModel(int nParm)
The default constructor is empty.
Definition: HISubCollisionModel.h:147
double sigTot() const
The target total nucleon-nucleon cross section.
Definition: HISubCollisionModel.h:179
bool operator<(const SubCollision &s) const
Used to order sub-collisions in a set.
Definition: HISubCollisionModel.h:55
int idASave
For variable energies.
Definition: HISubCollisionModel.h:290
const double femtometer
Lengths.
Definition: HIBasics.h:31
double sigSDEP() const
The target single diffractive excitation cross section (projectile).
Definition: HISubCollisionModel.h:191
Nucleon * proj
The projectile nucleon.
Definition: HISubCollisionModel.h:63
This is not a collision.
Definition: HISubCollisionModel.h:37
vector< double > minParm() const override
virtual SigEst getSig() const override;
Definition: HISubCollisionModel.h:562
vector< double > maxParm() const override
Get the maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:362
vector< double > minParm() const override
Get the minimum and maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:324
vector< double > sig
The cross sections (tot, nd, dd, sdp, sdt, cd, el, bslope).
Definition: HISubCollisionModel.h:128
double pickRadiusProj() const override
Pick a radius for the nucleon, depending on the specific model.
Definition: HISubCollisionModel.h:468
vector< double > minParm() const override
Get the minimum and maximum allowed parameter values for this model.
Definition: HISubCollisionModel.h:462
ImpactParameterGenerator()
Definition: HISubCollisionModel.h:497
Definition: Settings.h:195
double b
The impact parameter distance between the nucleons in femtometer.
Definition: HISubCollisionModel.h:69
NaiveSubCollisionModel()
The default constructor simply lists the nucleon-nucleon cross sections.
Definition: HISubCollisionModel.h:354
The projectile is diffractively excited.
Definition: HISubCollisionModel.h:39