ATLAS Offline Software
WprimeFlat.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "UserSetting.h"
7 #include "Pythia8/PhaseSpace.h"
8 
9 #include <stdexcept>
10 
11 namespace Pythia8{
12  class WprimeFlat;
13 }
14 
16 
17 namespace Pythia8 {
18 
19  class WprimeFlat : public UserHooks {
20 
21  public:
22 
23  // Constructor.
24  WprimeFlat(): m_energyMode("WprimeFlat:EnergyMode", 8){}
25 
26  // Destructor.
28 
29  // Allow process cross section to be modified...
30  virtual bool canModifySigma() {return true;}
31 
32  // ...which gives access to the event at the trial level, before selection.
33  virtual double multiplySigmaBy(const SigmaProcess* sigmaProcessPtr,
34  const PhaseSpace* phaseSpacePtr,
35  bool /* inEvent */) {
36  // All events should be 2 -> 1, but kill them if not.
37  if (sigmaProcessPtr->nFinal() != 1) return 0.;
38 
39  // Weight cross section with BW propagator, i.e. to remove it.
40  // (inEvent = false for initialization).
41  // No inEvent criteria, want weight both for cross section
42  // and MC generation.
43  int idRes = sigmaProcessPtr->resonanceA();
44  double mRes = particleDataPtr->m0(idRes);
45  double wRes = particleDataPtr->mWidth(idRes);
46  double m2Res = mRes*mRes;
47  double GamMRat = wRes/mRes;
48  double sHat = phaseSpacePtr->sHat();
49  double weightBW = pow2(sHat - m2Res) + pow2(sHat * GamMRat);
50  double m = std::sqrt(sHat)/((double)m_energyMode(settingsPtr)*1000.0);
51 
52  switch(m_energyMode(settingsPtr)){
53  case 8:
54  if(m < 0.0375){
55  weightBW *= 121.88e-12*std::exp(13.0*m);
56  }else{
57  weightBW *= 1.0e-12*std::exp(18.5*m-1.4*std::log(m));
58  }
59 
60  break;
61 
62  case 13:
63  if(m < 0.023){
64  weightBW *= 102.77e-12*std::exp(11.5*m);
65  }else if(m < 0.231){
66  weightBW *= 1.0e-12*std::exp(16.1*m-1.2*std::log(m));
67  }else{
68  weightBW *= 1.8675e-16*std::exp(31.7*m-4.6*std::log(m));
69  }
70  break;
71 
72  default:
73  throw std::runtime_error("Unknown WprimeFlat:EnergyMode - should be either 8 or 13!");
74 
75  }
76 
77  return weightBW;
78  }
79 
80  private:
81 
84 
85  };
86 
87 } // end namespace Pythia8
88 
89 
Pythia8::WprimeFlat::canModifySigma
virtual bool canModifySigma()
Definition: WprimeFlat.cxx:30
python.SystemOfUnits.m
int m
Definition: SystemOfUnits.py:91
Pythia8::WprimeFlat::m_energyMode
Pythia8_UserHooks::UserSetting< int > m_energyMode
User-settable mode to set the collision energy (default is 8)
Definition: WprimeFlat.cxx:83
Pythia8_UserHooks::UserHooksFactory::Creator
Definition: UserHooksFactory.h:54
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
Pythia8::WprimeFlat::multiplySigmaBy
virtual double multiplySigmaBy(const SigmaProcess *sigmaProcessPtr, const PhaseSpace *phaseSpacePtr, bool)
Definition: WprimeFlat.cxx:33
UserHooksFactory.h
Pythia8
Author: James Monk (jmonk@cern.ch)
Definition: IPythia8Custom.h:13
Pythia8_UserHooks::UserSetting< int >
UserSetting.h
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
Pythia8::WprimeFlat
Definition: WprimeFlat.cxx:19
Pythia8::WprimeFlat::WprimeFlat
WprimeFlat()
Definition: WprimeFlat.cxx:24
python.CaloCondTools.log
log
Definition: CaloCondTools.py:20
WprimeFlatCreator
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::WprimeFlat > WprimeFlatCreator("WprimeFlat")
Pythia8::WprimeFlat::~WprimeFlat
~WprimeFlat()
Definition: WprimeFlat.cxx:27