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/PythiaStdlib.h"
19 #include "Pythia8/Settings.h"
20 #include "Pythia8/PartonLevel.h"
58 Clustering(
const Clustering& inSystem ){
59 emitted = inSystem.emitted;
60 emittor = inSystem.emittor;
61 recoiler = inSystem.recoiler;
62 partner = inSystem.partner;
63 pTscale = inSystem.pTscale;
67 Clustering(
int emtIn,
int radIn,
int recIn,
int partnerIn,
77 double pT()
const {
return pTscale; }
118 MergingHooks* mergingHooksPtrIn,
119 BeamParticle beamAIn,
120 BeamParticle beamBIn,
121 ParticleData* particleDataPtrIn,
124 bool isStronglyOrdered,
132 for (
int i = 0, N = children.size(); i < N; ++i )
delete children[i];
136 bool projectOntoDesiredHistories();
148 double weightTREE(PartonLevel* trial, AlphaStrong * asFSR,
149 AlphaStrong * asISR,
double RN);
153 double weightLOOP(PartonLevel* trial,
double RN);
155 double weightFIRST(PartonLevel* trial, AlphaStrong* asFSR,
156 AlphaStrong* asISR,
double RN, Rndm* rndmPtr );
159 double weight_UMEPS_TREE(PartonLevel* trial, AlphaStrong * asFSR,
160 AlphaStrong * asISR,
double RN);
161 double weight_UMEPS_SUBT(PartonLevel* trial, AlphaStrong * asFSR,
162 AlphaStrong * asISR,
double RN);
165 double weight_UNLOPS_TREE(PartonLevel* trial, AlphaStrong * asFSR,
166 AlphaStrong * asISR,
double RN);
167 double weight_UNLOPS_SUBT(PartonLevel* trial, AlphaStrong * asFSR,
168 AlphaStrong * asISR,
double RN);
169 double weight_UNLOPS_LOOP(PartonLevel* trial,
double RN);
170 double weight_UNLOPS_SUBTNLO(PartonLevel* trial,
double RN);
171 double weight_UNLOPS_CORRECTION(
int order, PartonLevel* trial,
172 AlphaStrong* asFSR, AlphaStrong* asISR,
173 double RN, Rndm* rndmPtr );
176 bool foundAllowedHistories() {
177 return (children.size() > 0 && foundAllowedPath); }
179 bool foundOrderedHistories() {
180 return (children.size() > 0 && foundOrderedPath); }
182 bool foundCompleteHistories() {
183 return (children.size() > 0 && foundCompletePath); }
186 void getStartingConditions(
const double RN,
Event& outState );
188 bool getClusteredEvent(
const double RN,
int nSteps,
Event& outState);
190 bool getFirstClusteredEventAboveTMS(
const double RN,
int nDesired,
191 Event& process,
int & nPerformed,
bool updateProcess =
true );
197 Event lowestMultProc(
const double RN) {
199 return (select(RN)->state);
203 double getPDFratio(
int side,
bool forSudakov,
bool useHardPDF,
204 int flavNum,
double xNum,
double muNum,
205 int flavDen,
double xDen,
double muDen);
209 void printHistory(
const double RN );
217 friend class Merging;
223 static const int NTRIAL;
227 void setScalesInHistory();
236 void findPath(vector<int>& out);
256 void setScales( vector<int> index,
bool forward);
265 void scaleCopies(
int iPart,
const Event& refEvent,
double rho);
271 void setEventScales();
275 void printScales() {
if ( mother ) mother->printScales();
276 cout <<
" size " << state.size() <<
" scale " << scale <<
" clusterIn "
277 << clusterIn.pT() <<
" state.scale() " << state.scale() << endl; }
280 bool trimHistories();
282 void remove(){ doInclude =
false; }
284 bool keep(){
return doInclude; }
289 bool isOrderedPath(
double maxscale );
291 bool followsInputPath();
295 bool allIntermediateAboveRhoMS(
double rhoms,
bool good =
true );
297 bool foundAnyOrderedPaths();
323 Event clusteredState(
int nSteps);
329 History * select(
double rnd);
343 double weightTree(PartonLevel* trial,
double as0,
double maxscale,
344 double pdfScale, AlphaStrong * asFSR, AlphaStrong * asISR,
345 double& asWeight,
double& pdfWeight);
348 double weightTreeALPHAS(
double as0, AlphaStrong * asFSR,
349 AlphaStrong * asISR );
351 double weightTreePDFs(
double maxscale,
double pdfScale );
353 double weightTreeEmissions( PartonLevel* trial,
int type,
int njetMax,
357 double weightFirst(PartonLevel* trial,
double as0,
double muR,
358 double maxscale, AlphaStrong * asFSR, AlphaStrong * asISR, Rndm* rndmPtr );
362 double weightFirstALPHAS(
double as0,
double muR, AlphaStrong * asFSR,
363 AlphaStrong * asISR);
366 double weightFirstPDFs(
double as0,
double maxscale,
double pdfScale,
370 double weightFirstEmissions(PartonLevel* trial,
double as0,
double maxscale,
371 AlphaStrong * asFSR, AlphaStrong * asISR,
bool fixpdf,
bool fixas );
374 double hardFacScale(
const Event& event);
376 double hardRenScale(
const Event& event);
386 double doTrialShower(PartonLevel* trial,
int type,
double maxscale,
387 double minscale = 0.);
390 bool updateind(vector<int> & ind,
int i,
int N);
393 vector<double> countEmissions(PartonLevel* trial,
double maxscale,
394 double minscale,
int showerType,
double as0, AlphaStrong * asFSR,
395 AlphaStrong * asISR,
int N,
bool fixpdf,
bool fixas);
399 double monteCarloPDFratios(
int flav,
double x,
double maxScale,
400 double minScale,
double pdfScale,
double asME, Rndm* rndmPtr);
405 bool onlyOrderedPaths();
410 bool onlyStronglyOrderedPaths();
415 bool onlyAllowedPaths();
423 bool registerPath(History & l,
bool isOrdered,
bool isStronglyOrdered,
424 bool isAllowed,
bool isComplete);
430 vector<Clustering> getAllQCDClusterings();
435 vector<Clustering> getQCDClusterings(
const Event& event);
446 vector<Clustering> findQCDTriple (
int EmtTagIn,
int colTopIn,
447 const Event& event, vector<int> PosFinalPartn,
448 vector <int> PosInitPartn );
450 vector<Clustering> getAllEWClusterings();
451 vector<Clustering> getEWClusterings(
const Event& event);
452 vector<Clustering> findEWTriple(
int EmtTagIn,
const Event& event,
453 vector<int> PosFinalPartn );
455 vector<Clustering> getAllSQCDClusterings();
456 vector<Clustering> getSQCDClusterings(
const Event& event);
457 vector<Clustering> findSQCDTriple (
int EmtTagIn,
int colTopIn,
458 const Event& event, vector<int> PosFinalPartn,
459 vector <int> PosInitPartn );
465 double getProb(
const Clustering & SystemIn);
480 double pdfForSudakov();
484 double hardProcessME(
const Event& event);
490 Event cluster(
const Clustering & inSystem);
498 int getRadBeforeFlav(
const int RadAfter,
const int EmtAfter,
507 int getRadBeforeCol(
const int RadAfter,
const int EmtAfter,
516 int getRadBeforeAcol(
const int RadAfter,
const int EmtAfter,
524 int getColPartner(
const int in,
const Event& event);
531 int getAcolPartner(
const int in,
const Event& event);
541 vector<int> getReclusteredPartners(
const int rad,
const int emt,
560 bool getColSinglet(
const int flavType,
const int iParton,
561 const Event& event, vector<int>& exclude,
562 vector<int>& colSinglet);
568 bool isColSinglet(
const Event& event, vector<int> system);
575 bool isFlavSinglet(
const Event& event,
576 vector<int> system,
int flav=0);
587 bool connectRadiator( Particle& Radiator,
const int RadType,
588 const Particle& Recoiler,
const int RecType,
589 const Event& event );
605 int FindCol(
int col,
int iExclude1,
int iExclude2,
606 const Event& event,
int type,
bool isHardIn);
614 int FindParticle(
const Particle& particle,
const Event& event,
615 bool checkStatus =
true );
622 bool allowedClustering(
int rad,
int emt,
int rec,
int partner,
623 const Event& event );
630 bool isSinglett(
int rad,
int emt,
int rec,
const Event& event );
638 bool validEvent(
const Event& event );
642 bool equalClustering( Clustering clus1 , Clustering clus2 );
647 double choseHardScale(
const Event& event )
const;
651 int getCurrentFlav(
const int)
const;
655 double getCurrentX(
const int)
const;
657 double getCurrentZ(
const int rad,
const int rec,
const int emt)
const;
660 double pTLund(
const Particle& RadAfterBranch,
const Particle& EmtAfterBranch,
661 const Particle& RecAfterBranch,
int ShowerType);
665 int posChangedIncoming(
const Event& event,
bool before);
671 double pdfFactor(
const Event& event,
const int type,
double pdfScale,
677 double integrand(
int flav,
double x,
double scaleInt,
double z);
694 vector<History *> children;
699 map<double,History *> paths;
708 map<double,History *> goodBranches, badBranches;
711 double sumGoodBranches, sumBadBranches;
715 bool foundOrderedPath;
719 bool foundStronglyOrderedPath;
723 bool foundAllowedPath;
727 bool foundCompletePath;
743 Clustering clusterIn;
744 int iReclusteredOld, iReclusteredNew;
750 MergingHooks* mergingHooksPtr;
756 History(
const History &) {}
759 History & operator=(
const History &) {
768 ParticleData* particleDataPtr;
782 #endif // end Pythia8_History_H