12 #ifndef Pythia8_HeavyIons_H
13 #define Pythia8_HeavyIons_H
15 #include "Pythia8/HIUserHooks.h"
16 #include "Pythia8/PhysicsBase.h"
31 class HeavyIons :
public PhysicsBase {
52 virtual bool init() = 0;
58 virtual bool next() = 0;
174 virtual bool init()
override;
177 virtual bool next()
override;
184 return projectile.begin();
186 vector<Nucleon>::iterator targBegin() {
187 return target.begin();
189 vector<Nucleon>::iterator projEnd() {
190 return projectile.end();
192 vector<Nucleon>::iterator targEnd() {
198 virtual void onInitInfoPtr()
override {
199 registerSubObject(
sigtot); }
210 EventInfo getND() {
return getMBIAS(0, 101); }
211 EventInfo getND(
const SubCollision & coll) {
return getMBIAS(&coll, 101); }
212 EventInfo getEl(
const SubCollision & coll) {
return getMBIAS(&coll, 102); }
213 EventInfo getSDP(
const SubCollision & coll) {
return getMBIAS(&coll, 103); }
214 EventInfo getSDT(
const SubCollision & coll) {
return getMBIAS(&coll, 104); }
215 EventInfo getDD(
const SubCollision & coll) {
return getMBIAS(&coll, 105); }
216 EventInfo getCD(
const SubCollision & coll) {
return getMBIAS(&coll, 106); }
217 EventInfo getSDabsP(
const SubCollision & coll)
218 {
return getSASD(&coll, 103); }
219 EventInfo getSDabsT(
const SubCollision & coll)
220 {
return getSASD(&coll, 104); }
221 EventInfo getMBIAS(
const SubCollision * coll,
int procid);
222 EventInfo getSASD(
const SubCollision * coll,
int procid);
223 bool genAbs(
const multiset<SubCollision> & coll,
224 list<EventInfo> & subevents);
225 void addSASD(
const multiset<SubCollision> & coll);
226 bool addDD(
const multiset<SubCollision> & coll, list<EventInfo> & subevents);
227 bool addSD(
const multiset<SubCollision> & coll, list<EventInfo> & subevents);
228 void addSDsecond(
const multiset<SubCollision> & coll);
229 bool addCD(
const multiset<SubCollision> & coll, list<EventInfo> & subevents);
230 void addCDsecond(
const multiset<SubCollision> & coll);
231 bool addEL(
const multiset<SubCollision> & coll, list<EventInfo> & subevents);
232 void addELsecond(
const multiset<SubCollision> & coll);
233 bool buildEvent(list<EventInfo> & subevents,
234 const vector<Nucleon> & proj,
235 const vector<Nucleon> & targ);
237 bool setupFullCollision(
EventInfo & ei,
const SubCollision & coll,
239 bool isRemnant(
const EventInfo & ei,
int i,
int past = 1 )
const {
240 int statNow = ei.event[i].status()*past;
241 if ( statNow == 63 )
return true;
242 if ( statNow > 70 && statNow < 80 )
243 return isRemnant(ei, ei.event[i].mother1(), -1);
248 static int getBeam(
Event & ev,
int i);
256 bool colConnect =
false);
260 vector<int> findRecoilers(
const Event & e,
bool tside,
int beam,
int end,
261 const Vec4 & pdiff,
const Vec4 & pbeam);
265 static void addJunctions(
Event & evnt,
Event & sub,
int coloff);
270 const vector<Nucleon> & targ);
278 pair<RotBstMatrix,RotBstMatrix> & R12,
int,
int);
279 static double mT2(
const Vec4 & p) {
return p.pPos()*p.pNeg(); }
280 static double mT(
const Vec4 & p) {
return sqrt(max(mT2(p), 0.0)); }
285 struct ProcessSelectorHook:
public UserHooks {
287 ProcessSelectorHook(): proc(0), b(-1.0) {}
290 virtual bool canVetoProcessLevel() {
295 virtual bool doVetoProcessLevel(
Event&) {
296 return proc > 0 && infoPtr->code() != proc;
300 virtual bool canSetImpactParameter()
const {
305 virtual double doSetImpactParameter() {
321 HoldProcess(shared_ptr<ProcessSelectorHook> hook,
int proc,
322 double b = -1.0) : saveHook(hook), saveProc(hook->proc), saveB(hook->b) {
330 saveHook->proc = saveProc;
336 shared_ptr<ProcessSelectorHook> saveHook;
347 shared_ptr<ProcessSelectorHook> selectMB;
350 shared_ptr<ProcessSelectorHook> selectSASD;
354 static const int MAXTRY = 999;
355 static const int MAXEVSAVE = 999;
358 vector<Nucleon> projectile;
359 vector<Nucleon> target;
362 multiset<SubCollision> subColls;
369 ImpactParameterGenerator * bGenPtr;
373 NucleusModel * projPtr;
374 NucleusModel * targPtr;
378 SubCollisionModel * collPtr;
397 osSave->rdbuf(ros.rdbuf());
418 #endif // Pythia8_HeavyIons_H
static bool getTransforms(Vec4 p1, Vec4 p2, const Vec4 &p1p, pair< RotBstMatrix, RotBstMatrix > &R12, int, int)
HeavyIons(Pythia &mainPythiaIn)
ostream * osSave
The redirected ostream.
Optional object for signal processes (nn).
virtual bool next()
Produce a collision involving heavy ions.
virtual ~HeavyIons()
Destructor.
bool addNucleonExcitation(EventInfo &orig, EventInfo &add, bool colConnect=false)
std::streambuf * bufferSave
The original buffer of the redirected ostream.
static void addSpecialSettings(Settings &settings)
EventInfo getSignal(const SubCollision &coll)
Generate events from the internal Pythia oblects;.
bool nextSASD(int proc)
Generate a single diffractive.
Optional object for signal processes (pp).
PythiaObject
Enumerate the different internal Pythia objects.
EventInfo mkEventInfo(Pythia &pyt, const SubCollision *coll=0)
Setup an EventInfo object from a Pythia instance.
Info * getInfo()
Only one function: return the info object.
vector< Pythia * > pythia
void clearProcessLevel(Pythia &pyt)
bool setHIUserHooksPtr(HIUserHooksPtr userHooksPtrIn)
Possibility to pass in pointer for special heavy ion user hooks.
Single diffractive as one side of non-diffractive.
void sumUpMessages(Info &in, string tag, const Info &other)
vector< Nucleon >::iterator projBegin()
Iterate over nucleons.
static void setupSpecials(Settings &settings, string match)
Duplicate setting on the form match: to settings on the form HImatch:
Optional object for signal processes (pn).
virtual bool init()
Initialize Angantyr.
Optional object for signal processes (np).
Angantyr(Pythia &mainPythiaIn)
Redirect(ostream &os, ostream &ros)
Redirect os to ros for the lifetime of this object.
bool setUserHooksPtr(PythiaObject sel, UserHooks *userHooksPtrIn)
Set UserHooks for specific (or ALL) internal Pythia objects.
HIUserHooksPtr HIHooksPtr
bool addNucleusRemnants(const vector< Nucleon > &proj, const vector< Nucleon > &targ)
Status
Enum for specifying the status of a nucleon.
vector< string > pythiaNames
The names associated with the secondary pythia objects.
void addSubEvent(Event &evnt, Event &sub)
Add a sub-event to the final event record.
internal class to redirect stdout
The default HeavyIon model in Pythia.
static bool isHeavyIon(Settings &settings)