thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
XComb.h
1// -*- C++ -*-
2//
3// XComb.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5//
6// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8//
9#ifndef ThePEG_XComb_H
10#define ThePEG_XComb_H
11// This is the declaration of the XComb class.
12
14#include "ThePEG/PDF/PartonExtractor.fh"
15#include "ThePEG/PDF/PartonBin.h"
16#include "ThePEG/PDF/PartonBinInstance.h"
17#include "ThePEG/Utilities/AnyReference.h"
18#include "ThePEG/Utilities/VSelector.h"
19#include "ThePEG/Utilities/ClassDescription.h"
20#include "ThePEG/Utilities/Maths.h"
21#include "ThePEG/EventRecord/Particle.h"
22#include "ThePEG/Handlers/EventHandler.fh"
23#include "ThePEG/Cuts/Cuts.fh"
24
25namespace ThePEG {
26
43class XComb: public Base {
44
45public:
46
52 XComb(Energy newMaxEnergy, const cPDPair & inc,
53 tEHPtr newEventHandler, tPExtrPtr newExtractor, tCascHdlPtr newCKKW,
54 const PBPair & newPartonBins, tCutsPtr newCuts);
55
60
64 virtual ~XComb();
66
67
68
74 const EventHandler & eventHandler() const { return *theEventHandler; }
75
80
85
89 tCutsPtr cuts() const { return theCuts; }
90
95 tCascHdlPtr CKKWHandler() const { return theCKKW; }
97
103 const cPDPair & particles() const { return theParticles; }
104
108 const cPDPair & partons() const { return thePartons; }
109
113 const PBPair & partonBins() const { return thePartonBins; }
114
118 Energy maxEnergy() const { return theMaxEnergy; }
119
126 bool empty() const { return !theEventHandler; }
128
132
136 virtual void clean();
137
142
146 void prepare(const PPair &);
147
151 const PPair & lastParticles() const { return theLastParticles; }
152
156 const PPair & lastPartons() const { return theLastPartons; }
157
162
167 tSubProPtr subProcess() const { return theSub; }
168
174
176 typedef map<cPPtr,PBIPtr> PartonBinInstanceMap;
177
182
187
192
197
203
207 Energy2 lastS() const { return theLastS; }
208
213 void lastS(Energy2 s) { theLastS = s; }
214
218 Energy2 lastSHat() const { return theLastSHat; }
219
224 void lastSHat(Energy2 sh) { theLastSHat = sh; }
225
229 double lastTau() const { return lastSHat()/lastS(); }
230
234 double lastY() const { return theLastY; }
235
239 void lastY(double y) { theLastY = y; }
240
245 double lastP1() const { return theLastP1P2.first; }
246
251 double lastP2() const { return theLastP1P2.second; }
252
257 void lastP1P2(pair<double,double> pp) { theLastP1P2 = pp; }
258
263 double lastL1() const { return theLastL1L2.first; }
264
269 double lastL2() const { return theLastL1L2.second; }
270
275 void lastL1L2(pair<double,double>);
276
281 double lastX1() const { return theLastX1X2.first; }
282
287 double lastX2() const { return theLastX1X2.second; }
288
293 void lastX1X2(pair<double,double>);
294
299 double lastE1() const { return theLastE1E2.first; }
300
305 double lastE2() const { return theLastE1E2.second; }
306
311 void lastE1E2(pair<double,double>);
312
316 Energy2 lastScale() const { return theLastScale; }
317
321 void lastScale(Energy2 Q2) { theLastScale = Q2; }
322
327 return
330 lastScale();
331 }
332
337
342 return
346 }
347
352
357 double lastAlphaS() const { return theLastAlphaS; }
358
362 void lastAlphaS(double a) { theLastAlphaS = a; }
363
368 double lastAlphaEM() const { return theLastAlphaEM; }
369
373 void lastAlphaEM(double a) { theLastAlphaEM = a; }
375
376public:
377
381 bool hasMeta(int id) const {
382 return theMeta.find(id) != theMeta.end();
383 }
384
388 template<class T>
389 void meta(int id, T& ref) {
390 theMeta[id] = AnyReference(ref);
391 }
392
396 void eraseMeta(int id) {
397 theMeta.erase(id);
398 }
399
403 template<class T>
404 T& meta(int id) const {
405 return theMeta.find(id)->second.cast<T>();
406 }
407
412
417
421 void lastParticles(const PPair & p) { theLastParticles = p; }
422
426 void resetPartonBinInstances(const PBIPair & newBins) { thePartonBinInstances = newBins; }
427
428public:
429
437
443 void persistentInput(PersistentIStream & is, int version);
445
449 static void Init();
450
451private:
452
457
462
467
471 tCutsPtr theCuts;
472
477
482
487
492
497
502
507
512
517
522
526 double theLastY;
527
532
538
544
550
555
560
565
570
575
580
587
593
597 map<int,AnyReference> theMeta;
598
599private:
600
605
609 XComb & operator=(const XComb &) = delete;
610
611};
612
619template <>
620struct BaseClassTrait<XComb,1>: public ClassTraitsType {
622 typedef Base NthBase;
623};
624
629template <>
630struct ClassTraits<XComb>:
631 public ClassTraitsBase<XComb> {
633 static string className() { return "ThePEG::XComb"; }
634};
635
638}
639
640#endif /* ThePEG_XComb_H */
This is the main config header file for ThePEG.
AnyReference is inspired by boost::any to hold a reference to an object of arbitrary type.
Definition: AnyReference.h:22
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition: EventHandler.h:63
PersistentIStream is used to read persistent objects from a stream where they were previously written...
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
The XComb class stores all information about the generation of a hard sub-proces for a given pair of ...
Definition: XComb.h:43
void meta(int id, T &ref)
Set meta information.
Definition: XComb.h:389
DPair theLastL1L2
Log of one over the incoming partons momentum fraction wrt.
Definition: XComb.h:537
void setPartonBinInfo()
Set the local parton bin info objects for this XComb.
Energy2 theLastCentralScale
The last chosen central scale of the hard scattering.
Definition: XComb.h:559
void lastP1P2(pair< double, double > pp)
Set log of one over the momentum fraction of the incoming particles w.r.t.
Definition: XComb.h:257
PPair theLastPartons
The pair of incoming parton instances.
Definition: XComb.h:511
Energy2 theLastScale
The last chosen scale of the hard scattering.
Definition: XComb.h:554
tPExtrPtr pExtractor() const
A pointer to the parton extractor.
Definition: XComb.h:84
tCutsPtr cuts() const
A pointer to the kinematical cuts.
Definition: XComb.h:89
XComb & operator=(const XComb &)=delete
Private and non-existent assignment operator.
DPair theLastP1P2
Log of one over the momentum fraction of the incoming particles.
Definition: XComb.h:531
tEHPtr theEventHandler
The corresponding collision handler.
Definition: XComb.h:456
Energy2 theLastSHat
The last generated total energy squared of the incoming prtons.
Definition: XComb.h:521
double lastAlphaS() const
Get the used in the hard scattering.
Definition: XComb.h:357
PartonBinInstanceMap & partonBinInstanceMap()
Access the parton bin instance map (used by the parton extractor)
Definition: XComb.h:181
PBPair theParticleBins
Additional information about the origins of the incoming partons.
Definition: XComb.h:496
void lastE1E2(pair< double, double >)
Set one minus the incoming parton momentum fractions w.r.t.
virtual ~XComb()
Destructor.
double lastX1() const
The first incoming parton momentum fraction w.r.t.
Definition: XComb.h:281
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
double lastY() const
The last generated rapidity of the hard scattering sub-system.
Definition: XComb.h:234
void createPartonBinInstances()
Create PartonBinInstance objects for this XComb.
double lastE2() const
Return 1-lastX2() to highest possible precision for x 1.
Definition: XComb.h:305
Energy2 theLastShowerScale
The last chosen shower scale.
Definition: XComb.h:564
const EventHandler & eventHandler() const
Return a reference to the corresponding collision handler.
Definition: XComb.h:74
Energy2 theLastS
The last generated total energy squared of the incoming particles.
Definition: XComb.h:516
virtual void clean()
Reset all saved data about last generated phasespace point;.
double theLastAlphaEM
The used in the hard scattering.
Definition: XComb.h:574
DPair theLastX1X2
The incoming partons momentum fraction wrt.
Definition: XComb.h:543
cPDPair theParticles
The incoming particle types.
Definition: XComb.h:476
cPDPair thePartons
The incoming parton types.
Definition: XComb.h:481
void lastSHat(Energy2 sh)
Set the last generated total energy squared of the incoming prtons.
Definition: XComb.h:224
const cPDPair & particles() const
The incoming particle types.
Definition: XComb.h:103
DPair theLastE1E2
1-lastX1() and 1-lastX2() to highest possible precision for x 1.
Definition: XComb.h:549
void lastPartons(PPair pp)
Set the pair of incoming parton instances.
Definition: XComb.h:161
void prepare(const PPair &)
Prepare this XComb for producing a sub-process.
double lastP1() const
Log of one over the momentum fraction of the first incoming particle w.r.t.
Definition: XComb.h:245
DVector theMEInfo
Information saved by the matrix element in the calculation of the cross section to be used later when...
Definition: XComb.h:586
void lastX1X2(pair< double, double >)
Set the incoming parton momentum fractions w.r.t.
Energy2 lastScale() const
Get the last chosen scale of the hard scattering.
Definition: XComb.h:316
Energy theMaxEnergy
The maximum cm energy for this process.
Definition: XComb.h:579
const PPair & lastPartons() const
Return the pair of incoming parton instances.
Definition: XComb.h:156
void lastL1L2(pair< double, double >)
Set log of one over the incoming parton momentum fractions w.r.t.
const PartonBinInstanceMap & partonBinInstanceMap() const
Return the parton bin instance map (used by the parton extractor)
Definition: XComb.h:186
void resetPartonBinInstances(const PBIPair &newBins)
Set information about currently generated partons.
Definition: XComb.h:426
PartonBinInstanceMap thePartonBinInstanceMap
The parton bin instance map (used by the parton extractor)
Definition: XComb.h:486
map< cPPtr, PBIPtr > PartonBinInstanceMap
A map of PartonBinInstance objects indexed by the extracted parton.
Definition: XComb.h:176
tCascHdlPtr theCKKW
A pointer to a CascadeHandler to be used for CKKW-reweighting.
Definition: XComb.h:466
Energy maxEnergy() const
The maximum cm energy for this process.
Definition: XComb.h:118
void lastY(double y)
Set the last generated rapidity of the hard scattering sub-system.
Definition: XComb.h:239
void setPartonBinInstances(PBIPair pbis, Energy2 scale)
Set information about currently generated partons.
const PBIPair & partonBinInstances() const
Additional information about the incoming partons.
Definition: XComb.h:191
T & meta(int id) const
Retrieve meta information.
Definition: XComb.h:404
void eraseMeta(int id)
Erase meta information.
Definition: XComb.h:396
Energy2 lastCentralScale() const
Get the last chosen central scale of the hard scattering.
Definition: XComb.h:326
Energy2 lastSHat() const
The last generated total energy squared of the incoming prtons.
Definition: XComb.h:218
double lastL1() const
Log of one over the first incoming parton momentum fraction w.r.t.
Definition: XComb.h:263
PBPair thePartonBins
Additional information about the incoming partons.
Definition: XComb.h:491
PBIPair thePartonBinInstances
Additional information about the incoming partons.
Definition: XComb.h:501
const cPDPair & partons() const
The incoming parton types.
Definition: XComb.h:108
PPair theLastParticles
The pair of incoming particle instances.
Definition: XComb.h:506
tCascHdlPtr CKKWHandler() const
Return a possibly null pointer to a CascadeHandler to be used for CKKW-reweighting.
Definition: XComb.h:95
bool hasMeta(int id) const
Check for meta information.
Definition: XComb.h:381
tPBIPtr partonBinInstance(tcPPtr) const
Return the corresponding parton bin instance for a given extracted parton.
bool empty() const
Returns true if this XComb does not correspond to a proper subprocess generation.
Definition: XComb.h:126
void lastAlphaS(double a)
Set the used in the hard scattering.
Definition: XComb.h:362
static void Init()
Standard Init function used to initialize the interface.
tEHPtr eventHandlerPtr() const
Return a pointer to the corresponding collision handler.
Definition: XComb.h:79
void lastS(Energy2 s)
Set the last generated total energy squared of the incoming particles.
Definition: XComb.h:213
double lastX2() const
The second incoming parton momentum fraction w.r.t.
Definition: XComb.h:287
tPExtrPtr thePartonExtractor
A pointer to the parton extractor.
Definition: XComb.h:461
double lastP2() const
Log of one over the momentum fraction of the second incoming particle w.r.t.
Definition: XComb.h:251
double lastTau() const
lastSHat()/lastS().
Definition: XComb.h:229
double theLastY
The last rapidity of the sub process, log(x1/x2)/2.
Definition: XComb.h:526
void lastCentralScale(Energy2 Q2)
Set the last chosen central scale of the hard scattering.
Definition: XComb.h:336
double lastL2() const
Log of one over the second incoming parton momentum fraction w.r.t.
Definition: XComb.h:269
PBIPair & partonBinInstances()
Additional information about the incoming partons.
Definition: XComb.h:196
XComb(Energy newMaxEnergy, const cPDPair &inc, tEHPtr newEventHandler, tPExtrPtr newExtractor, tCascHdlPtr newCKKW, const PBPair &newPartonBins, tCutsPtr newCuts)
Standard constructor.
double lastE1() const
Return 1-lastX1() to highest possible precision for x 1.
Definition: XComb.h:299
double theLastAlphaS
The used in the hard scattering.
Definition: XComb.h:569
double lastAlphaEM() const
Get the used in the hard scattering.
Definition: XComb.h:368
const PBPair & partonBins() const
Additional information about the incoming partons.
Definition: XComb.h:113
Energy2 lastS() const
The last generated total energy squared of the incoming particles.
Definition: XComb.h:207
void lastParticles(const PPair &p)
Set the pair of incoming particle instances.
Definition: XComb.h:421
Energy2 lastShowerScale() const
Get the last chosen shower scale.
Definition: XComb.h:341
SubProPtr theSub
The SubProcess object corresponding to the last generated sub-process.
Definition: XComb.h:592
void subProcess(tSubProPtr)
Set the SubProcess object corresponding to the last generated sub-process.
const PPair & lastParticles() const
Return the pair of incoming particle instances.
Definition: XComb.h:151
void lastAlphaEM(double a)
Set the used in the hard scattering.
Definition: XComb.h:373
void lastScale(Energy2 Q2)
Set the last chosen scale of the hard scattering.
Definition: XComb.h:321
void lastShowerScale(Energy2 Q2)
Set the last chosen showr scale.
Definition: XComb.h:351
XComb()
Default constructor.
tSubProPtr subProcess() const
Return the SubProcess object corresponding to the last generated sub-process.
Definition: XComb.h:167
map< int, AnyReference > theMeta
The meta information.
Definition: XComb.h:597
tCutsPtr theCuts
A pointer to the kinematical cuts used.
Definition: XComb.h:471
static ClassDescription< XComb > initXComb
Describe a concrete class with persistent data.
Definition: XComb.h:604
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
pair< PPtr, PPtr > PPair
A pair of pointers to Particle objects.
Definition: Containers.h:127
pair< cPDPtr, cPDPtr > cPDPair
A pair of pointers to const ParticleData objects.
Definition: Containers.h:118
pair< PBIPtr, PBIPtr > PBIPair
A pair of pointers to PartonBinInstance objects.
constexpr ZeroUnit ZERO
ZERO can be used as zero for any unitful quantity.
Definition: PhysicalQty.h:35
vector< double > DVector
A vector of doubles.
Definition: Containers.h:163
pair< double, double > DPair
A pair of doubles.
Definition: Containers.h:166
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
Define the base class from which all (polymorphic) classes in ThePEG are derived.
Definition: ThePEG.h:54
static string className()
Return the name of class T.
Definition: ClassTraits.h:66
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30