thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.2.1
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 
13 #include "ThePEG/Config/ThePEG.h"
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 
25 namespace ThePEG {
26 
43 class XComb: public Base {
44 
45 public:
46 
52  XComb(Energy newMaxEnergy, const cPDPair & inc,
53  tEHPtr newEventHandler, tPExtrPtr newExtractor, tCascHdlPtr newCKKW,
54  const PBPair & newPartonBins, tCutsPtr newCuts);
55 
59  XComb();
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 
141  void setPartonBinInstances(PBIPair pbis, Energy2 scale);
142 
146  void prepare(const PPair &);
147 
151  const PPair & lastParticles() const { return theLastParticles; }
152 
156  const PPair & lastPartons() const { return theLastPartons; }
157 
161  void lastPartons(PPair pp) { theLastPartons = pp; }
162 
167  tSubProPtr subProcess() const { return theSub; }
168 
173  void subProcess(tSubProPtr);
174 
176  typedef map<cPPtr,PBIPtr> PartonBinInstanceMap;
177 
181  PartonBinInstanceMap& partonBinInstanceMap() { return thePartonBinInstanceMap; }
182 
186  const PartonBinInstanceMap& partonBinInstanceMap() const { return thePartonBinInstanceMap; }
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
345  lastCentralScale();
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 
376 public:
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 
411  void setPartonBinInfo();
412 
417 
421  void lastParticles(const PPair & p) { theLastParticles = p; }
422 
426  void resetPartonBinInstances(const PBIPair & newBins) { thePartonBinInstances = newBins; }
427 
428 public:
429 
436  void persistentOutput(PersistentOStream & os) const;
437 
443  void persistentInput(PersistentIStream & is, int version);
445 
449  static void Init();
450 
451 private:
452 
457 
462 
467 
471  tCutsPtr theCuts;
472 
477 
482 
486  PartonBinInstanceMap thePartonBinInstanceMap;
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 
599 private:
600 
605 
609  XComb & operator=(const XComb &) = delete;
610 
611 };
612 
619 template <>
620 struct BaseClassTrait<XComb,1>: public ClassTraitsType {
622  typedef Base NthBase;
623 };
624 
629 template <>
630 struct ClassTraits<XComb>:
631  public ClassTraitsBase<XComb> {
633  static string className() { return "ThePEG::XComb"; }
634 };
635 
638 }
639 
640 #endif /* ThePEG_XComb_H */
DPair theLastL1L2
Log of one over the incoming partons momentum fraction wrt.
Definition: XComb.h:537
XComb & operator=(const XComb &)=delete
Private and non-existent assignment operator.
void lastPartons(PPair pp)
Set the pair of incoming parton instances.
Definition: XComb.h:161
const cPDPair & particles() const
The incoming particle types.
Definition: XComb.h:103
PersistentIStream is used to read persistent objects from a stream where they were previously written...
tCutsPtr cuts() const
A pointer to the kinematical cuts.
Definition: XComb.h:89
tCascHdlPtr theCKKW
A pointer to a CascadeHandler to be used for CKKW-reweighting.
Definition: XComb.h:466
void lastX1X2(pair< double, double >)
Set the incoming parton momentum fractions w.r.t.
void lastS(Energy2 s)
Set the last generated total energy squared of the incoming particles.
Definition: XComb.h:213
map< int, AnyReference > theMeta
The meta information.
Definition: XComb.h:597
const PBPair & partonBins() const
Additional information about the incoming partons.
Definition: XComb.h:113
The EventHandler is the base class used to implement event handlers in ThePEG.
Definition: EventHandler.h:63
DPair theLastP1P2
Log of one over the momentum fraction of the incoming particles.
Definition: XComb.h:531
void lastShowerScale(Energy2 Q2)
Set the last chosen showr scale.
Definition: XComb.h:351
Define the base class from which all (polymorphic) classes in ThePEG are derived. ...
Definition: ThePEG.h:54
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
SubProPtr theSub
The SubProcess object corresponding to the last generated sub-process.
Definition: XComb.h:592
tPExtrPtr pExtractor() const
A pointer to the parton extractor.
Definition: XComb.h:84
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
double lastAlphaS() const
Get the used in the hard scattering.
Definition: XComb.h:357
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
T & meta(int id) const
Retrieve meta information.
Definition: XComb.h:404
cPDPair thePartons
The incoming parton types.
Definition: XComb.h:481
void lastL1L2(pair< double, double >)
Set log of one over the incoming parton momentum fractions w.r.t.
Energy2 lastS() const
The last generated total energy squared of the incoming particles.
Definition: XComb.h:207
double theLastAlphaEM
The used in the hard scattering.
Definition: XComb.h:574
PartonBinInstanceMap thePartonBinInstanceMap
The parton bin instance map (used by the parton extractor)
Definition: XComb.h:486
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
double lastE2() const
Return 1-lastX2() to highest possible precision for x 1.
Definition: XComb.h:305
Energy2 lastScale() const
Get the last chosen scale of the hard scattering.
Definition: XComb.h:316
Energy2 lastShowerScale() const
Get the last chosen shower scale.
Definition: XComb.h:341
const PPair & lastPartons() const
Return the pair of incoming parton instances.
Definition: XComb.h:156
Energy2 theLastShowerScale
The last chosen shower scale.
Definition: XComb.h:564
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
double theLastAlphaS
The used in the hard scattering.
Definition: XComb.h:569
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
const PBIPair & partonBinInstances() const
Additional information about the incoming partons.
Definition: XComb.h:191
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
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 lastScale(Energy2 Q2)
Set the last chosen scale of the hard scattering.
Definition: XComb.h:321
void lastSHat(Energy2 sh)
Set the last generated total energy squared of the incoming prtons.
Definition: XComb.h:224
This is the main config header file for ThePEG.
PBPair theParticleBins
Additional information about the origins of the incoming partons.
Definition: XComb.h:496
void createPartonBinInstances()
Create PartonBinInstance objects for this XComb.
Energy2 lastCentralScale() const
Get the last chosen central scale of the hard scattering.
Definition: XComb.h:326
void lastAlphaEM(double a)
Set the used in the hard scattering.
Definition: XComb.h:373
vector< double > DVector
A vector of doubles.
Definition: Containers.h:163
void lastAlphaS(double a)
Set the used in the hard scattering.
Definition: XComb.h:362
double lastL2() const
Log of one over the second incoming parton momentum fraction w.r.t.
Definition: XComb.h:269
virtual ~XComb()
Destructor.
PBIPair & partonBinInstances()
Additional information about the incoming partons.
Definition: XComb.h:196
bool hasMeta(int id) const
Check for meta information.
Definition: XComb.h:381
The XComb class stores all information about the generation of a hard sub-proces for a given pair of ...
Definition: XComb.h:43
PBPair thePartonBins
Additional information about the incoming partons.
Definition: XComb.h:491
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
double theLastY
The last rapidity of the sub process, log(x1/x2)/2.
Definition: XComb.h:526
PartonBinInstanceMap & partonBinInstanceMap()
Access the parton bin instance map (used by the parton extractor)
Definition: XComb.h:181
tPExtrPtr thePartonExtractor
A pointer to the parton extractor.
Definition: XComb.h:461
tCutsPtr theCuts
A pointer to the kinematical cuts used.
Definition: XComb.h:471
PPair theLastParticles
The pair of incoming particle instances.
Definition: XComb.h:506
tPBIPtr partonBinInstance(tcPPtr) const
Return the corresponding parton bin instance for a given extracted parton.
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.
double lastL1() const
Log of one over the first incoming parton momentum fraction w.r.t.
Definition: XComb.h:263
AnyReference is inspired by boost::any to hold a reference to an object of arbitrary type...
Definition: AnyReference.h:22
void lastCentralScale(Energy2 Q2)
Set the last chosen central scale of the hard scattering.
Definition: XComb.h:336
cPDPair theParticles
The incoming particle types.
Definition: XComb.h:476
void setPartonBinInfo()
Set the local parton bin info objects for this XComb.
double lastX2() const
The second incoming parton momentum fraction w.r.t.
Definition: XComb.h:287
void prepare(const PPair &)
Prepare this XComb for producing a sub-process.
pair< PPtr, PPtr > PPair
A pair of pointers to Particle objects.
Definition: Containers.h:127
pair< PBIPtr, PBIPtr > PBIPair
A pair of pointers to PartonBinInstance objects.
tCascHdlPtr CKKWHandler() const
Return a possibly null pointer to a CascadeHandler to be used for CKKW-reweighting.
Definition: XComb.h:95
static ClassDescription< XComb > initXComb
Describe a concrete class with persistent data.
Definition: XComb.h:604
double lastP2() const
Log of one over the momentum fraction of the second incoming particle w.r.t.
Definition: XComb.h:251
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
pair< double, double > DPair
A pair of doubles.
Definition: Containers.h:166
DPair theLastE1E2
1-lastX1() and 1-lastX2() to highest possible precision for x 1.
Definition: XComb.h:549
tEHPtr eventHandlerPtr() const
Return a pointer to the corresponding collision handler.
Definition: XComb.h:79
double lastAlphaEM() const
Get the used in the hard scattering.
Definition: XComb.h:368
bool empty() const
Returns true if this XComb does not correspond to a proper subprocess generation. ...
Definition: XComb.h:126
const EventHandler & eventHandler() const
Return a reference to the corresponding collision handler.
Definition: XComb.h:74
tSubProPtr subProcess() const
Return the SubProcess object corresponding to the last generated sub-process.
Definition: XComb.h:167
double lastTau() const
lastSHat()/lastS().
Definition: XComb.h:229
XComb()
Default constructor.
const PPair & lastParticles() const
Return the pair of incoming particle instances.
Definition: XComb.h:151
void lastE1E2(pair< double, double >)
Set one minus the incoming parton momentum fractions w.r.t.
double lastX1() const
The first incoming parton momentum fraction w.r.t.
Definition: XComb.h:281
Energy maxEnergy() const
The maximum cm energy for this process.
Definition: XComb.h:118
DPair theLastX1X2
The incoming partons momentum fraction wrt.
Definition: XComb.h:543
void eraseMeta(int id)
Erase meta information.
Definition: XComb.h:396
PPair theLastPartons
The pair of incoming parton instances.
Definition: XComb.h:511
virtual void clean()
Reset all saved data about last generated phasespace point;.
double lastY() const
The last generated rapidity of the hard scattering sub-system.
Definition: XComb.h:234
Energy2 lastSHat() const
The last generated total energy squared of the incoming prtons.
Definition: XComb.h:218
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
Energy2 theLastS
The last generated total energy squared of the incoming particles.
Definition: XComb.h:516
void resetPartonBinInstances(const PBIPair &newBins)
Set information about currently generated partons.
Definition: XComb.h:426
const cPDPair & partons() const
The incoming parton types.
Definition: XComb.h:108
static void Init()
Standard Init function used to initialize the interface.
Energy2 theLastCentralScale
The last chosen central scale of the hard scattering.
Definition: XComb.h:559
Energy theMaxEnergy
The maximum cm energy for this process.
Definition: XComb.h:579
double lastP1() const
Log of one over the momentum fraction of the first incoming particle w.r.t.
Definition: XComb.h:245
map< cPPtr, PBIPtr > PartonBinInstanceMap
A map of PartonBinInstance objects indexed by the extracted parton.
Definition: XComb.h:176
pair< cPDPtr, cPDPtr > cPDPair
A pair of pointers to const ParticleData objects.
Definition: Containers.h:118
void meta(int id, T &ref)
Set meta information.
Definition: XComb.h:389
double lastE1() const
Return 1-lastX1() to highest possible precision for x 1.
Definition: XComb.h:299
tEHPtr theEventHandler
The corresponding collision handler.
Definition: XComb.h:456
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
Energy2 theLastScale
The last chosen scale of the hard scattering.
Definition: XComb.h:554
void lastParticles(const PPair &p)
Set the pair of incoming particle instances.
Definition: XComb.h:421
constexpr ZeroUnit ZERO
ZERO can be used as zero for any unitful quantity.
Definition: PhysicalQty.h:35
PBIPair thePartonBinInstances
Additional information about the incoming partons.
Definition: XComb.h:501
Energy2 theLastSHat
The last generated total energy squared of the incoming prtons.
Definition: XComb.h:521
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
const PartonBinInstanceMap & partonBinInstanceMap() const
Return the parton bin instance map (used by the parton extractor)
Definition: XComb.h:186