00001 #include <Pythia.h> 00002 00003 class PtHatReweightUserHook : public Pythia8::UserHooks 00004 { 00005 public: 00006 PtHatReweightUserHook(double _pt = 15, double _power = 4.5) : 00007 pt(_pt), power(_power) {} 00008 virtual ~PtHatReweightUserHook() {} 00009 00010 virtual bool canBiasSelection() { return true; } 00011 00012 virtual double biasSelectionBy(const Pythia8::SigmaProcess* sigmaProcessPtr, 00013 const Pythia8::PhaseSpace* phaseSpacePtr, bool inEvent) 00014 { 00015 //the variable selBias of the base class should be used; 00016 if ((sigmaProcessPtr->nFinal() == 2)) { 00017 selBias = pow(phaseSpacePtr->pTHat() / pt, power); 00018 return selBias; 00019 } 00020 selBias = 1.; 00021 return selBias; 00022 } 00023 00024 private: 00025 double pt, power; 00026 };