1 #include "Pythia8/Pythia.h" 14 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
17 if ((sigmaProcessPtr->nFinal() == 2)) {
18 selBias =
pow(phaseSpacePtr->pTHat() /
pt,
power);
34 p = {5.3571961909810e+13,1.0907678218282e+01,-2.5898069229451e+00,-5.1575514014931e-01,5.5951279807561e-02,3.5e+02};
35 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; };
42 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
45 if ((sigmaProcessPtr->nFinal() == 2)) {
46 selBias = 1.0/sigma(phaseSpacePtr->pTHat());
54 std::vector<double>
p;
55 std::function<double(double)>
sigma;
62 const std::string& _yCMsigma_func,
double _yCM_power,
63 double _pTHatMin,
double _pTHatMax) :
64 yLabsigma_func(_yLabsigma_func), yCMsigma_func(_yCMsigma_func),
65 yLab_power(_yLab_power), yCM_power(_yCM_power),
66 pTHatMin(_pTHatMin), pTHatMax(_pTHatMax)
69 yLabsigma = TF1(
"yLabsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
70 yCMsigma = TF1(
"yCMsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
77 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
80 if ((sigmaProcessPtr->nFinal() == 2)) {
81 double x1 = phaseSpacePtr->x1();
82 double x2 = phaseSpacePtr->x2();
83 double yLab = 0.5*
log(x1/x2);
84 double yCM = 0.5*
log( phaseSpacePtr->tHat() / phaseSpacePtr->uHat() );
85 double pTHat = phaseSpacePtr->pTHat();
86 double sigmaLab = yLabsigma.Eval(pTHat);
87 double sigmaCM = yCMsigma.Eval(pTHat);
89 selBias =
exp(
pow(fabs(yLab),yLab_power)/(2*sigmaLab*sigmaLab) +
90 pow(fabs(yCM),yCM_power)/(2*sigmaCM*sigmaCM) );
108 const std::string& _yCMsigma_func,
double _yCM_power,
109 double _pTHatMin,
double _pTHatMax,
110 double _pt = 15,
double _power = 4.5) :
111 yLabsigma_func(_yLabsigma_func), yCMsigma_func(_yCMsigma_func),
112 yLab_power(_yLab_power), yCM_power(_yCM_power),
113 pTHatMin(_pTHatMin), pTHatMax(_pTHatMax),
pt(_pt),
power(_power)
116 yLabsigma = TF1(
"yLabsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
117 yCMsigma = TF1(
"yCMsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
124 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
127 if ((sigmaProcessPtr->nFinal() == 2)) {
128 double x1 = phaseSpacePtr->x1();
129 double x2 = phaseSpacePtr->x2();
130 double yLab = 0.5*
log(x1/x2);
131 double yCM = 0.5*
log( phaseSpacePtr->tHat() / phaseSpacePtr->uHat() );
132 double pTHat = phaseSpacePtr->pTHat();
133 double sigmaLab = yLabsigma.Eval(pTHat);
134 double sigmaCM = yCMsigma.Eval(pTHat);
136 selBias =
pow(pTHat /
pt,
power) *
exp(
pow(fabs(yLab),yLab_power)/(2*sigmaLab*sigmaLab) +
137 pow(fabs(yCM),yCM_power)/(2*sigmaCM*sigmaCM) );
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)
virtual double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent)
virtual ~PtHatReweightUserHook()
std::function< double(double)> sigma
virtual bool canBiasSelection()
PtHatReweightUserHook(double _pt=15, double _power=4.5)
virtual double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent)
virtual ~PtHatEmpReweightUserHook()
std::string yLabsigma_func
virtual ~PtHatRapReweightUserHook()
std::string yLabsigma_func
virtual ~RapReweightUserHook()
virtual bool canBiasSelection()
virtual bool canBiasSelection()
RapReweightUserHook(const std::string &_yLabsigma_func, double _yLab_power, const std::string &_yCMsigma_func, double _yCM_power, double _pTHatMin, double _pTHatMax)
PtHatEmpReweightUserHook()
virtual double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent)
virtual bool canBiasSelection()
virtual double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent)
Power< A, B >::type pow(const A &a, const B &b)