15 #ifndef Pythia8_aMCatNLOHooks_H 16 #define Pythia8_aMCatNLOHooks_H 18 #include "Pythia8/Pythia.h" 35 : mergingScheme(mergingSchemeIn), normFactor(1.) {}
38 double getNormFactor(){
return normFactor;}
52 int nQuarksMerge =
settingsPtr->mode(
"Merging:nQuarksMerge");
55 string procSave =
settingsPtr->word(
"Merging:Process");
56 bool hasIN = (procSave.find(
">", 0) != string::npos);
57 string incoming = procSave.substr(0,procSave.find(
">", 0));
58 string outgoing = procSave.substr(procSave.find(
">", 0)+1,procSave.size());
59 string outgoingSave = outgoing;
63 for(
int n = outgoing.find(
",", 0); n != int(string::npos);
64 n = outgoing.find(
",", n)) { nCommas++; n++; }
66 for(
int i =0; i < nCommas;++i) {
67 int n = outgoing.find(
",", 0);
68 out.push_back(outgoing.substr(0,n));
69 outgoing = outgoing.substr(n+1,outgoing.size());
71 if (outgoing.size()>0) out.push_back(outgoing);
75 if (
settingsPtr->word(
"Merging:Process") ==
"guess" ) {
76 string processString =
"";
79 processString += incoming +
">";
81 int beamAid = beamAPtr->
id();
82 int beamBid = beamBPtr->
id();
83 if (abs(beamAid) == 2212) processString +=
"p";
84 if (beamAid == 11) processString +=
"e-";
85 if (beamAid ==-11) processString +=
"e+";
86 if (abs(beamBid) == 2212) processString +=
"p";
87 if (beamBid == 11) processString +=
"e-";
88 if (beamBid ==-11) processString +=
"e+";
92 bool foundOutgoing =
false;
98 &&
workEvent[i].idAbs() > nQuarksMerge) ) ) {
100 ostringstream procOSS;
103 processString += procOSS.str();
107 for (
int i =0; i < int(out.size()); ++i) {
108 if (out[i].find(
"guess") != string::npos)
continue;
109 processString +=
"," + out[i];
112 if (foundOutgoing) proc = processString;
115 if (proc.size()>0)
settingsPtr->word(
"Merging:Process", proc);
116 else proc = procSave;
126 bool isumeps = (mergingScheme == 1);
127 bool isunlops = (mergingScheme == 2);
131 int np_nlo = (nps_nlo !=
"") ? atoi((
char*)nps_nlo.c_str()) : -1;
133 int np_lo = (nps_lo !=
"") ? atoi((
char*)nps_lo.c_str()) : -1;
140 for(
int n = proc.find(
"j", 0); n != int(string::npos);
141 n = proc.find(
"j", n)) { nj++; n++; }
143 if (
settingsPtr->word(
"Merging:process").compare(
"e+e->jj") == 0) {
152 }
else if (np_lo > -1){
162 bool updateWgt =
true;
166 if (isunlops && np_nlo == 0 && np_lo == -1) {
173 }
else if (isunlops && np_nlo > 0 && np_lo == -1) {
189 }
else if (isunlops && np_nlo == -1 && np_lo > -1) {
201 int nmaxNLO =
settingsPtr->mode(
"Merging:nJetMaxNLO");
204 && np_lo <= nmaxNLO+1
217 }
else if (isumeps && np_lo == 0) {
221 }
else if (isumeps && np_lo > 0) {
double weightNominal
The nominal Pythia weight, in pb for lha strategy 4 and -4.
Definition: Weights.h:403
bool flag(string keyIn)
Give back current value, with check that key exists.
Definition: Settings.cc:1478
bool canVetoProcessLevel()
Allow to set the number of partons.
Definition: aMCatNLOHooks.h:41
Settings * settingsPtr
Pointer to the settings database.
Definition: PhysicsBase.h:81
The Event class holds all info on the generated event.
Definition: Event.h:453
Rndm * rndmPtr
Pointer to the random number generator.
Definition: PhysicsBase.h:93
void omitResonanceDecays(const Event &process, bool finalOnly=false)
omitResonanceDecays omits resonance decay chains from process record.
Definition: UserHooks.cc:132
int size() const
Event record size.
Definition: Event.h:504
int id() const
Member functions for output.
Definition: BeamParticle.h:195
bool doVetoProcessLevel(Event &process)
Set the number of partons.
Definition: aMCatNLOHooks.h:43
Header for classes to set beam momentum and interaction vertex spread.
Definition: Analysis.h:20
Event workEvent
Have one event object around as work area.
Definition: UserHooks.h:248
Info * infoPtr
Definition: PhysicsBase.h:78
UserHooks is base class for user access to program execution.
Definition: UserHooks.h:32
double flat()
Generate next random number uniformly between 0 and 1.
Definition: Basics.cc:189
amcnlo_unitarised_interface()
Constructor and destructor.
Definition: aMCatNLOHooks.h:33
string getEventAttribute(string key, bool doRemoveWhitespace=false) const
Retrieve events tag information.
Definition: Info.cc:307
Definition: aMCatNLOHooks.h:28