File indexing completed on 2025-01-18 10:06:20
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013 #ifndef Pythia8_DireSplitInfo_H
0014 #define Pythia8_DireSplitInfo_H
0015
0016 #define DIRE_SPLITINFO_VERSION "2.002"
0017
0018 #include "Pythia8/Event.h"
0019 #include "Pythia8/PartonSystems.h"
0020 #include "Pythia8/DireBasics.h"
0021
0022 namespace Pythia8 {
0023
0024
0025
0026
0027
0028 class DireSingleColChain {
0029
0030 public:
0031
0032 DireSingleColChain() {}
0033 DireSingleColChain(const DireSingleColChain& chainIn) : chain(chainIn.chain),
0034 original_chain(chainIn.original_chain) {}
0035 DireSingleColChain & operator=(const DireSingleColChain& c) { if (this != &c)
0036 { chain = c.chain; original_chain = c.original_chain;} return *this; }
0037 DireSingleColChain(int iPos, const Event& state,
0038 PartonSystems* partonSysPtr);
0039
0040 void addToChain(const int iPos, const Event& state);
0041
0042 int iPosEnd() { return chain.back().first; }
0043 int colEnd () { return chain.back().second.first; }
0044 int acolEnd() { return chain.back().second.second; }
0045 int size() const { return chain.size(); }
0046 bool isInChain ( int iPos);
0047 int posInChain ( int iPos);
0048 bool colInChain ( int col);
0049
0050 DireSingleColChain chainFromCol(int iPos, int col, int nSteps,
0051 const Event& state);
0052
0053 string listPos() const;
0054
0055
0056 void print() const;
0057 void list () const;
0058 string list2 () const;
0059
0060 void clear() { chain.resize(0); original_chain.resize(0); }
0061
0062 vector<pair<int,pair<int,int> > > chain;
0063 vector<pair<int,pair<int,int> > > original_chain;
0064
0065
0066 pair<int,pair<int,int> >& operator[](int i) {return chain[i];}
0067 const pair<int,pair<int,int> >& operator[](int i) const {return chain[i];}
0068
0069 };
0070
0071
0072
0073
0074
0075 class DireColChains {
0076
0077 public:
0078
0079 DireColChains() {}
0080
0081 void addChain(DireSingleColChain chain) { chains.push_back( chain); }
0082
0083 int size() const { return chains.size(); }
0084
0085 DireSingleColChain chainOf (int iPos);
0086
0087 DireSingleColChain chainFromCol (int iPos, int col, int nSteps,
0088 const Event& state);
0089
0090 int check(int iSys, const Event& state, PartonSystems* partonSysPtr);
0091
0092 void list();
0093
0094 vector<DireSingleColChain> chains;
0095
0096 };
0097
0098
0099
0100 class DireSplitParticle {
0101
0102 public:
0103
0104 DireSplitParticle() : id(0), col(-1), acol(-1), charge(0), spin(-9), m2(-1.),
0105 isFinal(false) {}
0106 DireSplitParticle( int idIn, int colIn, int acolIn, int chargeIn, int spinIn,
0107 double m2In, bool isFinalIn) : id(idIn), col(colIn),
0108 acol(acolIn), charge(chargeIn), spin(spinIn), m2(m2In), isFinal(isFinalIn)
0109 {}
0110 DireSplitParticle ( const Particle& in) : id(in.id()),
0111 col(in.col()), acol(in.acol()), charge(in.charge()), spin(in.pol()),
0112 m2(pow2(in.m())), isFinal(in.isFinal()) {}
0113
0114 void store( int idIn, int colIn, int acolIn, int chargeIn, int spinIn,
0115 double m2In, bool isFinalIn) { id = idIn; col = colIn;
0116 acol = acolIn; charge = chargeIn; spin = spinIn; m2 = m2In;
0117 isFinal = isFinalIn; }
0118 void store( const Particle in) { id = in.id(); col = in.col();
0119 acol = in.acol(); charge = in.charge(); spin = in.pol();
0120 m2 = pow2(in.m()); isFinal = in.isFinal(); }
0121
0122 void clear() { col = acol = -1; id = charge = 0; spin = -9; m2 = -1.;
0123 isFinal = false; }
0124
0125
0126 int id, col, acol, charge, spin;
0127
0128
0129 double m2;
0130
0131
0132 bool isFinal;
0133
0134 };
0135
0136
0137
0138 class DireSplitKinematics {
0139
0140 public:
0141
0142 DireSplitKinematics() : m2Dip(-1.), pT2(-1.), pT2Old(-1.), z(-1.), phi(-9.),
0143 sai(0.), xa(-1), phi2(-9.), m2RadBef(-1.), m2Rec(-1.), m2RadAft(-1.),
0144 m2EmtAft(-1.), m2EmtAft2(-1.), xBef(-1.), xAft(-1.) {}
0145
0146 DireSplitKinematics( double m2DipIn, double pT2In, double zIn, double phiIn,
0147 double saiIn, double xaIn, double phi2In, double m2RadBefIn,
0148 double m2RecIn, double m2RadAftIn, double m2EmtAftIn, double m2EmtAft2In,
0149 double xBefIn, double xAftIn )
0150 : m2Dip(m2DipIn), pT2(pT2In), pT2Old(-1.), z(zIn), phi(phiIn),
0151 sai(saiIn), xa(xaIn), phi2(phi2In), m2RadBef(m2RadBefIn), m2Rec(m2RecIn),
0152 m2RadAft(m2RadAftIn), m2EmtAft(m2EmtAftIn), m2EmtAft2(m2EmtAft2In),
0153 xBef(xBefIn), xAft(xAftIn) {}
0154
0155 void store2to3kine( double m2DipIn, double pT2In, double zIn, double phiIn,
0156 double xAftIn = -1.) {
0157 m2Dip = m2DipIn; pT2 = pT2In; z = zIn; phi = phiIn; xAft = xAftIn; }
0158 void store2to3mass( double m2RadBefIn, double m2RecIn, double m2RadAftIn,
0159 double m2EmtAftIn) { m2RadBef = m2RadBefIn; m2Rec = m2RecIn;
0160 m2RadAft = m2RadAftIn; m2EmtAft = m2EmtAftIn; }
0161
0162 void store2to4kine( double m2DipIn, double pT2In, double zIn, double phiIn,
0163 double saiIn, double xaIn, double phi2In, double xAftIn = -1.) {
0164 m2Dip = m2DipIn;
0165 pT2 = pT2In; z = zIn; phi = phiIn; sai = saiIn; xa = xaIn; phi2 = phi2In;
0166 xAft = xAftIn;}
0167 void store2to4mass( double m2RadBefIn, double m2RecIn, double m2RadAftIn,
0168 double m2EmtAftIn, double m2EmtAft2In) {
0169 m2RadBef = m2RadBefIn; m2Rec = m2RecIn; m2RadAft = m2RadAftIn;
0170 m2EmtAft = m2EmtAftIn; m2EmtAft2 = m2EmtAft2In; }
0171
0172 void set_m2Dip ( double in) {m2Dip=(in);}
0173 void set_pT2 ( double in) {pT2=(in);}
0174 void set_pT2Old ( double in) {pT2Old=(in);}
0175 void set_z ( double in) {z=(in);}
0176 void set_phi ( double in) {phi=(in);}
0177 void set_sai ( double in) {sai=(in);}
0178 void set_xa ( double in) {xa=(in);}
0179 void set_phi2 ( double in) {phi2=(in);}
0180 void set_m2RadBef ( double in) {m2RadBef=(in);}
0181 void set_m2Rec ( double in) {m2Rec=(in);}
0182 void set_m2RadAft ( double in) {m2RadAft=(in);}
0183 void set_m2EmtAft ( double in) {m2EmtAft=(in);}
0184 void set_m2EmtAft2 ( double in) {m2EmtAft2=(in);}
0185 void set_xBef ( double in) {xBef=(in);}
0186 void set_xAft ( double in) {xAft=(in);}
0187
0188 void clear() { m2Dip = pT2 = pT2Old = z = xa = m2RadBef = m2Rec = m2RadAft
0189 = m2EmtAft = m2EmtAft2 = xBef = xAft = -1.; sai = 0.; phi = phi2 = -9.; }
0190
0191 void store ( const DireSplitKinematics& k);
0192
0193 void list();
0194
0195 unordered_map<string,double> getKinInfo() {
0196 return create_unordered_map<string,double> ("m2Dip",m2Dip)("pT2",pT2)
0197 ("pT2Old",pT2Old)
0198 ("z",z)("phi",phi)("sai",sai)("xa",xa)("phi2",phi2)("m2RadBef",m2RadBef)
0199 ("m2Rec",m2Rec)("m2RadAft",m2RadAft)("m2EmtAft",m2EmtAft)
0200 ("m2EmtAft2",m2EmtAft2)("xBef",xBef) ("xAft",xAft);
0201 }
0202
0203
0204 double m2Dip, pT2, pT2Old, z, phi, sai, xa, phi2,
0205 m2RadBef, m2Rec, m2RadAft, m2EmtAft, m2EmtAft2;
0206 double xBef, xAft;
0207
0208 };
0209
0210
0211
0212 class DireSplitInfo {
0213
0214 public:
0215
0216 DireSplitInfo() : iRadBef(0), iRecBef(0), iRadAft(0), iRecAft(0), iEmtAft(0),
0217 iEmtAft2(0), side(0), type(0), system(0), systemRec(0),
0218 splittingSelName(""), useForBranching(false), terminateEvolution(false),
0219 iRadBefStore(-1), iRecBefStore(-1), iRadAftStore(-1), iRecAftStore(-1),
0220 iEmtAftStore(-1), iEmtAft2Store(-1), sideStore(-1), typeStore(-1),
0221 systemStore(-1), systemRecStore(-1), splittingSelNameStore(""),
0222 useForBranchingStore(false), terminateEvolutionStore(false) {
0223 init(); }
0224 DireSplitInfo ( const Event& state, int iRadBefIn, int iRecBefIn,
0225 int iRadAftIn, int iRecAftIn, int iEmtAftIn,
0226 double m2DipIn = -1., double pT2In = -1., double zIn = -1.,
0227 double phiIn = -9., double saiIn = 0., double xaIn = -1.,
0228 double phi2In = -9., double m2RadBefIn = -1., double m2RecIn = -1.,
0229 double m2RadAftIn = -1., double m2EmtAftIn = -1., double m2EmtAft2In = -1.,
0230 double xBefIn = -1., double xAftIn = -1.,
0231 int sideIn = 0, int typeIn = 0, int systemIn = 0, int systemRecIn = 0,
0232 string splittingSelNameIn = "", bool useForBranchingIn = false,
0233 DireSingleColChain iSiblingsIn = DireSingleColChain() ) :
0234 iRadBef(iRadBefIn), iRecBef(iRecBefIn),
0235 iRadAft(iRadAftIn), iRecAft(iRecAftIn), iEmtAft(iEmtAftIn),
0236 kinSave(m2DipIn, pT2In, zIn, phiIn, saiIn, xaIn, phi2In, m2RadBefIn,
0237 m2RecIn, m2RadAftIn, m2EmtAftIn, m2EmtAft2In, xBefIn, xAftIn),
0238 side(sideIn), type(typeIn), system(systemIn), systemRec(systemRecIn),
0239 splittingSelName(splittingSelNameIn), useForBranching(useForBranchingIn),
0240 terminateEvolution(false), iSiblings(iSiblingsIn)
0241 { init(state); }
0242
0243 DireSplitInfo ( const Event& state, int iRadBefIn, int iRecBefIn,
0244 string splittingSelNameIn) : iRadBef(iRadBefIn), iRecBef(iRecBefIn),
0245 splittingSelName(splittingSelNameIn),
0246 iRadBefStore(-1), iRecBefStore(-1), iRadAftStore(-1), iRecAftStore(-1),
0247 iEmtAftStore(-1), iEmtAft2Store(-1), sideStore(-1), typeStore(-1),
0248 systemStore(-1), systemRecStore(-1), splittingSelNameStore(""),
0249 useForBranchingStore(false), terminateEvolutionStore(false) {
0250 iRadAft = iRecAft = iEmtAft = side = type = system = systemRec = 0;
0251 useForBranching = terminateEvolution = false; init(state); }
0252
0253 DireSplitInfo ( const Event& state, int iRadAftIn, int iRecAftIn,
0254 int iEmtAftIn, string splittingSelNameIn) :
0255 iRadAft(iRadAftIn), iRecAft(iRecAftIn),
0256 iEmtAft(iEmtAftIn), splittingSelName(splittingSelNameIn),
0257 iRadBefStore(-1), iRecBefStore(-1), iRadAftStore(-1), iRecAftStore(-1),
0258 iEmtAftStore(-1), iEmtAft2Store(-1), sideStore(-1), typeStore(-1),
0259 systemStore(-1), systemRecStore(-1), splittingSelNameStore(""),
0260 useForBranchingStore(false), terminateEvolutionStore(false) {
0261 splittingSelName = ""; iRadBef = iRecBef = side = type = system
0262 = systemRec = 0;
0263 useForBranching = terminateEvolution = false; init(state); }
0264
0265 DireSplitInfo ( const DireSplitInfo& s) : iRadBefStore(-1), iRecBefStore(-1),
0266 iRadAftStore(-1), iRecAftStore(-1), iEmtAftStore(-1), iEmtAft2Store(-1),
0267 sideStore(-1), typeStore(-1), systemStore(-1), systemRecStore(-1),
0268 particleSaveStore(), kinSaveStore(), splittingSelNameStore(),
0269 extrasStore(), useForBranchingStore(false), terminateEvolutionStore(false),
0270 iSiblingsStore() {
0271 iRadBef = s.iRadBef;
0272 iRecBef = s.iRecBef;
0273 iRadAft = s.iRadAft;
0274 iRecAft = s.iRecAft;
0275 iEmtAft = s.iEmtAft;
0276 iEmtAft2 = s.iEmtAft2;
0277 for (int i=0; i < int(s.particleSave.size()); ++i)
0278 particleSave.push_back(s.particleSave[i]);
0279 kinSave.store(s.kinSave);
0280 side = s.side;
0281 type = s.type;
0282 system = s.system;
0283 systemRec = s.systemRec;
0284 splittingSelName = s.splittingSelName;
0285 for ( unordered_map<string,double>::const_iterator it = s.extras.begin();
0286 it != s.extras.end(); ++it )
0287 extras.insert(make_pair(it->first,it->second));
0288 useForBranching = s.useForBranching;
0289 terminateEvolution = s.terminateEvolution;
0290 iSiblings = s.iSiblings;
0291 }
0292
0293 void init(const Event& state = Event() );
0294
0295 void store (const DireSplitInfo& s);
0296
0297 void save ();
0298
0299 void restore ();
0300
0301 const DireSplitParticle* radBef() const { return &particleSave[0]; }
0302 const DireSplitParticle* recBef() const { return &particleSave[1]; }
0303 const DireSplitParticle* radAft() const { return &particleSave[2]; }
0304 const DireSplitParticle* recAft() const { return &particleSave[3]; }
0305 const DireSplitParticle* emtAft() const { return &particleSave[4]; }
0306 const DireSplitParticle* emtAft2() const { return &particleSave[5]; }
0307
0308 const DireSplitKinematics* kinematics() const { return &kinSave; }
0309
0310 void set2to3kin( double m2DipIn, double pT2In, double zIn, double phiIn,
0311 double m2RadBefIn, double m2RecIn, double m2RadAftIn, double m2EmtAftIn) {
0312 kinSave.store2to3kine(m2DipIn, pT2In, zIn, phiIn);
0313 kinSave.store2to3mass(m2RadBefIn, m2RecIn, m2RadAftIn, m2EmtAftIn); }
0314
0315 void set2to4kin( double m2DipIn, double pT2In, double zIn, double phiIn,
0316 double saiIn, double xaIn, double phi2In, double m2RadBefIn,
0317 double m2RecIn, double m2RadAftIn, double m2EmtAftIn, double m2EmtAft2In) {
0318 kinSave.store2to4kine(m2DipIn, pT2In, zIn, phiIn, saiIn, xaIn, phi2In);
0319 kinSave.store2to4mass(m2RadBefIn, m2RecIn, m2RadAftIn, m2EmtAftIn,
0320 m2EmtAft2In); }
0321
0322 void set_m2Dip ( double in) {kinSave.set_m2Dip(in);}
0323 void set_pT2 ( double in) {kinSave.set_pT2(in);}
0324 void set_pT2Old ( double in) {kinSave.set_pT2Old(in);}
0325 void set_z ( double in) {kinSave.set_z(in);}
0326 void set_phi ( double in) {kinSave.set_phi(in);}
0327 void set_sai ( double in) {kinSave.set_sai(in);}
0328 void set_xa ( double in) {kinSave.set_xa(in);}
0329 void set_phi2 ( double in) {kinSave.set_phi2(in);}
0330 void set_m2RadBef ( double in) {kinSave.set_m2RadBef(in);}
0331 void set_m2Rec ( double in) {kinSave.set_m2Rec(in);}
0332 void set_m2RadAft ( double in) {kinSave.set_m2RadAft(in);}
0333 void set_m2EmtAft ( double in) {kinSave.set_m2EmtAft(in);}
0334 void set_m2EmtAft2 ( double in) {kinSave.set_m2EmtAft2(in);}
0335 void set_xBef ( double in) {kinSave.set_xBef(in);}
0336 void set_xAft ( double in) {kinSave.set_xAft(in);}
0337
0338 void storeRadBef(const Particle& in)
0339 { particleSave[0].store(in); }
0340 void storeRecBef(const Particle& in)
0341 { particleSave[1].store(in); }
0342 void storeRadAft(const Particle& in)
0343 { particleSave[2].store(in); }
0344 void storeRecAft(const Particle& in)
0345 { particleSave[3].store(in); }
0346 void storeEmtAft(const Particle& in)
0347 { particleSave[4].store(in); }
0348 void storeEmtAft2(const Particle& in)
0349 { particleSave[5].store(in); }
0350
0351 void setRadBef( int idIn = 0, int colIn = -1, int acolIn = -1,
0352 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0353 bool isFinalIn = false) { setParticle(0, idIn, colIn,
0354 acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0355 void setRecBef( int idIn = 0, int colIn = -1, int acolIn = -1,
0356 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0357 bool isFinalIn = false) { setParticle(1, idIn, colIn,
0358 acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0359 void setRadAft( int idIn = 0, int colIn = -1, int acolIn = -1,
0360 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0361 bool isFinalIn = false) { setParticle(2, idIn, colIn,
0362 acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0363 void setRecAft( int idIn = 0, int colIn = -1, int acolIn = -1,
0364 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0365 bool isFinalIn = false) { setParticle(3, idIn, colIn,
0366 acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0367 void setEmtAft( int idIn = 0, int colIn = -1, int acolIn = -1,
0368 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0369 bool isFinalIn = false) { setParticle(4, idIn, colIn,
0370 acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0371 void setEmtAft2( int idIn = 0, int colIn = -1, int acolIn = -1,
0372 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0373 bool isFinalIn = false) { setParticle(5, idIn, colIn,
0374 acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0375 void clearRadBef() { setParticle(0, 0, -1, -1, 0, -9, -1.0, false); }
0376 void clearRecBef() { setParticle(1, 0, -1, -1, 0, -9, -1.0, false); }
0377 void clearRadAft() { setParticle(2, 0, -1, -1, 0, -9, -1.0, false); }
0378 void clearRecAft() { setParticle(3, 0, -1, -1, 0, -9, -1.0, false); }
0379 void clearEmtAft() { setParticle(4, 0, -1, -1, 0, -9, -1.0, false); }
0380 void clearEmtAft2() { setParticle(5, 0, -1, -1, 0, -9, -1.0, false); }
0381 void setParticle( int iPos, int idIn = 0, int colIn = -1, int acolIn = -1,
0382 int chargeIn = 0, int spinIn = -9, double m2In = -1.0,
0383 bool isFinalIn = false) { particleSave[iPos].store(
0384 idIn, colIn, acolIn, chargeIn, spinIn, m2In, isFinalIn); }
0385
0386 void storeName (string name) { splittingSelName = name; }
0387 void storeType ( int in) { type = in; }
0388 void storeSystem ( int in) { system = in; }
0389 void storeSystemRec ( int in) { systemRec = in; }
0390 void storeSide ( int in) { side = in; }
0391 void storeExtras ( unordered_map<string,double> in) { extras = in; }
0392 void storeRadRecBefPos (int rad, int rec) { iRadBef = rad; iRecBef = rec; }
0393 void canUseForBranching (bool in) { useForBranching = in;}
0394
0395 void addExtra(string key, double value) {
0396 unordered_map<string, double>::iterator it = extras.find(key);
0397 if (it == extras.end()) extras.insert(make_pair(key,value));
0398 else it->second = value;
0399 }
0400
0401 void storeInfo(string name, int typeIn, int systemIn, int systemRecIn,
0402 int sideIn, int iPosRadBef, int iPosRecBef,
0403 const Event& state, int idEmtAft,
0404 int idRadAft, int nEmissions, double m2Dip, double pT2, double pT2Old,
0405 double z, double phi, double m2Bef, double m2s, double m2r, double m2i,
0406 double sa1, double xa, double phia1, double m2j, double xBef, double xAft);
0407
0408 unordered_map<string,double> getKinInfo() { return kinSave.getKinInfo();}
0409
0410 void storePosAfter( int iRadAftIn, int iRecAftIn, int iEmtAftIn,
0411 int iEmtAft2In);
0412
0413 void clear();
0414
0415 void list();
0416
0417
0418 int iRadBef, iRecBef;
0419
0420
0421 int iRadAft, iRecAft, iEmtAft, iEmtAft2;
0422
0423 vector<DireSplitParticle> particleSave;
0424 DireSplitKinematics kinSave;
0425
0426
0427 int side, type, system, systemRec;
0428 string splittingSelName;
0429 unordered_map<string,double> extras;
0430
0431 bool useForBranching, terminateEvolution;
0432
0433
0434 int iRadBefStore, iRecBefStore, iRadAftStore, iRecAftStore, iEmtAftStore,
0435 iEmtAft2Store, sideStore, typeStore, systemStore, systemRecStore;
0436 vector<DireSplitParticle> particleSaveStore;
0437 DireSplitKinematics kinSaveStore;
0438 string splittingSelNameStore;
0439 unordered_map<string,double> extrasStore;
0440 bool useForBranchingStore, terminateEvolutionStore;
0441
0442 DireSingleColChain iSiblings, iSiblingsStore;
0443 void setSiblings(DireSingleColChain s) { clearSiblings(); iSiblings = s; }
0444 void clearSiblings() { iSiblings.clear(); }
0445
0446 };
0447
0448
0449
0450 }
0451
0452 #endif