File indexing completed on 2023-10-25 09:48:16
0001 #include "GeneratorInterface/ExhumeInterface/interface/TwoSpace.h"
0002 #include "CLHEP/Random/RandomEngine.h"
0003
0004 Exhume::TwoSpace::TwoSpace(const edm::ParameterSet& pset) : CrossSection(pset) {
0005 Partons.resize(2);
0006
0007 dirty_weighting = true;
0008 PhiMax = 0.0;
0009 PartonMass = 0.0;
0010 MaximumSubProcessValue = 0.0;
0011 SetMassAtThetaScan(2000);
0012 Fudge = 1.2;
0013 }
0014
0015 Exhume::TwoSpace::~TwoSpace() {}
0016
0017 int Exhume::TwoSpace::GetNumberOfSubParameters() { return (2); }
0018
0019 void Exhume::TwoSpace::SetSubParameters() {
0020 double cos_th = randomEngine->flat();
0021
0022 CosTheta = GetValue(cos_th);
0023 Phi = 2 * M_PI * randomEngine->flat();
0024
0025
0026 LIPS2Amp();
0027 }
0028
0029 void Exhume::TwoSpace::MaximiseSubParameters() {
0030 if (dirty_weighting == true) {
0031
0032 WeightInit(CosThetaMin, CosThetaMax);
0033 dirty_weighting = false;
0034 }
0035 CosTheta = MaximumSubProcessCosTheta;
0036
0037 Phi = PhiMax;
0038 LIPS2Amp();
0039 return;
0040 }
0041
0042 void Exhume::TwoSpace::SetPartons() {
0043 Amp2LIPS();
0044 double _SinTheta = sin(acos(CosTheta));
0045 double _E = 0.5 * SqrtsHat;
0046 double _Pmod = sqrt(_E * _E - PartonMass * PartonMass);
0047 double _Px = _Pmod * _SinTheta * cos(Phi);
0048 double _Py = _Pmod * _SinTheta * sin(Phi);
0049 double _Pz = _Pmod * CosTheta;
0050
0051 Partons[0].p.setPx(_Px);
0052 Partons[0].p.setPy(_Py);
0053 Partons[0].p.setPz(_Pz);
0054 Partons[0].p.setE(_E);
0055
0056 Partons[1].p.setPx(-_Px);
0057 Partons[1].p.setPy(-_Py);
0058 Partons[1].p.setPz(-_Pz);
0059 Partons[1].p.setE(_E);
0060
0061 Partons[0].p.boost(CentralVector.boostVector());
0062 Partons[1].p.boost(CentralVector.boostVector());
0063
0064 return;
0065 }
0066
0067 double Exhume::TwoSpace::SubParameterWeight() {
0068
0069 Amp2LIPS();
0070 double _SubWgt;
0071 _SubWgt = GetFunc(CosTheta);
0072
0073
0074 return (Fudge * _SubWgt / (MaximumSubProcessValue));
0075 }
0076
0077 double Exhume::TwoSpace::SubParameterRange() { return (Fudge * 2 * M_PI * TotalIntegral / MaximumSubProcessValue); }
0078
0079
0080
0081
0082
0083 double Exhume::TwoSpace::WeightFunc(const double& _CosTheta) {
0084
0085
0086 CosTheta = _CosTheta;
0087
0088 Phi = PhiMax;
0089
0090
0091
0092
0093
0094
0095
0096 double _SqrtsHat;
0097 if (PartonMass > 2.0) {
0098 _SqrtsHat = 2 * PartonMass + 0.001;
0099 } else {
0100 _SqrtsHat = sqrt(4 * PartonMass * PartonMass + 10.0);
0101 }
0102
0103 SetKinematics(_SqrtsHat, 0.0, 0.0, 0.0, 0.0, 0.0);
0104
0105 LIPS2Amp();
0106
0107 double _wgt = SubProcess();
0108
0109
0110
0111
0112 if (_wgt > MaximumSubProcessValue) {
0113 MaximumSubProcessCosTheta = _CosTheta;
0114 MaximumSubProcessValue = _wgt;
0115 std::cout << MaximumSubProcessCosTheta << std::endl;
0116 std::cout << MaximumSubProcessValue << std::endl;
0117 }
0118
0119 return (_wgt);
0120 }
0121
0122 void Exhume::TwoSpace::SetThetaMin(const double& ThetaMin_) {
0123 ThetaMin = ThetaMin_;
0124 ThetaMax = M_PI - ThetaMin_;
0125
0126 CosThetaMin = cos(ThetaMax);
0127 CosThetaMax = cos(ThetaMin);
0128 MaximumSubProcessCosTheta = CosThetaMax;
0129
0130
0131
0132 return;
0133 }
0134
0135