ThePEG  1.8.0
MEBase.h
1 // -*- C++ -*-
2 //
3 // MEBase.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_MEBase_H
10 #define ThePEG_MEBase_H
11 // This is the declaration of the MEBase class.
12 
13 #include "ThePEG/Handlers/HandlerBase.h"
14 #include "ThePEG/EventRecord/SubProcess.h"
15 #include "ThePEG/MatrixElement/DiagramBase.h"
16 #include "ThePEG/MatrixElement/ColourLines.h"
17 #include "ThePEG/MatrixElement/Amplitude.h"
18 #include "ThePEG/Handlers/LastXCombInfo.h"
19 #include "ThePEG/Handlers/StandardXComb.fh"
20 #include "ReweightBase.h"
21 
22 #include "MEBase.fh"
23 
24 namespace ThePEG {
25 
67 class MEBase: public HandlerBase, public LastXCombInfo<StandardXComb> {
68 
69 public:
70 
72  typedef vector<DiagPtr> DiagramVector;
74  typedef DiagramVector::size_type DiagramIndex;
76  typedef vector<ReweightPtr> ReweightVector;
77 
78 public:
79 
85  MEBase();
86 
90  virtual ~MEBase();
92 
93 public:
94 
101  virtual unsigned int orderInAlphaS() const = 0;
102 
107  virtual unsigned int orderInAlphaEW() const = 0;
108 
114  virtual double me2() const = 0;
115 
120  virtual Energy2 scale() const = 0;
121 
127  virtual double alphaS() const;
128 
134  virtual double alphaEM() const;
135 
140  void setKinematics(tPPair in, const PVector & out);
141 
149  virtual void setKinematics();
150 
154  virtual void constructVertex(tSubProPtr sub);
155 
160  virtual int nDim() const;
161 
170  virtual bool generateKinematics(const double * r) = 0;
171 
176  virtual bool wantCMS() const { return true; }
177 
184  virtual bool headCuts() const { return false; }
185 
190  virtual bool ignoreCuts() const { return false; }
191 
196  virtual bool apply() const { return true; }
197 
202  virtual CrossSection dSigHatDR() const = 0;
203 
212  virtual bool haveX1X2() const { return false; }
213 
218  virtual bool havePDFWeight1() const { return false; }
219 
224  virtual bool havePDFWeight2() const { return false; }
225 
231  virtual bool keepRandomNumbers() const { return false; }
232 
240  virtual void generateSubCollision(SubProcess &);
241 
246  virtual void clearKinematics();
247 
251  virtual void getDiagrams() const = 0;
252 
260  virtual bool noMirror () const { return false; }
261 
265  const DiagramVector & diagrams() const {
266  if ( theDiagrams.empty() ) getDiagrams();
267  return theDiagrams;
268  }
269 
275  colourGeometries(tcDiagPtr diag) const = 0;
276 
282  virtual const ColourLines &
283  selectColourGeometry(tcDiagPtr diag) const;
284 
291  virtual Selector<DiagramIndex> diagrams(const DiagramVector &) const {
292  return Selector<DiagramIndex>();
293  }
294 
295 
302  virtual DiagramIndex diagram(const DiagramVector &) const;
303 
308  inline bool reweighted() const {
309  return reweights.size() > 0 || preweights.size() > 0;
310  }
311 
317  double reWeight() const;
318 
324  double preWeight() const;
325 
329  void addReweighter(tReweightPtr rw);
330 
334  void addPreweighter(tReweightPtr rw);
335 
342 
348 
349 public:
350 
356  Energy2 sHat() const { return theLastSHat; }
357 
362  double preweight() const { return lastPreweight; }
363 
369  virtual void flushCaches() {}
370 
375  virtual void setXComb(tStdXCombPtr);
376 
381  const DVector & meInfo() const;
382 
387  void meInfo(const DVector & info) const;
388 
395  int maxMultCKKW() const { return theMaxMultCKKW; }
396 
403  int minMultCKKW() const { return theMinMultCKKW; }
404 
410  virtual void setVetoScales(tSubProPtr) const {}
412 
413 public:
414 
421  void persistentOutput(PersistentOStream & os) const;
422 
428  void persistentInput(PersistentIStream & is, int version);
430 
434  static void Init();
435 
436 protected:
437 
442  void add(DiagPtr dp) const { theDiagrams.push_back(dp); }
443 
447  vector<Lorentz5Momentum> & meMomenta();
449 
455  void lastME2(double v) const;
457 
463  void lastMECrossSection(CrossSection v) const;
465 
472  void lastMEPDFWeight(double v) const;
474 
479  void jacobian(double j);
481 
488  void use(tcMEPtr other);
489 
493  void useDiagrams(tcMEPtr other) const;
494 
495 private:
496 
500  mutable DiagramVector theDiagrams;
501 
505  Energy2 theLastSHat;
506 
510  ReweightVector reweights;
511 
515  ReweightVector preweights;
516 
520  mutable double lastPreweight;
521 
526 
534 
542 
543 private:
544 
549 
553  MEBase & operator=(const MEBase &);
554 
555 };
556 
557 }
558 
559 
560 namespace ThePEG {
561 
568 template <>
569 struct BaseClassTrait<MEBase,1>: public ClassTraitsType {
571  typedef HandlerBase NthBase;
572 };
573 
578 template <>
579 struct ClassTraits<MEBase>: public ClassTraitsBase<MEBase> {
581  static string className() { return "ThePEG::MEBase"; }
582 };
583 
586 }
587 
588 #include "ThePEG/Handlers/StandardXComb.h"
589 
590 #endif /* ThePEG_MEBase_H */
bool reweighted() const
Return true if this matrix element has associated (p)reWeight objects assigned.
Definition: MEBase.h:308
MEBase & operator=(const MEBase &)
Private and non-existent assignment operator.
virtual void setKinematics()
Set the typed and momenta of the incoming and outgoing partons to be used in subsequent calls to me()...
virtual bool headCuts() const
If this is a dependent matrix element in a ME group, return true, if cuts should be inherited from th...
Definition: MEBase.h:184
PersistentIStream is used to read persistent objects from a stream where they were previously written...
virtual void constructVertex(tSubProPtr sub)
construct the spin information for the interaction
const DiagramVector & diagrams() const
Return all possible diagrams.
Definition: MEBase.h:265
double preweight() const
Return the factor with which this matrix element was last pre-weighted.
Definition: MEBase.h:362
static void Init()
Standard Init function used to initialize the interfaces.
Energy2 sHat() const
Return the last set invariant mass squared.
Definition: MEBase.h:356
virtual Selector< DiagramIndex > diagrams(const DiagramVector &) const
With the information previously supplied with the setKinematics(...) method, a derived class may opti...
Definition: MEBase.h:291
void addPreweighter(tReweightPtr rw)
Add objects to the list of preweighters.
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
virtual Energy2 scale() const =0
Return the scale associated with the phase space point provided by the last call to setKinematics()...
ReweightVector preweights
The preweight objects modifying this matrix element.
Definition: MEBase.h:515
virtual void clearKinematics()
Clear the information previously provided by a call to setKinematics(...).
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
A concreate implementation of ClassDescriptionBase describing an abstract class with persistent data...
LastXCombInfo is a templated class giving easy access to the information in an XComb object...
Definition: LastXCombInfo.h:32
double lastME2() const
Return the matrix element squared as calculated for the last phase space point.
virtual bool generateKinematics(const double *r)=0
Generate internal degrees of freedom given nDim() uniform random numbers in the interval ]0...
virtual void flushCaches()
Inform this matrix element that a new phase space point is about to be generated, so all caches shoul...
Definition: MEBase.h:369
void amplitude(Ptr< Amplitude >::pointer amp)
Set the amplitude associated with this matrix element.
Definition: MEBase.h:346
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:509
virtual Selector< const ColourLines * > colourGeometries(tcDiagPtr diag) const =0
Return a Selector with possible colour geometries for the selected diagram weighted by their relative...
virtual bool wantCMS() const
Return true, if this matrix element expects the incoming partons in their center-of-mass system...
Definition: MEBase.h:176
virtual unsigned int orderInAlphaEW() const =0
Return the order in in which this matrix element is given.
void addReweighter(tReweightPtr rw)
Add objects to the list of reweighters.
virtual bool ignoreCuts() const
If this is a dependent matrix element in a ME group, return true, if cuts should be ignored...
Definition: MEBase.h:190
void use(tcMEPtr other)
Initialize all member variables from another MEBase object.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
Ptr< Amplitude >::pointer amplitude() const
Return the amplitude associated with this matrix element.
Definition: MEBase.h:341
void add(DiagPtr dp) const
To be used by sub classes in the getDiagrams() method to add included diagrams.
Definition: MEBase.h:442
vector< double > DVector
A vector of doubles.
Definition: Containers.h:163
virtual void setVetoScales(tSubProPtr) const
Set veto scales on the particles at the given SubProcess which has been generated using this matrix e...
Definition: MEBase.h:410
pair< tPPtr, tPPtr > tPPair
A pair of transient pointers to const Particle objects.
Definition: Containers.h:133
virtual double alphaEM() const
Return the value of associated with the phase space point provided by the last call to setKinematics...
virtual bool keepRandomNumbers() const
Return true, if the XComb steering this matrix element should keep track of the random numbers used t...
Definition: MEBase.h:231
const DVector & meInfo() const
Retrieve information obtained in the calculation of the cross section to be used later when selecting...
virtual double alphaS() const
Return the value of associated with the phase space point provided by the last call to setKinematics...
void useDiagrams(tcMEPtr other) const
Initialize the diagrams from another MEBase object.
double preWeight() const
With the information previously supplied with the setKinematics(...) methods, return the comined effe...
A SubProcess object represents a hard sub-process in a collision.
Definition: SubProcess.h:33
int minMultCKKW() const
If this matrix element is to be used together with others for CKKW reweighting and veto...
Definition: MEBase.h:403
vector< ReweightPtr > ReweightVector
A vector of pointers to ReweightBase objects.
Definition: MEBase.h:76
ReweightVector reweights
The reweight objects modifying this matrix element.
Definition: MEBase.h:510
virtual bool apply() const
If this is a dependent matrix element in a ME group, return true, if it applies to the process set in...
Definition: MEBase.h:196
double jacobian() const
Get the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
virtual void setXComb(tStdXCombPtr)
Set the XComb object to be used in the next call to generateKinematics() and dSigHatDR().
virtual unsigned int orderInAlphaS() const =0
Return the order in in which this matrix element is given.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual ~MEBase()
Destructor.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
static AbstractClassDescription< MEBase > initMEBase
Describe an abstract base class with persistent data.
Definition: MEBase.h:548
virtual bool havePDFWeight2() const
Return true, if this matrix element provides the PDF weight for the second incoming parton itself...
Definition: MEBase.h:224
virtual void getDiagrams() const =0
Add all possible diagrams with the add() function.
int theMinMultCKKW
If this matrix element is to be used together with others for CKKW reweighting and veto...
Definition: MEBase.h:541
virtual bool noMirror() const
Return true, if this matrix element does not want to make use of mirroring processes; in this case al...
Definition: MEBase.h:260
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
virtual int nDim() const
The number of internal degreed of freedom used in the matrix element.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
Ptr< Amplitude >::pointer theAmplitude
The amplitude associated with this matrix element.
Definition: MEBase.h:525
Selector is a templated class for storing objects associated with probabilities in a way such that...
Definition: Selector.h:46
vector< Lorentz5Momentum > & meMomenta()
Access the momenta set by the last call to generateKinematics().
double lastPreweight
The factor with which this matrix element was last pre-weighted.
Definition: MEBase.h:520
virtual const ColourLines & selectColourGeometry(tcDiagPtr diag) const
Select a ColpurLines geometry.
vector< DiagPtr > DiagramVector
A vector of pointers to DiagramBase objects.
Definition: MEBase.h:72
int maxMultCKKW() const
If this matrix element is to be used together with others for CKKW reweighting and veto...
Definition: MEBase.h:395
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
double reWeight() const
With the information previously supplied with the setKinematics(...) methods, return the combined eff...
This template class allows the compiler to check calculations with physical quantities for dimensiona...
Definition: PhysicalQty.h:81
The MEBase class is the base class of all objects representing hard matrix elements in ThePEG...
Definition: MEBase.h:67
virtual CrossSection dSigHatDR() const =0
Return the matrix element squared differential in the variables given by the last call to generateKin...
The ColourLines class defines the colour flow in a SubProcess.
Definition: ColourLines.h:23
DiagramVector::size_type DiagramIndex
The size_type used in the DiagramVector.
Definition: MEBase.h:74
MEBase()
Default constructor.
DiagramVector theDiagrams
The diagrams included for this matrix element.
Definition: MEBase.h:500
double lastMEPDFWeight() const
Return the PDF weight as calculated for the last phase space point, if the matrix element does supply...
vector< PPtr > PVector
A vector of pointers to Particle objects.
Definition: Containers.h:76
virtual DiagramIndex diagram(const DiagramVector &) const
Select a diagram.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
int theMaxMultCKKW
If this matrix element is to be used together with others for CKKW reweighting and veto...
Definition: MEBase.h:533
virtual double me2() const =0
Return the matrix element for the kinematical configuation previously provided by the last call to se...
Energy2 theLastSHat
The last set invariant mass squared.
Definition: MEBase.h:505
virtual bool haveX1X2() const
Return true, if this matrix element will generate momenta for the incoming partons itself...
Definition: MEBase.h:212
virtual bool havePDFWeight1() const
Return true, if this matrix element provides the PDF weight for the first incoming parton itself...
Definition: MEBase.h:218
CrossSection lastMECrossSection() const
Return the partonic cross section as calculated for the last phase space point.
The templated ClassTraitsBase class defines a set of default information about classes used by ThePEG...
Definition: ClassTraits.h:52
virtual void generateSubCollision(SubProcess &)
Comlete a SubProcess object using the internal degrees of freedom generated in the last generateKinem...