thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
MEBase.h
1// -*- C++ -*-
2//
3// MEBase.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_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 "ThePEG/Handlers/EventHandler.fh"
23#include "ThePEG/Handlers/StandardEventHandler.fh"
24#include "ThePEG/Handlers/SubProcessHandler.fh"
25#include "ThePEG/PDF/PartonBin.fh"
26
27#include "MEBase.fh"
28
29namespace ThePEG {
30
72class MEBase: public HandlerBase, public LastXCombInfo<StandardXComb> {
73
74public:
75
77 typedef vector<DiagPtr> DiagramVector;
79 typedef DiagramVector::size_type DiagramIndex;
81 typedef vector<ReweightPtr> ReweightVector;
82
83public:
84
91
95 virtual ~MEBase();
97
98public:
99
106 virtual unsigned int orderInAlphaS() const = 0;
107
112 virtual unsigned int orderInAlphaEW() const = 0;
113
119 virtual double me2() const = 0;
120
125 virtual Energy2 scale() const = 0;
126
132 virtual double alphaS() const;
133
139 virtual double alphaEM() const;
140
145 void setKinematics(tPPair in, const PVector & out);
146
154 virtual void setKinematics() {}
155
159 virtual void constructVertex(tSubProPtr sub);
160
164 virtual void constructVertex(tSubProPtr sub, const ColourLines* cl);
165
170 virtual int nDim() const;
171
180 virtual bool generateKinematics(const double * r) = 0;
181
186 virtual bool wantCMS() const { return true; }
187
194 virtual bool headCuts() const { return false; }
195
200 virtual bool ignoreCuts() const { return false; }
201
206 virtual bool apply() const { return true; }
207
212 virtual CrossSection dSigHatDR() const = 0;
213
219 virtual map<string,double> generateOptionalWeights() {
220 return map<string,double>();
221 }
222
231 virtual bool haveX1X2() const { return false; }
232
237 virtual bool havePDFWeight1() const { return false; }
238
243 virtual bool havePDFWeight2() const { return false; }
244
250 virtual bool keepRandomNumbers() const { return false; }
251
260
265 virtual void clearKinematics();
266
270 virtual void getDiagrams() const = 0;
271
279 virtual bool noMirror () const { return false; }
280
284 const DiagramVector & diagrams() const {
285 if ( theDiagrams.empty() ) getDiagrams();
286 return theDiagrams;
287 }
288
294 colourGeometries(tcDiagPtr diag) const = 0;
295
301 virtual const ColourLines &
302 selectColourGeometry(tcDiagPtr diag) const;
303
311 return Selector<DiagramIndex>();
312 }
313
314
321 virtual DiagramIndex diagram(const DiagramVector &) const;
322
327 inline bool reweighted() const {
328 return reweights.size() > 0 || preweights.size() > 0;
329 }
330
336 double reWeight() const;
337
343 double preWeight() const;
344
349
354
361
367
368public:
369
375 Energy2 sHat() const { return lastSHat(); }
376
381 double preweight() const { return lastPreweight(); }
382
388 virtual void flushCaches() {}
389
394 virtual StdXCombPtr makeXComb(Energy newMaxEnergy, const cPDPair & inc,
395 tEHPtr newEventHandler,tSubHdlPtr newSubProcessHandler,
396 tPExtrPtr newExtractor, tCascHdlPtr newCKKW,
397 const PBPair & newPartonBins, tCutsPtr newCuts,
398 const DiagramVector & newDiagrams, bool mir,
399 const PartonPairVec& allPBins,
400 tStdXCombPtr newHead = tStdXCombPtr(),
401 tMEPtr newME = tMEPtr());
402
407 virtual StdXCombPtr makeXComb(tStdXCombPtr newHead,
408 const PBPair & newPartonBins,
409 const DiagramVector & newDiagrams,
410 tMEPtr newME = tMEPtr());
411
416 virtual void fillProjectors() { }
417
422 virtual void setXComb(tStdXCombPtr);
423
428 const DVector & meInfo() const;
429
434 void meInfo(const DVector & info) const;
435
442 virtual int maxMultCKKW() const { return theMaxMultCKKW; }
443
450 virtual int minMultCKKW() const { return theMinMultCKKW; }
451
458 virtual void maxMultCKKW(int mult) { theMaxMultCKKW = mult; }
459
466 virtual void minMultCKKW(int mult) { theMinMultCKKW = mult; }
467
473 virtual void setVetoScales(tSubProPtr) const {}
475
476public:
477
485
491 void persistentInput(PersistentIStream & is, int version);
493
497 static void Init();
498
499protected:
500
505 void add(DiagPtr dp) const { theDiagrams.push_back(dp); }
506
510 vector<Lorentz5Momentum> & meMomenta();
512
518 void lastME2(double v) const;
520
524 void lastPreweight(double w) const;
526
534
541 void lastMEPDFWeight(double v) const;
543
548 void lastMECouplings(double v) const;
550
555 void jacobian(double j);
557
564 void use(tcMEPtr other);
565
569 void useDiagrams(tcMEPtr other) const;
570
571protected:
572
575
581 virtual void doinit();
582
587 virtual void doinitrun();
589
590private:
591
596
601
606
611
619
627
628private:
629
634
638 MEBase & operator=(const MEBase &) = delete;
639
640};
641
642}
643
644
645namespace ThePEG {
646
653template <>
654struct BaseClassTrait<MEBase,1>: public ClassTraitsType {
656 typedef HandlerBase NthBase;
657};
658
663template <>
664struct ClassTraits<MEBase>: public ClassTraitsBase<MEBase> {
666 static string className() { return "ThePEG::MEBase"; }
667};
668
671}
672
673#include "ThePEG/Handlers/StandardXComb.h"
674
675#endif /* ThePEG_MEBase_H */
A concreate implementation of ClassDescriptionBase describing an abstract class with persistent data.
The ColourLines class defines the colour flow in a SubProcess.
Definition: ColourLines.h:23
HandlerBase is an abstract base class derived from the Interfaced class via the HandlerBaseT class ad...
Definition: HandlerBase.h:151
LastXCombInfo is a templated class giving easy access to the information in an XComb object.
Definition: LastXCombInfo.h:32
double lastMEPDFWeight() const
Return the PDF weight as calculated for the last phase space point, if the matrix element does supply...
CrossSection lastMECrossSection() const
Return the partonic cross section as calculated for the last phase space point.
double jacobian() const
Get the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
double lastME2() const
Return the matrix element squared as calculated for the last phase space point.
Energy2 lastSHat() const
The last used interval in total parton-parton energy squared.
double lastPreweight() const
Return the last preweight factor.
double lastMECouplings() const
Return the coupling weight as calculated for the last phase space point.
The MEBase class is the base class of all objects representing hard matrix elements in ThePEG.
Definition: MEBase.h:72
virtual unsigned int orderInAlphaEW() const =0
Return the order in in which this matrix element is given.
virtual void doinit()
Initialize this object after the setup phase before saving an EventGenerator to disk.
static AbstractClassDescription< MEBase > initMEBase
Describe an abstract base class with persistent data.
Definition: MEBase.h:633
void lastMEPDFWeight(double v) const
Set the PDF weight as calculated for the last phase space point, if the matrix element does supply PD...
virtual double me2() const =0
Return the matrix element for the kinematical configuation previously provided by the last call to se...
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:206
virtual Selector< DiagramIndex > diagrams(const DiagramVector &) const
With the information previously supplied with the setKinematics(...) method, a derived class may opti...
Definition: MEBase.h:310
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:250
virtual ~MEBase()
Destructor.
const DVector & meInfo() const
Retrieve information obtained in the calculation of the cross section to be used later when selecting...
vector< Lorentz5Momentum > & meMomenta()
Access the momenta set by the last call to generateKinematics().
virtual void maxMultCKKW(int mult)
If this matrix element is to be used together with others for CKKW reweighting and veto,...
Definition: MEBase.h:458
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:388
bool reweighted() const
Return true if this matrix element has associated (p)reWeight objects assigned.
Definition: MEBase.h:327
vector< ReweightPtr > ReweightVector
A vector of pointers to ReweightBase objects.
Definition: MEBase.h:81
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual StdXCombPtr makeXComb(Energy newMaxEnergy, const cPDPair &inc, tEHPtr newEventHandler, tSubHdlPtr newSubProcessHandler, tPExtrPtr newExtractor, tCascHdlPtr newCKKW, const PBPair &newPartonBins, tCutsPtr newCuts, const DiagramVector &newDiagrams, bool mir, const PartonPairVec &allPBins, tStdXCombPtr newHead=tStdXCombPtr(), tMEPtr newME=tMEPtr())
For the given event generation setup return a xcomb object appropriate to this matrix element.
void use(tcMEPtr other)
Initialize all member variables from another MEBase object.
virtual Energy2 scale() const =0
Return the scale associated with the phase space point provided by the last call to setKinematics().
void lastME2(double v) const
Set the matrix element squared as calculated for the last phase space point.
const DiagramVector & diagrams() const
Return all possible diagrams.
Definition: MEBase.h:284
virtual bool generateKinematics(const double *r)=0
Generate internal degrees of freedom given nDim() uniform random numbers in the interval ]0,...
virtual void constructVertex(tSubProPtr sub)
construct the spin information for the interaction
virtual void fillProjectors()
Fill the projectors object of xcombs to choose subprocesses different than the one currently integrat...
Definition: MEBase.h:416
Ptr< Amplitude >::pointer amplitude() const
Return the amplitude associated with this matrix element.
Definition: MEBase.h:360
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:279
Ptr< Amplitude >::pointer theAmplitude
The amplitude associated with this matrix element.
Definition: MEBase.h:610
int theMinMultCKKW
If this matrix element is to be used together with others for CKKW reweighting and veto,...
Definition: MEBase.h:626
virtual double alphaS() const
Return the value of associated with the phase space point provided by the last call to setKinematics...
void lastPreweight(double w) const
Set the last preweight factor.
void addPreweighter(tReweightPtr rw)
Add objects to the list of preweighters.
double preweight() const
Return the factor with which this matrix element was last pre-weighted.
Definition: MEBase.h:381
virtual bool haveX1X2() const
Return true, if this matrix element will generate momenta for the incoming partons itself.
Definition: MEBase.h:231
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:200
double preWeight() const
With the information previously supplied with the setKinematics(...) methods, return the comined effe...
virtual unsigned int orderInAlphaS() const =0
Return the order in in which this matrix element is given.
DiagramVector theDiagrams
The diagrams included for this matrix element.
Definition: MEBase.h:595
virtual bool wantCMS() const
Return true, if this matrix element expects the incoming partons in their center-of-mass system.
Definition: MEBase.h:186
void addReweighter(tReweightPtr rw)
Add objects to the list of reweighters.
virtual int maxMultCKKW() const
If this matrix element is to be used together with others for CKKW reweighting and veto,...
Definition: MEBase.h:442
virtual double alphaEM() const
Return the value of associated with the phase space point provided by the last call to setKinematics...
virtual CrossSection dSigHatDR() const =0
Return the matrix element squared differential in the variables given by the last call to generateKin...
virtual void generateSubCollision(SubProcess &)
Comlete a SubProcess object using the internal degrees of freedom generated in the last generateKinem...
virtual const ColourLines & selectColourGeometry(tcDiagPtr diag) const
Select a ColpurLines geometry.
void meInfo(const DVector &info) const
Save information obtained in the calculation of the cross section to be used later when selecting dia...
void lastMECrossSection(CrossSection v) const
Set the partonic cross section as calculated for the last phase space point.
virtual int minMultCKKW() const
If this matrix element is to be used together with others for CKKW reweighting and veto,...
Definition: MEBase.h:450
DiagramVector::size_type DiagramIndex
The size_type used in the DiagramVector.
Definition: MEBase.h:79
virtual void constructVertex(tSubProPtr sub, const ColourLines *cl)
construct the spin information for the interaction
double reWeight() const
With the information previously supplied with the setKinematics(...) methods, return the combined eff...
ReweightVector reweights
The reweight objects modifying this matrix element.
Definition: MEBase.h:600
void useDiagrams(tcMEPtr other) const
Initialize the diagrams from another MEBase object.
void lastMECouplings(double v) const
Set the coupling weight as calculated for the last phase space point.
void amplitude(Ptr< Amplitude >::pointer amp)
Set the amplitude associated with this matrix element.
Definition: MEBase.h:365
MEBase()
Default constructor.
virtual void doinitrun()
Initialize this object.
virtual DiagramIndex diagram(const DiagramVector &) const
Select a diagram.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
int theMaxMultCKKW
If this matrix element is to be used together with others for CKKW reweighting and veto,...
Definition: MEBase.h:618
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 void setKinematics()
Set the typed and momenta of the incoming and outgoing partons to be used in subsequent calls to me()...
Definition: MEBase.h:154
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:473
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:194
MEBase & operator=(const MEBase &)=delete
Private and non-existent assignment operator.
ReweightVector preweights
The preweight objects modifying this matrix element.
Definition: MEBase.h:605
virtual bool havePDFWeight2() const
Return true, if this matrix element provides the PDF weight for the second incoming parton itself.
Definition: MEBase.h:243
void jacobian(double j)
Set the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
virtual bool havePDFWeight1() const
Return true, if this matrix element provides the PDF weight for the first incoming parton itself.
Definition: MEBase.h:237
virtual void getDiagrams() const =0
Add all possible diagrams with the add() function.
vector< DiagPtr > DiagramVector
A vector of pointers to DiagramBase objects.
Definition: MEBase.h:77
virtual StdXCombPtr makeXComb(tStdXCombPtr newHead, const PBPair &newPartonBins, const DiagramVector &newDiagrams, tMEPtr newME=tMEPtr())
For the given event generation setup return a dependent xcomb object appropriate to this matrix eleme...
static void Init()
Standard Init function used to initialize the interfaces.
virtual void minMultCKKW(int mult)
If this matrix element is to be used together with others for CKKW reweighting and veto,...
Definition: MEBase.h:466
virtual int nDim() const
The number of internal degreed of freedom used in the matrix element.
virtual void clearKinematics()
Clear the information previously provided by a call to setKinematics(...).
void add(DiagPtr dp) const
To be used by sub classes in the getDiagrams() method to add included diagrams.
Definition: MEBase.h:505
virtual void setXComb(tStdXCombPtr)
Set the XComb object to be used in the next call to generateKinematics() and dSigHatDR().
void setKinematics(tPPair in, const PVector &out)
Set the typed and momenta of the incoming and outgoing partons to be used in subsequent calls to me()...
Energy2 sHat() const
Return the last set invariant mass squared.
Definition: MEBase.h:375
virtual map< string, double > generateOptionalWeights()
If variations are available for the subprocess handled, generate and return a map of optional weights...
Definition: MEBase.h:219
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
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
Selector is a templated class for storing objects associated with probabilities in a way such that,...
Definition: Selector.h:46
The StandardXComb class inherits from the more general XComb class which stores all information about...
Definition: StandardXComb.h:53
A SubProcess object represents a hard sub-process in a collision.
Definition: SubProcess.h:33
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
pair< cPDPtr, cPDPtr > cPDPair
A pair of pointers to const ParticleData objects.
Definition: Containers.h:118
pair< tPPtr, tPPtr > tPPair
A pair of transient pointers to const Particle objects.
Definition: Containers.h:133
vector< PPtr > PVector
A vector of pointers to Particle objects.
Definition: Containers.h:76
vector< double > DVector
A vector of doubles.
Definition: Containers.h:163
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition: ClassTraits.h:161
static string className()
Return the name of class T.
Definition: ClassTraits.h:66