File: LuminosityFunction.cc

package info (click to toggle)
thepeg 1.8.0-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 9,312 kB
  • ctags: 11,509
  • sloc: cpp: 57,129; sh: 11,315; java: 3,212; lisp: 1,402; makefile: 830; ansic: 58; perl: 3
file content (112 lines) | stat: -rw-r--r-- 3,367 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
// -*- C++ -*-
//
// LuminosityFunction.cc is a part of ThePEG - Toolkit for HEP Event Generation
// Copyright (C) 1999-2011 Leif Lonnblad
//
// ThePEG is licenced under version 2 of the GPL, see COPYING for details.
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
//
//
// This is the implementation of the non-inlined, non-templated member
// functions of the LuminosityFunction class.
//

#include "LuminosityFunction.h"
#include "ThePEG/Handlers/XComb.h"
#include "ThePEG/Vectors/LorentzRotation.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"

#ifdef ThePEG_TEMPLATES_IN_CC_FILE
// #include "LuminosityFunction.tcc"
#endif

using namespace ThePEG;

IBPtr LuminosityFunction::clone() const {
  return new_ptr(*this);
}

IBPtr LuminosityFunction::fullclone() const {
  return new_ptr(*this);
}

LuminosityFunction::LuminosityFunction(Energy a, Energy b)
  : theBeamEMaxA(a), theBeamEMaxB(b) {}

void LuminosityFunction::select(tXCombPtr xcomb) {
  theLastXComb = xcomb;
}

bool LuminosityFunction::canHandle(const cPDPair &) const {
  return true;
}

Energy LuminosityFunction::maximumCMEnergy() const {
  return sqrt(4.0*beamEMaxA()*beamEMaxB());
}

LorentzRotation LuminosityFunction::getBoost() const {
  LorentzRotation r(0.0, 0.0, (beamEMaxA() - beamEMaxB())/
		              (beamEMaxA() + beamEMaxB()));
  return r;
}

double LuminosityFunction::Y() const {
  return 0.5*log(beamEMaxA()/beamEMaxB());
}

int LuminosityFunction::nDim(const cPDPair &) const {
  return 0;
}

double LuminosityFunction::
value(const cPDPair &, double l1, double l2) const {
  return l1 == 0.0 && l2 == 0.0? 1.0: 0.0;
}

pair<double,double>
LuminosityFunction::
generateLL(const double *, double &) const {
  return make_pair(0.0, 0.0);
}

void LuminosityFunction::persistentOutput(PersistentOStream & os) const {
  os << theLastXComb << ounit(theBeamEMaxA, GeV) << ounit(theBeamEMaxB, GeV);
}

void LuminosityFunction::persistentInput(PersistentIStream & is, int) {
  is >> theLastXComb >> iunit(theBeamEMaxA, GeV) >> iunit(theBeamEMaxB, GeV);
}

ClassDescription<LuminosityFunction> LuminosityFunction::initLuminosityFunction;

void LuminosityFunction::Init() {

  static ClassDocumentation<LuminosityFunction> documentation
    ("This base class should be used by all classes describing the luminosity "
     "and energy distribution of colliding particle beams.");

  static Parameter<LuminosityFunction,Energy> interfaceBeamEMaxA
    ("BeamEMaxA",
     "The maximum energy of the beam entering along the positive z-axis. "
     "Note that derived classes may shift the beams away from the z-axis.",
     &LuminosityFunction::theBeamEMaxA, GeV, 45.6*GeV, ZERO, ZERO,
     true, false, Interface::lowerlim);

  static Parameter<LuminosityFunction,Energy> interfaceBeamEMaxB
    ("BeamEMaxB",
     "The maximum energy of the beam entering along the negative z-axis. "
     "Note that derived classes may shift the beams away from the z-axis.",
     &LuminosityFunction::theBeamEMaxB, GeV, 45.6*GeV, ZERO, ZERO,
     true, false, Interface::lowerlim);

  interfaceBeamEMaxA.rank(10);
  interfaceBeamEMaxB.rank(9);
  interfaceBeamEMaxA.setHasDefault(false);
  interfaceBeamEMaxB.setHasDefault(false);

}