ATLAS Offline Software
Loading...
Searching...
No Matches
mHatReweight.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "UserSetting.h"
7#include "Pythia8/PhaseSpace.h"
8
9#include <stdexcept>
10
11namespace Pythia8{
12 class mHatReweight;
13}
14
16
17namespace Pythia8 {
18
19 class mHatReweight : public UserHooks {
20
21 public:
22
23 // Constructor
25 : m_slope("mHatReweight:Slope", 1)
26 , m_mHatConstMin("mHatReweight:mHatConstMin", 1500)
27 , m_p1("mHatReweight:p1", -3.872)
28 , m_p2("mHatReweight:p2", 15.606)
29 {
30 std::cout<<"*************************************************************"<<std::endl;
31 std::cout<<"* *"<<std::endl;
32 std::cout<<"* Populating high-mass events with mHatReweight UserHook! *"<<std::endl;
33 std::cout<<"* *"<<std::endl;
34 std::cout<<"*************************************************************"<<std::endl;
35 }
36
37 // Allow process cross section to be modified...
38 virtual bool canModifySigma() {return true;}
39
40 // ...which gives access to the event at the trial level, before selection.
41 virtual double multiplySigmaBy(const SigmaProcess* sigmaProcessPtr,
42 const PhaseSpace* phaseSpacePtr,
43 bool /* inEvent */) {
44 // All events should be 2 -> 1, but kill them if not.
45 if (sigmaProcessPtr->nFinal() != 1) return 0.;
46 // config
47 double slope = m_slope(settingsPtr);
48 double mHatConstMin = m_mHatConstMin(settingsPtr);
49 double p1 = m_p1(settingsPtr);
50 double p2 = m_p2(settingsPtr);
51 // event kinematics
52 double mHat = std::sqrt(phaseSpacePtr->sHat());
53 double ecm = phaseSpacePtr->ecm();
54
55 // scale factor
56 double scale = 0.0;
57 // low-mass slope modification
58 if( mHat < mHatConstMin ){
59 scale = std::pow(mHat/ecm, slope);
60 }
61 // const high-mass
62 else {
63 double xsec = std::pow(mHat/ecm, p1) * std::pow(1 - mHat/ecm, p2);
64 double xsecMin = std::pow(mHatConstMin/ecm, p1) * std::pow(1 - mHatConstMin/ecm, p2);
65 scale = std::pow(mHatConstMin/ecm, slope) * xsecMin / xsec;
66 }
67 return scale;
68 }
69
70 private:
71 // User-settable slope for power-law scaling (s^m)
76 };
77
78} // end namespace Pythia8
79
80
Pythia8_UserHooks::UserSetting< double > m_mHatConstMin
Pythia8_UserHooks::UserSetting< double > m_p1
virtual double multiplySigmaBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool)
virtual bool canModifySigma()
Pythia8_UserHooks::UserSetting< double > m_p2
Pythia8_UserHooks::UserSetting< double > m_slope
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::mHatReweight > mHatReweightCreator("mHatReweight")
Author: James Monk (jmonk@cern.ch)