thepeg is hosted by Hepforge, IPPP Durham
ThePEG  2.1.5
PartonBinInstance.h
1 // -*- C++ -*-
2 //
3 // PartonBinInstance.h is a part of ThePEG - Toolkit for HEP Event Generation
4 // Copyright (C) 1999-2017 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_PartonBinInstance_H
10 #define THEPEG_PartonBinInstance_H
11 // This is the declaration of the PartonBinInstance class.
12 
13 #include "ThePEG/Config/ThePEG.h"
14 #include "ThePEG/PDF/PartonBin.h"
15 
16 namespace ThePEG {
17 
20 typedef pair<PBIPtr,PBIPtr> PBIPair;
21 
23 
29 
30 public:
31 
38 
43 
47  virtual ~PartonBinInstance();
48 
53  PartonBinInstance(tcPBPtr, tPBIPtr = tPBIPtr());
54 
73 
81  PartonBinInstance(tPPtr particle, tPPtr parton, tcPBPtr pb,
82  Energy2 scale = ZERO);
83 
85 
86 public:
87 
93  tcPBPtr bin() const { return theBin; }
94 
99  const PartonVector & bins() const { return theBins; }
100 
104  tcPDPtr particleData() const { return bin()->particle(); }
105 
109  tcPDPtr partonData() const { return bin()->parton(); }
110 
116  tPBIPtr incoming() const { return theIncoming; }
117 
122  tPBIPtr getFirst();
123 
128  tcPDFPtr pdf() const { return bin()->pdf(); }
129 
133  tcRemHPtr remnantHandler() const { return bin()->remnantHandler(); }
134 
139  bool hasPoleIn1() const;
141 
147  void reset(double lx = 0, Energy2 Q2 = ZERO);
148 
152  void prepare();
153 
157  void generate(const double * r);
158 
162  double jacobian() const { return theJacobian; }
163 
167  void jacobian(double j) { theJacobian = j; }
169 
175  tPPtr particle() const { return theParticle; }
176 
180  void particle(tPPtr p) { theParticle = p; }
181 
185  tPPtr parton() const { return theParton; }
186 
190  void parton(tPPtr p) { theParton = p; }
191 
196  const PVector & partons() const { return thePartons; }
197 
202  double xi() const {
203  if ( theXi < 0.0 ) theXi = exp(-li());
204  return theXi;
205  }
206 
207 
212  double eps() const {
213  if ( theEps < 0.0 ) theEps = Math::exp1m(-li());
214  return theEps;
215  }
216 
221  double li() const { return theLi; }
222 
227  void li(double lx) {
228  theLi = lx;
229  theXi = theEps = -1.0;
230  }
231 
232 
237  double x() const {
238  if ( theX < 0.0 ) theX = exp(-l());
239  return theX;
240  }
241 
242 
247  double l() const { return theL; }
248 
253  void l(double lx) {
254  theL = lx;
255  theX = -1.0;
256  }
257 
258 
262  Energy2 scale() const { return theScale; }
263 
264 
268  void scale(Energy2 s) { theScale = s; }
269 
273  const TransverseMomentum & kT() const { return theKT; }
274 
278  double remnantWeight() const { return theRemnantWeight; }
279 
283  void remnantWeight(double w) { theRemnantWeight = w; }
284 
288  const PVector & remnants() const { return theRemnants; }
289 
293  void remnants(const PVector & rems) { theRemnants = rems; }
294 
300  tRemIPtr remnantInfo() const { return theRemInfo; }
301 
307  void remnantInfo(tRemIPtr ri) { theRemInfo = ri; }
309 
310 public:
311 
318  void persistentOutput(PersistentOStream & os) const;
319 
325  void persistentInput(PersistentIStream & is, int version);
327 
331  static void Init();
332 
333 private:
334 
338  cPBPtr theBin;
339 
344  PartonVector theBins;
345 
352 
356  double theJacobian;
357 
362 
367 
373 
379  mutable double theXi;
385  mutable double theEps;
391  double theLi;
392 
397  mutable double theX;
402  double theL;
403 
408 
413 
418 
423 
430 
431 private:
432 
437 
441  PartonBinInstance & operator=(const PartonBinInstance &) = delete;
442 
443 };
444 
447 class RemInfoBase: public Base {
448 public:
450  virtual ~RemInfoBase() {}
451 };
452 
453 }
454 
455 
456 namespace ThePEG {
457 
462 template <>
463 struct BaseClassTrait<PartonBinInstance,1>: public ClassTraitsType {
465  typedef Base NthBase;
466 };
467 
470 template <>
471 struct ClassTraits<PartonBinInstance>:
472  public ClassTraitsBase<PartonBinInstance> {
474  static string className() { return "ThePEG::PartonBinInstance"; }
475 };
476 
479 }
480 
481 #endif /* THEPEG_PartonBinInstance_H */
tcPDFPtr pdf() const
The PDFBase object describing the momentum distribution of the parton within the particle in this Par...
PersistentIStream is used to read persistent objects from a stream where they were previously written...
double remnantWeight() const
Get the weight associated with the remnant generation.
void particle(tPPtr p)
Set the current particle instance.
virtual ~RemInfoBase()
The descructor.
void jacobian(double j)
Set the jacobian associated with the phase space point generated.
Define the base class from which all (polymorphic) classes in ThePEG are derived. ...
Definition: ThePEG.h:54
void remnantInfo(tRemIPtr ri)
Set information saved by the remnant handler from the generation, to be used in the construction of t...
ClassTraitsType is an empty, non-polymorphic, base class.
Definition: ClassTraits.h:30
double theLi
The momentum fraction (xi, li=log(xi), eps=1-xi), of this parton w.r.t.
void li(double lx)
Set the logarithmic momentum fraction of this parton w.r.t.
A concreate implementation of ClassDescriptionBase describing a concrete class with persistent data...
tcPDPtr particleData() const
Return a pointer to the data object of the incoming particle.
PVector theRemnants
The current remnants.
Energy2 scale() const
Get the scale at which the current parton was extracted.
void generate(const double *r)
Generate l and Q2 of this and parent bins.
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
void reset(double lx=0, Energy2 Q2=ZERO)
Reset the current PartonBin, making room for a new event.
PVector thePartons
The currently extracted partons (in case of multiple interactions.
tPBIPtr incoming() const
In the case the incoming particle in turn is extracted from another particle, return the PartonBinIns...
double eps() const
Get one minus the momentum fraction of this parton w.r.t.
PBIPtr theIncoming
In the case the incoming particle in turn is extracted from another particle, this is the PartonBinIn...
TransientConstRCPtr is a simple wrapper around a bare const pointer which can be assigned to and from...
Definition: RCPtr.h:696
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition: RCPtr.h:519
RemIPtr theRemInfo
The information saved by the remnant handler from the generation, to be used in the construction of t...
const PVector & remnants() const
Get the current remnants.
This is the main namespace within which all identifiers in ThePEG are declared.
Definition: FactoryBase.h:28
double theX
The momentum fraction (x, l=log(x)) of this parton w.r.t.
This is the main config header file for ThePEG.
const PartonVector & bins() const
Return pointers to the bins this instance refer to in case more than one parton has been extracted...
void prepare()
Reset last generated l and Q2 values of this and parent bins.
TransverseMomentum theKT
The transverse momentum of the extracted parton.
static ClassDescription< PartonBinInstance > initPartonBinInstance
Describe a concrete class with persistent data.
double exp1m(double x)
Return , with highest possible precision for .
double li() const
Get the logarithmic momentum fraction of this parton w.r.t.
PPtr theParticle
The current particle instance.
tPPtr particle() const
Get the current particle instance.
#define ThePEG_DECLARE_CLASS_POINTERS(full, abbrev)
This macro helps us to declare pointers and stuff to standard classes.
Definition: Pointers.h:58
tcPDPtr partonData() const
Return a pointer to the data object of the extracted parton.
Empty base class.
double x() const
Get the momentum fraction of this parton w.r.t.
void remnants(const PVector &rems)
Set the current remnants.
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
bool hasPoleIn1() const
Return true if the corresponding PDFs has a pole at $x=1$ for the current particle/parton combination...
double theXi
The momentum fraction (xi, li=log(xi), eps=1-xi), of this parton w.r.t.
void remnantWeight(double w)
Set the weight associated with the remnant generation.
double theRemnantWeight
The weight associated with the remnant generation.
double xi() const
Get the momentum fraction of this parton w.r.t.
double jacobian() const
Get the jacobian associated with the phase space point generated.
pair< PBIPtr, PBIPtr > PBIPair
A pair of pointers to PartonBinInstance objects.
PartonBinInstance()
Default constructor.
RCPtr is a reference counted (smart) pointer.
Definition: RCPtr.h:60
double theJacobian
The jacobian associated with the phase space point generated.
PartonBinInstance is used to store information about the generation of a given parton extraction for ...
double theL
The momentum fraction (x, l=log(x)) of this parton w.r.t.
PartonVector theBins
Pointer to the main bin (and secondary in case several partons have been extracted this instance refe...
ThePEG::Ptr< PartonBinInstance >::transient_pointer tPBIPtr
Alias for a transient pointer to PartonBinInstance .
void scale(Energy2 s)
Set the scale at which the current parton was extracted.
PPtr theParton
The current parton instance.
tPPtr parton() const
Get the current parton instance.
tRemIPtr remnantInfo() const
Get information saved by the remnant handler from the generation, to be used in the construction of t...
tcRemHPtr remnantHandler() const
The remnant handler associated with the pdf().
tPBIPtr getFirst()
Return the parton bin instance corresponding to the first incoming particle for this bin...
PartonBinInstance & operator=(const PartonBinInstance &)=delete
Private and non-existent assignment operator.
The default concrete implementation of ClassTraitsBase.
Definition: ClassTraits.h:134
cPBPtr theBin
Pointer to the main bin this instance refer to.
double theEps
The momentum fraction (xi, li=log(xi), eps=1-xi), of this parton w.r.t.
virtual ~PartonBinInstance()
Destructor.
tcPBPtr bin() const
Return a pointer to the PartonBin this instance refer to.
static void Init()
Standard Init function used to initialize the interfaces.
vector< PPtr > PVector
A vector of pointers to Particle objects.
Definition: Containers.h:76
void parton(tPPtr p)
Set the current parton instance.
BaseClassTraits describes the base classes of the templated class.
Definition: ClassTraits.h:156
Energy2 theScale
The scale at which the current parton was extracted.
double l() const
Get the logarithmic momentum fraction of this parton w.r.t.
constexpr ZeroUnit ZERO
ZERO can be used as zero for any unitful quantity.
Definition: PhysicalQty.h:33
const PVector & partons() const
The currently extracted partons (in case of multiple interactions.
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
const TransverseMomentum & kT() const
Return the transverse momentum of the extracted parton.
void l(double lx)
Set the logarithmic momentum fraction of this parton w.r.t.