1 #include "Pythia8/Pythia.h" 14 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
override 17 if ((sigmaProcessPtr->nFinal() == 2)) {
18 selBias =
pow(phaseSpacePtr->pTHat() /
pt,
power);
34 if (tuneName ==
"CP5")
35 p = {7377.94700788, 8.38168461349, -4.70983112392, -0.0310148108446, -0.028798537937, 925.335472326};
38 p = {5.3571961909810e+13,1.0907678218282e+01,-2.5898069229451e+00,-5.1575514014931e-01,5.5951279807561e-02,3.5e+02};
39 sigma = [
this](
double x) ->
double {
return (
p[0]*
pow(
x,
p[2]+
p[3]*
log(0.01*
x)+
p[4]*
pow(
log(0.01*
x),2))*
pow(1-2*
x/(13000.+
p[5]),
p[1]))*
x; };
46 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
override 49 if ((sigmaProcessPtr->nFinal() == 2)) {
50 selBias = 1.0/sigma(phaseSpacePtr->pTHat());
58 std::vector<double>
p;
59 std::function<double(double)>
sigma;
66 const std::string& _yCMsigma_func,
double _yCM_power,
67 double _pTHatMin,
double _pTHatMax) :
68 yLabsigma_func(_yLabsigma_func), yCMsigma_func(_yCMsigma_func),
69 yLab_power(_yLab_power), yCM_power(_yCM_power),
70 pTHatMin(_pTHatMin), pTHatMax(_pTHatMax)
73 yLabsigma = TF1(
"yLabsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
74 yCMsigma = TF1(
"yCMsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
81 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
override 84 if ((sigmaProcessPtr->nFinal() == 2)) {
85 double x1 = phaseSpacePtr->x1();
86 double x2 = phaseSpacePtr->x2();
87 double yLab = 0.5*
log(x1/x2);
88 double yCM = 0.5*
log( phaseSpacePtr->tHat() / phaseSpacePtr->uHat() );
89 double pTHat = phaseSpacePtr->pTHat();
90 double sigmaLab = yLabsigma.Eval(pTHat);
91 double sigmaCM = yCMsigma.Eval(pTHat);
93 selBias =
exp(
pow(fabs(yLab),yLab_power)/(2*sigmaLab*sigmaLab) +
94 pow(fabs(yCM),yCM_power)/(2*sigmaCM*sigmaCM) );
112 const std::string& _yCMsigma_func,
double _yCM_power,
113 double _pTHatMin,
double _pTHatMax,
114 double _pt = 15,
double _power = 4.5) :
115 yLabsigma_func(_yLabsigma_func), yCMsigma_func(_yCMsigma_func),
116 yLab_power(_yLab_power), yCM_power(_yCM_power),
117 pTHatMin(_pTHatMin), pTHatMax(_pTHatMax),
pt(_pt),
power(_power)
120 yLabsigma = TF1(
"yLabsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
121 yCMsigma = TF1(
"yCMsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
128 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
override 131 if ((sigmaProcessPtr->nFinal() == 2)) {
132 double x1 = phaseSpacePtr->x1();
133 double x2 = phaseSpacePtr->x2();
134 double yLab = 0.5*
log(x1/x2);
135 double yCM = 0.5*
log( phaseSpacePtr->tHat() / phaseSpacePtr->uHat() );
136 double pTHat = phaseSpacePtr->pTHat();
137 double sigmaLab = yLabsigma.Eval(pTHat);
138 double sigmaCM = yCMsigma.Eval(pTHat);
140 selBias =
pow(pTHat /
pt,
power) *
exp(
pow(fabs(yLab),yLab_power)/(2*sigmaLab*sigmaLab) +
141 pow(fabs(yCM),yCM_power)/(2*sigmaCM*sigmaCM) );
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
~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
Power< A, B >::type pow(const A &a, const B &b)
PtHatEmpReweightUserHook(const std::string &tuneName="")