ThePEG  1.8.0
XComb.h
1 // -*- C++ -*-
2 //
3 // XComb.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 //
6 // ThePEG is licenced under version 2 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  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 
179 
184 
190 
194  Energy2 lastS() const { return theLastS; }
195 
200  void lastS(Energy2 s) { theLastS = s; }
201 
205  Energy2 lastSHat() const { return theLastSHat; }
206 
211  void lastSHat(Energy2 sh) { theLastSHat = sh; }
212 
216  double lastTau() const { return lastSHat()/lastS(); }
217 
221  double lastY() const { return theLastY; }
222 
226  void lastY(double y) { theLastY = y; }
227 
232  double lastP1() const { return theLastP1P2.first; }
233 
238  double lastP2() const { return theLastP1P2.second; }
239 
244  void lastP1P2(pair<double,double> pp) { theLastP1P2 = pp; }
245 
250  double lastL1() const { return theLastL1L2.first; }
251 
256  double lastL2() const { return theLastL1L2.second; }
257 
262  void lastL1L2(pair<double,double>);
263 
268  double lastX1() const { return theLastX1X2.first; }
269 
274  double lastX2() const { return theLastX1X2.second; }
275 
280  void lastX1X2(pair<double,double>);
281 
286  double lastE1() const { return theLastE1E2.first; }
287 
292  double lastE2() const { return theLastE1E2.second; }
293 
298  void lastE1E2(pair<double,double>);
299 
303  Energy2 lastScale() const { return theLastScale; }
304 
308  void lastScale(Energy2 Q2) { theLastScale = Q2; }
309 
314  double lastAlphaS() const { return theLastAlphaS; }
315 
319  void lastAlphaS(double a) { theLastAlphaS = a; }
320 
325  double lastAlphaEM() const { return theLastAlphaEM; }
326 
330  void lastAlphaEM(double a) { theLastAlphaEM = a; }
332 
333 public:
334 
338  bool hasMeta(int id) const {
339  return theMeta.find(id) != theMeta.end();
340  }
341 
345  template<class T>
346  void meta(int id, T& ref) {
347  theMeta[id] = AnyReference(ref);
348  }
349 
353  void eraseMeta(int id) {
354  theMeta.erase(id);
355  }
356 
360  template<class T>
361  T& meta(int id) const {
362  return theMeta.find(id)->second.cast<T>();
363  }
364 
365 protected:
366 
370  void setPartonBinInfo();
371 
376 
377 public:
378 
385  void persistentOutput(PersistentOStream & os) const;
386 
392  void persistentInput(PersistentIStream & is, int version);
394 
398  static void Init();
399 
400 protected:
401 
405  void lastParticles(const PPair & p) { theLastParticles = p; }
406 
410  void resetPartonBinInstances(const PBIPair & newBins) { thePartonBinInstances = newBins; }
411 
412 private:
413 
418 
423 
428 
432  tCutsPtr theCuts;
433 
438 
443 
448 
453 
458 
463 
468 
472  Energy2 theLastS;
473 
477  Energy2 theLastSHat;
478 
482  double theLastY;
483 
488 
494 
500 
506 
510  Energy2 theLastScale;
511 
516 
521 
526 
533 
539 
543  map<int,AnyReference> theMeta;
544 
545 private:
546 
551 
555  XComb & operator=(const XComb &);
556 
557 };
558 
565 template <>
566 struct BaseClassTrait<XComb,1>: public ClassTraitsType {
568  typedef Base NthBase;
569 };
570 
575 template <>
576 struct ClassTraits<XComb>:
577  public ClassTraitsBase<XComb> {
579  static string className() { return "ThePEG::XComb"; }
580 };
581 
584 }
585 
586 #endif /* ThePEG_XComb_H */
T & meta(int id) const
Retrieve meta information.
Definition: XComb.h:361
DPair theLastL1L2
Log of one over the incoming partons momentum fraction wrt.
Definition: XComb.h:493
const EventHandler & eventHandler() const
Return a reference to the corresponding collision handler.
Definition: XComb.h:74
bool empty() const
Returns true if this XComb does not correspond to a proper subprocess generation. ...
Definition: XComb.h:126
void lastPartons(PPair pp)
Set the pair of incoming parton instances.
Definition: XComb.h:161
PersistentIStream is used to read persistent objects from a stream where they were previously written...
tCascHdlPtr theCKKW
A pointer to a CascadeHandler to be used for CKKW-reweighting.
Definition: XComb.h:427
tPExtrPtr pExtractor() const
A pointer to the parton extractor.
Definition: XComb.h:84
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:200
map< int, AnyReference > theMeta
The meta information.
Definition: XComb.h:543
tEHPtr eventHandlerPtr() const
Return a pointer to the corresponding collision handler.
Definition: XComb.h:79
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:487
Define the base class from which all (polymorphic) classes in ThePEG are derived. ...
Definition: ThePEG.h:54
tSubProPtr subProcess() const
Return the SubProcess object corresponding to the last generated sub-process.
Definition: XComb.h:167
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:538
const PPair & lastPartons() const
Return the pair of incoming parton instances.
Definition: XComb.h:156
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
cPDPair thePartons
The incoming parton types.
Definition: XComb.h:442
void lastL1L2(pair< double, double >)
Set log of one over the incoming parton momentum fractions w.r.t.
double lastTau() const
lastSHat()/lastS().
Definition: XComb.h:216
bool hasMeta(int id) const
Check for meta information.
Definition: XComb.h:338
const PPair & lastParticles() const
Return the pair of incoming particle instances.
Definition: XComb.h:151
double theLastAlphaEM
The used in the hard scattering.
Definition: XComb.h:520
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:681
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:509
tCascHdlPtr CKKWHandler() const
Return a possibly null pointer to a CascadeHandler to be used for CKKW-reweighting.
Definition: XComb.h:95
double lastL2() const
Log of one over the second incoming parton momentum fraction w.r.t.
Definition: XComb.h:256
double theLastAlphaS
The used in the hard scattering.
Definition: XComb.h:515
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
tCutsPtr cuts() const
A pointer to the kinematical cuts.
Definition: XComb.h:89
double lastE1() const
Return 1-lastX1() to highest possible precision for x 1.
Definition: XComb.h:286
double lastY() const
The last generated rapidity of the hard scattering sub-system.
Definition: XComb.h:221
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:532
Energy2 lastScale() const
Get the last chosen scale of the hard scattering.
Definition: XComb.h:303
void lastScale(Energy2 Q2)
Set the last chosen scale of the hard scattering.
Definition: XComb.h:308
void lastSHat(Energy2 sh)
Set the last generated total energy squared of the incoming prtons.
Definition: XComb.h:211
double lastX1() const
The first incoming parton momentum fraction w.r.t.
Definition: XComb.h:268
double lastAlphaEM() const
Get the used in the hard scattering.
Definition: XComb.h:325
PBPair theParticleBins
Additional information about the origins of the incoming partons.
Definition: XComb.h:452
void createPartonBinInstances()
Create PartonBinInstance objects for this XComb.
void lastAlphaEM(double a)
Set the used in the hard scattering.
Definition: XComb.h:330
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:319
virtual ~XComb()
Destructor.
PBIPair & partonBinInstances()
Additional information about the incoming partons.
Definition: XComb.h:183
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:447
QTY< 0, 1, 0 >::Type Energy
Energy.
Definition: Unitsystem.h:34
void lastP1P2(pair< double, double > pp)
Set log of one over the momentum fraction of the incoming particles w.r.t.
Definition: XComb.h:244
double theLastY
The last rapidity of the sub process, log(x1/x2)/2.
Definition: XComb.h:482
tPExtrPtr thePartonExtractor
A pointer to the parton extractor.
Definition: XComb.h:422
tCutsPtr theCuts
A pointer to the kinematical cuts used.
Definition: XComb.h:432
PPair theLastParticles
The pair of incoming particle instances.
Definition: XComb.h:462
double lastX2() const
The second incoming parton momentum fraction w.r.t.
Definition: XComb.h:274
const cPDPair & partons() const
The incoming parton types.
Definition: XComb.h:108
void lastY(double y)
Set the last generated rapidity of the hard scattering sub-system.
Definition: XComb.h:226
void setPartonBinInstances(PBIPair pbis, Energy2 scale)
Set information about currently generated partons.
AnyReference is inspired by boost::any to hold a reference to an object of arbitrary type...
Definition: AnyReference.h:22
cPDPair theParticles
The incoming particle types.
Definition: XComb.h:437
void setPartonBinInfo()
Set the local parton bin info objects for this XComb.
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.
static ClassDescription< XComb > initXComb
Describe a concrete class with persistent data.
Definition: XComb.h:550
void clean()
Reset all saved data about last generated phasespace point;.
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:505
double lastE2() const
Return 1-lastX2() to highest possible precision for x 1.
Definition: XComb.h:292
Energy2 lastSHat() const
The last generated total energy squared of the incoming prtons.
Definition: XComb.h:205
XComb()
Default constructor.
void lastE1E2(pair< double, double >)
Set one minus the incoming parton momentum fractions w.r.t.
DPair theLastX1X2
The incoming partons momentum fraction wrt.
Definition: XComb.h:499
void eraseMeta(int id)
Erase meta information.
Definition: XComb.h:353
PPair theLastPartons
The pair of incoming parton instances.
Definition: XComb.h:467
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
const PBIPair & partonBinInstances() const
Additional information about the incoming partons.
Definition: XComb.h:178
Energy2 theLastS
The last generated total energy squared of the incoming particles.
Definition: XComb.h:472
double lastP2() const
Log of one over the momentum fraction of the second incoming particle w.r.t.
Definition: XComb.h:238
void resetPartonBinInstances(const PBIPair &newBins)
Set information about currently generated partons.
Definition: XComb.h:410
static void Init()
Standard Init function used to initialize the interface.
double lastAlphaS() const
Get the used in the hard scattering.
Definition: XComb.h:314
Energy theMaxEnergy
The maximum cm energy for this process.
Definition: XComb.h:525
double lastP1() const
Log of one over the momentum fraction of the first incoming particle w.r.t.
Definition: XComb.h:232
pair< cPDPtr, cPDPtr > cPDPair
A pair of pointers to const ParticleData objects.
Definition: Containers.h:118
const cPDPair & particles() const
The incoming particle types.
Definition: XComb.h:103
void meta(int id, T &ref)
Set meta information.
Definition: XComb.h:346
Energy2 lastS() const
The last generated total energy squared of the incoming particles.
Definition: XComb.h:194
tEHPtr theEventHandler
The corresponding collision handler.
Definition: XComb.h:417
XComb & operator=(const XComb &)
Private and non-existent assignment operator.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
const PBPair & partonBins() const
Additional information about the incoming partons.
Definition: XComb.h:113
Energy2 theLastScale
The last chosen scale of the hard scattering.
Definition: XComb.h:510
void lastParticles(const PPair &p)
Set the pair of incoming particle instances.
Definition: XComb.h:405
Energy maxEnergy() const
The maximum cm energy for this process.
Definition: XComb.h:118
tPBIPtr partonBinInstance(tcPPtr) const
Return the corresponding parton bin instance for a given extracted parton.
PBIPair thePartonBinInstances
Additional information about the incoming partons.
Definition: XComb.h:457
double lastL1() const
Log of one over the first incoming parton momentum fraction w.r.t.
Definition: XComb.h:250
Energy2 theLastSHat
The last generated total energy squared of the incoming prtons.
Definition: XComb.h:477
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52