-
Notifications
You must be signed in to change notification settings - Fork 0
/
ReweightMinPT.cc
76 lines (61 loc) · 2.28 KB
/
ReweightMinPT.cc
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
// -*- C++ -*-
//
// ReweightMinPT.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 ReweightMinPT class.
//
#include "ReweightMinPT.h"
#include "ThePEG/Interface/ClassDocumentation.h"
#include "ThePEG/Interface/Parameter.h"
#include "ThePEG/Handlers/StandardXComb.h"
#include "ThePEG/Persistency/PersistentOStream.h"
#include "ThePEG/Persistency/PersistentIStream.h"
using namespace ThePEG;
IBPtr ReweightMinPT::clone() const {
return new_ptr(*this);
}
IBPtr ReweightMinPT::fullclone() const {
return new_ptr(*this);
}
double ReweightMinPT::weight() const {
Energy minPt = Constants::MaxEnergy;
for ( int i = 0, N = subProcess()->outgoing().size(); i < N; ++i ) {
int id = abs(subProcess()->outgoing()[i]->id());
if ( id<10 || id==21 ) {
minPt = min(minPt, subProcess()->outgoing()[i]->momentum().perp());
}
}
return pow(minPt/scale, power);
}
void ReweightMinPT::persistentOutput(PersistentOStream & os) const {
os << power << ounit(scale,GeV);
}
void ReweightMinPT::persistentInput(PersistentIStream & is, int) {
is >> power >> iunit(scale,GeV);
}
ClassDescription<ReweightMinPT> ReweightMinPT::initReweightMinPT;
// Definition of the static class description member.
void ReweightMinPT::Init() {
static ClassDocumentation<ReweightMinPT> documentation
("There is no documentation for the ThePEG::ReweightMinPT class");
static Parameter<ReweightMinPT,double> interfacePower
("Power",
"The power to which the minimum tranverse momentum (divided by a "
"<interface>Scale</interface>) is raised to give the weight.",
&ReweightMinPT::power, 4.0, -10.0, 10.0, false, false, true);
static Parameter<ReweightMinPT,Energy> interfaceScale
("Scale",
"The scale with which the minimum transverse momentum is divided "
"befor it is raised to a <interface>Power</interface> to give the "
"weight..",
&ReweightMinPT::scale, GeV, 50.0*GeV, ZERO, ZERO,
false, false, Interface::lowerlim);
interfacePower.rank(10);
interfaceScale.rank(9);
}