JHUGen MELA  v2.4.1
Matrix element calculations as used in JHUGen. MELA is an important tool that was used for the Higgs boson discovery and for precise measurements of its structure and interactions. Please see the website https://spin.pha.jhu.edu/ and papers cited there for more details, and kindly cite those papers when using this code.
TensorPdfFactory.cc
Go to the documentation of this file.
1 #include "TensorPdfFactory.h"
2 
3 
4 using namespace std;
5 using namespace MELAStreamHelpers;
6 
7 
8 TensorPdfFactory::TensorPdfFactory(RooSpin::modelMeasurables const& measurables_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) :
9 SpinPdfFactory(measurables_, V1decay_, V2decay_, OnshellH_)
10 {
11  initGVals();
12 }
13 
15  destroyGVals();
16 }
18  couplings.Lambda = new RooRealVar("Lambda", "Lambda", 1000.);
19 
20  for (int v=0; v<(int)SIZE_GVV; v++){
21  for (int im=0; im<2; im++){
22  TString strcore;
23  double initval = 0;
24  TString strapp = "Val";
25  if (im==1) strapp.Append("Im");
26  strapp.Prepend(Form("%i", v+1));
27 
28  strcore = "g";
29  strcore.Append(strapp);
30  RooRealVar* gVal = new RooRealVar(strcore, strcore, initval, -1e15, 1e15);
31  gVal->removeMin();
32  gVal->removeMax();
33  couplings.bList[v][im] = (RooAbsReal*)gVal;
34  }
35  }
36 
37  for (int f=0; f<2; f++){
38  TString strcore = Form("f_spinz%i", f+1);
39  RooRealVar* fVal = new RooRealVar(strcore, strcore, 0., 0., 1.);
40  if (f==0) couplings.f_spinz1 = (RooRealVar*)fVal;
41  else couplings.f_spinz2 = (RooRealVar*)fVal;
42  }
43 }
45  for (int v=0; v<(int)SIZE_GVV; v++){
46  for (int im=0; im<2; im++){
47  delete couplings.bList[v][im];
48  }
49  }
50  delete couplings.Lambda;
51 
52  delete couplings.f_spinz1;
53  delete couplings.f_spinz2;
54 }
55 
56 void TensorPdfFactory::addHypothesis(int ig, double initval, double iphase){
57  if (ig>=(int)SIZE_GVV || ig<0) MELAerr << "Invalid g" << ig << endl;
58  else{
59  ((RooRealVar*)couplings.bList[ig][0])->setVal(initval*cos(iphase));
60  ((RooRealVar*)couplings.bList[ig][1])->setVal(initval*sin(iphase));
61  }
62 }
63 void TensorPdfFactory::setTensorPolarization(int ig, double initval){
64  if (ig>2 || ig<=0) MELAerr << "Cannot set f_spinz" << ig << ". Please st f_spinz1 or f_spinz2 only." << endl;
65  else{
66  if (ig==1) ((RooRealVar*)couplings.f_spinz1)->setVal(initval);
67  else ((RooRealVar*)couplings.f_spinz2)->setVal(initval);
68  }
69 }
71  for (int ig=0; ig<(int)SIZE_GVV; ig++){
72  for (int im=0; im<2; im++) ((RooRealVar*)couplings.bList[ig][im])->setVal(0.);
73  }
74  ((RooRealVar*)couplings.f_spinz1)->setVal(0.);
75  ((RooRealVar*)couplings.f_spinz2)->setVal(0.);
76 }
77 
79  couplings.Lambda->setConstant(true); // The user is not allowed to change this value!
80 
81  // Set fqq, fz2
82  couplings.f_spinz1->setConstant(yesNo);
83  couplings.f_spinz2->setConstant(yesNo);
84 
85  // Set the b decay couplings
86  for (int ig=0; ig<(int)SIZE_GVV; ig++){
87  for (int im=0; im<2; im++){
88  if (dynamic_cast<RooRealVar*>(couplings.bList[ig][im])!=0) ((RooRealVar*)couplings.bList[ig][im])->setConstant(yesNo);
89  }
90  }
91 }
TensorPdfFactory::couplings
RooSpinTwo::modelCouplings couplings
Definition: TensorPdfFactory.h:12
TensorPdfFactory::~TensorPdfFactory
virtual ~TensorPdfFactory()
Definition: TensorPdfFactory.cc:14
RooSpinTwo::modelCouplings::Lambda
RooRealVar * Lambda
Definition: RooSpinTwo.h:12
SIZE_GVV
@ SIZE_GVV
Definition: raw_couplings.txt:158
TensorPdfFactory::resetHypotheses
virtual void resetHypotheses()
Definition: TensorPdfFactory.cc:70
TensorPdfFactory::setTensorPolarization
virtual void setTensorPolarization(int ig, double initval)
Definition: TensorPdfFactory.cc:63
RooSpinTwo::modelCouplings::f_spinz1
RooRealVar * f_spinz1
Definition: RooSpinTwo.h:13
TensorPdfFactory::initGVals
virtual void initGVals()
Definition: TensorPdfFactory.cc:17
SpinPdfFactory
Definition: SpinPdfFactory.h:9
TensorPdfFactory::addHypothesis
virtual void addHypothesis(int ig, double initval, double iphase=0)
Definition: TensorPdfFactory.cc:56
RooSpinTwo::modelCouplings::f_spinz2
RooRealVar * f_spinz2
Definition: RooSpinTwo.h:14
testME_all.int
int
Definition: testME_all.py:13
TensorPdfFactory::destroyGVals
virtual void destroyGVals()
Definition: TensorPdfFactory.cc:44
MELAStreamHelpers::MELAerr
MELAOutputStreamer MELAerr
MELAStreamHelpers
Definition: MELAStreamHelpers.hh:7
globalc::f
double complex, dimension(2) f
Definition: reductionC.F90:50
RooSpin::modelMeasurables
Definition: RooSpin.h:50
TensorPdfFactory.h
TensorPdfFactory::makeCouplingsConst
virtual void makeCouplingsConst(bool yesNo=true)
Definition: TensorPdfFactory.cc:78
RooSpinTwo::modelCouplings::bList
RooAbsReal * bList[SIZE_GVV][2]
Definition: RooSpinTwo.h:11
RooSpin::VdecayType
VdecayType
Definition: RooSpin.h:28
TensorPdfFactory::TensorPdfFactory
TensorPdfFactory(RooSpin::modelMeasurables const &measurables_, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true)
Definition: TensorPdfFactory.cc:8