ThePEG  1.8.0
PartonBinInstance.h
1 // -*- C++ -*-
2 //
3 // PartonBinInstance.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_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 
54 
73 
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 
339 
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 
407  Energy2 theScale;
408 
413 
418 
423 
430 
431 private:
432 
437 
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 */