12 #ifndef Pythia8_HeavyIons_H 13 #define Pythia8_HeavyIons_H 15 #include "Pythia8/HIInfo.h" 16 #include "Pythia8/PhysicsBase.h" 52 virtual bool init() = 0;
58 virtual bool next() = 0;
79 loggerPtr->ERROR_MSG(
"method not implemented for this heavy ion model");
82 loggerPtr->ERROR_MSG(
"method not implemented for this heavy ion model");
84 virtual bool setKinematics(
double,
double,
double,
double,
double,
double) {
85 loggerPtr->ERROR_MSG(
"method not implemented for this heavy ion model");
88 loggerPtr->ERROR_MSG(
"method not implemented for this heavy ion model");
93 loggerPtr->ERROR_MSG(
"method not implemented for this heavy ion model");
199 virtual bool init()
override;
202 virtual bool next()
override;
205 bool setUserHooksPtr(
PythiaObject sel, UserHooksPtr userHooksPtrIn);
208 bool setKinematicsCM();
211 bool setKinematics(
double,
double,
double,
double,
double,
double)
override;
216 bool setBeamIDs(
int idAIn,
int idBIn = 0)
override;
230 return *collPtr.get(); }
233 return collPtr.get();
238 return *bGenPtr.get(); }
250 return *projPtr.get(); }
254 return *targPtr.get(); }
266 void setBeamKinematics(
int idA,
int idB);
283 static int getBeam(
Event& ev,
int i);
284 static int isRemnant(
const EventInfo& ei,
int i,
int past = 1 ) {
285 if ( i < 3 )
return 0;
286 int statNow = ei.
event[i].status()*past;
287 if ( statNow == 63 )
return ei.
event[i].mother1();
288 if ( statNow/10 == 7 )
289 return isRemnant(ei, ei.
event[i].mother1(), -1);
295 bool genAbs(
SubCollisionSet& subCollsIn, list<EventInfo>& subEventsIn);
302 list<EventInfo>& subEventsIn,
303 vector<CollDesc> colldescs);
305 vector<CollDesc> colldescs);
309 bool buildEvent(list<EventInfo>& subEventsIn);
313 bool nextSASD(
int proc);
318 bool colConnect =
false);
320 bool colConnect =
false);
324 vector<int> findRecoilers(
const Event& e,
bool tside,
int beam,
int end,
325 const Vec4& pdiff,
const Vec4& pbeam);
328 static void insertEntries(
Event & e,
int pos,
int n);
332 bool fixSecondaryAbsorptive(
Event & ev,
double xpom);
336 static void addJunctions(
Event& evnt,
Event& sub,
int coloff);
340 bool addNucleusRemnants();
351 pair<RotBstMatrix,RotBstMatrix>& R12);
352 static double mT2(
const Vec4& p) {
return p.pPos()*p.pNeg(); }
353 static double mT(
const Vec4& p) {
return sqrt(max(mT2(p), 0.0)); }
359 struct ProcessSelectorHook:
public UserHooks {
361 ProcessSelectorHook(): proc(0), b(-1.0) {}
371 if ( proc > 0 &&
infoPtr->code()%10 != proc%10 )
return true;
375 if (
infoPtr->code() == 103 && process[1].idAbs() < 600 &&
376 process[1].idAbs() > 500 && process[3].status() == 15 &&
377 process[3].m() < process[1].m() + 1.0 + 0.4)
379 if (
infoPtr->code() == 105 && process[1].idAbs() < 600 &&
380 process[1].idAbs() > 500 && process[3].status() == 15 &&
381 process[3].m() < process[1].m() + 1.0 + 0.4)
392 return xveto(4, ev, oldsize, iSys);
401 int iSys,
bool =
false ) {
402 return xveto(5, ev, oldsize, iSys);
410 return xveto(3, ev, oldsize, -1);
423 return istep == 1? procveto(ev): giveUp;
447 return finalveto(event);
473 bool xveto(
int type,
const Event & event,
int oldsize,
int iSys);
476 bool procveto(
const Event& ev);
480 bool finalveto(
const Event& ev);
482 bool checkVeto(
bool ret) {
485 if ( failcount >= 100 ) {
490 return ( giveUp?
false: ret );
508 int nAllowQuarkTries = 1;
509 int iAllowQuarkTries = 0;
510 bool hasQuark =
false;
520 HoldProcess(shared_ptr<ProcessSelectorHook> hook,
int proc,
521 double b = -1.0,
double olap = -1.0,
double xmax = 0.0)
522 : saveHook(hook), saveProc(hook->proc), saveB(hook->b),
523 saveOlap(hook->olap), saveXmax(hook->xmax) {
528 hook->iAllowQuarkTries = 0;
529 hook->hasQuark = hook->giveUp =
false;
536 saveHook->proc = saveProc;
538 saveHook->olap = saveOlap;
539 saveHook->xmax = saveXmax;
544 shared_ptr<ProcessSelectorHook> saveHook;
561 shared_ptr<ProcessSelectorHook> selectMB;
564 shared_ptr<ProcessSelectorHook> selectSASD;
569 return doLowEnergyNow? 1: 2; }
573 static const int MAXTRY = 999;
574 static const int MAXEVSAVE = 999;
578 bool hasSignal =
false;
583 set<int> vetoPrimaryProcess = {};
586 bool doHadronLevel =
true;
589 bool doSDTest =
false;
592 bool glauberOnly =
false;
599 shared_ptr<SubCollisionModel> collPtr = {};
602 shared_ptr<SubCollisionModel> lowEnergyCollPtr = {};
605 shared_ptr<ImpactParameterGenerator> bGenPtr = {};
613 shared_ptr<NucleusModel> projPtr = {};
614 shared_ptr<NucleusModel> targPtr = {};
617 bool doVarECM =
false;
620 bool allowIDAswitch =
false;
623 bool doLowEnergy =
false;
627 bool doLowEnergyNow =
false;
630 double eCMlow = 20.0;
634 int recoilerMode = 1;
644 double sabsEps = 0.0;
648 double sabsMinMX = 1.23;
652 double sabsCutMX = 20.0;
655 bool cascadeMode =
false;
659 vector<int> cascadeMediumIons = { 1000070140, 1000080160, 1000180400 };
662 bool doAbort =
false;
virtual int numberVetoStep()
Up to how many ISR + FSR steps of hardest interaction should be checked.
Definition: UserHooks.h:100
const SubCollisionModel & subCollisionModel() const
Get the underlying subcollision model.
Definition: HeavyIons.h:229
const NucleusModel & targetModel() const
The underlying target nucleus model.
Definition: HeavyIons.h:253
virtual bool canVetoPartonLevelEarly()
Definition: UserHooks.h:120
const SubCollisionSet & subCollisions() const
Subcollisions for the current event.
Definition: HeavyIons.h:225
Definition: PhysicsBase.h:26
void registerSubObject(PhysicsBase &pb)
Register a sub object that should have its information in sync with this.
Definition: PhysicsBase.cc:57
HeavyIons(Pythia &mainPythiaIn)
Definition: HeavyIons.h:38
virtual bool canSetEnhanceB() const
Can set the enhancement for the MPI treatment.
Definition: UserHooks.h:241
The Event class holds all info on the generated event.
Definition: Event.h:408
Definition: HINucleusModel.h:152
virtual int hasGlauberCalculation() const
Definition: HeavyIons.h:107
vector< Info * > info
The Info objects associated to the secondary Pythia objects.
Definition: HeavyIons.h:150
static bool isHeavyIon(Settings &settings)
Check the settings and return false of there are no heavy ion beams.
Definition: HeavyIons.cc:394
Definition: SigmaTotal.h:141
const NucleusModel & projectileModel() const
The underlying projectile nucleus model.
Definition: HeavyIons.h:249
static void setupSpecials(Settings &settings, string match)
Duplicate setting on the form match: to settings on the form HImatch:
Definition: HeavyIons.cc:41
static set< int > clearSoftQCDFlags(Settings &settings)
Definition: HeavyIons.cc:125
virtual bool doVetoMPIStep(int, const Event &)
Definition: UserHooks.h:116
virtual bool doVetoFSREmission(int, const Event &, int, bool=false)
Definition: UserHooks.h:164
Definition: HINucleusModel.h:198
virtual bool doVetoPartonLevelEarly(const Event &)
Definition: UserHooks.h:124
Definition: HISubCollisionModel.h:704
virtual int numberVetoMPIStep()
Up to how many MPI steps should be checked.
Definition: UserHooks.h:112
const Nucleus & target() const
Target nucleus configuration for the current event.
Definition: HeavyIons.h:245
void clearProcessLevel(Pythia &pyt)
Definition: HeavyIons.cc:208
The SubCollisionSet gives a set of subcollisions between two nuclei.
Definition: HISubCollisionModel.h:96
int idProj
Save current beam configuration.
Definition: HeavyIons.h:128
HIUserHooksPtr HIHooksPtr
Definition: HeavyIons.h:140
virtual ~HeavyIons()
Destructor.
Definition: HeavyIons.h:44
virtual bool canVetoISREmission()
Possibility to veto an emission in the ISR machinery.
Definition: UserHooks.h:147
Event event
The Event object.
Definition: HIBasics.h:33
virtual bool canVetoMPIEmission()
Possibility to veto an MPI.
Definition: UserHooks.h:168
const Nucleus & projectile() const
Projectile nucleus configuration for the current event.
Definition: HeavyIons.h:241
Definition: HISubCollisionModel.h:143
Definition: HeavyIons.h:154
virtual void onInitInfoPtr() override
Definition: HeavyIons.h:262
PythiaObject
Enumerate the different internal Pythia objects.
Definition: HeavyIons.h:174
vector< string > pythiaNames
The names associated with the secondary pythia objects.
Definition: HeavyIons.h:147
static void addSpecialSettings(Settings &settings)
The abstract HeavyIons class.
Definition: HeavyIons.cc:26
Pythia * mainPythiaPtr
Definition: HeavyIons.h:132
Definition: HISubCollisionModel.h:30
virtual bool canVetoProcessLevel()
Possibility to veto event after process-level selection.
Definition: UserHooks.h:60
virtual bool canSetImpactParameter() const
Can set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:235
virtual bool canVetoStep()
Definition: UserHooks.h:97
bool setHIUserHooksPtr(HIUserHooksPtr userHooksPtrIn)
Possibility to pass in pointer for special heavy ion user hooks.
Definition: HeavyIons.h:73
Info * getInfo()
Only one function: return the info object.
Definition: HeavyIons.h:157
Status
Enum for specifying the status of a nucleon.
Definition: HINucleusModel.h:33
Class for storing Events and Info objects.
Definition: HIBasics.h:25
Logger * loggerPtr
Pointer to logger.
Definition: PhysicsBase.h:91
virtual bool doVetoISREmission(int, const Event &, int)
Definition: UserHooks.h:153
CollisionType
This defines the type of a binary nucleon collision.
Definition: HISubCollisionModel.h:35
SigmaTotal sigTotNN
Definition: HeavyIons.h:136
virtual bool setKinematics(double)
Set beam kinematics.
Definition: HeavyIons.h:78
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
The Pythia class contains the top-level routines to generate an event.
Definition: Pythia.h:72
virtual bool doVetoMPIEmission(int, const Event &)
Definition: UserHooks.h:173
HIInfo hiInfo
Definition: HeavyIons.h:98
Info * infoPtr
Definition: PhysicsBase.h:82
void setAbortPartonLevel(bool abortIn)
Set abort in parton level.
Definition: Info.h:490
virtual bool setBeamIDs(int, int=0)
Set beam particles.
Definition: HeavyIons.h:92
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
tuple< SubCollision::CollisionType, int, Nucleon::Status, Nucleon::Status > CollDesc
Convenient typedef for adding secondary sub-collisions.
Definition: HeavyIons.h:187
const SigmaTotal & sigmaNN() const
Hadronic cross sections used by the subcollision model.
Definition: HeavyIons.h:257
virtual bool canVetoFSREmission()
Possibility to veto an emission in the FSR machinery.
Definition: UserHooks.h:156
vector< Pythia * > pythia
Definition: HeavyIons.h:144
virtual bool doVetoProcessLevel(Event &)
Definition: UserHooks.h:64
virtual bool canVetoMPIStep()
Definition: UserHooks.h:109
virtual bool doVetoStep(int, int, int, const Event &)
Definition: UserHooks.h:105
Definition: HeavyIons.h:31
virtual void stat()
Print out statistics.
Definition: HeavyIons.cc:268
virtual double doSetEnhanceB()
Set the enhancement for the MPI treatment.
Definition: UserHooks.h:244
const ImpactParameterGenerator & impactParameterGenerator() const
Get the underlying impact parameter generator.
Definition: HeavyIons.h:237
void updateInfo()
Update the Info object in the main Pythia object.
Definition: HeavyIons.cc:237
The default HeavyIon model in Pythia.
Definition: HeavyIons.h:169
Definition: Settings.h:196
virtual double doSetImpactParameter()
Set the overall impact parameter for the MPI treatment.
Definition: UserHooks.h:238