thepeg is hosted by Hepforge, IPPP Durham
ThePEG 2.3.0
StandardXComb.h
1// -*- C++ -*-
2//
3// StandardXComb.h is a part of ThePEG - Toolkit for HEP Event Generation
4// Copyright (C) 1999-2019 Leif Lonnblad
5// Copyright (C) 2009-2019 Simon Platzer
6//
7// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
8// Please respect the MCnet academic guidelines, see GUIDELINES for details.
9//
10#ifndef ThePEG_StandardXComb_H
11#define ThePEG_StandardXComb_H
12// This is the declaration of the StandardXComb class.
13
15#include "SubProcessHandler.fh"
16#include "ThePEG/PDF/PartonExtractor.fh"
17#include "ThePEG/PDF/PartonBin.h"
18#include "ThePEG/PDF/PartonBinInstance.h"
19#include "ThePEG/Utilities/VSelector.h"
20#include "ThePEG/Utilities/ClassDescription.h"
21#include "ThePEG/Utilities/Maths.h"
22#include "ThePEG/Utilities/XSecStat.h"
23#include "ThePEG/EventRecord/Particle.h"
24#include "ThePEG/MatrixElement/MEBase.h"
25#include "ThePEG/Handlers/XComb.h"
26#include "ThePEG/Handlers/StandardEventHandler.h"
27#include "ThePEG/Handlers/SubProcessHandler.fh"
28#include "StandardXComb.fh"
29
30namespace ThePEG {
31
53class StandardXComb: public XComb {
54
55public:
56
59
62
64 friend class MEBase;
65
66public:
67
73 StandardXComb(Energy newMaxEnergy, const cPDPair & inc,
74 tEHPtr newEventHandler,tSubHdlPtr newSubProcessHandler,
75 tPExtrPtr newExtractor, tCascHdlPtr newCKKW,
76 const PBPair & newPartonBins, tCutsPtr newCuts, tMEPtr newME,
77 const DiagramVector & newDiagrams, bool mir,
78 tStdXCombPtr newHead = tStdXCombPtr());
79
83 StandardXComb(tStdXCombPtr newHead,
84 const PBPair & newPartonBins, tMEPtr newME,
85 const DiagramVector & newDiagrams);
86
91
95 virtual ~StandardXComb();
96
100 StandardXComb(tMEPtr me, const tPVector & parts, DiagramIndex i);
101
103
106
112
119 void refillPartonBinInstances(const double* r);
120
129 bool setIncomingPartons(tStdXCombPtr labHead = tStdXCombPtr());
130
134 void fill(const PPair& newParticles,
135 const PPair& newPartons,
136 const vector<Lorentz5Momentum>& newMEMomenta,
137 const DVector& newLastRandomNumbers = DVector());
138
140
147 tcSubHdlPtr subProcessHandler() const { return theSubProcessHandler; }
148
152 tMEPtr matrixElement() const { return theME; }
153
159 tStdXCombPtr head() const { return theHead; }
160
164 void head(tStdXCombPtr headXC) { theHead = headXC; }
165
171
177
182 tStdXCombPtr lastProjector() const { return theProjector; }
183
188 void lastProjector(tStdXCombPtr pxc) { theProjector = pxc; }
189
191
197 virtual bool checkInit();
198
203 virtual int nDim() const { return theNDim; }
204
208 const pair<int,int>& partonDimensions() const { return partonDims; }
209
214
218 double cutWeight() const { return theCutWeight; }
219
223 virtual void clean();
224
229
234
240 virtual CrossSection dSigDR(const pair<double,double> ll, int nr, const double * r);
241
248 CrossSection dSigDR(const double * r);
249
256 virtual map<string,double> generateOptionalWeights();
257
261 double lastPDFWeight() const { return theLastPDFWeight; }
262
267
273
278 bool needsReshuffling() const { return theNeedsReshuffling; }
279
284 void reshuffle(vector<Lorentz5Momentum>&) const;
285
291
297 virtual const XSecStat & stats() const { return theStats; }
298
303 virtual void select(double weight) { theStats.select(weight); }
304
308 virtual void accept() { theStats.accept(); }
309
313 void reweight(double oldWeight, double newWeight) {
314 theStats.reweight(oldWeight,newWeight);
315 }
316
322 virtual void reject(double weight = 1.0) { theStats.reject(weight); }
323
327 virtual void reset() { theStats.reset(); }
329
335 const DiagramVector & diagrams() const { return theDiagrams; }
336
341 bool mirror() const { return isMirror; }
342
348 const vector<Lorentz5Momentum> & meMomenta() const { return theMEMomenta; }
349
353 tcDiagPtr lastDiagram() const {
354 if ( !theExternalDiagram )
355 return diagrams()[lastDiagramIndex()];
356 return theExternalDiagram;
357 }
358
364 const cPDVector & mePartonData() const { return theMEPartonData; }
365
370
376 const DVector & meInfo() const { return theMEInfo; }
377
383 void meInfo(const DVector & info) { theMEInfo = info; }
384
391
396 double jacobian() const { return theLastJacobian; }
397
403 double lastME2() const { return theLastME2; }
404
408 double lastPreweight() const { return theLastPreweight; }
409
416
423 double lastMEPDFWeight() const { return theLastMEPDFWeight; }
424
429 double lastMECouplings() const { return theLastMECouplings; }
431
436 virtual void newSubProcess(bool group = false);
437
443 vector<Lorentz5Momentum> & meMomenta() { return theMEMomenta; }
444
451
458
463 void externalDiagram(tcDiagPtr diag) { theExternalDiagram = diag; }
464
469
473 void lastPDFWeight(double w) { theLastPDFWeight = w; }
474
479
484 void jacobian(double j) { theLastJacobian = j; }
485
491 void lastME2(double v) { theLastME2 = v; }
492
496 void lastPreweight(double w) { theLastPreweight = w; }
497
504
511 void lastMEPDFWeight(double v) { theLastMEPDFWeight = v; }
512
516 void lastMECouplings(double v) { theLastMECouplings = v; }
517
518public:
519
527
533 void persistentInput(PersistentIStream & is, int version);
535
539 static void Init();
540
541private:
542
547
551 tMEPtr theME;
552
557
562
568
574
575protected:
576
581 pair<int,int> partonDims;
582
583private:
584
589
595 vector<Lorentz5Momentum> theMEMomenta;
596
603
608
613
620
627
632
637
643
650
655
662
670
675
681 tStdXCombPtr theHead;
682
688
693 tStdXCombPtr theProjector;
694
699
704
709
715
719 double reshuffleEquation(double, const vector<pair<Energy2,Energy2> >&, Energy2) const;
720
724 double solveReshuffleEquation(const vector<pair<Energy2,Energy2> >&, Energy2) const;
725
726private:
727
732
737
738};
739
746template <>
749 typedef XComb NthBase;
750};
751
756template <>
757struct ClassTraits<StandardXComb>:
758 public ClassTraitsBase<StandardXComb> {
760 static string className() { return "ThePEG::StandardXComb"; }
761};
762
765}
766
767#endif /* ThePEG_StandardXComb_H */
This is the main config header file for ThePEG.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data.
The MEBase class is the base class of all objects representing hard matrix elements in ThePEG.
Definition: MEBase.h:72
DiagramVector::size_type DiagramIndex
The size_type used in the DiagramVector.
Definition: MEBase.h:79
vector< DiagPtr > DiagramVector
A vector of pointers to DiagramBase objects.
Definition: MEBase.h:77
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...
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
void recreatePartonBinInstances(Energy2 scale)
Properly setup the PartonBinInstance objects provided a sub process has been constructed using this X...
void head(tStdXCombPtr headXC)
Set the head XComb pointer.
virtual void select(double weight)
Select the current event.
void checkReshufflingNeeds()
Check if a reshuffling is required when constructing the hard subprocess.
bool checkedCuts
True, if cuts have already been checked.
int theNDim
The number of dimensions of the phase space used to generate this process.
double lastPDFWeight() const
Return the PDF weight used in the last call to dSigDR.
double solveReshuffleEquation(const vector< pair< Energy2, Energy2 > > &, Energy2) const
Solve the reshuffling equation given the coefficients.
MEBase::DiagramVector DiagramVector
A vector of DiagramBase objects.
Definition: StandardXComb.h:58
StandardXComb(Energy newMaxEnergy, const cPDPair &inc, tEHPtr newEventHandler, tSubHdlPtr newSubProcessHandler, tPExtrPtr newExtractor, tCascHdlPtr newCKKW, const PBPair &newPartonBins, tCutsPtr newCuts, tMEPtr newME, const DiagramVector &newDiagrams, bool mir, tStdXCombPtr newHead=tStdXCombPtr())
Standard constructor.
double lastMECouplings() const
Return the coupling factor as calculated for the lats phase space point.
virtual bool checkInit()
Try to determine if this subprocess is at all possible.
virtual void reset()
Reset statistics.
virtual map< string, double > generateOptionalWeights()
If variations are available for the subprocess handled, generate and return a map of optional weights...
void externalDiagram(tcDiagPtr diag)
Set a diagram to be used instead of the one selected by the matrix element.
tStdXCombPtr theHead
A pointer to the head XComb this XComb depends on.
static void Init()
Standard Init function used to initialize the interface.
double lastPreweight() const
Return the last preweight factor.
void reshuffle(vector< Lorentz5Momentum > &) const
Perform the reshuffling from hardProcessMass to mass values, given outgoing momenta.
StandardXComb & operator=(const StandardXComb &)=delete
Private and non-existent assignment operator.
DiagramIndex theLastDiagramIndex
The last selected tree diagram.
CrossSection lastCrossSection() const
Return the cross section calculated in the last call to dSigDR.
DiagramIndex lastDiagramIndex() const
Return the index of the last selected diagram.
void fill(const PPair &newParticles, const PPair &newPartons, const vector< Lorentz5Momentum > &newMEMomenta, const DVector &newLastRandomNumbers=DVector())
Fill phase space information as far as possible.
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
double theLastPDFWeight
The PDF weight used in the last call to dSigDR.
double theLastPreweight
The last preweight factor.
void lastDiagramIndex(DiagramIndex i)
Set the last selected diagram.
double reshuffleEquation(double, const vector< pair< Energy2, Energy2 > > &, Energy2) const
Calculate the reshuffling equation given the coefficients.
const pair< int, int > & partonDimensions() const
Return the parton extraction dimensions.
const DiagramVector & diagrams() const
The diagrams used by the matrix element.
void lastMECouplings(double v)
Set the coupling factor.
void refillPartonBinInstances(const double *r)
Fill the variables needed to generate remnants; momenta will be used from the partons set in this xco...
StandardXComb()
Default constructor.
virtual tSubProPtr construct()
Construct a sub-process object from the information available.
cPDVector & mePartonData()
Return the parton types to be used by the matrix element object, in the order specified by the TreeDi...
tSubHdlPtr theSubProcessHandler
The corresponding sub-process handler.
tMEPtr matrixElement() const
The matrix element to be used.
vector< Lorentz5Momentum > theMEMomenta
The momenta of the partons to be used by the matrix element object, in the order specified by the Tre...
virtual CrossSection dSigDR(const pair< double, double > ll, int nr, const double *r)
Generate a phase space point from a vector r of nr numbers in the interval ]0,1[ and return the corre...
DVector theMEInfo
Information saved by the matrix element in the calculation of the cross section to be used later when...
double theLastMECouplings
The coupling factor.
StandardXComb(tMEPtr me, const tPVector &parts, DiagramIndex i)
Constructor used by MEBase to create a temporary object to store info.
double lastMEPDFWeight() const
Return the PDF weight as calculated for the last phase space point, if the matrix element does supply...
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
void lastME2(double v)
Set the matrix element squared as calculated for the last phase space point.
tStdXCombPtr head() const
Return a pointer to the head XComb this XComb depends on.
static ClassDescription< StandardXComb > initStandardXComb
Describe a concrete class with persistent data.
Selector< tStdXCombPtr > & projectors()
Return a selector object of xcombs to choose subprocesses different than the one currently integrated...
bool needsReshuffling() const
Return true if a reshuffling is required when constructing the hard subprocess.
bool theNeedsReshuffling
True if a reshuffling is required when constructing the hard subprocess.
bool setIncomingPartons(tStdXCombPtr labHead=tStdXCombPtr())
Setup information on incoming partons depending on the information previously supplied through the ch...
void didGenerateKinematics()
Indicate that kinematics have been generated.
double jacobian() const
Get the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
CrossSection dSigDR(const double *r)
If this XComb has a head XComb, return the cross section differential in the variables previously sup...
double theLastJacobian
Save the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
tcSubHdlPtr subProcessHandler() const
Return a pointer to the corresponding sub-process handler.
vector< Lorentz5Momentum > & meMomenta()
Return the momenta of the partons to be used by the matrix element object, in the order specified by ...
double theCutWeight
The cut weight encountered from fuzzy cuts.
tcDiagPtr lastDiagram() const
Return the last selected diagram.
void lastPreweight(double w)
Set the last preweight factor.
void lastCrossSection(CrossSection s)
Set the cross section calculated in the last call to dSigDR.
tcDiagPtr theExternalDiagram
A diagram to be used instead of the one selected by the matrix element.
double lastME2() const
Return the matrix element squared as calculated for the last phase space point.
void lastPDFWeight(double w)
Set the PDF weight used in the last call to dSigDR.
virtual void accept()
Accept the current event assuming it was previously selcted.
virtual void clean()
Reset all saved data about last generated phasespace point;.
CrossSection theLastMECrossSection
The partonic cross section as calculated for the last phase space point.
virtual void newSubProcess(bool group=false)
Construct the corresponding SubProcess object if it hasn't been done before.
DVector & lastRandomNumbers()
Access the random numbers used to generate the last phase space point, if the matrix element requeste...
bool isMirror
True if the TreeDiagram's for this matrix element should in fact be mirrored before used to create an...
void reweight(double oldWeight, double newWeight)
Reweight a selected and accepted event.
StandardXComb(tStdXCombPtr newHead, const PBPair &newPartonBins, tMEPtr newME, const DiagramVector &newDiagrams)
Constructor given a head xcomb.
Selector< tStdXCombPtr > theProjectors
A selector object of xcombs to choose subprocesses different than the one currently integrated.
virtual void reject(double weight=1.0)
Reject the current event assuming it was previously accepted.
virtual ~StandardXComb()
Destructor.
DiagramVector theDiagrams
The diagrams used by the matrix element.
XSecStat theStats
Statistics gathering for this XComb.
DVector theLastRandomNumbers
The random numbers used to generate the last phase space point, if the matrix element requested so.
tStdXCombPtr theProjector
A pointer to a projector xcomb which will generate a subprocess different from the one just integrate...
const cPDVector & mePartonData() const
Return the parton types to be used by the matrix element object, in the order specified by the TreeDi...
const vector< Lorentz5Momentum > & meMomenta() const
Return the momenta of the partons to be used by the matrix element object, in the order specified by ...
double theLastME2
The matrix element squared as calculated for the last phase space point.
double cutWeight() const
Return the cut weight encountered from fuzzy cuts.
pair< int, int > partonDims
The number of dimensions of the phase space used for each of the incoming partons.
void lastProjector(tStdXCombPtr pxc)
Set a pointer to a projector xcomb which will generate a subprocess different from the one just integ...
virtual int nDim() const
The number of dimensions of the phase space used to generate this process.
const Selector< tStdXCombPtr > & projectors() const
Return a selector object of xcombs to choose subprocesses different than the one currently integrated...
bool theKinematicsGenerated
True, if kinematics have already been generated.
MEBase::DiagramIndex DiagramIndex
A vector of indices.
Definition: StandardXComb.h:61
bool mirror() const
True if the TreeDiagram's for this matrix element should in fact be mirrored before used to create an...
cPDVector theMEPartonData
The parton types to be used by the matrix element object, in the order specified by the TreeDiagram o...
bool willPassCuts()
Return true, if the current configuration will pass the cuts.
void jacobian(double j)
Set the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
const DVector & meInfo() const
Get information saved by the matrix element in the calculation of the cross section to be used later ...
bool kinematicsGenerated() const
Return true, if kinematics have already been generated.
void meInfo(const DVector &info)
Set information saved by the matrix element in the calculation of the cross section to be used later ...
const DVector & lastRandomNumbers() const
Return the random numbers used to generate the last phase space point, if the matrix element requeste...
double theLastMEPDFWeight
The PDF weight as calculated for the last phase space point, if the matrix element does supply PDF we...
bool passedCuts
The result of the last call to willPassCuts.
tMEPtr theME
The matrix element to be used.
CrossSection theLastCrossSection
The cross section calculated in the last call to dSigDR.
CrossSection lastMECrossSection() const
Return the partonic cross section as calculated for the last phase space point.
virtual const XSecStat & stats() const
The statistics object for this XComb.
void lastMEPDFWeight(double v)
Set the PDF weight as calculated for the last phase space point, if the matrix element does supply PD...
void lastMECrossSection(CrossSection v)
Set the partonic cross section as calculated for the last phase space point.
tStdXCombPtr lastProjector() const
Return a pointer to a projector xcomb which will generate a subprocess different from the one just in...
The XComb class stores all information about the generation of a hard sub-proces for a given pair of ...
Definition: XComb.h:43
XSecStat is a concrete helper class used to collect statistics about the cross section for a specific...
Definition: XSecStat.h:36
void reset()
Reset the statistics.
Definition: XSecStat.h:92
void accept()
An event of the corresponding class has been accepted.
Definition: XSecStat.h:109
void select(double weight)
An event of the corresponding class has been attempted.
Definition: XSecStat.h:117
void reweight(double oldWeight, double newWeight)
Reweight a selected and accepted event.
Definition: XSecStat.h:129
void reject(double weight=1.0)
Reject the event which was last accepted with accept() or selected with select(double).
Definition: XSecStat.h:142
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
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
vector< double > DVector
A vector of doubles.
Definition: Containers.h:163
vector< cPDPtr > cPDVector
A vector of pointers to const ParticleData objects.
Definition: Containers.h:36
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
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