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 const std::string& _yCMsigma_func,
double _yCM_power,
35 double _pTHatMin,
double _pTHatMax) :
36 yLabsigma_func(_yLabsigma_func), yCMsigma_func(_yCMsigma_func),
37 yLab_power(_yLab_power), yCM_power(_yCM_power),
38 pTHatMin(_pTHatMin), pTHatMax(_pTHatMax)
41 yLabsigma = TF1(
"yLabsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
42 yCMsigma = TF1(
"yCMsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
49 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
52 if ((sigmaProcessPtr->nFinal() == 2)) {
53 double x1 = phaseSpacePtr->x1();
54 double x2 = phaseSpacePtr->x2();
55 double yLab = 0.5*
log(x1/x2);
56 double yCM = 0.5*
log( phaseSpacePtr->tHat() / phaseSpacePtr->uHat() );
57 double pTHat = phaseSpacePtr->pTHat();
58 double sigmaLab = yLabsigma.Eval(pTHat);
59 double sigmaCM = yCMsigma.Eval(pTHat);
61 selBias =
exp(
pow(fabs(yLab),yLab_power)/(2*sigmaLab*sigmaLab) +
62 pow(fabs(yCM),yCM_power)/(2*sigmaCM*sigmaCM) );
80 const std::string& _yCMsigma_func,
double _yCM_power,
81 double _pTHatMin,
double _pTHatMax,
82 double _pt = 15,
double _power = 4.5) :
83 yLabsigma_func(_yLabsigma_func), yCMsigma_func(_yCMsigma_func),
84 yLab_power(_yLab_power), yCM_power(_yCM_power),
85 pTHatMin(_pTHatMin), pTHatMax(_pTHatMax),
pt(_pt),
power(_power)
88 yLabsigma = TF1(
"yLabsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
89 yCMsigma = TF1(
"yCMsigma", yLabsigma_func.c_str(), pTHatMin, pTHatMax);
96 const Pythia8::PhaseSpace* phaseSpacePtr,
bool inEvent)
99 if ((sigmaProcessPtr->nFinal() == 2)) {
100 double x1 = phaseSpacePtr->x1();
101 double x2 = phaseSpacePtr->x2();
102 double yLab = 0.5*
log(x1/x2);
103 double yCM = 0.5*
log( phaseSpacePtr->tHat() / phaseSpacePtr->uHat() );
104 double pTHat = phaseSpacePtr->pTHat();
105 double sigmaLab = yLabsigma.Eval(pTHat);
106 double sigmaCM = yCMsigma.Eval(pTHat);
108 selBias =
pow(pTHat /
pt,
power) *
exp(
pow(fabs(yLab),yLab_power)/(2*sigmaLab*sigmaLab) +
109 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()
virtual bool canBiasSelection()
PtHatReweightUserHook(double _pt=15, double _power=4.5)
virtual double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent)
std::string yLabsigma_func
virtual ~PtHatRapReweightUserHook()
std::string yLabsigma_func
virtual ~RapReweightUserHook()
virtual bool canBiasSelection()
RapReweightUserHook(const std::string &_yLabsigma_func, double _yLab_power, const std::string &_yCMsigma_func, double _yCM_power, double _pTHatMin, double _pTHatMax)
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)