CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ReweightUserHooks.h
Go to the documentation of this file.
1 #include <Pythia.h>
2 
3 class PtHatReweightUserHook : public Pythia8::UserHooks
4 {
5  public:
6  PtHatReweightUserHook(double _pt = 15, double _power = 4.5) :
7  pt(_pt), power(_power) {}
8  virtual ~PtHatReweightUserHook() {}
9 
10  virtual bool canBiasSelection() { return true; }
11 
12  virtual double biasSelectionBy(const Pythia8::SigmaProcess* sigmaProcessPtr,
13  const Pythia8::PhaseSpace* phaseSpacePtr, bool inEvent)
14  {
15  //the variable selBias of the base class should be used;
16  if ((sigmaProcessPtr->nFinal() == 2)) {
17  selBias = pow(phaseSpacePtr->pTHat() / pt, power);
18  return selBias;
19  }
20  selBias = 1.;
21  return selBias;
22  }
23 
24  private:
25  double pt, power;
26 };
virtual ~PtHatReweightUserHook()
PtHatReweightUserHook(double _pt=15, double _power=4.5)
virtual double biasSelectionBy(const Pythia8::SigmaProcess *sigmaProcessPtr, const Pythia8::PhaseSpace *phaseSpacePtr, bool inEvent)
virtual bool canBiasSelection()
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40