10 #ifndef Pythia8_History_H 11 #define Pythia8_History_H 13 #include "Pythia8/Basics.h" 14 #include "Pythia8/BeamParticle.h" 15 #include "Pythia8/Event.h" 16 #include "Pythia8/Info.h" 17 #include "Pythia8/ParticleData.h" 18 #include "Pythia8/PartonLevel.h" 19 #include "Pythia8/PythiaStdlib.h" 20 #include "Pythia8/Settings.h" 21 #include "Pythia8/StandardModel.h" 22 #include "Pythia8/SimpleWeakShowerMEs.h" 66 Clustering() : emitted(0), emittor(0), recoiler(0), partner(0), pTscale(),
67 flavRadBef(0), spinRad(9), spinEmt(9), spinRec(9), spinRadBef(9),
68 radBef(0), recBef(0), iPosInMother() {}
75 emitted(inSystem.emitted), emittor(inSystem.emittor),
76 recoiler(inSystem.recoiler), partner(inSystem.partner),
77 pTscale(inSystem.pTscale), flavRadBef(inSystem.flavRadBef),
78 spinRad(inSystem.spinRad), spinEmt(inSystem.spinEmt),
79 spinRec(inSystem.spinRec), spinRadBef(inSystem.spinRad),
80 radBef(inSystem.radBef), recBef(inSystem.recBef),
81 iPosInMother(inSystem.iPosInMother) {}
84 Clustering(
int emtIn,
int radIn,
int recIn,
int partnerIn,
85 double pTscaleIn,
int flavRadBefIn = 0,
int spinRadIn = 9,
86 int spinEmtIn = 9,
int spinRecIn = 9,
int spinRadBefIn = 9,
87 int radBefIn = 0,
int recBefIn = 0, map<int,int> posIn = map<int,int>())
88 : emitted(emtIn), emittor(radIn), recoiler(recIn), partner(partnerIn),
89 pTscale(pTscaleIn), flavRadBef(flavRadBefIn), spinRad(spinRadIn),
90 spinEmt(spinEmtIn), spinRec(spinRecIn), spinRadBef(spinRadBefIn),
91 radBef(radBefIn), recBef(recBefIn), iPosInMother(posIn) {}
135 MergingHooksPtr mergingHooksPtrIn,
143 bool isStronglyOrdered,
151 for (
int i = 0, N = children.size(); i < N; ++i )
delete children[i];
155 bool projectOntoDesiredHistories();
173 vector<double> weightNL3Loop(
PartonLevel* trial,
double RN);
202 vector<double> weightUNLOPSFirst(
int order,
PartonLevel* trial,
208 return (children.size() > 0 && foundAllowedPath); }
211 return (children.size() > 0 && foundOrderedPath); }
214 return (children.size() > 0 && foundCompletePath); }
217 void getStartingConditions(
const double RN,
Event& outState );
219 bool getClusteredEvent(
const double RN,
int nSteps,
Event& outState);
221 bool getFirstClusteredEventAboveTMS(
const double RN,
int nDesired,
222 Event& process,
int & nPerformed,
bool updateProcess =
true );
230 return (select(RN)->state);
234 double getPDFratio(
int side,
bool forSudakov,
bool useHardPDF,
235 int flavNum,
double xNum,
double muNum,
236 int flavDen,
double xDen,
double muDen);
239 double getWeakProb();
244 double getWeakProb(vector<int>& mode, vector<Vec4>& mom,
245 vector<int> fermionLines);
250 double getSingleWeakProb(vector<int> &mode, vector<Vec4> &mom,
251 vector<int> fermionLines);
257 void findStateTransfer(map<int,int> &transfer);
261 void printHistory(
const double RN );
275 static const int NTRIAL;
279 void setScalesInHistory();
288 void findPath(vector<int>& out);
308 void setScales( vector<int> index,
bool forward);
317 void scaleCopies(
int iPart,
const Event& refEvent,
double rho);
323 void setEventScales();
327 void printScales() {
if ( mother ) mother->printScales();
328 cout <<
" size " << state.size() <<
" scale " << scale <<
" clusterIn " 329 << clusterIn.pT() <<
" state.scale() " << state.scale() << endl; }
332 bool trimHistories();
334 void remove(){ doInclude =
false; }
336 bool keep(){
return doInclude; }
341 bool isOrderedPath(
double maxscale );
343 bool followsInputPath();
347 bool allIntermediateAboveRhoMS(
double rhoms,
bool good =
true );
349 bool foundAnyOrderedPaths();
375 Event clusteredState(
int nSteps);
395 vector<double> weightTree(
PartonLevel* trial,
double as0,
double aem0,
398 vector<double>& aemWeight, vector<double>& pdfWeight);
401 vector<double> weightTreeAlphaS(
double as0,
AlphaStrong * asFSR,
402 AlphaStrong * asISR,
int njetMax = -1,
bool asVarInME =
false );
404 vector<double> weightTreeAlphaEM(
double aem0,
AlphaEM * aemFSR,
405 AlphaEM * aemISR,
int njetMax = -1 );
407 vector<double> weightTreePDFs(
double maxscale,
double pdfScale,
410 vector<double> weightTreeEmissions(
PartonLevel* trial,
int type,
411 int njetMin,
int njetMax,
double maxscale );
414 double weightFirst(
PartonLevel* trial,
double as0,
double muR,
419 double weightFirstAlphaS(
double as0,
double muR,
AlphaStrong * asFSR,
423 double weightFirstAlphaEM(
double aem0,
double muR,
AlphaEM * aemFSR,
427 double weightFirstPDFs(
double as0,
double maxscale,
double pdfScale,
431 double weightFirstEmissions(
PartonLevel* trial,
double as0,
double maxscale,
435 double hardFacScale(
const Event& event);
437 double hardRenScale(
const Event& event);
447 vector<double> doTrialShower(
PartonLevel* trial,
int type,
double maxscale,
448 double minscale = 0.);
451 bool updateind(vector<int> & ind,
int i,
int N);
454 vector<double> countEmissions(
PartonLevel* trial,
double maxscale,
455 double minscale,
int showerType,
double as0,
AlphaStrong * asFSR,
456 AlphaStrong * asISR,
int N,
bool fixpdf,
bool fixas);
460 double monteCarloPDFratios(
int flav,
double x,
double maxScale,
461 double minScale,
double pdfScale,
double asME,
Rndm* rndmPtr);
466 bool onlyOrderedPaths();
471 bool onlyStronglyOrderedPaths();
476 bool onlyAllowedPaths();
484 bool registerPath(
History & l,
bool isOrdered,
bool isStronglyOrdered,
485 bool isAllowed,
bool isComplete);
491 vector<Clustering> getAllQCDClusterings();
496 vector<Clustering> getQCDClusterings(
const Event& event);
507 vector<Clustering> findQCDTriple (
int emtTagIn,
int colTopIn,
508 const Event& event, vector<int> posFinalPartn,
509 vector <int> posInitPartn );
511 vector<Clustering> getAllEWClusterings();
512 vector<Clustering> getEWClusterings(
const Event& event);
513 vector<Clustering> findEWTripleW(
int emtTagIn,
const Event& event,
514 vector<int> posFinalPartn, vector<int> posInitPartn );
515 vector<Clustering> findEWTripleZ(
int emtTagIn,
const Event& event,
516 vector<int> posFinalPartn, vector<int> posInitPartn );
518 vector<Clustering> getAllSQCDClusterings();
519 vector<Clustering> getSQCDClusterings(
const Event& event);
520 vector<Clustering> findSQCDTriple (
int emtTagIn,
int colTopIn,
521 const Event& event, vector<int> posFinalPartn,
522 vector <int> posInitPartn );
525 void attachClusterings (vector<Clustering>& clus,
int iEmt,
int iRad,
526 int iRec,
int iPartner,
double pT,
const Event& event);
547 double pdfForSudakov();
551 double hardProcessME(
const Event& event);
565 int getRadBeforeFlav(
const int radAfter,
const int emtAfter,
572 int getRadBeforeSpin(
const int radAfter,
const int emtAfter,
573 const int spinRadAfter,
const int spinEmtAfter,
582 int getRadBeforeCol(
const int radAfter,
const int emtAfter,
591 int getRadBeforeAcol(
const int radAfter,
const int emtAfter,
599 int getColPartner(
const int in,
const Event& event);
606 int getAcolPartner(
const int in,
const Event& event);
616 vector<int> getReclusteredPartners(
const int rad,
const int emt,
635 bool getColSinglet(
const int flavType,
const int iParton,
636 const Event& event, vector<int>& exclude,
637 vector<int>& colSinglet);
643 bool isColSinglet(
const Event& event, vector<int> system);
650 bool isFlavSinglet(
const Event& event,
651 vector<int> system,
int flav=0);
662 bool connectRadiator(
Particle& radiator,
const int radType,
663 const Particle& recoiler,
const int recType,
664 const Event& event );
680 int FindCol(
int col,
int iExclude1,
int iExclude2,
681 const Event& event,
int type,
bool isHardIn);
689 int FindParticle(
const Particle& particle,
const Event& event,
690 bool checkStatus =
true );
697 bool allowedClustering(
int rad,
int emt,
int rec,
int partner,
698 const Event& event );
705 bool isSinglett(
int rad,
int emt,
int rec,
const Event& event );
722 double choseHardScale(
const Event& event )
const;
726 int getCurrentFlav(
const int)
const;
730 double getCurrentX(
const int)
const;
732 double getCurrentZ(
const int rad,
const int rec,
const int emt,
733 int idRadBef = 0)
const;
736 double pTLund(
const Event& event,
int radAfterBranch,
int emtAfterBranch,
737 int recAfterBranch,
int showerType,
int idRadBef = 0);
741 int posChangedIncoming(
const Event& event,
bool before);
747 double pdfFactor(
const Event& event,
const int type,
double pdfScale,
753 double integrand(
int flav,
double x,
double scaleInt,
double z);
757 vector<int> posFlavCKM(
int flav);
762 bool checkFlavour(vector<int>& flavCounts,
int flavRad,
int flavRadBef,
766 bool checkWeakRecoils(map<int,int> &allowedRecoils,
bool isFirst =
false);
770 int findISRRecoiler();
775 void reverseBoostISR(
Vec4& pMother,
Vec4& pSister,
Vec4& pPartner,
776 Vec4& pDaughter,
Vec4& pRecoiler,
int sign,
double eCM,
double&
phi);
780 bool isQCD2to2(
const Event& event);
784 bool isEW2to1(
const Event& event);
787 void setSelectedChild();
790 void setupSimpleWeakShower(
int nSteps);
793 void transferSimpleWeakShower(vector<int> &mode, vector<Vec4> &mom,
794 vector<int> fermionLines, vector<pair<int,int> > &dipoles,
int nSteps);
797 vector<int> updateWeakModes(vector<int>& weakModes,
798 map<int,int>& stateTransfer);
802 vector<int> updateWeakFermionLines(vector<int> fermionLines,
803 map<int,int>& stateTransfer);
806 vector<pair<int,int> > updateWeakDipoles(vector<pair<int,int> > &dipoles,
807 map<int,int>& stateTransfer);
811 void setupWeakHard(vector<int>& mode, vector<int>& fermionLines,
815 double getShowerPluginScale(
const Event& event,
int rad,
int emt,
int rec,
816 string key,
double scalePythia);
833 vector<History *> children;
841 map<double,History *> paths;
850 map<double,History *> goodBranches, badBranches;
853 double sumGoodBranches, sumBadBranches;
857 bool foundOrderedPath;
861 bool foundStronglyOrderedPath;
865 bool foundAllowedPath;
869 bool foundCompletePath;
886 int iReclusteredOld, iReclusteredNew;
892 MergingHooksPtr mergingHooksPtr;
895 History() : mother(), selectedChild(), sumpath(), sumGoodBranches(),
896 sumBadBranches(), foundOrderedPath(), foundStronglyOrderedPath(),
897 foundAllowedPath(), foundCompletePath(), scale(), nextInInput(), prob(),
898 iReclusteredOld(), iReclusteredNew(), doInclude(), mergingHooksPtr(),
899 particleDataPtr(), infoPtr(), loggerPtr(), showers(), coupSMPtr(),
900 sumScalarPT(), probMaxSave(), depth(), minDepthSave() {}
937 if (mother)
return mother->probMax();
940 void updateProbMax(
double probIn,
bool isComplete =
false) {
941 if (mother) mother->updateProbMax(probIn, isComplete);
942 if (!isComplete && !foundCompletePath)
return;
943 if (abs(probIn) > probMaxSave) probMaxSave = probIn;
946 int depth, minDepthSave;
948 if ( mother )
return mother->minDepth();
951 void updateMinDepth(
int depthIn) {
952 if ( mother )
return mother->updateMinDepth(depthIn);
953 minDepthSave = (minDepthSave>0) ? min(minDepthSave,depthIn) : depthIn;
~Clustering()
Default destructor.
Definition: History.h:71
Clustering(int emtIn, int radIn, int recIn, int partnerIn, double pTscaleIn, int flavRadBefIn=0, int spinRadIn=9, int spinEmtIn=9, int spinRecIn=9, int spinRadBefIn=9, int radBefIn=0, int recBefIn=0, map< int, int > posIn=map< int, int >())
Constructor with input.
Definition: History.h:84
int radBef
The radiator before the splitting.
Definition: History.h:57
Clustering(const Clustering &inSystem)
Copy constructor.
Definition: History.h:74
Definition: StandardModel.h:23
int flavRadBef
The flavour of the radiator prior to the emission.
Definition: History.h:47
double pT() const
Function to return pythia pT scale of clustering.
Definition: History.h:94
double pTscale
The scale associated with this clustering.
Definition: History.h:45
bool foundAllowedHistories()
Function to check if any allowed histories were found.
Definition: History.h:207
The Event class holds all info on the generated event.
Definition: Event.h:453
int recBef
The recoiler before the splitting.
Definition: History.h:59
Definition: BeamParticle.h:133
void list() const
print for debug
Definition: History.cc:27
Definition: StandardModel.h:106
int spinEmt
Spin of the emitted (-1 is left handed, +1 is right handed).
Definition: History.h:51
int partner
The colour connected recoiler (Can be different for ISR)
Definition: History.h:43
int spinRad
Spin of the radiator (-1 is left handed, +1 is right handed).
Definition: History.h:49
int emittor
The emittor parton.
Definition: History.h:39
Definition: PartonLevel.h:45
map< int, int > iPosInMother
Definition: History.h:63
Definition: StandardModel.h:135
~History()
The destructor deletes each child.
Definition: History.h:150
Definition: SimpleWeakShowerMEs.h:26
int emitted
The emitted parton location.
Definition: History.h:37
int recoiler
The recoiler parton.
Definition: History.h:41
double phi(const Vec4 &v1, const Vec4 &v2)
phi is azimuthal angle between v1 and v2 around z axis.
Definition: Basics.cc:693
bool foundOrderedHistories()
Function to check if any ordered histories were found.
Definition: History.h:210
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:71
Event lowestMultProc(const double RN)
Function to get the lowest multiplicity reclustered event.
Definition: History.h:228
int spinRadBef
Spin of the radiator before the splitting.
Definition: History.h:55
bool foundCompleteHistories()
Function to check if any ordered histories were found.
Definition: History.h:213
Clustering()
Default constructor.
Definition: History.h:66
bool validEvent(const Event &event)
The Merging class.
Definition: DireMerging.cc:24
This class holds a map of all ParticleDataEntries.
Definition: ParticleData.h:422
Definition: History.h:116
int spinRec
Spin of the recoiler (-1 is left handed, +1 is right handed).
Definition: History.h:53