ThePEG  1.8.0
StandardXComb.h
1 // -*- C++ -*-
2 //
3 // StandardXComb.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2011 Leif Lonnblad
5 // Copyright (C) 2009-2011 Simon Platzer
6 //
7 // ThePEG is licenced under version 2 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 
14 #include "ThePEG/Config/ThePEG.h"
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 
30 namespace ThePEG {
31 
53 class StandardXComb: public XComb {
54 
55 public:
56 
59 
62 
64  friend class MEBase;
65 
66 public:
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();
84 
88  virtual ~StandardXComb();
89 
93  StandardXComb(tMEPtr me, const tPVector & parts, DiagramIndex i);
94 
96 
103  tcSubHdlPtr subProcessHandler() const { return theSubProcessHandler; }
104 
108  tMEPtr matrixElement() const { return theME; }
109 
115  tStdXCombPtr head() const { return theHead; }
116 
120  void head(tStdXCombPtr headXC) { theHead = headXC; }
122 
128  virtual bool checkInit();
129 
134  int nDim() const { return theNDim; }
135 
139  bool willPassCuts() const;
140 
146  virtual CrossSection dSigDR(const pair<double,double> ll, int nr, const double * r);
147 
151  double lastPDFWeight() const { return theLastPDFWeight; }
152 
157 
161  virtual tSubProPtr construct();
163 
169  virtual const XSecStat & stats() const { return theStats; }
170 
175  virtual void select(double weight) { theStats.select(weight); }
176 
180  virtual void accept() { theStats.accept(); }
181 
185  void reweight(double oldWeight, double newWeight) {
186  theStats.reweight(oldWeight,newWeight);
187  }
188 
194  virtual void reject(double weight = 1.0) { theStats.reject(weight); }
195 
199  virtual void reset() { theStats.reset(); }
201 
207  const DiagramVector & diagrams() const { return theDiagrams; }
208 
213  bool mirror() const { return isMirror; }
214 
220  const vector<Lorentz5Momentum> & meMomenta() const { return theMEMomenta; }
221 
225  tcDiagPtr lastDiagram() const { return diagrams()[lastDiagramIndex()]; }
226 
232  const cPDVector & mePartonData() const { return theMEPartonData; }
233 
237  DiagramIndex lastDiagramIndex() const { return theLastDiagramIndex; }
238 
244  const DVector & meInfo() const { return theMEInfo; }
245 
251  void meInfo(const DVector & info) { theMEInfo = info; }
252 
258  const DVector& lastRandomNumbers() const { return theLastRandomNumbers; }
259 
264  double jacobian() const { return theLastJacobian; }
265 
271  double lastME2() const { return theLastME2; }
272 
279 
286  double lastMEPDFWeight() const { return theLastMEPDFWeight; }
288 
289 protected:
290 
295  virtual void newSubProcess(bool group = false);
296 
302  vector<Lorentz5Momentum> & meMomenta() { return theMEMomenta; }
303 
310 
317 
321  void lastDiagramIndex(DiagramIndex i) { theLastDiagramIndex = i; }
322 
326  void lastPDFWeight(double w) { theLastPDFWeight = w; }
327 
332 
337  void jacobian(double j) { theLastJacobian = j; }
338 
344  void lastME2(double v) { theLastME2 = v; }
345 
352 
359  void lastMEPDFWeight(double v) { theLastMEPDFWeight = v; }
360 
361 public:
362 
369  void persistentOutput(PersistentOStream & os) const;
370 
376  void persistentInput(PersistentIStream & is, int version);
378 
382  static void Init();
383 
384 private:
385 
390 
394  tMEPtr theME;
395 
400 
404  DiagramVector theDiagrams;
405 
410  bool isMirror;
411 
416  int theNDim;
417 
418 protected:
419 
424  pair<int,int> partonDims;
425 
426 private:
427 
433  vector<Lorentz5Momentum> theMEMomenta;
434 
441 
445  DiagramIndex theLastDiagramIndex;
446 
453 
460 
465 
470 
476 
482  double theLastME2;
483 
490 
498 
504  tStdXCombPtr theHead;
505 
506 private:
507 
512 
517 
518 };
519 
526 template <>
527 struct BaseClassTrait<StandardXComb,1>: public ClassTraitsType {
529  typedef XComb NthBase;
530 };
531 
536 template <>
537 struct ClassTraits<StandardXComb>:
538  public ClassTraitsBase<StandardXComb> {
540  static string className() { return "ThePEG::StandardXComb"; }
541 };
542 
545 }
546 
547 #endif /* ThePEG_StandardXComb_H */
double theLastME2
The matrix element squared as calculated for the last phase space point.
CrossSection theLastMECrossSection
The partonic cross section as calculated for the last phase space point.
void reset()
Reset the statistics.
Definition: XSecStat.h:92
PersistentIStream is used to read persistent objects from a stream where they were previously written...
void select(double weight)
An event of the corresponding class has been attempted.
Definition: XSecStat.h:119
bool mirror() const
True if the TreeDiagram&#39;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.
CrossSection theLastCrossSection
The cross section calculated in the last call to dSigDR.
void lastMEPDFWeight(double v)
Set the PDF weight as calculated for the last phase space point, if the matrix element does supply PD...
const DiagramVector & diagrams() const
The diagrams used by the matrix element.
double theLastMEPDFWeight
The PDF weight as calculated for the last phase space point, if the matrix element does supply PDF we...
double lastPDFWeight() const
Return the PDF weight used in the last call to dSigDR.
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
void accept()
An event of the corresponding class has been accepted.
Definition: XSecStat.h:109
StandardXComb & operator=(const StandardXComb &)
Private and non-existent assignment operator.
void head(tStdXCombPtr headXC)
Set the head XComb pointer.
pair< int, int > partonDims
The number of dimensions of the phase space used for each of the incoming partons.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
static ClassDescription< StandardXComb > initStandardXComb
Describe a concrete class with persistent data.
tStdXCombPtr head() const
Return a pointer to the head XComb this XComb depends on.
double theLastJacobian
Save the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
double lastMEPDFWeight() const
Return the PDF weight as calculated for the last phase space point, if the matrix element does supply...
virtual void reset()
Reset statistics.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
int nDim() const
The number of dimensions of the phase space used to generate this process.
bool willPassCuts() const
Return true, if the current configuration will pass the cuts.
virtual void newSubProcess(bool group=false)
Construct the corresponding SubProcess object if it hasn&#39;t been done before.
DiagramIndex lastDiagramIndex() const
Return the index of the last selected diagram.
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:509
double lastME2() const
Return the matrix element squared as calculated for the last phase space point.
static void Init()
Standard Init function used to initialize the interface.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
virtual ~StandardXComb()
Destructor.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
virtual void reject(double weight=1.0)
Reject the current event assuming it was previously accepted.
const DVector & meInfo() const
Get information saved by the matrix element in the calculation of the cross section to be used later ...
const cPDVector & mePartonData() const
Return the parton types to be used by the matrix element object, in the order specified by the TreeDi...
DVector & lastRandomNumbers()
Access the random numbers used to generate the last phase space point, if the matrix element requeste...
void reject(double weight=1.0)
Reject the event which was last accepted with accept() or selected with select(double).
Definition: XSecStat.h:144
vector< double > DVector
A vector of doubles.
Definition: Containers.h:163
tStdXCombPtr theHead
A pointer to the head XComb this XComb depends on.
MEBase::DiagramIndex DiagramIndex
A vector of indices.
Definition: StandardXComb.h:61
cPDVector theMEPartonData
The parton types to be used by the matrix element object, in the order specified by the TreeDiagram o...
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
tSubHdlPtr theSubProcessHandler
The corresponding sub-process handler.
tMEPtr theME
The matrix element to be used.
The XComb class stores all information about the generation of a hard sub-proces for a given pair of ...
Definition: XComb.h:43
QTY< 0, 1, 0 >::Type Energy
Energy.
Definition: Unitsystem.h:34
vector< Lorentz5Momentum > & meMomenta()
Return the momenta of the partons to be used by the matrix element object, in the order specified by ...
MEBase::DiagramVector DiagramVector
A vector of DiagramBase objects.
Definition: StandardXComb.h:58
virtual void accept()
Accept the current event assuming it was previously selcted.
void reweight(double oldWeight, double newWeight)
Reweight a selected and accepted event.
Definition: XSecStat.h:131
int theNDim
The number of dimensions of the phase space used to generate this process.
The StandardXComb class inherits from the more general XComb class which stores all information about...
Definition: StandardXComb.h:53
DVector theMEInfo
Information saved by the matrix element in the calculation of the cross section to be used later when...
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...
DiagramVector theDiagrams
The diagrams used by the matrix element.
virtual bool checkInit()
Try to determine if this subprocess is at all possible.
tcSubHdlPtr subProcessHandler() const
Return a pointer to the corresponding sub-process handler.
bool isMirror
True if the TreeDiagram&#39;s for this matrix element should in fact be mirrored before used to create an...
virtual const XSecStat & stats() const
The statistics object for this XComb.
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...
vector< cPDPtr > cPDVector
A vector of pointers to const ParticleData objects.
Definition: Containers.h:36
tcDiagPtr lastDiagram() const
Return the last selected diagram.
tMEPtr matrixElement() const
The matrix element to be used.
CrossSection lastMECrossSection() const
Return the partonic cross section as calculated for the last phase space point.
const vector< Lorentz5Momentum > & meMomenta() const
Return the momenta of the partons to be used by the matrix element object, in the order specified by ...
void lastPDFWeight(double w)
Set the PDF weight used in the last call to dSigDR.
vector< DiagPtr > DiagramVector
A vector of pointers to DiagramBase objects.
Definition: MEBase.h:72
void lastDiagramIndex(DiagramIndex i)
Set the last selected diagram.
virtual void select(double weight)
Select the current event.
DVector theLastRandomNumbers
The random numbers used to generate the last phase space point, if the matrix element requested so...
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
XSecStat theStats
Statistics gathering for this XComb.
double theLastPDFWeight
The PDF weight used in the last call to dSigDR.
void meInfo(const DVector &info)
Set information saved by the matrix element in the calculation of the cross section to be used later ...
void lastMECrossSection(CrossSection v)
Set the partonic cross section as calculated for the last phase space point.
This template class allows the compiler to check calculations with physical quantities for dimensiona...
Definition: PhysicalQty.h:81
pair< cPDPtr, cPDPtr > cPDPair
A pair of pointers to const ParticleData objects.
Definition: Containers.h:118
The MEBase class is the base class of all objects representing hard matrix elements in ThePEG...
Definition: MEBase.h:67
DiagramVector::size_type DiagramIndex
The size_type used in the DiagramVector.
Definition: MEBase.h:74
CrossSection lastCrossSection() const
Return the cross section calculated in the last call to dSigDR.
vector< tPPtr > tPVector
A vector of transient pointers to Particle objects.
Definition: Containers.h:82
DiagramIndex theLastDiagramIndex
The last selected tree diagram.
void lastCrossSection(CrossSection s)
Set the cross section calculated in the last call to dSigDR.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
XSecStat is a concrete helper class used to collect statistics about the cross section for a specific...
Definition: XSecStat.h:36
const DVector & lastRandomNumbers() const
Return the random numbers used to generate the last phase space point, if the matrix element requeste...
StandardXComb()
Default constructor.
vector< Lorentz5Momentum > theMEMomenta
The momenta of the partons to be used by the matrix element object, in the order specified by the Tre...
double jacobian() const
Get the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
void jacobian(double j)
Set the last jacobian obtained when generating the kinematics for the call to dSigHatDR.
void lastME2(double v)
Set the matrix element squared 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