JHUGen MELA  JHUGen v7.5.6, MELA v2.4.2
Matrix element calculations as used in JHUGen.
RooSpin.h
Go to the documentation of this file.
1 #ifndef ROOSPIN
2 #define ROOSPIN
3 
4 #include <cmath>
5 #include <vector>
6 #include "TVar.hh"
7 #include "RooAbsPdf.h"
8 #include "RooRealProxy.h"
9 #include "RooCategoryProxy.h"
10 #include "RooAbsReal.h"
11 #include "RooRealVar.h"
12 #include "RooFormulaVar.h"
13 #include "RooAbsCategory.h"
14 #include "Riostream.h"
15 #include "TMath.h"
16 #include "TCouplingsBase.hh"
17 #include "MELAStreamHelpers.hh"
18 
19 
20 namespace AnaMelaHelpers{
21  void multiplyComplexNumbers(std::vector<Double_t> const& reals, std::vector<Double_t> const& imags, Double_t& resRe, Double_t& resIm);
22 }
23 
24 
25 class RooSpin : public RooAbsPdf {
26 public:
27 
28  enum VdecayType{
36  };
37 
38  enum{
48  };
49 
51  RooAbsReal* h1;
52  RooAbsReal* h2;
53  RooAbsReal* hs;
54  RooAbsReal* Phi;
55  RooAbsReal* Phi1;
56  RooAbsReal* m1;
57  RooAbsReal* m2;
58  RooAbsReal* m12;
59  RooAbsReal* Y;
60  };
62  RooAbsReal* mX;
63  RooAbsReal* gamX;
64  RooAbsReal* mW;
65  RooAbsReal* gamW;
66  RooAbsReal* mZ;
67  RooAbsReal* gamZ;
68  RooAbsReal* mWprime;
69  RooAbsReal* gamWprime;
70  RooAbsReal* mZprime;
71  RooAbsReal* gamZprime;
72  RooAbsReal* Sin2ThetaW;
73  RooAbsReal* vev;
74  RooAbsReal* gVprimeff_decay1_left;
76  RooAbsReal* gVprimeff_decay2_left;
78  };
79 
80  RooSpin();
81  RooSpin(
82  const char* name, const char* title,
83  modelMeasurables const& _measurables,
84  modelParameters const& _parameters,
87  );
88  RooSpin(const RooSpin& other, const char* name=0);
89  inline virtual ~RooSpin(){}
90 
91  virtual TObject* clone(const char* newname) const = 0;
92 
93  virtual Double_t evaluate() const = 0;
94  virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const = 0;
95  virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const = 0;
96 
97  void setVerbosity(TVar::VerbosityLevel verbosity_);
98  virtual void setDecayModes(RooSpin::VdecayType Vdecay1_, RooSpin::VdecayType Vdecay2_){ Vdecay1=Vdecay1_; Vdecay2=Vdecay2_; }
99  virtual void getMVGamV(Double_t* mV=0, Double_t* gamV=0) const;
100  virtual void getMVprimeGamVprime(Double_t* mV=0, Double_t* gamV=0) const;
101 
102  virtual void defaultIntegration(){ intCodeStart=1; }
103  virtual void alwaysIntegrate(Int_t code=1);
104  virtual void printParameters() const;
105 
106 protected:
107 
108  RooRealProxy h1;
109  RooRealProxy h2;
110  RooRealProxy Phi;
111  RooRealProxy m1;
112  RooRealProxy m2;
113  RooRealProxy m12;
114  RooRealProxy hs;
115  RooRealProxy Phi1;
116  RooRealProxy Y;
117 
118  RooRealProxy mX;
119  RooRealProxy gamX;
120  RooRealProxy mW;
121  RooRealProxy gamW;
122  RooRealProxy mZ;
123  RooRealProxy gamZ;
124  RooRealProxy mWprime;
125  RooRealProxy gamWprime;
126  RooRealProxy mZprime;
127  RooRealProxy gamZprime;
128  RooRealProxy Sin2ThetaW;
129  RooRealProxy vev;
130  RooRealProxy gVprimeff_decay1_left;
132  RooRealProxy gVprimeff_decay2_left;
134 
137 
140 
141  static constexpr Double_t GeVunit=1e-2;
142 
143  virtual void calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t mass, Int_t propType=1) const;
144  virtual void calculateVffGVGA(Double_t& gV, Double_t& gA, RooSpin::VdecayType Vdecay, bool isGamma=false) const;
145  virtual void calculateVffR1R2(Double_t& R1Val, Double_t& R2Val, bool isGammaV1=false, bool isGammaV2=false) const;
146  virtual Double_t calculateAmplitudeScale(int VGammaVpmode1=0, int VGammaVpmode2=0) const;
147 
148  virtual void calculateVprimeffGVGA(Double_t& gV, Double_t& gA, int whichVprime/*1 or 2*/) const;
149  virtual void calculateVprimeffR1R2(Double_t& R1Val, Double_t& R2Val) const;
150 
151  virtual void setProxies(modelMeasurables _measurables);
152  virtual void setProxy(RooRealProxy& proxy, RooAbsReal* objectPtr);
153  virtual Bool_t checkFundamentalType(const RooRealProxy& proxy) const;
154 
155  // Check if some amplitudes are needed, otherwise don't even compute them
156  virtual Bool_t computeNeededAmplitude(int /*VGammaVpmode1*/, int /*VGammaVpmode2*/) const { return true; }
157 
158 };
159 
160 #endif
TVar::ERROR
@ ERROR
Definition: TVar.hh:49
RooSpin::modelMeasurables::h2
RooAbsReal * h2
Definition: RooSpin.h:52
RooSpin::calculateAmplitudeScale
virtual Double_t calculateAmplitudeScale(int VGammaVpmode1=0, int VGammaVpmode2=0) const
Definition: RooSpin.cc:366
RooSpin::vev
RooRealProxy vev
Definition: RooSpin.h:129
AnaMelaHelpers
Definition: RooSpin.h:20
RooSpin::modelParameters::gamW
RooAbsReal * gamW
Definition: RooSpin.h:65
RooSpin::printParameters
virtual void printParameters() const
Definition: RooSpin.cc:397
RooSpin::kVdecayType_Zll
@ kVdecayType_Zll
Definition: RooSpin.h:31
RooSpin::setVerbosity
void setVerbosity(TVar::VerbosityLevel verbosity_)
Definition: RooSpin.cc:376
RooSpin::modelMeasurables::Y
RooAbsReal * Y
Definition: RooSpin.h:59
RooSpin::Phi
RooRealProxy Phi
Definition: RooSpin.h:110
TVar::VerbosityLevel
VerbosityLevel
Definition: TVar.hh:47
RooSpin::modelParameters::gamZ
RooAbsReal * gamZ
Definition: RooSpin.h:67
RooSpin::setProxy
virtual void setProxy(RooRealProxy &proxy, RooAbsReal *objectPtr)
Definition: RooSpin.cc:389
RooSpin::prime_hs
@ prime_hs
Definition: RooSpin.h:41
RooSpin::modelMeasurables::Phi1
RooAbsReal * Phi1
Definition: RooSpin.h:55
RooSpin::calculateVffGVGA
virtual void calculateVffGVGA(Double_t &gV, Double_t &gA, RooSpin::VdecayType Vdecay, bool isGamma=false) const
Definition: RooSpin.cc:196
RooSpin::prime_m2
@ prime_m2
Definition: RooSpin.h:45
RooSpin::kVdecayType_Zdd
@ kVdecayType_Zdd
Definition: RooSpin.h:34
RooSpin::kVdecayType_Zuu
@ kVdecayType_Zuu
Definition: RooSpin.h:33
RooSpin::m12
RooRealProxy m12
Definition: RooSpin.h:113
RooSpin::modelParameters::mZ
RooAbsReal * mZ
Definition: RooSpin.h:66
RooSpin::modelMeasurables::m12
RooAbsReal * m12
Definition: RooSpin.h:58
RooSpin::calculatePropagator
virtual void calculatePropagator(Double_t &propRe, Double_t &propIm, Double_t mass, Int_t propType=1) const
Definition: RooSpin.cc:133
RooSpin::getMVprimeGamVprime
virtual void getMVprimeGamVprime(Double_t *mV=0, Double_t *gamV=0) const
Definition: RooSpin.cc:351
RooSpin::Sin2ThetaW
RooRealProxy Sin2ThetaW
Definition: RooSpin.h:128
RooSpin::modelMeasurables::m1
RooAbsReal * m1
Definition: RooSpin.h:56
RooSpin::modelParameters::gamZprime
RooAbsReal * gamZprime
Definition: RooSpin.h:71
RooSpin::m1
RooRealProxy m1
Definition: RooSpin.h:111
RooSpin::mX
RooRealProxy mX
Definition: RooSpin.h:118
RooSpin::mZ
RooRealProxy mZ
Definition: RooSpin.h:122
RooSpin::prime_m1
@ prime_m1
Definition: RooSpin.h:44
AnaMelaHelpers::multiplyComplexNumbers
void multiplyComplexNumbers(std::vector< Double_t > const &reals, std::vector< Double_t > const &imags, Double_t &resRe, Double_t &resIm)
Definition: RooSpin.cc:7
RooSpin::calculateVprimeffR1R2
virtual void calculateVprimeffR1R2(Double_t &R1Val, Double_t &R2Val) const
Definition: RooSpin.cc:343
RooSpin::prime_Phi
@ prime_Phi
Definition: RooSpin.h:42
RooSpin::checkFundamentalType
virtual Bool_t checkFundamentalType(const RooRealProxy &proxy) const
Definition: RooSpin.cc:392
RooSpin::modelParameters::gamWprime
RooAbsReal * gamWprime
Definition: RooSpin.h:69
RooSpin::modelParameters::mW
RooAbsReal * mW
Definition: RooSpin.h:64
RooSpin::prime_h2
@ prime_h2
Definition: RooSpin.h:40
RooSpin::modelParameters::mWprime
RooAbsReal * mWprime
Definition: RooSpin.h:68
RooSpin::gVprimeff_decay2_right
RooRealProxy gVprimeff_decay2_right
Definition: RooSpin.h:133
RooSpin::verbosity
TVar::VerbosityLevel verbosity
Definition: RooSpin.h:139
RooSpin::clone
virtual TObject * clone(const char *newname) const =0
RooSpin::calculateVprimeffGVGA
virtual void calculateVprimeffGVGA(Double_t &gV, Double_t &gA, int whichVprime) const
Definition: RooSpin.cc:320
RooSpin::gamZ
RooRealProxy gamZ
Definition: RooSpin.h:123
RooSpin::Y
RooRealProxy Y
Definition: RooSpin.h:116
RooSpin::Vdecay2
RooSpin::VdecayType Vdecay2
Definition: RooSpin.h:136
RooSpin::modelParameters::gVprimeff_decay1_right
RooAbsReal * gVprimeff_decay1_right
Definition: RooSpin.h:75
RooSpin::~RooSpin
virtual ~RooSpin()
Definition: RooSpin.h:89
RooSpin::prime_m12
@ prime_m12
Definition: RooSpin.h:46
RooSpin::evaluate
virtual Double_t evaluate() const =0
RooSpin::intCodeStart
Int_t intCodeStart
Definition: RooSpin.h:138
RooSpin::analyticalIntegral
virtual Double_t analyticalIntegral(Int_t code, const char *rangeName=0) const =0
RooSpin::kVdecayType_GammaOnshell
@ kVdecayType_GammaOnshell
Definition: RooSpin.h:30
RooSpin::mWprime
RooRealProxy mWprime
Definition: RooSpin.h:124
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
RooSpin
Definition: RooSpin.h:25
RooSpin::RooSpin
RooSpin()
Definition: RooSpin.cc:36
RooSpin::modelMeasurables::m2
RooAbsReal * m2
Definition: RooSpin.h:57
RooSpin::mZprime
RooRealProxy mZprime
Definition: RooSpin.h:126
RooSpin::modelMeasurables::h1
RooAbsReal * h1
Definition: RooSpin.h:51
RooSpin::modelParameters::mZprime
RooAbsReal * mZprime
Definition: RooSpin.h:70
RooSpin::m2
RooRealProxy m2
Definition: RooSpin.h:112
RooSpin::h2
RooRealProxy h2
Definition: RooSpin.h:109
RooSpin::gVprimeff_decay1_right
RooRealProxy gVprimeff_decay1_right
Definition: RooSpin.h:131
RooSpin::modelParameters::vev
RooAbsReal * vev
Definition: RooSpin.h:73
RooSpin::modelParameters::gamX
RooAbsReal * gamX
Definition: RooSpin.h:63
RooSpin::gamWprime
RooRealProxy gamWprime
Definition: RooSpin.h:125
RooSpin::modelParameters::Sin2ThetaW
RooAbsReal * Sin2ThetaW
Definition: RooSpin.h:72
RooSpin::kVdecayType_Znn
@ kVdecayType_Znn
Definition: RooSpin.h:32
RooSpin::gamW
RooRealProxy gamW
Definition: RooSpin.h:121
TCouplingsBase.hh
RooSpin::kVdecayType_Zud
@ kVdecayType_Zud
Definition: RooSpin.h:35
RooSpin::mW
RooRealProxy mW
Definition: RooSpin.h:120
RooSpin::hs
RooRealProxy hs
Definition: RooSpin.h:114
RooSpin::modelParameters::gVprimeff_decay2_left
RooAbsReal * gVprimeff_decay2_left
Definition: RooSpin.h:76
TVar.hh
RooSpin::prime_h1
@ prime_h1
Definition: RooSpin.h:39
RooSpin::gVprimeff_decay1_left
RooRealProxy gVprimeff_decay1_left
Definition: RooSpin.h:130
RooSpin::GeVunit
static constexpr Double_t GeVunit
Definition: RooSpin.h:141
RooSpin::getMVGamV
virtual void getMVGamV(Double_t *mV=0, Double_t *gamV=0) const
Definition: RooSpin.cc:305
RooSpin::gVprimeff_decay2_left
RooRealProxy gVprimeff_decay2_left
Definition: RooSpin.h:132
RooSpin::modelParameters::gVprimeff_decay1_left
RooAbsReal * gVprimeff_decay1_left
Definition: RooSpin.h:74
RooSpin::setProxies
virtual void setProxies(modelMeasurables _measurables)
Definition: RooSpin.cc:378
RooSpin::alwaysIntegrate
virtual void alwaysIntegrate(Int_t code=1)
Definition: RooSpin.cc:120
MELAStreamHelpers.hh
RooSpin::getAnalyticalIntegral
virtual Int_t getAnalyticalIntegral(RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const =0
RooSpin::setDecayModes
virtual void setDecayModes(RooSpin::VdecayType Vdecay1_, RooSpin::VdecayType Vdecay2_)
Definition: RooSpin.h:98
RooSpin::prime_Phi1
@ prime_Phi1
Definition: RooSpin.h:43
RooSpin::Vdecay1
RooSpin::VdecayType Vdecay1
Definition: RooSpin.h:135
RooSpin::kVdecayType_Wany
@ kVdecayType_Wany
Definition: RooSpin.h:29
RooSpin::computeNeededAmplitude
virtual Bool_t computeNeededAmplitude(int, int) const
Definition: RooSpin.h:156
RooSpin::modelMeasurables
Definition: RooSpin.h:50
RooSpin::h1
RooRealProxy h1
Definition: RooSpin.h:108
RooSpin::modelParameters
Definition: RooSpin.h:61
RooSpin::modelMeasurables::hs
RooAbsReal * hs
Definition: RooSpin.h:53
RooSpin::gamZprime
RooRealProxy gamZprime
Definition: RooSpin.h:127
RooSpin::prime_Y
@ prime_Y
Definition: RooSpin.h:47
RooSpin::calculateVffR1R2
virtual void calculateVffR1R2(Double_t &R1Val, Double_t &R2Val, bool isGammaV1=false, bool isGammaV2=false) const
Definition: RooSpin.cc:297
RooSpin::VdecayType
VdecayType
Definition: RooSpin.h:28
RooSpin::defaultIntegration
virtual void defaultIntegration()
Definition: RooSpin.h:102
RooSpin::gamX
RooRealProxy gamX
Definition: RooSpin.h:119
RooSpin::Phi1
RooRealProxy Phi1
Definition: RooSpin.h:115