JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
MelaIO.h
Go to the documentation of this file.
1 #ifndef MELAINPUTOUTPUT_H
2 #define MELAINPUTOUTPUT_H
3 
4 #include "TMCFM.hh"
5 #include "MELACandidate.h"
6 
7 
8 class MelaIO{
9 protected:
10 
11  double partonWeight[2][nmsq];
12  double MEsq[nmsq][nmsq];
14  double sumME;
15  double MEConst;
16 
17  double Qren;
18  double Qfac;
19  double alphas_mz;
20  double alphas_Qren;
21 
23 
24  double VDau1coupl[2]; // L/R
25  double VDau2coupl[2]; // L/R
26 
27 public:
28 
29  MELACandidate* melaCand; // Persistent container of the four-vectors, not owned by MelaIO
30 
31  void reset(){
32  sumME=0;
33  MEConst=1;
34  for (int ix=0; ix<nmsq; ix++){
35  for (int pp=0; pp<2; pp++) partonWeight[pp][ix]=0;
36  for (int iy=0; iy<nmsq; iy++){
37  MEsq[ix][iy]=0;
38  weightedMEsq[ix][iy]=0;
39  }
40  }
41  Qren=0;
42  Qfac=0;
43  alphas_mz=0;
44  alphas_Qren=0;
45  for (unsigned int jh=0; jh<nSupportedHiggses; jh++){ for (unsigned int img=0; img<2; img++) MH_GaH[jh][img]=0; }
46  for (unsigned int ic=0; ic<2; ic++){
47  VDau1coupl[ic]=0;
48  VDau2coupl[ic]=0;
49  }
50  }
51  MelaIO* getRef(){ return this; }
52 
53  // ME-related I/O
55  double partonOneWeight_[nmsq],
56  double partonTwoWeight_[nmsq]
57  ){
58  for (int ix=0; ix<nmsq; ix++){
59  partonWeight[0][ix]=partonOneWeight_[ix];
60  partonWeight[1][ix]=partonTwoWeight_[ix];
61  }
62  }
63  void setMEArray(double MEsq_[nmsq][nmsq], bool transpose=false){
64  for (int ix=0; ix<nmsq; ix++){
65  for (int iy=0; iy<nmsq; iy++){
66  int jx=(transpose ? iy : ix);
67  int jy=(transpose ? ix : iy);
68  MEsq[ix][iy]=MEsq_[jx][jy];
69  }
70  }
71  }
72  void addMEArray(double MEsq_[nmsq][nmsq], double factor=1., bool transpose=false){
73  for (int ix=0; ix<nmsq; ix++){
74  for (int iy=0; iy<nmsq; iy++){
75  int jx=(transpose ? iy : ix);
76  int jy=(transpose ? ix : iy);
77  MEsq[ix][iy]+=MEsq_[jx][jy]*factor;
78  }
79  }
80  if (sumME!=0) computeWeightedMEArray();
81  }
82  void addMERecord(MelaIO* rcd, double factor=1., bool overwrite=false){
83  double MEsq_[nmsq][nmsq]={ { 0 } };
84  double partonOneWeight_[nmsq]={ 0 };
85  double partonTwoWeight_[nmsq]={ 0 };
86  rcd->getUnweightedMEArray(MEsq_);
87  rcd->getPartonWeights(partonOneWeight_, partonTwoWeight_);
88 
89  if (overwrite) reset();
90  setPartonWeights(partonOneWeight_, partonTwoWeight_);
91  addMEArray(MEsq_, factor);
92  }
93 
95  sumME=0;
96  for (int ix=0; ix<nmsq; ix++){
97  for (int iy=0; iy<nmsq; iy++){
98  weightedMEsq[ix][iy]=partonWeight[0][ix]*MEsq[ix][iy]*partonWeight[1][iy];
99  sumME += weightedMEsq[ix][iy];
100  }
101  }
102  }
103 
104  MelaIO(){ melaCand=0; reset(); }
105  virtual ~MelaIO(){};
106 
107  double getSumME()const{ return sumME; }
108  void setMEConst(const double& val){ MEConst=val; }
109  void setMEConst(const float& val){ MEConst=(double)val; }
110  double getMEConst()const{ return MEConst; }
111  void getWeightedMEArray(double MEsq_[nmsq][nmsq]){
112  for (int ix=0; ix<nmsq; ix++){
113  for (int iy=0; iy<nmsq; iy++) MEsq_[ix][iy] = weightedMEsq[ix][iy];
114  }
115  }
116  void getUnweightedMEArray(double MEsq_[nmsq][nmsq])const{
117  for (int ix=0; ix<nmsq; ix++){
118  for (int iy=0; iy<nmsq; iy++) MEsq_[ix][iy] = MEsq[ix][iy];
119  }
120  }
122  double partonOneWeight_[nmsq],
123  double partonTwoWeight_[nmsq]
124  )const{
125  for (int ix=0; ix<nmsq; ix++){
126  partonOneWeight_[ix] = partonWeight[0][ix];
127  partonTwoWeight_[ix] = partonWeight[1][ix];
128  }
129  }
130 
131 
132  // Scale-related I/O
133  void setRenormalizationScale(const double& val){ Qren=val; }
134  double getRenormalizationScale()const{ return Qren; }
135  void setFactorizationScale(const double& val){ Qfac=val; }
136  double getFactorizationScale()const{ return Qfac; }
137  void setAlphaS(const double& val){ alphas_Qren=val; }
138  double getAlphaS()const{ return alphas_Qren; }
139  void setAlphaSatMZ(const double& val){ alphas_mz=val; }
140  double getAlphaSatMZ()const{ return alphas_mz; }
141 
142  // Mass-related I/O
143  void setHiggsMassWidth(const double& mass_, const double& width_, int jh){ if (jh<nSupportedHiggses){ MH_GaH[jh][0]=mass_; MH_GaH[jh][1]=width_; } }
144  void getHiggsMassWidth(double& mass_, double& width_, int jh)const{ if (jh<nSupportedHiggses){ mass_=MH_GaH[jh][0]; width_=MH_GaH[jh][1]; } }
145 
146  // Z, W or gamma couplings to fermions
147  void setVDaughterCouplings(const double& left, const double& right, int iv){
148  if (iv==0){ VDau1coupl[0]=left; VDau1coupl[1]=right; }
149  else if (iv==1){ VDau2coupl[0]=left; VDau2coupl[1]=right; }
150  }
151  void getVDaughterCouplings(double& left, double& right, int iv)const{
152  if (iv==0){ left=VDau1coupl[0]; right=VDau1coupl[1]; }
153  else if (iv==1){ left=VDau2coupl[0]; right=VDau2coupl[1]; }
154  }
155 
156 };
157 
158 
159 #endif
MelaIO::setMEArray
void setMEArray(double MEsq_[nmsq][nmsq], bool transpose=false)
Definition: MelaIO.h:63
MelaIO::getRef
MelaIO * getRef()
Definition: MelaIO.h:51
TMCFM.hh
MelaIO::setFactorizationScale
void setFactorizationScale(const double &val)
Definition: MelaIO.h:135
MelaIO::getUnweightedMEArray
void getUnweightedMEArray(double MEsq_[nmsq][nmsq]) const
Definition: MelaIO.h:116
MelaIO
Definition: MelaIO.h:8
MelaIO::computeWeightedMEArray
void computeWeightedMEArray()
Definition: MelaIO.h:94
MelaIO::getSumME
double getSumME() const
Definition: MelaIO.h:107
MelaIO::setAlphaS
void setAlphaS(const double &val)
Definition: MelaIO.h:137
MelaIO::MEsq
double MEsq[nmsq][nmsq]
Definition: MelaIO.h:12
MelaIO::setAlphaSatMZ
void setAlphaSatMZ(const double &val)
Definition: MelaIO.h:139
MelaIO::reset
void reset()
Definition: MelaIO.h:31
MelaIO::VDau2coupl
double VDau2coupl[2]
Definition: MelaIO.h:25
MelaIO::Qfac
double Qfac
Definition: MelaIO.h:18
nmsq
@ nmsq
Definition: TMCFM.hh:24
MelaIO::~MelaIO
virtual ~MelaIO()
Definition: MelaIO.h:105
MelaIO::getVDaughterCouplings
void getVDaughterCouplings(double &left, double &right, int iv) const
Definition: MelaIO.h:151
MelaIO::setRenormalizationScale
void setRenormalizationScale(const double &val)
Definition: MelaIO.h:133
MelaIO::getMEConst
double getMEConst() const
Definition: MelaIO.h:110
MelaIO::setPartonWeights
void setPartonWeights(double partonOneWeight_[nmsq], double partonTwoWeight_[nmsq])
Definition: MelaIO.h:54
MelaIO::getRenormalizationScale
double getRenormalizationScale() const
Definition: MelaIO.h:134
MelaIO::sumME
double sumME
Definition: MelaIO.h:14
MelaIO::getAlphaSatMZ
double getAlphaSatMZ() const
Definition: MelaIO.h:140
MelaIO::setHiggsMassWidth
void setHiggsMassWidth(const double &mass_, const double &width_, int jh)
Definition: MelaIO.h:143
MelaIO::getFactorizationScale
double getFactorizationScale() const
Definition: MelaIO.h:136
MelaIO::addMEArray
void addMEArray(double MEsq_[nmsq][nmsq], double factor=1., bool transpose=false)
Definition: MelaIO.h:72
MelaIO::getAlphaS
double getAlphaS() const
Definition: MelaIO.h:138
MelaIO::getWeightedMEArray
void getWeightedMEArray(double MEsq_[nmsq][nmsq])
Definition: MelaIO.h:111
MelaIO::getHiggsMassWidth
void getHiggsMassWidth(double &mass_, double &width_, int jh) const
Definition: MelaIO.h:144
nSupportedHiggses
@ nSupportedHiggses
Definition: TMCFM.hh:15
MelaIO::alphas_Qren
double alphas_Qren
Definition: MelaIO.h:20
MelaIO::weightedMEsq
double weightedMEsq[nmsq][nmsq]
Definition: MelaIO.h:13
MELACandidate.h
MelaIO::setMEConst
void setMEConst(const double &val)
Definition: MelaIO.h:108
MelaIO::alphas_mz
double alphas_mz
Definition: MelaIO.h:19
MelaIO::addMERecord
void addMERecord(MelaIO *rcd, double factor=1., bool overwrite=false)
Definition: MelaIO.h:82
MelaIO::Qren
double Qren
Definition: MelaIO.h:17
MelaIO::MelaIO
MelaIO()
Definition: MelaIO.h:104
MelaIO::setMEConst
void setMEConst(const float &val)
Definition: MelaIO.h:109
MelaIO::getPartonWeights
void getPartonWeights(double partonOneWeight_[nmsq], double partonTwoWeight_[nmsq]) const
Definition: MelaIO.h:121
MelaIO::setVDaughterCouplings
void setVDaughterCouplings(const double &left, const double &right, int iv)
Definition: MelaIO.h:147
MELACandidate
Definition: MELACandidate.h:7
MelaIO::partonWeight
double partonWeight[2][nmsq]
Definition: MelaIO.h:11
MelaIO::MEConst
double MEConst
Definition: MelaIO.h:15
MelaIO::melaCand
MELACandidate * melaCand
Definition: MelaIO.h:29
MelaIO::MH_GaH
double MH_GaH[nSupportedHiggses][2]
Definition: MelaIO.h:22
MelaIO::VDau1coupl
double VDau1coupl[2]
Definition: MelaIO.h:24