File: XComb.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 (169 lines) | stat: -rw-r--r-- 6,180 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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
// -*- C++ -*-
//
// XComb.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 XComb class.
//

#include "XComb.h"
#include "ThePEG/Handlers/EventHandler.h"
#include "ThePEG/Handlers/SubProcessHandler.h"
#include "ThePEG/Cuts/Cuts.h"
#include "ThePEG/PDF/PartonExtractor.h"
#include "ThePEG/Utilities/Debug.h"
#include "ThePEG/Utilities/Maths.h"
#include "ThePEG/PDT/ParticleData.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
#include "ThePEG/Utilities/SimplePhaseSpace.h"
#include "ThePEG/Utilities/UtilityBase.h"
#include "ThePEG/EventRecord/Particle.h"
#include "ThePEG/EventRecord/SubProcess.h"
#include "ThePEG/Vectors/LorentzRotation.h"
#include "ThePEG/MatrixElement/MEBase.h"
#include "ThePEG/MatrixElement/ColourLines.h"
#include "ThePEG/Handlers/LuminosityFunction.h"
#include "ThePEG/Handlers/CascadeHandler.h"
#include "ThePEG/Repository/EventGenerator.h"

using namespace ThePEG;

XComb::XComb()
  : theLastS(Energy2()), theLastSHat(Energy2()), theLastY(0.0),
    theLastP1P2(make_pair(1.0, 1.0)), theLastL1L2(make_pair(1.0, 1.0)),
    theLastX1X2(make_pair(1.0, 1.0)), theLastE1E2(make_pair(0.0, 0.0)),
    theLastScale(ZERO), theLastAlphaS(-1.0), theLastAlphaEM(-1.0),
    theMaxEnergy(ZERO) {}

XComb::
XComb(Energy newMaxEnergy, const cPDPair & inc, tEHPtr newEventHandler,
      tPExtrPtr newExtractor, tCascHdlPtr newCKKW, const PBPair & newPartonBins,
      tCutsPtr newCuts)
  : theEventHandler(newEventHandler),
    thePartonExtractor(newExtractor), theCKKW(newCKKW), theCuts(newCuts),
    theParticles(inc), thePartonBins(newPartonBins), theLastS(Energy2()),
    theLastSHat(Energy2()), theLastY(0.0), theLastP1P2(make_pair(1.0, 1.0)),
    theLastL1L2(make_pair(1.0, 1.0)), theLastX1X2(make_pair(1.0, 1.0)),
    theLastE1E2(make_pair(0.0, 0.0)), theLastScale(ZERO),
    theLastAlphaS(-1.0), theLastAlphaEM(-1.0), theMaxEnergy(newMaxEnergy) {
  thePartons = cPDPair(partonBins().first->parton(),
		       partonBins().second->parton());
  thePartonBinInstances.first =
    new_ptr(PartonBinInstance(partonBins().first));
  thePartonBinInstances.second =
    new_ptr(PartonBinInstance(partonBins().second));
  theParticleBins.first = thePartonBins.first->getFirst();
  theParticleBins.second = thePartonBins.second->getFirst();
}

XComb::~XComb() {}

void XComb::clean() {
  theLastParticles = PPair();
  theLastPartons = PPair();
  theLastS = theLastSHat = theLastScale = ZERO;
  theLastAlphaS = theLastAlphaEM = -1.0;
  theLastY = 0.0;
  theLastP1P2 = theLastL1L2 = theLastX1X2 = theLastE1E2 = DPair(0.0, 0.0);
  theSub = SubProPtr();
  thePartonBinInstances = PBIPair();
}

void XComb::prepare(const PPair & inc) {
  clean();
  createPartonBinInstances();
  theLastParticles = inc;
  pExtractor()->prepare(partonBinInstances());
}

void XComb::subProcess(tSubProPtr sp) {
  theSub = sp;
}

void XComb::setPartonBinInfo() {
  partonBinInstances().first->getFirst()->parton(lastParticles().first);
  partonBinInstances().second->getFirst()->parton(lastParticles().second);
}

void XComb::createPartonBinInstances() {
  thePartonBinInstances.first =
    new_ptr(PartonBinInstance(partonBins().first));
  thePartonBinInstances.second =
    new_ptr(PartonBinInstance(partonBins().second));
}

void XComb::setPartonBinInstances(PBIPair pbip, Energy2 scale) {
  clean();
  thePartonBinInstances = pbip;
  theLastParticles = PPair(pbip.first->getFirst()->parton(),
			   pbip.second->getFirst()->parton());
  theLastPartons = PPair(pbip.first->parton(),
			 pbip.second->parton());
  lastS((lastParticles().first->momentum() +
	 lastParticles().second->momentum()).m2());
  lastSHat((lastPartons().first->momentum() +
	    lastPartons().second->momentum()).m2());
  lastP1P2(make_pair(0.0, 0.0));
  lastX1X2(make_pair(lastPartons().first->momentum().plus()/
		     lastParticles().first->momentum().plus(),
		     lastPartons().second->momentum().minus()/
		     lastParticles().second->momentum().minus()));
  lastY(log(lastX1()/lastX2())*0.5);
  lastScale(scale);
}

void XComb::lastL1L2(pair<double,double> ll) {
  theLastL1L2 = ll;
  theLastX1X2 = make_pair(exp(-ll.first), exp(-ll.second));
  theLastE1E2 = make_pair(Math::exp1m(-ll.first), Math::exp1m(-ll.second));
}

void XComb::lastX1X2(pair<double,double> xx) {
  theLastX1X2 = xx;
  theLastL1L2 = make_pair(-log(xx.first), -log(xx.second));
  theLastE1E2 = make_pair(1.0 - xx.first, 1.0 - xx.second);
}

void XComb::lastE1E2(pair<double,double> ee) {
  theLastE1E2= ee;
  theLastL1L2 = make_pair(-Math::log1m(ee.first), -Math::log1m(ee.second));
  theLastX1X2 = make_pair(1.0 - ee.first, 1.0 - ee.second);
}

tPBIPtr XComb::partonBinInstance(tcPPtr p) const {
  return pExtractor()->partonBinInstance(p);
}

void XComb::Init() {}

void XComb::persistentOutput(PersistentOStream & os) const {

  os << theEventHandler << thePartonExtractor << theCKKW
     << theCuts << theParticles << thePartons << thePartonBins
     << theParticleBins << thePartonBinInstances
     << theLastParticles << theLastPartons
     << ounit(theLastS, GeV2) << ounit(theLastSHat, GeV2) << theLastY
     << theLastP1P2 << theLastL1L2 << theLastX1X2 << theLastE1E2
     << ounit(theLastScale, GeV2) << theLastAlphaS << theLastAlphaEM
     << ounit(theMaxEnergy, GeV) << theMEInfo << theSub;
}

void XComb::persistentInput(PersistentIStream & is, int) {
  is >> theEventHandler >> thePartonExtractor >> theCKKW
     >> theCuts >> theParticles >> thePartons >> thePartonBins
     >> theParticleBins >> thePartonBinInstances
     >> theLastParticles >> theLastPartons
     >> iunit(theLastS, GeV2) >> iunit(theLastSHat, GeV2) >> theLastY
     >> theLastP1P2 >> theLastL1L2 >> theLastX1X2 >> theLastE1E2
     >> iunit(theLastScale, GeV2) >> theLastAlphaS >> theLastAlphaEM
     >> iunit(theMaxEnergy, GeV) >> theMEInfo >> theSub;
}

ClassDescription<XComb> XComb::initXComb;