JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
SpinPdfFactory.cc
Go to the documentation of this file.
1 #include "SpinPdfFactory.h"
2 
3 
4 using namespace std;
5 using namespace MELAStreamHelpers;
6 
7 
8 SpinPdfFactory::SpinPdfFactory(RooSpin::modelMeasurables const& measurables_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) :
9 V1decay(V1decay_),
10 V2decay(V2decay_),
11 OnshellH(OnshellH_)
12 {
13  initMeasurables(measurables_);
14  initMassPole();
16 }
17 
21 }
23  measurables.h1 = (RooAbsReal*)measurables_.h1;
24  measurables.h2 = (RooAbsReal*)measurables_.h2;
25  measurables.Phi = (RooAbsReal*)measurables_.Phi;
26  measurables.m1 = (RooAbsReal*)measurables_.m1;
27  measurables.m2 = (RooAbsReal*)measurables_.m2;
28  measurables.m12 = (RooAbsReal*)measurables_.m12;
29  measurables.hs = (RooAbsReal*)measurables_.hs;
30  measurables.Phi1 = (RooAbsReal*)measurables_.Phi1;
31  measurables.Y = (RooAbsReal*)measurables_.Y;
32 }
34  if (!OnshellH) parameters.mX = new RooRealVar("mX", "mX", (measurables.m12)->getVal());
36  parameters.gamX = new RooRealVar("gamX", "gamX", 0);
37 }
38 void SpinPdfFactory::resetHiggsMassWidth(Double_t mXval, Double_t gamXval){
39  if (!OnshellH){
40  if (dynamic_cast<RooRealVar*>(parameters.mX)!=0){ ((RooRealVar*)parameters.mX)->removeMin(); ((RooRealVar*)parameters.mX)->removeMax(); ((RooRealVar*)parameters.mX)->setConstant(false); ((RooRealVar*)parameters.mX)->setVal(mXval); ((RooRealVar*)parameters.mX)->setRange(mXval, mXval); ((RooRealVar*)parameters.mX)->setConstant(true); }
41  if (dynamic_cast<RooRealVar*>(parameters.gamX)!=0){ ((RooRealVar*)parameters.gamX)->removeMin(); ((RooRealVar*)parameters.gamX)->removeMax(); ((RooRealVar*)parameters.gamX)->setConstant(false); ((RooRealVar*)parameters.gamX)->setVal(gamXval); ((RooRealVar*)parameters.gamX)->setRange(gamXval, gamXval); ((RooRealVar*)parameters.gamX)->setConstant(true); }
42  }
43  else MELAerr << "SpinPdfFactory::resetHiggsMassWidth: Higgs mass is already determined by the virtuality with zero width. Cannot set Higgs mass or width" << endl;
44 }
46  if ((((int)V1decay)>0 && ((int)V2decay)<0) || (((int)V1decay)<0 && ((int)V2decay)>0)) MELAerr << "SpinPdfFactory::initVdecayParams: V1 and V2 decays are inconsistent!" << endl;
47 
48  const Double_t GfVal = 1.16639e-5;
49  const Double_t vevVal = 1./sqrt(GfVal*sqrt(2.));
50 
51  parameters.mW = new RooRealVar("mW", "mW", 80.399);
52  parameters.gamW = new RooRealVar("gamW", "gamW", 2.085);
53  parameters.mZ = new RooRealVar("mZ", "mZ", 91.1876);
54  parameters.gamZ = new RooRealVar("gamZ", "gamZ", 2.4952);
55  parameters.mWprime = new RooRealVar("mWprime", "mWprime", 0);
56  parameters.gamWprime = new RooRealVar("gamWprime", "gamWprime", -1); // Turns off Wprime
57  parameters.mZprime = new RooRealVar("mZprime", "mZprime", 0);
58  parameters.gamZprime = new RooRealVar("gamZprime", "gamZprime", -1); // Turns off Zprime
59  parameters.Sin2ThetaW = new RooRealVar("Sin2ThetaW", "Sin2ThetaW", 0.23119);
60  parameters.vev = new RooRealVar("vev", "vev", vevVal);
61  parameters.gVprimeff_decay1_left = new RooRealVar("gVprimeff_decay1_left", "gVprimeff_decay1_left", 0);
62  parameters.gVprimeff_decay1_right = new RooRealVar("gVprimeff_decay1_right", "gVprimeff_decay1_right", 0);
63  parameters.gVprimeff_decay2_left = new RooRealVar("gVprimeff_decay2_left", "gVprimeff_decay2_left", 0);
64  parameters.gVprimeff_decay2_right = new RooRealVar("gVprimeff_decay2_right", "gVprimeff_decay2_right", 0);
65 }
66 void SpinPdfFactory::resetVdecayParams(Double_t mWval, Double_t gamWval, Double_t mZval, Double_t gamZval, Double_t Sin2ThetaWval, Double_t vevval){
67  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.mW), mWval);
68  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gamW), gamWval);
69  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.mZ), mZval);
70  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gamZ), gamZval);
71  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.Sin2ThetaW), Sin2ThetaWval);
72  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.vev), vevval);
73 }
74 void SpinPdfFactory::resetVprimeffCouplings(Double_t gVprimeff_decay1[2], Double_t gVprimeff_decay2[2]){
75  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gVprimeff_decay1_left), gVprimeff_decay1[0]);
76  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gVprimeff_decay1_right), gVprimeff_decay1[1]);
77  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gVprimeff_decay2_left), gVprimeff_decay2[0]);
78  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gVprimeff_decay2_right), gVprimeff_decay2[1]);
79 }
80 void SpinPdfFactory::resetVprimeMasses(Double_t mWval, Double_t gamWval, Double_t mZval, Double_t gamZval){
81  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.mWprime), mWval);
82  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gamWprime), gamWval);
83  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.mZprime), mZval);
84  SpinPdfFactory::setVariableValue(dynamic_cast<RooRealVar*>(parameters.gamZprime), gamZval);
85 }
86 void SpinPdfFactory::getMVGamV(Double_t* mV, Double_t* gamV)const{
88  if (mV!=0) (*mV)=(parameters.mW)->getVal();
89  if (gamV!=0) (*gamV)=(parameters.gamW)->getVal();
90  }
92  if (mV!=0) (*mV)=(parameters.mZ)->getVal();
93  if (gamV!=0) (*gamV)=(parameters.gamZ)->getVal();
94  }
95  else{
96  if (mV!=0) (*mV)=0;
97  if (gamV!=0) (*gamV)=0;
98  }
99 }
100 void SpinPdfFactory::getMVprimeGamVprime(Double_t* mV, Double_t* gamV)const{
102  if (mV!=0) (*mV)=(parameters.mWprime)->getVal();
103  if (gamV!=0) (*gamV)=(parameters.gamWprime)->getVal();
104  }
106  if (mV!=0) (*mV)=(parameters.mZprime)->getVal();
107  if (gamV!=0) (*gamV)=(parameters.gamZprime)->getVal();
108  }
109  else{
110  if (mV!=0) (*mV)=0;
111  if (gamV!=0) (*gamV)=0;
112  }
113 }
115  if ((((int)V1decay)>0 && ((int)V2decay)<0) || (((int)V1decay)<0 && ((int)V2decay)>0)) MELAerr << "SpinPdfFactory::resetVdecay: V1 and V2 decays are inconsistent!" << endl;
116 
117  V1decay=V1decay_;
118  V2decay=V2decay_;
120 }
121 
123  delete parameters.gamX;
124  if (!OnshellH) delete parameters.mX;
125 }
131  delete parameters.vev;
132  delete parameters.Sin2ThetaW;
133  delete parameters.gamZ;
134  delete parameters.mZ;
135  delete parameters.gamW;
136  delete parameters.mW;
137  delete parameters.gamZprime;
138  delete parameters.mZprime;
139  delete parameters.gamWprime;
140  delete parameters.mWprime;
141 }
142 
143 void SpinPdfFactory::setVariableValue(RooRealVar* var, Double_t val){
144  if (var){
145  var->removeMin();
146  var->removeMax();
147  var->setConstant(false);
148  var->setVal(val);
149  var->setRange(val, val);
150  var->setConstant(true);
151  }
152 }
153 
155  ((RooRealVar*) parameters.mX)->setConstant(yesNo);
156  ((RooRealVar*) parameters.gamX)->setConstant(yesNo);
157  ((RooRealVar*) parameters.mW)->setConstant(yesNo);
158  ((RooRealVar*) parameters.gamW)->setConstant(yesNo);
159  ((RooRealVar*) parameters.mZ)->setConstant(yesNo);
160  ((RooRealVar*) parameters.gamZ)->setConstant(yesNo);
161  ((RooRealVar*) parameters.mWprime)->setConstant(yesNo);
162  ((RooRealVar*) parameters.gamWprime)->setConstant(yesNo);
163  ((RooRealVar*) parameters.mZprime)->setConstant(yesNo);
164  ((RooRealVar*) parameters.gamZprime)->setConstant(yesNo);
165  ((RooRealVar*) parameters.Sin2ThetaW)->setConstant(yesNo);
166  ((RooRealVar*) parameters.vev)->setConstant(yesNo);
167  ((RooRealVar*) parameters.gVprimeff_decay1_left)->setConstant(yesNo);
168  ((RooRealVar*) parameters.gVprimeff_decay1_right)->setConstant(yesNo);
169  ((RooRealVar*) parameters.gVprimeff_decay2_left)->setConstant(yesNo);
170  ((RooRealVar*) parameters.gVprimeff_decay2_right)->setConstant(yesNo);
171 }
172 
RooSpin::modelMeasurables::h2
RooAbsReal * h2
Definition: RooSpin.h:52
SpinPdfFactory::getMVprimeGamVprime
virtual void getMVprimeGamVprime(Double_t *mV=0, Double_t *gamV=0) const
Definition: SpinPdfFactory.cc:100
RooSpin::modelParameters::gamW
RooAbsReal * gamW
Definition: RooSpin.h:65
SpinPdfFactory::setVerbosity
void setVerbosity(TVar::VerbosityLevel verbosity)
Definition: SpinPdfFactory.cc:173
RooSpin::setVerbosity
void setVerbosity(TVar::VerbosityLevel verbosity_)
Definition: RooSpin.cc:376
RooSpin::modelMeasurables::Y
RooAbsReal * Y
Definition: RooSpin.h:59
SpinPdfFactory::setVariableValue
static void setVariableValue(RooRealVar *var, Double_t val)
Definition: SpinPdfFactory.cc:143
TVar::VerbosityLevel
VerbosityLevel
Definition: TVar.hh:47
RooSpin::modelParameters::gamZ
RooAbsReal * gamZ
Definition: RooSpin.h:67
SpinPdfFactory::PDF_base
RooSpin * PDF_base
Definition: SpinPdfFactory.h:43
SpinPdfFactory::resetVprimeMasses
virtual void resetVprimeMasses(Double_t mWval, Double_t gamWval, Double_t mZval, Double_t gamZval)
Definition: SpinPdfFactory.cc:80
RooSpin::modelMeasurables::Phi1
RooAbsReal * Phi1
Definition: RooSpin.h:55
SpinPdfFactory::~SpinPdfFactory
virtual ~SpinPdfFactory()
Definition: SpinPdfFactory.cc:18
SpinPdfFactory::V1decay
RooSpin::VdecayType V1decay
Definition: SpinPdfFactory.h:38
RooSpin::modelParameters::mZ
RooAbsReal * mZ
Definition: RooSpin.h:66
RooSpin::modelMeasurables::m12
RooAbsReal * m12
Definition: RooSpin.h:58
SpinPdfFactory::SpinPdfFactory
SpinPdfFactory(RooSpin::modelMeasurables const &measurables_, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true)
Definition: SpinPdfFactory.cc:8
RooSpin::modelMeasurables::m1
RooAbsReal * m1
Definition: RooSpin.h:56
RooSpin::modelParameters::gamZprime
RooAbsReal * gamZprime
Definition: RooSpin.h:71
SpinPdfFactory.h
RooSpin::modelParameters::gamWprime
RooAbsReal * gamWprime
Definition: RooSpin.h:69
RooSpin::modelParameters::mW
RooAbsReal * mW
Definition: RooSpin.h:64
RooSpin::modelParameters::mWprime
RooAbsReal * mWprime
Definition: RooSpin.h:68
SpinPdfFactory::resetVprimeffCouplings
virtual void resetVprimeffCouplings(Double_t gVprimeff_decay1[2], Double_t gVprimeff_decay2[2])
Definition: SpinPdfFactory.cc:74
SpinPdfFactory::parameters
RooSpin::modelParameters parameters
Definition: SpinPdfFactory.h:12
SpinPdfFactory::V2decay
RooSpin::VdecayType V2decay
Definition: SpinPdfFactory.h:39
SpinPdfFactory::getMVGamV
virtual void getMVGamV(Double_t *mV=0, Double_t *gamV=0) const
Definition: SpinPdfFactory.cc:86
RooSpin::modelParameters::gVprimeff_decay1_right
RooAbsReal * gVprimeff_decay1_right
Definition: RooSpin.h:75
SpinPdfFactory::resetVdecayParams
virtual void resetVdecayParams(Double_t mWval, Double_t gamWval, Double_t mZval, Double_t gamZval, Double_t Sin2ThetaWval, Double_t vevval)
Definition: SpinPdfFactory.cc:66
RooSpin::kVdecayType_GammaOnshell
@ kVdecayType_GammaOnshell
Definition: RooSpin.h:30
RooSpin::modelParameters::gVprimeff_decay2_right
RooAbsReal * gVprimeff_decay2_right
Definition: RooSpin.h:77
RooSpin::modelMeasurables::Phi
RooAbsReal * Phi
Definition: RooSpin.h:54
RooSpin::modelParameters::mX
RooAbsReal * mX
Definition: RooSpin.h:62
SpinPdfFactory::OnshellH
Bool_t OnshellH
Definition: SpinPdfFactory.h:41
RooSpin::modelMeasurables::m2
RooAbsReal * m2
Definition: RooSpin.h:57
RooSpin::modelMeasurables::h1
RooAbsReal * h1
Definition: RooSpin.h:51
RooSpin::modelParameters::mZprime
RooAbsReal * mZprime
Definition: RooSpin.h:70
RooSpin::modelParameters::vev
RooAbsReal * vev
Definition: RooSpin.h:73
RooSpin::modelParameters::gamX
RooAbsReal * gamX
Definition: RooSpin.h:63
SpinPdfFactory::makeParamsConst
virtual void makeParamsConst(bool yesNo)
Definition: SpinPdfFactory.cc:154
MELAStreamHelpers::MELAerr
MELAOutputStreamer MELAerr
RooSpin::modelParameters::Sin2ThetaW
RooAbsReal * Sin2ThetaW
Definition: RooSpin.h:72
SpinPdfFactory::destroyMassPole
virtual void destroyMassPole()
Definition: SpinPdfFactory.cc:122
SpinPdfFactory::initMassPole
virtual void initMassPole()
Definition: SpinPdfFactory.cc:33
SpinPdfFactory::initVdecayParams
virtual void initVdecayParams()
Definition: SpinPdfFactory.cc:45
SpinPdfFactory::resetVdecay
virtual void resetVdecay(RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_)
Definition: SpinPdfFactory.cc:114
MELAStreamHelpers
Definition: MELAStreamHelpers.hh:7
RooSpin::modelParameters::gVprimeff_decay2_left
RooAbsReal * gVprimeff_decay2_left
Definition: RooSpin.h:76
SpinPdfFactory::resetHiggsMassWidth
virtual void resetHiggsMassWidth(Double_t mXval, Double_t gamXval=0.)
Definition: SpinPdfFactory.cc:38
RooSpin::modelParameters::gVprimeff_decay1_left
RooAbsReal * gVprimeff_decay1_left
Definition: RooSpin.h:74
RooSpin::setDecayModes
virtual void setDecayModes(RooSpin::VdecayType Vdecay1_, RooSpin::VdecayType Vdecay2_)
Definition: RooSpin.h:98
SpinPdfFactory::destroyVdecayParams
virtual void destroyVdecayParams()
Definition: SpinPdfFactory.cc:126
RooSpin::kVdecayType_Wany
@ kVdecayType_Wany
Definition: RooSpin.h:29
RooSpin::modelMeasurables
Definition: RooSpin.h:50
SpinPdfFactory::measurables
RooSpin::modelMeasurables measurables
Definition: SpinPdfFactory.h:11
SpinPdfFactory::initMeasurables
virtual void initMeasurables(RooSpin::modelMeasurables const &measurables_)
Definition: SpinPdfFactory.cc:22
RooSpin::modelMeasurables::hs
RooAbsReal * hs
Definition: RooSpin.h:53
RooSpin::VdecayType
VdecayType
Definition: RooSpin.h:28