14 #ifndef Pythia8_HINucleusModel_H 15 #define Pythia8_HINucleusModel_H 17 #include "Pythia8/HIBasics.h" 46 : idSave(idIn), indexSave(indexIn), nPosSave(pos), bPosSave(pos),
47 statusSave(UNWOUNDED), eventp(0), isDone(0) {}
52 int id()
const {
return idSave; }
55 int index()
const {
return indexSave; }
70 bool done()
const {
return isDone; }
76 const State&
state()
const {
return stateSave; }
80 static State nullstate;
81 return i < int(altStatesSave.size())? altStatesSave[i]: nullstate;
90 void state(
const State& s) { stateSave = s; }
93 void addAltState(
const State& s) { altStatesSave.push_back(s); }
110 statusSave = UNWOUNDED;
111 altStatesSave.clear();
139 vector<State> altStatesSave;
161 nucleonsSave = make_shared<vector<Nucleon>>(nucleons);
162 for (
Nucleon& nucleon : *nucleonsSave) {
164 nucleon.bShift(bPos);
170 for (
Nucleon& nucleon : *nucleonsSave)
171 nucleon.bShift(bPosNew - bPosSave);
177 vector<Nucleon>::iterator
begin() {
return nucleonsSave->begin(); }
178 vector<Nucleon>::iterator end() {
return nucleonsSave->end(); }
179 vector<Nucleon>::const_iterator begin()
const {
return nucleonsSave->begin();}
180 vector<Nucleon>::const_iterator end()
const {
return nucleonsSave->end();}
181 int size()
const {
return nucleonsSave->size();}
183 const Vec4 &
bPos() {
return bPosSave; }
188 shared_ptr<vector<Nucleon>> nucleonsSave;
205 ZSave(0), LSave(0), RSave(0.0), settingsPtr(0),
211 static shared_ptr<NucleusModel> create(
int model);
214 void initPtr(
int idIn,
bool isProjIn,
Info& infoIn);
215 virtual bool init() {
return true; }
216 virtual bool initGeometry() {
return false; }
219 void setParticle(
int idIn);
222 virtual void setPN(
const Vec4 & pNIn) { pNSave = pNIn; }
225 virtual void setMN(
double mNIn) { mNSave = mNIn; }
232 virtual vector<Nucleon> generate()
const = 0;
235 int id()
const {
return idSave; }
236 int I()
const {
return ISave; }
237 int A()
const {
return ASave; }
238 int Z()
const {
return ZSave; }
239 int L()
const {
return LSave; }
240 double R()
const {
return RSave; }
242 int idN()
const {
return idNSave; }
243 const Vec4& pN()
const {
return pNSave; }
244 double mN()
const {
return mNSave; }
273 size_t cacheSize = 0;
274 mutable map<int, vector< vector<Nucleon> > > nucleonCache;
297 bool init()
override;
301 vector<Nucleon> generate()
const override;
312 mutable vector<vector<Vec4> > nucleonPositions;
315 mutable size_t nUsed;
342 if (gaussHardCore)
return hardCoreRadius * abs(rndmPtr->gauss());
343 return hardCoreRadius;}
372 inthi0(0.0), inthi1(0.0), inthi2(0.0) {}
375 bool init()
override;
376 bool initGeometry()
override;
379 vector<Nucleon> generate()
const override;
382 double a()
const {
return aSave; }
388 Vec4 generateNucleon()
const;
392 intlo = R()*R()*R()/3.0;
393 inthi0 = a()*R()*R();
394 inthi1 = 2.0*a()*a()*R();
395 inthi2 = 2.0*a()*a()*a();
407 double intlo, inthi0, inthi1, inthi2;
428 bool init()
override;
429 bool initGeometry()
override;
448 virtual bool init()
override;
452 virtual vector<Nucleon> generate()
const override;
458 virtual Vec4 generateNucleon()
const;
461 double rho(
double r)
const {
462 double pref = 4./(pow(sqrt(M_PI * C2),3)) * (1 + (A() - 4.)/6. * r*r/C2);
463 return pref * exp(-r*r / C2);
494 virtual bool init()
override;
497 virtual vector<Nucleon> generate()
const override;
502 double rho(
double r)
const {
503 double pref = (2*hA*hB*(hA + hB))/
pow2(hA - hB);
504 double exps = exp(-2.*hA*r) + exp(-2.*hB*r) - 2.*exp(-(hA+hB)*r);
528 virtual bool init()
override;
532 virtual vector<Nucleon> generate()
const override;
538 virtual Vec4 generateNucleon()
const;
560 virtual bool init()
override;
564 virtual vector<Nucleon> generate()
const override;
569 unique_ptr<NucleusModel> nModelPtr;
Z0 Z(f is quark or lepton).*/ void Sigma1ffbar2gmZZprime
Initialize process.
Definition: SigmaNewGaugeBosons.cc:110
constexpr double pow2(const double &x)
Powers of small integers - for balance speed/code clarity.
Definition: PythiaStdlib.h:175
double rho(double r) const
The (normalized) density function.
Definition: HINucleusModel.h:502
GLISSANDOModel()
Default constructor.
Definition: HINucleusModel.h:422
double nucleusChR
Nucleus charge radius.
Definition: HINucleusModel.h:464
double a() const
Accessor functions.
Definition: HINucleusModel.h:382
bool done() const
Check if nucleon has been assigned.
Definition: HINucleusModel.h:70
virtual ~HardCoreModel()
Virtual destructor.
Definition: HINucleusModel.h:333
void reset()
Reset the states and status.
Definition: HINucleusModel.h:109
A general Woods-Saxon distributed nucleus.
Definition: HINucleusModel.h:362
double hA
Parameters of the Hulthen model.
Definition: HINucleusModel.h:506
Definition: HINucleusModel.h:152
double RSave
The estimate of the nucleus radius.
Definition: HINucleusModel.h:258
void overestimates()
Calculate overestimates for sampling.
Definition: HINucleusModel.h:391
vector< Nucleon >::iterator begin()
Iterate over nucleons.
Definition: HINucleusModel.h:177
The Hulthen potential for deuterons.
Definition: HINucleusModel.h:484
void state(const State &s)
Set the physical state.
Definition: HINucleusModel.h:90
HardCoreModel()
Default constructor.
Definition: HINucleusModel.h:330
vector< double > State
The state of a nucleon is a general vector of doubles.
Definition: HINucleusModel.h:41
bool gaussHardCore
Use a Gaussian hard core.
Definition: HINucleusModel.h:351
virtual ~HOShellModel()
Destructor.
Definition: HINucleusModel.h:445
const Vec4 & bPos() const
The absolute position in impact parameter space.
Definition: HINucleusModel.h:61
Definition: HINucleusModel.h:28
Definition: HINucleusModel.h:198
const Vec4 & nPos() const
The position of this nucleon relative to the nucleus center.
Definition: HINucleusModel.h:58
GaussianModel()
Default constructor.
Definition: HINucleusModel.h:523
int index() const
The index of the nucleon in the nucleus.
Definition: HINucleusModel.h:55
double protonChR
Nucleon charge radius.
Definition: HINucleusModel.h:470
virtual void setPN(const Vec4 &pNIn)
Set (new) nucleon 4-momentum.
Definition: HINucleusModel.h:222
const State & altState(int i=0)
Return an alternative state.
Definition: HINucleusModel.h:79
EventInfo * event() const
The event this nucleon is assigned to.
Definition: HINucleusModel.h:73
Definition: HINucleusModel.h:417
Nucleus(vector< Nucleon > nucleons, Vec4 bPos)
Constructor with nucleons and impact parameter.
Definition: HINucleusModel.h:160
HOShellModel()
Default constructor.
Definition: HINucleusModel.h:442
bool useHardCore
Use the hard core or not.
Definition: HINucleusModel.h:348
A Gaussian distribution for light nuclei.
Definition: HINucleusModel.h:518
Nucleus & reposition(const Vec4 &bPosNew)
Move the nucleus around in impact parameter space.
Definition: HINucleusModel.h:169
The nucleon is not wounded.
Definition: HINucleusModel.h:35
bool isProj
Projectile or target.
Definition: HINucleusModel.h:249
A Harmonic-Oscillator Shell model for light nuclei.
Definition: HINucleusModel.h:437
double rho(double r) const
The density function.
Definition: HINucleusModel.h:461
The nucleon is diffractively wounded.
Definition: HINucleusModel.h:37
double aSave
The nucleus radius, skin depth parameter, and hard core nucleon radius.
Definition: HINucleusModel.h:401
virtual void setMN(double mNIn)
Set (new) effective nucleon mass.
Definition: HINucleusModel.h:225
The nucleon is elastically scattered.
Definition: HINucleusModel.h:36
double hardCoreRadius
The radius or width of the hard core.
Definition: HINucleusModel.h:354
Info * infoPtr
Pointers to useful objects.
Definition: HINucleusModel.h:277
int idSave
The nucleus.
Definition: HINucleusModel.h:252
int id() const
Accessor functions:
Definition: HINucleusModel.h:52
ExternalNucleusModel()
Default constructor.
Definition: HINucleusModel.h:294
void debug()
Print out debugging information.
Definition: HINucleusModel.cc:23
int ISave
Cache information about the nucleus.
Definition: HINucleusModel.h:255
virtual ~GaussianModel()
Destructor.
Definition: HINucleusModel.h:526
void select()
Select this nucleon to be assigned to an event.
Definition: HINucleusModel.h:103
Status
Enum for specifying the status of a nucleon.
Definition: HINucleusModel.h:33
Class for storing Events and Info objects.
Definition: HIBasics.h:25
int id() const
Accessor functions.
Definition: HINucleusModel.h:235
void select(EventInfo &evp, Nucleon::Status s)
Select an event for this nucleon.
Definition: HINucleusModel.h:96
virtual ~NucleusModel()
Virtual destructor.
Definition: HINucleusModel.h:209
Definition: HINucleusModel.h:289
double rSample() const
Definition: HINucleusModel.h:341
Nucleon::Status status() const
The status of the nucleon.
Definition: HINucleusModel.h:67
WoodsSaxonModel()
Definition: HINucleusModel.h:371
void bShift(const Vec4 &bvec)
Shift the absolute position in impact parameter space.
Definition: HINucleusModel.h:64
NucleusModel()
Definition: HINucleusModel.h:204
void addAltState(const State &s)
Add an alternative state.
Definition: HINucleusModel.h:93
HulthenModel()
Default constructor.
Definition: HINucleusModel.h:489
double rhoMax
Maximum rho for these parameters.
Definition: HINucleusModel.h:476
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
const State & state() const
The physical state of the incoming nucleon.
Definition: HINucleusModel.h:76
void status(Nucleon::Status s)
Manipulating functions:
Definition: HINucleusModel.h:87
Nucleon(int idIn=0, int indexIn=0, const Vec4 &pos=Vec4())
Definition: HINucleusModel.h:45
virtual ~HulthenModel()
Virtual destructor.
Definition: HINucleusModel.h:492
double nucleusChR
Nucleus charge radius.
Definition: HINucleusModel.h:541
A model for nuclei clustered in smaller nuclei.
Definition: HINucleusModel.h:549
double C2
C2 parameter.
Definition: HINucleusModel.h:473
Definition: HINucleusModel.h:325
virtual ~GLISSANDOModel()
Virtual destructor.
Definition: HINucleusModel.h:425
virtual ~WoodsSaxonModel()
Virtual destructor.
Definition: HINucleusModel.h:367
virtual ~ClusterModel()
Virtual destructor.
Definition: HINucleusModel.h:557
Definition: Settings.h:196
ClusterModel()
Contructor.
Definition: HINucleusModel.h:554