9 #ifndef Pythia8_VinciaCommon_H 10 #define Pythia8_VinciaCommon_H 16 #include "Pythia8/Event.h" 17 #include "Pythia8/Info.h" 18 #include "Pythia8/ParticleData.h" 19 #include "Pythia8/PartonSystems.h" 20 #include "Pythia8/PythiaStdlib.h" 21 #include "Pythia8/StandardModel.h" 32 const double DECI = 1.0e-1;
33 const double CENTI = 1.0e-2;
34 const double MILLI = 1.0e-3;
35 const double MICRO = 1.0e-6;
36 const double NANO = 1.0e-9;
37 const double PICO = 1.0e-12;
40 const double CA = 3.0;
41 const double CF = 8.0/3.0;
42 const double TR = 1.0;
43 const double NC = 3.0;
46 const double gammaE = 0.577215664901532860606512090082402431042;
67 QQEmitFF, QGEmitFF, GQEmitFF, GGEmitFF, GXSplitFF,
68 QQEmitRF, QGEmitRF, XGSplitRF,
69 QQEmitII, GQEmitII, GGEmitII, QXConvII, GXConvII,
70 QQEmitIF, QGEmitIF, GQEmitIF, GGEmitIF, QXConvIF,
71 GXConvIF, XGSplitIF };
122 #ifndef __METHOD_NAME__ 124 #ifndef VINCIA_FUNCTION 125 #if ( defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) \ 126 || (defined(__ICC) && (__ICC >= 600)) ) 127 # define VINCIA_FUNCTION __PRETTY_FUNCTION__ 128 #elif defined(__DMC__) && (__DMC__ >= 0x810) 129 # define VINCIA_FUNCTION __PRETTY_FUNCTION__ 130 #elif defined(__FUNCSIG__) 131 # define VINCIA_FUNCTION __FUNCSIG__ 132 #elif ( (defined(__INTEL_COMPILER) && (__INTEL_COMPILER >= 600)) \ 133 || (defined(__IBMCPP__) && (__IBMCPP__ >= 500)) ) 134 # define VINCIA_FUNCTION __FUNCTION__ 135 #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x550) 136 # define VINCIA_FUNCTION __FUNC__ 137 #elif defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901) 138 # define VINCIA_FUNCTION __func__ 140 # define VINCIA_FUNCTION "unknown" 144 inline std::string
methodName(
const std::string& prettyFunction,
bool 146 size_t colons = prettyFunction.find(
"::");
148 size_t begin = colons + 2;
149 if (withPythia) begin = prettyFunction.substr(0,colons).rfind(
" ") + 1;
150 size_t end = prettyFunction.rfind(
"(") - begin;
151 return prettyFunction.substr(begin,end) +
"()";
154 #define __METHOD_NAME__ methodName(VINCIA_FUNCTION) 162 void printOut(
string,
string,
int nPad=0,
char padChar=
'-');
165 string num2str(
int,
int width=4) ;
166 string num2str(
double,
int width=9) ;
167 string bool2str(
bool,
int width=3) ;
171 const string& replace) {
172 string::size_type pos = 0;
173 while ((pos = subject.find(search, pos)) != string::npos) {
174 subject.replace(pos, search.length(), replace);
175 pos += replace.length();
183 map<string, string> rep;
185 rep[
":"] =
"_colon_";
186 string retVal = fileName;
187 for (map<string, string>::const_iterator it = rep.begin(); it != rep.end();
197 if (FILE *file = fopen(name.c_str(),
"r")) {
219 settingsPtr = infoPtr->settingsPtr;
220 partonSystemsPtr = infoPtr->partonSystemsPtr;
221 rndmPtr = infoPtr->rndmPtr;
231 bool colourise(
int iSys,
Event& event);
241 vector<int> colourSort(vector<Particle*>);
244 void makeColourMaps(
const int iSysIn,
const Event& event,
245 map<int,int>& indexOfAcol, map<int,int>& indexOfCol,
246 vector< pair<int,int> >& antLC,
const bool findFF,
const bool findIX);
249 bool inherit01(
double s01,
double s12);
260 bool isInitPtr{
false}, isInit{
false};
281 void setDaughters(
const Event& state,
int dau1In,
int dau2In,
int dau3In);
282 void setDaughters(
const vector<Particle>& state,
int dau1In,
int dau2In,
294 antFunType = antFunTypeIn;
298 bool initInvariantAndMassVecs();
301 void setInvariantsAndMasses(
const Event& state);
302 void setInvariantsAndMasses(
const vector<Particle>& state);
309 if (mDau.size() == 3)
310 swap(mDau[0],mDau[2]);
311 if (mMot.size() == 2)
312 swap(mMot[0],mMot[1]);
313 if (invariants.size() == 3) {
314 swap(invariants[1],invariants[2]);
320 if (!isFSR)
return false;
321 else if (antFunType >= QQEmitFF && antFunType < QQEmitRF)
return true;
325 if (!isFSR)
return false;
326 else if (antFunType >= QQEmitRF && antFunType < QQEmitII)
return true;
330 if (isFSR)
return false;
331 else if (antFunType >= QQEmitII && antFunType < QQEmitIF)
return true;
335 if (isFSR)
return false;
336 else if (antFunType >= QQEmitIF)
return true;
339 string getAntName()
const;
345 int dau1{}, dau2{}, dau3{};
352 int idMot1{}, idMot2{};
355 vector<int> helDau = {9, 9, 9};
356 vector<int> helMot = {9, 9};
363 double saj{}, sjb{}, sab{};
389 settingsPtr = settingsPtrIn;
392 vinComPtr = vinComPtrIn;
414 map<int,int> flavsBorn);
419 int nqpMin = 0,
int ngMin = 0);
428 map<int,int> nFlavsBorn) {
430 if (q2In > clusMin.
q2res)
return true;
471 bool isInitPtr{
false}, isInit{
false};
482 int nFlavZeroMassSav{};
502 settingsPtr = infoPtr->settingsPtr;
503 loggerPtr = infoPtr->loggerPtr;
504 rndmPtr = infoPtr->rndmPtr;
505 partonSystemsPtr = infoPtr->partonSystemsPtr;
515 double mHadMin(
const int id1,
const int id2);
519 bool showerChecks(
Event& event,
bool ISR);
529 for (
int i=0; i<2; i++) {
530 nUnmatchedMass[i] = 0;
537 if (q <= mc)
return 3;
538 else if (q <= mb)
return 4;
539 else if (q <= mt)
return 5;
544 double getShowerStartingScale(
int iSys,
const Event& event,
550 vector<VinciaClustering> findClusterings(
const vector<Particle>& state,
551 map<int, int> nFlavsBorn);
554 vector<VinciaClustering> findClusterings(
const vector<Particle>& state,
555 int nqpMin = 0,
int ngMin = 0);
559 const Event& event,
int verboseIn);
563 vector<Particle>& pClustered);
565 vector<Particle>& pClustered);
569 bool getMomenta3to2(vector<Vec4>& momNow, vector<Vec4>& momClus,
573 bool map3to2FF(vector<Vec4>& pClu,
const vector<Vec4> pIn,
574 int kMapType,
int a=0,
int r=1,
int b=2,
double mI=0.0,
double mK=0.0) {
575 if (mI == 0. && mK == 0.)
576 return map3to2FFmassless(pClu, pIn, kMapType, a, r, b);
578 return map3to2FFmassive(pClu, pIn, kMapType, mI, mK, a, r, b);
580 bool map3to2RF(vector<Vec4>& pClu,
const vector<Vec4>& pIn,
int a=0,
581 int r=1,
int b=2,
double mK = 0.);
582 bool map3to2IF(vector<Vec4>& pClu,
const vector<Vec4>& pIn,
583 int a = 0,
int r = 1,
int b = 2,
584 double mj = 0.,
double mk = 0.,
double mK = 0.);
585 bool map3to2II(vector<Vec4>& pClu,
const vector<Vec4>& pIn,
bool doBoost,
586 int a = 0,
int r = 2,
int b = 1,
double mj = 0.);
590 bool map2to3FF(vector<Vec4>& pNew,
const vector<Vec4>& pOld,
int kMapType,
591 const vector<double>& invariants,
double phi, vector<double> masses) {
592 if ( masses.size() <= 2 || ( masses[0] == 0.0 && masses[1] == 0.0
593 && masses[2] == 0.0 )) {
594 return map2to3FFmassless(pNew, pOld, kMapType, invariants, phi);
596 return map2to3FFmassive(pNew, pOld, kMapType, invariants, phi, masses);
603 vector<Vec4>& pOld,
double sAB,
double saj,
double sjb,
double sab,
604 double phi,
double m2j = 0.0) {
606 return map2to3IImassless(pNew, pRec, pOld, sAB, saj, sjb, sab, phi);
608 return map2to3IImassive(pNew, pRec, pOld, sAB, saj, sjb, sab, phi, m2j);
613 bool map2to3IFlocal(vector<Vec4>& pNew,
const vector<Vec4>& pOld,
614 double sOldAK,
double saj,
double sjk,
double sak,
double phi,
615 double m2oldK,
double m2j,
double m2k);
616 bool map2to3IFglobal(vector<Vec4>& pNew, vector<Vec4>& pRec,
617 const vector<Vec4>& pOld,
const Vec4 &pB,
618 double sAK,
double saj,
double sjk,
double sak,
double phi,
619 double mK2,
double mj2,
double mk2);
622 bool map2toNRF(vector<Vec4>& pAfter,
const vector<Vec4> pBefore,
623 unsigned int posR,
unsigned int posF,
624 const vector<double> invariants,
double phi,
625 const vector<double> masses);
628 bool map1to2RF(vector<Vec4>& pNew,
const Vec4 pRes,
double m1,
629 double m2,
double theta,
double phi);
632 bool onShellCM(
Vec4& p1,
Vec4& p2,
double m1,
double m2,
double tol = 1e-6);
635 bool mapToMassless(
int iSys,
Event& event,
bool makeNewCopies);
640 return (!onShellCM(p1,p2,m1,m2,1e-9));
653 vector<Particle> makeParticleList(
const int iSys,
const Event& event,
654 const vector<Particle> &pNew = vector<Particle>(),
655 const vector<int> &iOld = vector<int>());
662 vector<VinciaClustering> findAntennae(
Event& state,
int i1,
int i2,
int i3);
668 void list(
const vector<Particle>& state,
string title =
"",
672 void list(
const vector<VinciaClustering>& clusterings,
string title =
"",
677 void setVerbose(
int verboseIn) { verbose = verboseIn;};
687 double mu2freeze{}, mu2min{}, alphaSmax{};
690 double ms{}, mc{}, mb{}, mt{};
694 double epTolErr{}, epTolWarn{}, mTolErr{}, mTolWarn{};
701 bool map3to2FFmassive(vector<Vec4>& pClu,
const vector<Vec4> pIn,
702 int kMapType,
double mI,
double mK,
int a=0,
int r=1,
int b=2);
703 bool map3to2FFmassless(vector<Vec4>& pClu,
const vector<Vec4> pIn,
704 int kMapType,
int a=0,
int r=1,
int b=2);
707 bool map2to3FFmassive(vector<Vec4>& pNew,
const vector<Vec4>& pOld,
708 int kMapType,
const vector<double>& invariants,
double phi,
709 vector<double> masses);
710 bool map2to3FFmassless(vector<Vec4>& pNew,
const vector<Vec4>& pOld,
711 int kMapType,
const vector<double>& invariants,
double phi);
712 bool map2to3IImassive(vector<Vec4>& pNew, vector<Vec4>& pRec,
713 vector<Vec4>& pOld,
double sAB,
double saj,
double sjb,
double sab,
714 double phi,
double m2j = 0.0);
715 bool map2to3IImassless(vector<Vec4>& pNew, vector<Vec4>& pRec,
716 vector<Vec4>& pOld,
double sAB,
double saj,
double sjb,
double sab,
718 bool map2to3RF(vector<Vec4>& pThree,
const vector<Vec4> pTwo,
719 const vector<double> invariants,
double phi,
720 const vector<double> masses);
733 int nUnkownPDG{}, nIncorrectCol{}, nNAN{}, nVertex{}, nChargeCons{},
735 vector<int> nUnmatchedMass, nEPcons;
738 bool isInitPtr{
false}, isInit{
false};
void swap13()
Swap 1 <-> 3, including information about parents.
Definition: VinciaCommon.h:305
Definition: StandardModel.h:23
void setVerbose(int verboseIn)
Set verbosity level.
Definition: VinciaCommon.h:437
const double UNITY
Definition: VinciaCommon.h:31
The Event class holds all info on the generated event.
Definition: Event.h:453
bool is2to3() const
Methods to get branching type (currently only 2 -> 3).
Definition: VinciaCommon.h:342
Simple struct to store information about a 3 -> 2 clustering.
Definition: VinciaCommon.h:278
Logger * loggerPtr
Pointer to the logger.
Definition: Info.h:86
Definition: VinciaCommon.h:211
vector< double > invariants
Vector of invariants (stored as sAB, saj, sjb, sab).
Definition: VinciaCommon.h:365
void printOut(string, string, int nPad=0, char padChar='-')
end METHOD_NAME
Definition: VinciaCommon.cc:4964
int getNf(double q)
Get number of active flavors at a given Q scale.
Definition: VinciaCommon.h:536
string replaceString(string subject, const string &search, const string &replace)
Search and replace a string.
Definition: VinciaCommon.h:170
string num2str(int, int width=4)
String utilities.
Definition: VinciaCommon.cc:4924
void initPtr(Settings *settingsPtrIn, Info *infoPtrIn, VinciaCommon *vinComPtrIn)
Initialize pointers (must be done before init).
Definition: VinciaCommon.h:387
double q2res
Value of sector resolution variable that this clustering produces.
Definition: VinciaCommon.h:368
Definition: StandardModel.h:106
bool map2to3II(vector< Vec4 > &pNew, vector< Vec4 > &pRec, vector< Vec4 > &pOld, double sAB, double saj, double sjb, double sab, double phi, double m2j=0.0)
Definition: VinciaCommon.h:602
AntFunType
Enumerator for antenna function types, with "void" member NoFun.
Definition: VinciaCommon.h:66
string sanitizeFileName(string fileName)
Remove ":" and "/" from a file name.
Definition: VinciaCommon.h:182
Definition: VinciaCommon.h:494
void resetCounters()
Function to reset counters (print once every event for now).
Definition: VinciaCommon.h:522
void setAntenna(bool isFSRin, enum AntFunType antFunTypeIn)
Set antenna information.
Definition: VinciaCommon.h:292
std::string methodName(const std::string &prettyFunction, bool withNamespace=false)
end PYTHIA_FUNCTION
Definition: PythiaStdlib.h:283
const double gammaE
Mathematical constants (Euler–Mascheroni constant).
Definition: VinciaCommon.h:46
void setVerbose(int verboseIn)
Set verbose level.
Definition: VinciaCommon.h:252
int getVerbose()
Get/set verbose parameter.
Definition: VinciaCommon.h:676
void initPtr(Info *infoPtrIn)
Initialize pointers (must be done before init).
Definition: VinciaCommon.h:216
A simple class for containing evolution variable definitions.
Definition: VinciaCommon.h:382
ParticleData * particleDataPtr
Pointer to the particle data table.
Definition: Info.h:83
bool map2to3FF(vector< Vec4 > &pNew, const vector< Vec4 > &pOld, int kMapType, const vector< double > &invariants, double phi, vector< double > masses)
Definition: VinciaCommon.h:590
Maths headers.
Definition: VinciaCommon.h:25
bool fileExists(const std::string &name)
Utility for checking if a file exists.
Definition: VinciaCommon.h:196
double m2(const Vec4 &v1)
The squared invariant mass of one or more four-vectors.
Definition: Basics.cc:605
bool initPtr(Info *infoPtrIn)
Initialize pointers.
Definition: VinciaCommon.h:499
vector< double > mDau
Masses.
Definition: VinciaCommon.h:359
const int DEBUG
Verbosity levels. Vincia has one more level (debug) beyond report.
Definition: VinciaCommon.h:49
double phi(const Vec4 &v1, const Vec4 &v2)
phi is azimuthal angle between v1 and v2 around z axis.
Definition: Basics.cc:693
The PartonSystems class describes the whole set of subcollisions.
Definition: PartonSystems.h:42
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
const int DASHLEN
Padding length for dashes in standardised Vincia verbose output.
Definition: VinciaCommon.h:52
bool sectorVeto(double q2In, vector< Particle > &state, map< int, int > nFlavsBorn)
Definition: VinciaCommon.h:427
unsigned int uint
Convenient typedef for unsigned integers.
Definition: VinciaCommon.h:77
double theta(const Vec4 &v1, const Vec4 &v2)
theta is polar angle between v1 and v2.
Definition: Basics.cc:662
bool mapToMassive(Vec4 &p1, Vec4 &p2, double m1, double m2)
Definition: VinciaCommon.h:639
const double CA
Colour factors in Vincia normalization.
Definition: VinciaCommon.h:40
bool map3to2FF(vector< Vec4 > &pClu, const vector< Vec4 > pIn, int kMapType, int a=0, int r=1, int b=2, double mI=0.0, double mK=0.0)
3->2 clustering maps.
Definition: VinciaCommon.h:573
bool isFF() const
Methods to get antenna type.
Definition: VinciaCommon.h:319
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
Definition: Settings.h:195
void setMothers(int idMot1In, int idMot2In)
Set mother particle ids.
Definition: VinciaCommon.h:286