8 #ifndef Pythia8_DireSplittings_H
9 #define Pythia8_DireSplittings_H
11 #define DIRE_SPLITTINGS_VERSION "2.002"
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/BeamParticle.h"
15 #include "Pythia8/ParticleData.h"
16 #include "Pythia8/PythiaStdlib.h"
17 #include "Pythia8/Settings.h"
18 #include "Pythia8/StandardModel.h"
19 #include "Pythia8/Info.h"
20 #include "Pythia8/DireSplitInfo.h"
21 #include "Pythia8/DireBasics.h"
34 OverheadInfo(
int nFinalIn,
int idIn,
double valIn,
double xIn,
double pT2In)
35 : nFinal(nFinalIn), id(idIn), val(valIn), x(xIn), pT2(pT2In) {}
40 bool match(
int idIn,
int nfIn) {
return (idIn==
id && nfIn==nFinal); }
42 string list ()
const {
44 os << scientific << setprecision(6)
45 <<
"pT2 " << setw(10) << pT2 <<
" x " << setw(10) << x
46 <<
" id " << setw(4) <<
id <<
" nf " << setw(4) << nFinal
59 id(
"void"), correctionOrder(0), settingsPtr(0),
60 particleDataPtr(0), rndmPtr(0), beamAPtr(0),
61 beamBPtr(0), coupSMPtr(0), infoPtr(0), direInfoPtr(0),
62 is_qcd(
false), is_qed(
false), is_ewk(
false), is_fsr(
false),
63 is_isr(
false), is_dire(
false), nameHash(0) {}
68 renormMultFac(0), id(idIn), correctionOrder(softRS),
69 settingsPtr(settings), particleDataPtr(particleData), rndmPtr(rndm),
70 beamAPtr(beamA), beamBPtr(beamB), coupSMPtr(coupSMPtrIn),
71 infoPtr(infoPtrIn), direInfoPtr(direInfo), is_qcd(
false), is_qed(
false),
72 is_ewk(
false), is_fsr(
false), is_isr(
false), is_dire(
false),
73 nameHash(0) { init(); splitInfo.storeName(name()); }
94 bool is_qcd, is_qed, is_ewk, is_fsr, is_isr, is_dire;
96 bool is( ulong pattern ) {
97 if (pattern == nameHash)
return true;
101 unordered_map<string,double> kernelVals;
103 string name () {
return id;}
105 virtual bool canRadiate (
const Event&, pair<int,int>,
106 unordered_map<string,bool> = unordered_map<string,bool>(),
114 virtual bool useFastFunctions() {
return false; }
115 virtual bool canRadiate (
const Event&,
int,
int,
123 virtual int kinMap () {
return 1;}
126 virtual int motherID(
int) {
return 0;}
129 virtual int sisterID(
int) {
return 0;}
133 virtual vector <int> radAndEmt(
int,
int) {
return vector<int>(); }
134 virtual vector < pair<int,int> > radAndEmtCols(
int,
int,
Event)
135 {
return vector<pair<int,int> >(); }
136 virtual bool canUseForBranching() {
return false; }
137 virtual bool isPartial() {
return false; }
138 virtual int nEmissions() {
return 0; }
140 virtual bool swapRadEmt() {
return false; }
146 virtual vector <int> recPositions(
const Event&,
int,
int)
147 {
return vector<int>();}
150 virtual int radBefID(
int,
int) {
return 0;}
153 virtual pair<int,int> radBefCols(
int,
int,
int,
int)
154 {
return make_pair(0,0);}
157 virtual double gaugeFactor (
int,
int) {
return 1.;}
160 virtual double symmetryFactor (
int,
int) {
return 1.;}
169 virtual int couplingType (
int,
int) {
return -1;}
175 virtual double coupling (
double = 0.,
double = 0.,
double = 0.,
176 double = -1., pair<int,bool> = pair<int,bool>(),
177 pair<int,bool> = pair<int,bool>()) {
180 virtual double couplingScale2 (
double = 0.,
double = 0.,
double = 0.,
181 pair<int,bool> = pair<int,bool>(), pair<int,bool> = pair<int,bool>()) {
186 virtual double zSplit(
double,
double,
double) {
return 0.5;}
189 virtual double overestimateInt(
double,
double,
double,
double,
int = -1)
193 virtual double overestimateDiff(
double,
double,
int = -1) {
return 1.;}
196 virtual double getKernel(
string =
"");
197 virtual unordered_map<string,double> getKernelVals() {
return kernelVals; }
198 virtual void clearKernels() { kernelVals.clear(); }
203 virtual bool calc(
const Event& =
Event(),
int = -1) {
return false; }
205 shared_ptr<DireSpace> isr;
206 shared_ptr<DireTimes> fsr;
207 shared_ptr<DireTimes> fsrDec;
208 void setTimesPtr(shared_ptr<DireTimes> fsrIn) { fsr=fsrIn;}
209 void setTimesDecPtr(shared_ptr<DireTimes> fsrIn) { fsrDec=fsrIn;}
210 void setSpacePtr(shared_ptr<DireSpace> isrIn) { isr=isrIn;}
214 virtual double getJacobian(
const Event& =
Event(),
217 virtual unordered_map<string, double> getPhasespaceVars(
219 PartonSystems* = 0) {
return unordered_map<string,double>(); }
222 virtual bool allow_z_endpoint_for_kinematics() {
return false; }
223 virtual bool allow_pT2_endpoint_for_kinematics() {
return false; }
224 virtual bool allow_sai_endpoint_for_kinematics() {
return false; }
225 virtual bool allow_xa_endpoint_for_kinematics() {
return false; }
227 virtual void try_z_endpoint() {
return; }
228 virtual void try_pT2_endpoint() {
return; }
229 virtual void try_sai_endpoint() {
return; }
230 virtual void try_xa_endpoint() {
return; }
232 virtual bool is_z_endpoint() {
return false; }
233 virtual bool is_pT2_endpoint() {
return false; }
234 virtual bool is_sai_endpoint() {
return false; }
235 virtual bool is_xa_endpoint() {
return false; }
238 virtual double tdire_ff(
double,
double t,
double) {
return t; }
239 virtual double zdire_ff(
double z,
double,
double) {
return z; }
240 virtual double tdire_fi(
double,
double t,
double) {
return t; }
241 virtual double zdire_fi(
double z,
double,
double) {
return z; }
242 virtual double tdire_if(
double,
double t,
double) {
return t; }
243 virtual double zdire_if(
double z,
double,
double) {
return z; }
244 virtual double tdire_ii(
double,
double t,
double) {
return t; }
245 virtual double zdire_ii(
double z,
double,
double) {
return z; }
247 virtual bool hasMECBef(
const Event&,
double) {
return false; }
248 virtual bool hasMECAft(
const Event&,
double) {
return false; }
250 virtual void storeOverhead(
double pT2,
double x,
int radid,
int nf,
251 double val) { overhead_map.insert(make_pair(pT2,
OverheadInfo(nf, radid,
253 multimap<double,OverheadInfo> overhead_map;
255 virtual double overhead(
double pT2,
int idd,
int nf) {
257 if (overhead_map.empty())
return 1.;
259 multimap<double,OverheadInfo>::iterator lo = overhead_map.lower_bound(pT2);
260 if (lo != overhead_map.begin()) lo--;
261 if (lo != overhead_map.begin()) lo--;
262 multimap<double,OverheadInfo>::iterator hi = overhead_map.upper_bound(pT2);
263 if (hi != overhead_map.end()) hi++;
264 if (hi == overhead_map.end()) hi--;
268 for ( multimap<double,OverheadInfo>::iterator it = lo;
270 if (!it->second.match(idd,nf))
continue;
271 sum += it->second.val;
275 if (hi->second.match(idd,nf)) {
276 sum += hi->second.val;
280 return max(sum/max(1,n),1.);
290 #endif // end Pythia8_DireSplittings_H