1 #include "Pythia8/Pythia.h" 12 const Pythia8::PhaseSpace* phaseSpacePtr,
13 bool inEvent)
override {
15 if ((sigmaProcessPtr->nFinal() == 2)) {
16 selBias =
pow(phaseSpacePtr->pTHat() /
pt,
power);
30 if (tuneName ==
"CP5" || tuneName ==
"CP5Run3")
31 p = {7377.94700788, 8.38168461349, -4.70983112392, -0.0310148108446, -0.028798537937, 925.335472326};
34 p = {5.3571961909810e+13,
40 const double ecms = (tuneName ==
"CP5Run3" ? 13600. : 13000.);
41 sigma = [
this, ecms](
double x) ->
double {
43 pow(1 - 2 *
x / (ecms +
p[5]),
p[1])) *
52 const Pythia8::PhaseSpace* phaseSpacePtr,
53 bool inEvent)
override {
55 if ((sigmaProcessPtr->nFinal() == 2)) {
56 selBias = 1.0 /
sigma(phaseSpacePtr->pTHat());
64 std::vector<double>
p;
65 std::function<double(double)>
sigma;
91 const Pythia8::PhaseSpace* phaseSpacePtr,
92 bool inEvent)
override {
94 if ((sigmaProcessPtr->nFinal() == 2)) {
95 double x1 = phaseSpacePtr->x1();
96 double x2 = phaseSpacePtr->x2();
97 double yLab = 0.5 *
log(
x1 /
x2);
98 double yCM = 0.5 *
log(phaseSpacePtr->tHat() / phaseSpacePtr->uHat());
99 double pTHat = phaseSpacePtr->pTHat();
101 double sigmaCM =
yCMsigma.Eval(pTHat);
144 const Pythia8::PhaseSpace* phaseSpacePtr,
145 bool inEvent)
override {
147 if ((sigmaProcessPtr->nFinal() == 2)) {
148 double x1 = phaseSpacePtr->x1();
149 double x2 = phaseSpacePtr->x2();
150 double yLab = 0.5 *
log(
x1 /
x2);
151 double yCM = 0.5 *
log(phaseSpacePtr->tHat() / phaseSpacePtr->uHat());
152 double pTHat = phaseSpacePtr->pTHat();
154 double sigmaCM =
yCMsigma.Eval(pTHat);
bool canBiasSelection() override
PtHatRapReweightUserHook(const std::string &_yLabsigma_func, double _yLab_power, const std::string &_yCMsigma_func, double _yCM_power, double _pTHatMin, double _pTHatMax, double _pt=15, double _power=4.5)
double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent) override
std::function< double(double)> sigma
PtHatReweightUserHook(double _pt=15, double _power=4.5)
~PtHatEmpReweightUserHook() override
~PtHatReweightUserHook() override
std::string yCMsigma_func
std::string yCMsigma_func
~PtHatRapReweightUserHook() override
std::string yLabsigma_func
std::string yLabsigma_func
bool canBiasSelection() override
bool canBiasSelection() override
~RapReweightUserHook() override
double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent) override
RapReweightUserHook(const std::string &_yLabsigma_func, double _yLab_power, const std::string &_yCMsigma_func, double _yCM_power, double _pTHatMin, double _pTHatMax)
double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent) override
double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent) override
bool canBiasSelection() override
PtHatEmpReweightUserHook(const std::string &tuneName="")