From 6fcdeb10048aec7ee524f9b0a74cf2117cdcb821 Mon Sep 17 00:00:00 2001 From: Ulascan Sarica Date: Thu, 26 Jan 2017 21:16:20 +0100 Subject: [PATCH 1/3] anaPDF update --- MELA/interface/Mela.h | 10 +- MELA/interface/RooSpinOne_7D.h | 91 +-- ...lex_HVV.h => RooSpinTwo_7DComplex_ppHVV.h} | 20 +- ... => RooSpinZero_7DComplex_withAccep_HVV.h} | 20 +- ...dfFactory_ggH.h => ScalarPdfFactory_HVV.h} | 19 +- MELA/interface/TensorPdfFactory_HVV.h | 28 - MELA/interface/TensorPdfFactory_ppHVV.h | 29 + MELA/interface/VectorPdfFactory.h | 4 +- MELA/src/Mela.cc | 4 +- MELA/src/RooSpinOne_7D.cc | 528 +++++++++--------- ...x_HVV.cc => RooSpinTwo_7DComplex_ppHVV.cc} | 35 +- ...=> RooSpinZero_7DComplex_withAccep_HVV.cc} | 27 +- ...Factory_ggH.cc => ScalarPdfFactory_HVV.cc} | 19 +- ...ctory_HVV.cc => TensorPdfFactory_ppHVV.cc} | 13 +- 14 files changed, 436 insertions(+), 411 deletions(-) rename MELA/interface/{RooSpinTwo_7DComplex_HVV.h => RooSpinTwo_7DComplex_ppHVV.h} (71%) rename MELA/interface/{RooSpinZero_7DComplex_withAccep_ggH.h => RooSpinZero_7DComplex_withAccep_HVV.h} (80%) rename MELA/interface/{ScalarPdfFactory_ggH.h => ScalarPdfFactory_HVV.h} (60%) delete mode 100644 MELA/interface/TensorPdfFactory_HVV.h create mode 100644 MELA/interface/TensorPdfFactory_ppHVV.h rename MELA/src/{RooSpinTwo_7DComplex_HVV.cc => RooSpinTwo_7DComplex_ppHVV.cc} (89%) rename MELA/src/{RooSpinZero_7DComplex_withAccep_ggH.cc => RooSpinZero_7DComplex_withAccep_HVV.cc} (92%) rename MELA/src/{ScalarPdfFactory_ggH.cc => ScalarPdfFactory_HVV.cc} (94%) rename MELA/src/{TensorPdfFactory_HVV.cc => TensorPdfFactory_ppHVV.cc} (60%) diff --git a/MELA/interface/Mela.h b/MELA/interface/Mela.h index b3b55d90..84a0ada1 100755 --- a/MELA/interface/Mela.h +++ b/MELA/interface/Mela.h @@ -19,7 +19,7 @@ class TH3F; class RooRealVar; class RooAbsPdf; class RooArgSet; -class ScalarPdfFactory_ggH; +class ScalarPdfFactory_HVV; class VectorPdfFactory; class TensorPdfFactory; class RooqqZZ_JHU_ZgammaZZ_fast; @@ -29,9 +29,9 @@ class SuperMELA; #include "TVar.hh" #include "TEvtProb.hh" #include "MelaPConstant.h" -#include "ScalarPdfFactory_ggH.h" +#include "ScalarPdfFactory_HVV.h" #include "VectorPdfFactory.h" -#include "TensorPdfFactory_HVV.h" +#include "TensorPdfFactory_ppHVV.h" #include "RooqqZZ_JHU_ZgammaZZ_fast.h" class Mela{ @@ -208,9 +208,9 @@ class Mela{ RooAbsPdf* pdf; - ScalarPdfFactory_ggH* ggSpin0Model; + ScalarPdfFactory_HVV* ggSpin0Model; VectorPdfFactory* spin1Model; - TensorPdfFactory_HVV* spin2Model; + TensorPdfFactory_ppHVV* spin2Model; RooqqZZ_JHU_ZgammaZZ_fast* qqZZmodel; SuperMELA* super; diff --git a/MELA/interface/RooSpinOne_7D.h b/MELA/interface/RooSpinOne_7D.h index 40d8a24c..b9e37eb4 100755 --- a/MELA/interface/RooSpinOne_7D.h +++ b/MELA/interface/RooSpinOne_7D.h @@ -17,51 +17,56 @@ using namespace TMath; class RooSpinOne_7D : public RooAbsPdf { public: - RooSpinOne_7D() {} ; + RooSpinOne_7D(){}; RooSpinOne_7D(const char *name, const char *title, - RooAbsReal& _mzz, - RooAbsReal& _m1, - RooAbsReal& _m2, - RooAbsReal& _h1, - RooAbsReal& _h2, - RooAbsReal& _hs, - RooAbsReal& _Phi, - RooAbsReal& _Phi1, - RooAbsReal& _g1Val, - RooAbsReal& _g2Val, - RooAbsReal& _R1Val, - RooAbsReal& _R2Val, - RooAbsReal& _aParam, - RooAbsReal& _mZ, - RooAbsReal& _gamZ); - RooSpinOne_7D(const RooSpinOne_7D& other, const char* name=0) ; - virtual TObject* clone(const char* newname) const { return new RooSpinOne_7D(*this,newname); } - inline virtual ~RooSpinOne_7D() { } - Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ; - Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ; - - protected: + RooAbsReal& _mzz, + RooAbsReal& _m1, + RooAbsReal& _m2, + RooAbsReal& _h1, + RooAbsReal& _h2, + RooAbsReal& _hs, + RooAbsReal& _Phi, + RooAbsReal& _Phi1, + RooAbsReal& _g1Val, + RooAbsReal& _g2Val, + RooAbsReal& _R1Val, + RooAbsReal& _R2Val, + RooAbsReal& _aParam, + RooAbsReal& _mZ, + RooAbsReal& _gamZ); + RooSpinOne_7D(const RooSpinOne_7D& other, const char* name=0); + virtual TObject* clone(const char* newname) const { return new RooSpinOne_7D(*this, newname); } + inline virtual ~RooSpinOne_7D(){} + Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const; + Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const; - RooRealProxy mzz ; - RooRealProxy m1 ; - RooRealProxy m2 ; - RooRealProxy h1 ; - RooRealProxy h2 ; - RooRealProxy hs ; - RooRealProxy Phi ; - RooRealProxy Phi1 ; - RooRealProxy g1Val ; - RooRealProxy g2Val ; - RooRealProxy R1Val ; - RooRealProxy R2Val ; - RooRealProxy aParam ; - RooRealProxy mZ ; - RooRealProxy gamZ ; - Double_t evaluate() const ; - - private: - - // ClassDef(RooSpinOne_7D,1) // Your description goes here... + void setZZ4fOrdering(Bool_t flag=true); + +protected: + + RooRealProxy mzz; + RooRealProxy m1; + RooRealProxy m2; + RooRealProxy h1; + RooRealProxy h2; + RooRealProxy hs; + RooRealProxy Phi; + RooRealProxy Phi1; + RooRealProxy g1Val; + RooRealProxy g2Val; + RooRealProxy R1Val; + RooRealProxy R2Val; + RooRealProxy aParam; + RooRealProxy mZ; + RooRealProxy gamZ; + + Bool_t ZZ4fOrdering; + + Double_t evaluate() const; + +private: + + // ClassDef(RooSpinOne_7D,1) // Your description goes here... }; #endif diff --git a/MELA/interface/RooSpinTwo_7DComplex_HVV.h b/MELA/interface/RooSpinTwo_7DComplex_ppHVV.h similarity index 71% rename from MELA/interface/RooSpinTwo_7DComplex_HVV.h rename to MELA/interface/RooSpinTwo_7DComplex_ppHVV.h index 3c69d9dd..4941f9c5 100644 --- a/MELA/interface/RooSpinTwo_7DComplex_HVV.h +++ b/MELA/interface/RooSpinTwo_7DComplex_ppHVV.h @@ -1,28 +1,30 @@ -#ifndef ROOSPINTWO_7DCOMPLEX_HVV -#define ROOSPINTWO_7DCOMPLEX_HVV +#ifndef ROOSPINTWO_7DCOMPLEX_PPHVV +#define ROOSPINTWO_7DCOMPLEX_PPHVV #include "RooSpinTwo.h" -class RooSpinTwo_7DComplex_HVV : public RooSpinTwo { +class RooSpinTwo_7DComplex_ppHVV : public RooSpinTwo { public: - RooSpinTwo_7DComplex_HVV(){} - RooSpinTwo_7DComplex_HVV( + RooSpinTwo_7DComplex_ppHVV(){} + RooSpinTwo_7DComplex_ppHVV( const char *name, const char *title, modelMeasurables _measurables, modelParameters _parameters, modelCouplings _couplings, RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll ); - RooSpinTwo_7DComplex_HVV(const RooSpinTwo_7DComplex_HVV& other, const char* name=0); - virtual TObject* clone(const char* newname) const { return new RooSpinTwo_7DComplex_HVV(*this, newname); } - inline virtual ~RooSpinTwo_7DComplex_HVV(){} + RooSpinTwo_7DComplex_ppHVV(const RooSpinTwo_7DComplex_ppHVV& other, const char* name=0); + virtual TObject* clone(const char* newname) const { return new RooSpinTwo_7DComplex_ppHVV(*this, newname); } + inline virtual ~RooSpinTwo_7DComplex_ppHVV(){} Double_t evaluate() const; Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const; Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const; + void setZZ4fOrdering(Bool_t flag=true); + protected: @@ -32,6 +34,8 @@ class RooSpinTwo_7DComplex_HVV : public RooSpinTwo { Double_t evaluatePhi1PhiFactor(Int_t i1, Int_t i2, Int_t j1, Int_t j2, Int_t code, Double_t extraPhase1, Double_t extraPhase2) const; void evaluatePolarizationTerms(std::vector& Axxyyterm, const Int_t code, bool isGammaV1=false, bool isGammaV2=false) const; + Bool_t ZZ4fOrdering; + }; #endif diff --git a/MELA/interface/RooSpinZero_7DComplex_withAccep_ggH.h b/MELA/interface/RooSpinZero_7DComplex_withAccep_HVV.h similarity index 80% rename from MELA/interface/RooSpinZero_7DComplex_withAccep_ggH.h rename to MELA/interface/RooSpinZero_7DComplex_withAccep_HVV.h index a001617f..9afb3009 100755 --- a/MELA/interface/RooSpinZero_7DComplex_withAccep_ggH.h +++ b/MELA/interface/RooSpinZero_7DComplex_withAccep_HVV.h @@ -1,10 +1,10 @@ -#ifndef ROOSPINZERO_7DCOMPLEX_WITHACCEP_GGH -#define ROOSPINZERO_7DCOMPLEX_WITHACCEP_GGH +#ifndef ROOSPINZERO_7DCOMPLEX_WITHACCEP_HVV +#define ROOSPINZERO_7DCOMPLEX_WITHACCEP_HVV #include "RooSpinZero.h" -class RooSpinZero_7DComplex_withAccep_ggH : public RooSpinZero { +class RooSpinZero_7DComplex_withAccep_HVV : public RooSpinZero { public: @@ -44,8 +44,8 @@ class RooSpinZero_7DComplex_withAccep_ggH : public RooSpinZero { RooRealVar* dM2; }; - RooSpinZero_7DComplex_withAccep_ggH(){} - RooSpinZero_7DComplex_withAccep_ggH( + RooSpinZero_7DComplex_withAccep_HVV(){} + RooSpinZero_7DComplex_withAccep_HVV( const char *name, const char *title, modelMeasurables _measurables, modelParameters _parameters, @@ -53,14 +53,16 @@ class RooSpinZero_7DComplex_withAccep_ggH : public RooSpinZero { accepParameters _accepParams, RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll ); - RooSpinZero_7DComplex_withAccep_ggH(const RooSpinZero_7DComplex_withAccep_ggH& other, const char* name=0); - virtual TObject* clone(const char* newname) const { return new RooSpinZero_7DComplex_withAccep_ggH(*this, newname); } - inline virtual ~RooSpinZero_7DComplex_withAccep_ggH(){} + RooSpinZero_7DComplex_withAccep_HVV(const RooSpinZero_7DComplex_withAccep_HVV& other, const char* name=0); + virtual TObject* clone(const char* newname) const { return new RooSpinZero_7DComplex_withAccep_HVV(*this, newname); } + inline virtual ~RooSpinZero_7DComplex_withAccep_HVV(){} Double_t evaluate() const; Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const; Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const; + void setZZ4fOrdering(Bool_t flag=true); + protected: // acceptance parameters @@ -100,6 +102,8 @@ class RooSpinZero_7DComplex_withAccep_ggH : public RooSpinZero { RooRealProxy cM2; RooRealProxy dM2; + Bool_t ZZ4fOrdering; + void evaluatePolarizationTerms(Double_t& A00term, Double_t& Appterm, Double_t& Ammterm, Double_t& A00ppterm, Double_t& A00mmterm, Double_t& Appmmterm, const Int_t code, bool isGammaV1=false, bool isGammaV2=false) const; }; diff --git a/MELA/interface/ScalarPdfFactory_ggH.h b/MELA/interface/ScalarPdfFactory_HVV.h similarity index 60% rename from MELA/interface/ScalarPdfFactory_ggH.h rename to MELA/interface/ScalarPdfFactory_HVV.h index a2a9110f..73307e4c 100755 --- a/MELA/interface/ScalarPdfFactory_ggH.h +++ b/MELA/interface/ScalarPdfFactory_HVV.h @@ -1,23 +1,24 @@ -#ifndef SCALAR_PDF_FACTORY_GGH -#define SCALAR_PDF_FACTORY_GGH +#ifndef SCALAR_PDF_FACTORY_HVV +#define SCALAR_PDF_FACTORY_HVV -#include "RooSpinZero_7DComplex_withAccep_ggH.h" #include "ScalarPdfFactory.h" +#include "RooSpinZero_7DComplex_withAccep_HVV.h" -class ScalarPdfFactory_ggH : public ScalarPdfFactory { +class ScalarPdfFactory_HVV : public ScalarPdfFactory { public: - RooSpinZero_7DComplex_withAccep_ggH::accepParameters accepParams; + RooSpinZero_7DComplex_withAccep_HVV::accepParameters accepParams; - ScalarPdfFactory_ggH(RooSpin::modelMeasurables measurables_, bool acceptance_=false, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); - ScalarPdfFactory_ggH(RooSpin::modelMeasurables measurables_, double gRatio_[4][8], double gZGsRatio_[4][1], double gGsGsRatio_[3][1], bool pmf_applied_=false, bool acceptance_=false, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); - ~ScalarPdfFactory_ggH(); + ScalarPdfFactory_HVV(RooSpin::modelMeasurables measurables_, bool acceptance_=false, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); + ScalarPdfFactory_HVV(RooSpin::modelMeasurables measurables_, double gRatio_[4][8], double gZGsRatio_[4][1], double gGsGsRatio_[3][1], bool pmf_applied_=false, bool acceptance_=false, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); + ~ScalarPdfFactory_HVV(); void makeParamsConst(bool yesNo=true); + void setZZ4fOrdering(bool flag=true); RooSpinZero* getPDF(){ return (RooSpinZero*)PDF; } protected: - RooSpinZero_7DComplex_withAccep_ggH* PDF; + RooSpinZero_7DComplex_withAccep_HVV* PDF; virtual void initAcceptanceParams(); virtual void destroyAcceptanceParams(); diff --git a/MELA/interface/TensorPdfFactory_HVV.h b/MELA/interface/TensorPdfFactory_HVV.h deleted file mode 100644 index 3d796933..00000000 --- a/MELA/interface/TensorPdfFactory_HVV.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef TENSOR_PDF_FACTORY_HZZ -#define TENSOR_PDF_FACTORY_HZZ - -#include "RooSpinTwo_7DComplex_HVV.h" -#include "TensorPdfFactory.h" - - -class TensorPdfFactory_HVV : public TensorPdfFactory { -public: - - TensorPdfFactory_HVV(RooSpin::modelMeasurables measurables_, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); - ~TensorPdfFactory_HVV(); - - void makeParamsConst(bool yesNo=true); - RooSpinTwo* getPDF(){ return (RooSpinTwo*)PDF; } - -protected: - RooSpinTwo_7DComplex_HVV* PDF; - - void initPDF(); - void destroyPDF(){ delete PDF; } -}; - - -#endif - - - diff --git a/MELA/interface/TensorPdfFactory_ppHVV.h b/MELA/interface/TensorPdfFactory_ppHVV.h new file mode 100644 index 00000000..4931b19d --- /dev/null +++ b/MELA/interface/TensorPdfFactory_ppHVV.h @@ -0,0 +1,29 @@ +#ifndef TENSOR_PDF_FACTORY_PPHVV +#define TENSOR_PDF_FACTORY_PPHVV + +#include "RooSpinTwo_7DComplex_ppHVV.h" +#include "TensorPdfFactory.h" + + +class TensorPdfFactory_ppHVV : public TensorPdfFactory { +public: + + TensorPdfFactory_ppHVV(RooSpin::modelMeasurables measurables_, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); + ~TensorPdfFactory_ppHVV(); + + void makeParamsConst(bool yesNo=true); + void setZZ4fOrdering(bool flag=true); + RooSpinTwo* getPDF(){ return (RooSpinTwo*)PDF; } + +protected: + RooSpinTwo_7DComplex_ppHVV* PDF; + + void initPDF(); + void destroyPDF(){ delete PDF; } +}; + + +#endif + + + diff --git a/MELA/interface/VectorPdfFactory.h b/MELA/interface/VectorPdfFactory.h index 45459d16..70bfa0d6 100755 --- a/MELA/interface/VectorPdfFactory.h +++ b/MELA/interface/VectorPdfFactory.h @@ -19,7 +19,7 @@ class VectorPdfFactory{ RooRealVar* R1Val; RooRealVar* R2Val; - RooAbsPdf *PDF; + RooSpinOne_7D* PDF; RooRealVar* g1Val; RooRealVar* g2Val; @@ -116,6 +116,8 @@ class VectorPdfFactory{ } }; + void setZZ4fOrdering(bool flag=true){ PDF->setZZ4fOrdering(flag); } + }; #endif diff --git a/MELA/src/Mela.cc b/MELA/src/Mela.cc index c9983d77..01307df5 100755 --- a/MELA/src/Mela.cc +++ b/MELA/src/Mela.cc @@ -106,9 +106,9 @@ Mela::Mela( measurables_.Y = Y_rrv; if (myVerbosity_>=TVar::DEBUG) cout << "Create anaMELA PDF factories" << endl; - ggSpin0Model = new ScalarPdfFactory_ggH(measurables_, false, RooSpin::kVdecayType_Zll, RooSpin::kVdecayType_Zll); // RooSpin::kVdecayType_Zll,RooSpin::kVdecayType_Zll==ZZ + ggSpin0Model = new ScalarPdfFactory_HVV(measurables_, false, RooSpin::kVdecayType_Zll, RooSpin::kVdecayType_Zll); // RooSpin::kVdecayType_Zll,RooSpin::kVdecayType_Zll==ZZ spin1Model = new VectorPdfFactory(z1mass_rrv, z2mass_rrv, costhetastar_rrv, costheta1_rrv, costheta2_rrv, phi_rrv, phi1_rrv, mzz_rrv); - spin2Model = new TensorPdfFactory_HVV(measurables_, RooSpin::kVdecayType_Zll, RooSpin::kVdecayType_Zll); + spin2Model = new TensorPdfFactory_ppHVV(measurables_, RooSpin::kVdecayType_Zll, RooSpin::kVdecayType_Zll); qqZZmodel = new RooqqZZ_JHU_ZgammaZZ_fast("qqZZmodel", "qqZZmodel", *z1mass_rrv, *z2mass_rrv, *costheta1_rrv, *costheta2_rrv, *phi_rrv, *costhetastar_rrv, *phi1_rrv, *mzz_rrv, *upFrac_rrv); if (myVerbosity_>=TVar::DEBUG) cout << "Paths for newZZMatrixElement" << endl; diff --git a/MELA/src/RooSpinOne_7D.cc b/MELA/src/RooSpinOne_7D.cc index d1fdc82a..490fefc8 100755 --- a/MELA/src/RooSpinOne_7D.cc +++ b/MELA/src/RooSpinOne_7D.cc @@ -17,62 +17,62 @@ using namespace TMath; // ClassImp(RooSpinOne_7D) - RooSpinOne_7D::RooSpinOne_7D(const char *name, const char *title, - RooAbsReal& _mzz, - RooAbsReal& _m1, - RooAbsReal& _m2, - RooAbsReal& _h1, - RooAbsReal& _h2, - RooAbsReal& _hs, - RooAbsReal& _Phi, - RooAbsReal& _Phi1, - RooAbsReal& _g1Val, - RooAbsReal& _g2Val, - RooAbsReal& _R1Val, - RooAbsReal& _R2Val, - RooAbsReal& _aParam, - RooAbsReal& _mZ, - RooAbsReal& _gamZ) : - RooAbsPdf(name,title), - mzz("mzz","mzz",this,_mzz), - m1("m1","m1",this,_m1), - m2("m2","m2",this,_m2), - h1("h1","h1",this,_h1), - h2("h2","h2",this,_h2), - hs("hs","hs",this,_hs), - Phi("Phi","Phi",this,_Phi), - Phi1("Phi1","Phi1",this,_Phi1), - g1Val("g1Val","g1Val",this,_g1Val), - g2Val("g2Val","g2Val",this,_g2Val), - R1Val("R1Val","R1Val",this,_R1Val), - R2Val("R2Val","R2Val",this,_R2Val), - aParam("aParam","aParam",this,_aParam), - mZ("mZ","mZ",this,_mZ), - gamZ("gamZ","gamZ",this,_gamZ) -{ -} - - -RooSpinOne_7D::RooSpinOne_7D(const RooSpinOne_7D& other, const char* name) : - RooAbsPdf(other,name), - mzz("mzz",this,other.mzz), - m1("m1",this,other.m1), - m2("m2",this,other.m2), - h1("h1",this,other.h1), - h2("h2",this,other.h2), - hs("hs",this,other.hs), - Phi("Phi",this,other.Phi), - Phi1("Phi1",this,other.Phi1), - g1Val("g1Val",this,other.g1Val), - g2Val("g2Val",this,other.g2Val), - R1Val("R1Val",this,other.R1Val), - R2Val("R2Val",this,other.R2Val), - aParam("aParam",this,other.aParam), - mZ("mZ",this,other.mZ), - gamZ("gamZ",this,other.gamZ) -{ -} - +RooSpinOne_7D::RooSpinOne_7D( + const char *name, const char *title, + RooAbsReal& _mzz, + RooAbsReal& _m1, + RooAbsReal& _m2, + RooAbsReal& _h1, + RooAbsReal& _h2, + RooAbsReal& _hs, + RooAbsReal& _Phi, + RooAbsReal& _Phi1, + RooAbsReal& _g1Val, + RooAbsReal& _g2Val, + RooAbsReal& _R1Val, + RooAbsReal& _R2Val, + RooAbsReal& _aParam, + RooAbsReal& _mZ, + RooAbsReal& _gamZ) : + RooAbsPdf(name, title), + mzz("mzz", "mzz", this, _mzz), + m1("m1", "m1", this, _m1), + m2("m2", "m2", this, _m2), + h1("h1", "h1", this, _h1), + h2("h2", "h2", this, _h2), + hs("hs", "hs", this, _hs), + Phi("Phi", "Phi", this, _Phi), + Phi1("Phi1", "Phi1", this, _Phi1), + g1Val("g1Val", "g1Val", this, _g1Val), + g2Val("g2Val", "g2Val", this, _g2Val), + R1Val("R1Val", "R1Val", this, _R1Val), + R2Val("R2Val", "R2Val", this, _R2Val), + aParam("aParam", "aParam", this, _aParam), + mZ("mZ", "mZ", this, _mZ), + gamZ("gamZ", "gamZ", this, _gamZ), + ZZ4fOrdering(true) +{} + + +RooSpinOne_7D::RooSpinOne_7D(const RooSpinOne_7D& other, const char* name) : +RooAbsPdf(other, name), +mzz("mzz", this, other.mzz), +m1("m1", this, other.m1), +m2("m2", this, other.m2), +h1("h1", this, other.h1), +h2("h2", this, other.h2), +hs("hs", this, other.hs), +Phi("Phi", this, other.Phi), +Phi1("Phi1", this, other.Phi1), +g1Val("g1Val", this, other.g1Val), +g2Val("g2Val", this, other.g2Val), +R1Val("R1Val", this, other.R1Val), +R2Val("R2Val", this, other.R2Val), +aParam("aParam", this, other.aParam), +mZ("mZ", this, other.mZ), +gamZ("gamZ", this, other.gamZ), +ZZ4fOrdering(other.ZZ4fOrdering) +{} Double_t RooSpinOne_7D::evaluate() const @@ -211,89 +211,87 @@ Double_t RooSpinOne_7D::evaluate() const } -Int_t RooSpinOne_7D::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const -{ - if (matchArgs(allVars,analVars,RooArgSet(*hs.absArg(),*h1.absArg(),*h2.absArg(),*Phi.absArg(),*Phi1.absArg()))) return 6 ; - if (matchArgs(allVars,analVars,hs,h1,h2,Phi)) return 5 ; - if (matchArgs(allVars,analVars,hs,h1,h2,Phi1)) return 4 ; - if (matchArgs(allVars,analVars,hs,h1,Phi,Phi1)) return 3 ; - if (matchArgs(allVars,analVars,hs,h2,Phi,Phi1)) return 2 ; - if (matchArgs(allVars,analVars,h1,h2,Phi,Phi1)) return 1 ; - return 0 ; +Int_t RooSpinOne_7D::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const{ + if (matchArgs(allVars, analVars, RooArgSet(*hs.absArg(), *h1.absArg(), *h2.absArg(), *Phi.absArg(), *Phi1.absArg()))) return 6; + if (matchArgs(allVars, analVars, hs, h1, h2, Phi)) return 5; + if (matchArgs(allVars, analVars, hs, h1, h2, Phi1)) return 4; + if (matchArgs(allVars, analVars, hs, h1, Phi, Phi1)) return 3; + if (matchArgs(allVars, analVars, hs, h2, Phi, Phi1)) return 2; + if (matchArgs(allVars, analVars, h1, h2, Phi, Phi1)) return 1; + return 0; } -Double_t RooSpinOne_7D::analyticalIntegral(Int_t code, const char* rangeName) const -{ - +Double_t RooSpinOne_7D::analyticalIntegral(Int_t code, const char* rangeName) const{ bool isZZ = true; - if ( mZ < 90.) isZZ = false; - if ( isZZ ) { - if( (m1+m2) > mzz || m2>m1 ) return 1e-9; - } else { - if( (m1+m2) > mzz ) return 1e-9; + if (mZ < 90.) isZZ = false; + if (isZZ) { + if ((m1+m2) > mzz || m2>m1) return 1e-9; } - double nanval = sqrt((1 - TMath::Power(m1 - m2,2)/TMath::Power(mzz,2))*(1 - TMath::Power(m1 + m2,2)/TMath::Power(mzz,2))); + else { + if ((m1+m2) > mzz) return 1e-9; + } + double nanval = sqrt((1 - TMath::Power(m1 - m2, 2)/TMath::Power(mzz, 2))*(1 - TMath::Power(m1 + m2, 2)/TMath::Power(mzz, 2))); if (nanval != nanval) return 1e-9; - + //----------------------------------------------------------------------- // propagator //----------------------------------------------------------------------- - - Double_t betaValSquared = (1.-(pow(m1-m2,2)/pow(mzz,2)))*(1.-(pow(m1+m2,2)/pow(mzz,2))); + + Double_t betaValSquared = (1.-(pow(m1-m2, 2)/pow(mzz, 2)))*(1.-(pow(m1+m2, 2)/pow(mzz, 2))); Double_t betaVal = sqrt(betaValSquared); - - Double_t term1Coeff = (pow(m1,3))/( (pow(m1,2)-pow(mZ,2))*(pow(m1,2)-pow(mZ,2))+pow(mZ,2)*pow(gamZ,2) ); - Double_t term2Coeff = (pow(m2,3))/( (pow(m2,2)-pow(mZ,2))*(pow(m2,2)-pow(mZ,2))+pow(mZ,2)*pow(gamZ,2) ); - + + Double_t term1Coeff = (pow(m1, 3))/((pow(m1, 2)-pow(mZ, 2))*(pow(m1, 2)-pow(mZ, 2))+pow(mZ, 2)*pow(gamZ, 2)); + Double_t term2Coeff = (pow(m2, 3))/((pow(m2, 2)-pow(mZ, 2))*(pow(m2, 2)-pow(mZ, 2))+pow(mZ, 2)*pow(gamZ, 2)); + //----------------------------------------------------------------------- // Helicity Amplitudes //----------------------------------------------------------------------- // calculating the angular parameters from the coupling constants // See http://www.pha.jhu.edu/~gritsan/FORM/result_spin1.txt - + Double_t x = (mzz*mzz-m1*m1-m2*m2)/(2.0*m1*m2); Double_t hs_ = -hs; - Double_t f00Real = TMath::Power(mzz,-1)*g1Val*( sqrt(x*x-1) )*(m1*m1-m2*m2); + Double_t f00Real = TMath::Power(mzz, -1)*g1Val*(sqrt(x*x-1))*(m1*m1-m2*m2); Double_t f00Imag = 0.; Double_t fppReal = 0.; - Double_t fppImag = TMath::Power(mzz,-1)*g2Val*(m1*m1-m2*m2); + Double_t fppImag = TMath::Power(mzz, -1)*g2Val*(m1*m1-m2*m2); Double_t fmmReal = 0.; Double_t fmmImag = -1. * fppImag; - Double_t fp0Real = m1*g1Val * ( sqrt(x*x-1) ); - Double_t fp0Imag = Power(mzz,-2.)*Power(m2,3)*g2Val * ( - 1./2. ) - + Power(mzz,-2.)*m1*m1*m2*g2Val * ( 1 + 2*(x*x-1) ) - + Power(mzz,-2.)*Power(m1,4)*Power(m2,-1)*g2Val * ( - 1./2. ) - + m2*g2Val * ( - 1./2. ) - + m1*m1*Power(m2,-1)*g2Val * ( 1./2. ); + Double_t fp0Real = m1*g1Val * (sqrt(x*x-1)); + Double_t fp0Imag = Power(mzz, -2.)*Power(m2, 3)*g2Val * (-1./2.) + + Power(mzz, -2.)*m1*m1*m2*g2Val * (1 + 2*(x*x-1)) + + Power(mzz, -2.)*Power(m1, 4)*Power(m2, -1)*g2Val * (-1./2.) + + m2*g2Val * (-1./2.) + + m1*m1*Power(m2, -1)*g2Val * (1./2.); - Double_t f0pReal = m2*g1Val * ( - sqrt(x*x-1) ); - Double_t f0pImag = Power(mzz,-2.)*Power(m1,-1)*Power(m2,4)*g2Val * ( 1./2. ) - + Power(mzz,-2.)*m1*Power(m2,2)*g2Val * ( - 1 - 2*(x*x-1) ) - + Power(mzz,-2.)*Power(m1,3)*g2Val * ( 1./2. ) - + Power(m1,-1)*Power(m2,2)*g2Val * ( - 1./2. ) - + m1*g2Val * ( 1./2. ); - - Double_t f0mReal = m2*g1Val * ( - sqrt(x*x-1) ); - Double_t f0mImag = Power(mzz,-2.)*Power(m1,-1)*Power(m2,4)*g2Val * ( - 1./2. ) - + Power(mzz,-2.)*m1*Power(m2,2)*g2Val * ( 1 + 2*(x*x-1) ) - + Power(mzz,-2.)*Power(m1,3)*g2Val * ( - 1./2. ) - + Power(m1,-1)*Power(m2,2)*g2Val * ( 1./2. ) - + m1*g2Val * ( - 1./2. ); - - Double_t fm0Real = m1*g1Val * ( sqrt(x*x-1) ); - Double_t fm0Imag = Power(mzz,-2.)*Power(m2,3)*g2Val * ( 1./2. ) - + Power(mzz,-2.)*m1*m1*m2*g2Val * ( - 1 - 2*(x*x-1) ) - + Power(mzz,-2.)*Power(m1,4)*Power(m2,-1)*g2Val * ( 1./2. ) - + m2*g2Val * ( 1./2. ) - + m1*m1*Power(m2,-1)*g2Val * ( - 1./2. ); - + Double_t f0pReal = m2*g1Val * (-sqrt(x*x-1)); + Double_t f0pImag = Power(mzz, -2.)*Power(m1, -1)*Power(m2, 4)*g2Val * (1./2.) + + Power(mzz, -2.)*m1*Power(m2, 2)*g2Val * (-1 - 2*(x*x-1)) + + Power(mzz, -2.)*Power(m1, 3)*g2Val * (1./2.) + + Power(m1, -1)*Power(m2, 2)*g2Val * (-1./2.) + + m1*g2Val * (1./2.); + + Double_t f0mReal = m2*g1Val * (-sqrt(x*x-1)); + Double_t f0mImag = Power(mzz, -2.)*Power(m1, -1)*Power(m2, 4)*g2Val * (-1./2.) + + Power(mzz, -2.)*m1*Power(m2, 2)*g2Val * (1 + 2*(x*x-1)) + + Power(mzz, -2.)*Power(m1, 3)*g2Val * (-1./2.) + + Power(m1, -1)*Power(m2, 2)*g2Val * (1./2.) + + m1*g2Val * (-1./2.); + + Double_t fm0Real = m1*g1Val * (sqrt(x*x-1)); + Double_t fm0Imag = Power(mzz, -2.)*Power(m2, 3)*g2Val * (1./2.) + + Power(mzz, -2.)*m1*m1*m2*g2Val * (-1 - 2*(x*x-1)) + + Power(mzz, -2.)*Power(m1, 4)*Power(m2, -1)*g2Val * (1./2.) + + m2*g2Val * (1./2.) + + m1*m1*Power(m2, -1)*g2Val * (-1./2.); + Double_t f00 = f00Imag*f00Imag + f00Real*f00Real; Double_t fpp = fppImag*fppImag + fppReal*fppReal; Double_t fmm = fmmImag*fmmImag + fmmReal*fmmReal; @@ -301,160 +299,162 @@ Double_t RooSpinOne_7D::analyticalIntegral(Int_t code, const char* rangeName) co Double_t f0p = f0pImag*f0pImag + f0pReal*f0pReal; Double_t fm0 = fm0Imag*fm0Imag + fm0Real*fm0Real; Double_t f0m = f0mImag*f0mImag + f0mReal*f0mReal; - - Double_t phi00=atan2(f00Imag,f00Real); - Double_t phipp=atan2(fppImag,fppReal)-phi00; - Double_t phimm=atan2(fmmImag,fmmReal)-phi00; - Double_t phip0=atan2(fp0Imag,fp0Real)-phi00; - Double_t phi0p=atan2(f0pImag,f0pReal)-phi00; - Double_t phim0=atan2(fm0Imag,fm0Real)-phi00; - Double_t phi0m=atan2(f0mImag,f0mReal)-phi00; + + Double_t phi00=atan2(f00Imag, f00Real); + Double_t phipp=atan2(fppImag, fppReal)-phi00; + Double_t phimm=atan2(fmmImag, fmmReal)-phi00; + Double_t phip0=atan2(fp0Imag, fp0Real)-phi00; + Double_t phi0p=atan2(f0pImag, f0pReal)-phi00; + Double_t phim0=atan2(fm0Imag, fm0Real)-phi00; + Double_t phi0m=atan2(f0mImag, f0mReal)-phi00; Double_t integral=0; - switch(code) - { - // Integrate out all angles - case 6: - { - integral = 0.; - integral+= - (32.*f00*TMath::Power(Pi(),2))/27.; - integral+= - (32.*fpp*TMath::Power(Pi(),2))/27.; - integral+= - (32.*fmm*TMath::Power(Pi(),2))/27.; - integral+= - (32.*fp0*TMath::Power(Pi(),2))/27.; - integral+= - (32.*f0m*TMath::Power(Pi(),2))/27.; - integral+= - (32.*f0p*TMath::Power(Pi(),2))/27.; - integral+= - (32.*fm0*TMath::Power(Pi(),2))/27.; - return term1Coeff*term2Coeff*betaVal*integral; - - } - - // projections onto Phi1, integrate all other angles - case 5: - { - integral = 0.; - integral += - (16*f00*Pi())/27.; - integral += - (16*fpp*Pi())/27.; - integral += - (16*fmm*Pi())/27.; - integral += - (16*fp0*Pi())/27.; - integral += - (16*f0m*Pi())/27.; - integral += - (16*f0p*Pi())/27.; - integral += - (16*fm0*Pi())/27.; - integral += - (8*Sqrt(fm0)*Sqrt(fp0)*Pi()*Cos(2.*Phi1 + phim0 - phip0))/27.; - return term1Coeff*term2Coeff*betaVal*integral; - - } - // projection to Phi, integrate all other angles - case 4: - { - integral = 0.; - integral += - (16*f00*Pi())/27.; - integral += - (16*fmm*Pi())/27.; - integral += - (16*fpp*Pi())/27.; - integral += - (16*fp0*Pi())/27.; - integral += - (16*f0m*Pi())/27.; - integral += - (16*f0p*Pi())/27.; - integral += - (16*fm0*Pi())/27.; - integral += - (Sqrt(f00)*Sqrt(fmm)*TMath::Power(TMath::Pi(),3)*R1Val*R2Val*Cos(Phi - phimm))/12.; - integral += - (Sqrt(f00)*Sqrt(fpp)*TMath::Power(TMath::Pi(),3)*R1Val*R2Val*Cos(Phi + phipp))/12.; - integral += - (8*Sqrt(fmm)*Sqrt(fpp)*TMath::Pi()*Cos(2*Phi - phimm + phipp))/27.; - integral += - (Sqrt(f0m)*Sqrt(fp0)*TMath::Power(Pi(),3)*R1Val*R2Val* - Cos(Phi - phi0m + phip0))/12.; - integral += - (Sqrt(f0p)*Sqrt(fm0)*TMath::Power(Pi(),3)*R1Val*R2Val* - Cos(Phi + phi0p - phim0))/12.; - return term1Coeff*term2Coeff*betaVal*integral; - } - - // projections to h2, integrate over all others - case 3: - { - integral = 0.; - integral += - (-8*f00*(-1 + TMath::Power(h2,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (4*fmm*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h2,2) - 2*h2*R2Val))/9.; - integral += - (4*fpp*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h2,2) + 2*h2*R2Val))/9.; - integral += - (-8*fp0*(-1 + TMath::Power(h2,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (4*f0m*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h2,2) - 2*h2*R2Val))/9.; - integral += - (4*f0p*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h2,2) + 2*h2*R2Val))/9.; - integral += - (-8*fm0*(-1 + TMath::Power(h2,2))*TMath::Power(TMath::Pi(),2))/9.; - return term1Coeff*term2Coeff*betaVal*integral; - } - // projections to h1, integrate all others - case 2: - { - integral=0.; - integral += - (-8*f00*(-1 + TMath::Power(h1,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (4*fmm*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h1,2) - 2*h1*R1Val))/9.; - integral += - (4*fpp*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h1,2) + 2*h1*R1Val))/9.; - integral += - (4*fp0*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h1,2) + 2*h1*R1Val))/9.; - integral += - (-8*f0m*(-1 + TMath::Power(h1,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (-8*f0p*(-1 + TMath::Power(h1,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (4*fm0*TMath::Power(TMath::Pi(),2)*(1 + TMath::Power(h1,2) - 2*h1*R1Val))/9.; - return term1Coeff*term2Coeff*betaVal*integral; - } - - // projections to hs, integrate all others - case 1: - { - integral = 0.; - integral += - (-8*f00*(-1 + TMath::Power(hs_,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (-8*fmm*(-1 + TMath::Power(hs_,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (-8*fpp*(-1 + TMath::Power(hs_,2))*TMath::Power(TMath::Pi(),2))/9.; - integral += - (4.*fp0*TMath::Power(Pi(),2)*(1. + TMath::Power(hs_,2)))/9.; - integral += - (4.*f0m*TMath::Power(Pi(),2)*(1. + TMath::Power(hs_,2)))/9.; - integral += - (4.*f0p*TMath::Power(Pi(),2)*(1. + TMath::Power(hs_,2)))/9.; - integral += - (4.*fm0*TMath::Power(Pi(),2)*(1. + TMath::Power(hs_,2)))/9.; - return term1Coeff*term2Coeff*betaVal*integral; - - } - } - assert(0) ; - return 0 ; + switch (code) + { + // Integrate out all angles + case 6: + { + integral = 0.; + integral+= + (32.*f00*TMath::Power(Pi(), 2))/27.; + integral+= + (32.*fpp*TMath::Power(Pi(), 2))/27.; + integral+= + (32.*fmm*TMath::Power(Pi(), 2))/27.; + integral+= + (32.*fp0*TMath::Power(Pi(), 2))/27.; + integral+= + (32.*f0m*TMath::Power(Pi(), 2))/27.; + integral+= + (32.*f0p*TMath::Power(Pi(), 2))/27.; + integral+= + (32.*fm0*TMath::Power(Pi(), 2))/27.; + return term1Coeff*term2Coeff*betaVal*integral; + + } + + // projections onto Phi1, integrate all other angles + case 5: + { + integral = 0.; + integral += + (16*f00*Pi())/27.; + integral += + (16*fpp*Pi())/27.; + integral += + (16*fmm*Pi())/27.; + integral += + (16*fp0*Pi())/27.; + integral += + (16*f0m*Pi())/27.; + integral += + (16*f0p*Pi())/27.; + integral += + (16*fm0*Pi())/27.; + integral += + (8*Sqrt(fm0)*Sqrt(fp0)*Pi()*Cos(2.*Phi1 + phim0 - phip0))/27.; + return term1Coeff*term2Coeff*betaVal*integral; + + } + // projection to Phi, integrate all other angles + case 4: + { + integral = 0.; + integral += + (16*f00*Pi())/27.; + integral += + (16*fmm*Pi())/27.; + integral += + (16*fpp*Pi())/27.; + integral += + (16*fp0*Pi())/27.; + integral += + (16*f0m*Pi())/27.; + integral += + (16*f0p*Pi())/27.; + integral += + (16*fm0*Pi())/27.; + integral += + (Sqrt(f00)*Sqrt(fmm)*TMath::Power(TMath::Pi(), 3)*R1Val*R2Val*Cos(Phi - phimm))/12.; + integral += + (Sqrt(f00)*Sqrt(fpp)*TMath::Power(TMath::Pi(), 3)*R1Val*R2Val*Cos(Phi + phipp))/12.; + integral += + (8*Sqrt(fmm)*Sqrt(fpp)*TMath::Pi()*Cos(2*Phi - phimm + phipp))/27.; + integral += + (Sqrt(f0m)*Sqrt(fp0)*TMath::Power(Pi(), 3)*R1Val*R2Val* + Cos(Phi - phi0m + phip0))/12.; + integral += + (Sqrt(f0p)*Sqrt(fm0)*TMath::Power(Pi(), 3)*R1Val*R2Val* + Cos(Phi + phi0p - phim0))/12.; + return term1Coeff*term2Coeff*betaVal*integral; + } + + // projections to h2, integrate over all others + case 3: + { + integral = 0.; + integral += + (-8*f00*(-1 + TMath::Power(h2, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (4*fmm*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h2, 2) - 2*h2*R2Val))/9.; + integral += + (4*fpp*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h2, 2) + 2*h2*R2Val))/9.; + integral += + (-8*fp0*(-1 + TMath::Power(h2, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (4*f0m*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h2, 2) - 2*h2*R2Val))/9.; + integral += + (4*f0p*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h2, 2) + 2*h2*R2Val))/9.; + integral += + (-8*fm0*(-1 + TMath::Power(h2, 2))*TMath::Power(TMath::Pi(), 2))/9.; + return term1Coeff*term2Coeff*betaVal*integral; + } + // projections to h1, integrate all others + case 2: + { + integral=0.; + integral += + (-8*f00*(-1 + TMath::Power(h1, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (4*fmm*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h1, 2) - 2*h1*R1Val))/9.; + integral += + (4*fpp*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h1, 2) + 2*h1*R1Val))/9.; + integral += + (4*fp0*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h1, 2) + 2*h1*R1Val))/9.; + integral += + (-8*f0m*(-1 + TMath::Power(h1, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (-8*f0p*(-1 + TMath::Power(h1, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (4*fm0*TMath::Power(TMath::Pi(), 2)*(1 + TMath::Power(h1, 2) - 2*h1*R1Val))/9.; + return term1Coeff*term2Coeff*betaVal*integral; + } + + // projections to hs, integrate all others + case 1: + { + integral = 0.; + integral += + (-8*f00*(-1 + TMath::Power(hs_, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (-8*fmm*(-1 + TMath::Power(hs_, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (-8*fpp*(-1 + TMath::Power(hs_, 2))*TMath::Power(TMath::Pi(), 2))/9.; + integral += + (4.*fp0*TMath::Power(Pi(), 2)*(1. + TMath::Power(hs_, 2)))/9.; + integral += + (4.*f0m*TMath::Power(Pi(), 2)*(1. + TMath::Power(hs_, 2)))/9.; + integral += + (4.*f0p*TMath::Power(Pi(), 2)*(1. + TMath::Power(hs_, 2)))/9.; + integral += + (4.*fm0*TMath::Power(Pi(), 2)*(1. + TMath::Power(hs_, 2)))/9.; + return term1Coeff*term2Coeff*betaVal*integral; + + } + } + assert(0); + return 0; } + +void RooSpinOne_7D::setZZ4fOrdering(Bool_t flag){ ZZ4fOrdering=flag; } diff --git a/MELA/src/RooSpinTwo_7DComplex_HVV.cc b/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc similarity index 89% rename from MELA/src/RooSpinTwo_7DComplex_HVV.cc rename to MELA/src/RooSpinTwo_7DComplex_ppHVV.cc index edc1f7f7..97e6d247 100644 --- a/MELA/src/RooSpinTwo_7DComplex_HVV.cc +++ b/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc @@ -1,7 +1,7 @@ -#include "RooSpinTwo_7DComplex_HVV.h" +#include "RooSpinTwo_7DComplex_ppHVV.h" -RooSpinTwo_7DComplex_HVV::RooSpinTwo_7DComplex_HVV( +RooSpinTwo_7DComplex_ppHVV::RooSpinTwo_7DComplex_ppHVV( const char *name, const char *title, modelMeasurables _measurables, modelParameters _parameters, @@ -13,17 +13,19 @@ RooSpinTwo_7DComplex_HVV::RooSpinTwo_7DComplex_HVV( _parameters, _couplings, _Vdecay1, _Vdecay2 - ) + ), + ZZ4fOrdering(true) {} -RooSpinTwo_7DComplex_HVV::RooSpinTwo_7DComplex_HVV( - const RooSpinTwo_7DComplex_HVV& other, const char* name - ) : RooSpinTwo(other, name) +RooSpinTwo_7DComplex_ppHVV::RooSpinTwo_7DComplex_ppHVV( + const RooSpinTwo_7DComplex_ppHVV& other, const char* name + ) : RooSpinTwo(other, name), + ZZ4fOrdering(other.ZZ4fOrdering) {} -Double_t RooSpinTwo_7DComplex_HVV::evaluateH1Factor(Int_t i1, Int_t j1, Int_t helicity, Int_t code) const{ +Double_t RooSpinTwo_7DComplex_ppHVV::evaluateH1Factor(Int_t i1, Int_t j1, Int_t helicity, Int_t code) const{ const Double_t Pi = TMath::Pi(); Double_t dHel = (Double_t)helicity; Double_t result = 0; @@ -43,7 +45,7 @@ Double_t RooSpinTwo_7DComplex_HVV::evaluateH1Factor(Int_t i1, Int_t j1, Int_t he } return result; } -Double_t RooSpinTwo_7DComplex_HVV::evaluateH2Factor(Int_t i2, Int_t j2, Int_t helicity, Int_t code) const{ +Double_t RooSpinTwo_7DComplex_ppHVV::evaluateH2Factor(Int_t i2, Int_t j2, Int_t helicity, Int_t code) const{ const Double_t Pi = TMath::Pi(); Double_t dHel = (Double_t)helicity; Double_t result = 0; @@ -63,7 +65,7 @@ Double_t RooSpinTwo_7DComplex_HVV::evaluateH2Factor(Int_t i2, Int_t j2, Int_t he } return result; } -Double_t RooSpinTwo_7DComplex_HVV::evaluateHSFactor(Int_t di, Int_t dj, Int_t code) const{ +Double_t RooSpinTwo_7DComplex_ppHVV::evaluateHSFactor(Int_t di, Int_t dj, Int_t code) const{ Double_t f_spinz0 = 1. - f_spinz1 - f_spinz2; if (f_spinz0<0) f_spinz0=0; Double_t hsneg = -hs; if (fabs(hsneg)>1.) hsneg *= 1./fabs(hsneg); @@ -125,7 +127,7 @@ Double_t RooSpinTwo_7DComplex_HVV::evaluateHSFactor(Int_t di, Int_t dj, Int_t co else if ((di==-2 && dj==2) || (di==2 && dj==-2)) result = AF2m22; return result; } -Double_t RooSpinTwo_7DComplex_HVV::evaluatePhi1PhiFactor(Int_t i1, Int_t i2, Int_t j1, Int_t j2, Int_t code, Double_t extraPhase1, Double_t extraPhase2) const{ +Double_t RooSpinTwo_7DComplex_ppHVV::evaluatePhi1PhiFactor(Int_t i1, Int_t i2, Int_t j1, Int_t j2, Int_t code, Double_t extraPhase1, Double_t extraPhase2) const{ const Double_t Pi = TMath::Pi(); Double_t result = 0; @@ -166,7 +168,7 @@ Double_t RooSpinTwo_7DComplex_HVV::evaluatePhi1PhiFactor(Int_t i1, Int_t i2, Int return result; } -void RooSpinTwo_7DComplex_HVV::evaluatePolarizationTerms(std::vector& Axxyyterm, const Int_t code, bool isGammaV1, bool isGammaV2) const{ +void RooSpinTwo_7DComplex_ppHVV::evaluatePolarizationTerms(std::vector& Axxyyterm, const Int_t code, bool isGammaV1, bool isGammaV2) const{ Double_t R1Val, R2Val; calculateR1R2(R1Val, R2Val, isGammaV1, isGammaV2); @@ -274,7 +276,7 @@ void RooSpinTwo_7DComplex_HVV::evaluatePolarizationTerms(std::vector& return; } -Double_t RooSpinTwo_7DComplex_HVV::evaluate() const{ +Double_t RooSpinTwo_7DComplex_ppHVV::evaluate() const{ Double_t mV; getMVGamV(&mV); bool isZZ = (mV >= 90.); @@ -282,7 +284,7 @@ Double_t RooSpinTwo_7DComplex_HVV::evaluate() const{ Double_t m1_=m1; if (Vdecay1==RooSpin::kVdecayType_GammaOnshell) m1_=0; Double_t m2_=m2; if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) m2_=0; if (isZZ && Vdecay1==Vdecay2){ - if ((m1_+m2_) > m12 || (fabs(m2_-mV) m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; @@ -317,7 +319,7 @@ Double_t RooSpinTwo_7DComplex_HVV::evaluate() const{ return value; } -Int_t RooSpinTwo_7DComplex_HVV::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const{ +Int_t RooSpinTwo_7DComplex_ppHVV::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const{ Int_t code = intCodeStart; if (checkFundamentalType(h1)){ if (matchArgs(allVars, analVars, h1) || Vdecay1==RooSpin::kVdecayType_GammaOnshell) code *= prime_h1; } if (checkFundamentalType(h2)){ if (matchArgs(allVars, analVars, h2) || Vdecay2==RooSpin::kVdecayType_GammaOnshell) code *= prime_h2; } @@ -327,7 +329,7 @@ Int_t RooSpinTwo_7DComplex_HVV::getAnalyticalIntegral(RooArgSet& allVars, RooArg if (code==1) code=0; return code; } -Double_t RooSpinTwo_7DComplex_HVV::analyticalIntegral(Int_t code, const char* /*rangeName*/) const{ +Double_t RooSpinTwo_7DComplex_ppHVV::analyticalIntegral(Int_t code, const char* /*rangeName*/) const{ Double_t mV; getMVGamV(&mV); bool isZZ = (mV >= 90.); @@ -335,7 +337,7 @@ Double_t RooSpinTwo_7DComplex_HVV::analyticalIntegral(Int_t code, const char* /* Double_t m1_=m1; if (Vdecay1==RooSpin::kVdecayType_GammaOnshell) m1_=0; Double_t m2_=m2; if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) m2_=0; if (isZZ && Vdecay1==Vdecay2){ - if ((m1_+m2_) > m12 || (fabs(m2_-mV) m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; @@ -378,3 +380,4 @@ Double_t RooSpinTwo_7DComplex_HVV::analyticalIntegral(Int_t code, const char* /* return value; } +void RooSpinTwo_7DComplex_ppHVV::setZZ4fOrdering(Bool_t flag){ ZZ4fOrdering=flag; } diff --git a/MELA/src/RooSpinZero_7DComplex_withAccep_ggH.cc b/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc similarity index 92% rename from MELA/src/RooSpinZero_7DComplex_withAccep_ggH.cc rename to MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc index 45d332d1..8d9721a5 100755 --- a/MELA/src/RooSpinZero_7DComplex_withAccep_ggH.cc +++ b/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc @@ -1,7 +1,7 @@ -#include "RooSpinZero_7DComplex_withAccep_ggH.h" +#include "RooSpinZero_7DComplex_withAccep_HVV.h" -RooSpinZero_7DComplex_withAccep_ggH::RooSpinZero_7DComplex_withAccep_ggH( +RooSpinZero_7DComplex_withAccep_HVV::RooSpinZero_7DComplex_withAccep_HVV( const char *name, const char *title, modelMeasurables _measurables, modelParameters _parameters, @@ -47,12 +47,13 @@ RooSpinZero_7DComplex_withAccep_ggH::RooSpinZero_7DComplex_withAccep_ggH( aM2("aM2", "aM2", this, (RooAbsReal&)*(_accepParams.aM2)), bM2("bM2", "bM2", this, (RooAbsReal&)*(_accepParams.bM2)), cM2("cM2", "cM2", this, (RooAbsReal&)*(_accepParams.cM2)), - dM2("dM2", "dM2", this, (RooAbsReal&)*(_accepParams.dM2)) + dM2("dM2", "dM2", this, (RooAbsReal&)*(_accepParams.dM2)), + ZZ4fOrdering(true) {} -RooSpinZero_7DComplex_withAccep_ggH::RooSpinZero_7DComplex_withAccep_ggH( - const RooSpinZero_7DComplex_withAccep_ggH& other, const char* name +RooSpinZero_7DComplex_withAccep_HVV::RooSpinZero_7DComplex_withAccep_HVV( + const RooSpinZero_7DComplex_withAccep_HVV& other, const char* name ) : RooSpinZero(other, name), aPhi("aPhi", this, other.aPhi), bPhi("bPhi", this, other.bPhi), @@ -86,10 +87,11 @@ RooSpinZero_7DComplex_withAccep_ggH::RooSpinZero_7DComplex_withAccep_ggH( aM2("aM2", this, other.aM2), bM2("bM2", this, other.bM2), cM2("cM2", this, other.cM2), - dM2("dM2", this, other.dM2) + dM2("dM2", this, other.dM2), + ZZ4fOrdering(other.ZZ4fOrdering) {} -void RooSpinZero_7DComplex_withAccep_ggH::evaluatePolarizationTerms(Double_t& A00term, Double_t& Appterm, Double_t& Ammterm, Double_t& A00ppterm, Double_t& A00mmterm, Double_t& Appmmterm, const Int_t code, bool isGammaV1, bool isGammaV2) const{ +void RooSpinZero_7DComplex_withAccep_HVV::evaluatePolarizationTerms(Double_t& A00term, Double_t& Appterm, Double_t& Ammterm, Double_t& A00ppterm, Double_t& A00mmterm, Double_t& Appmmterm, const Int_t code, bool isGammaV1, bool isGammaV2) const{ const Double_t Pi = TMath::Pi(); Double_t R1Val, R2Val; @@ -235,7 +237,7 @@ void RooSpinZero_7DComplex_withAccep_ggH::evaluatePolarizationTerms(Double_t& A0 } } -Double_t RooSpinZero_7DComplex_withAccep_ggH::evaluate() const{ +Double_t RooSpinZero_7DComplex_withAccep_HVV::evaluate() const{ Double_t mV; getMVGamV(&mV); bool isZZ = (mV >= 90.); @@ -243,7 +245,7 @@ Double_t RooSpinZero_7DComplex_withAccep_ggH::evaluate() const{ Double_t m1_=m1; if (Vdecay1==RooSpin::kVdecayType_GammaOnshell) m1_=0; Double_t m2_=m2; if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) m2_=0; if (isZZ && Vdecay1==Vdecay2){ - if ((m1_+m2_) > m12 || (fabs(m2_-mV) m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; @@ -298,7 +300,7 @@ Double_t RooSpinZero_7DComplex_withAccep_ggH::evaluate() const{ return value; } -Int_t RooSpinZero_7DComplex_withAccep_ggH::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const{ +Int_t RooSpinZero_7DComplex_withAccep_HVV::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const{ Int_t code = intCodeStart; if (checkFundamentalType(h1)){ if (matchArgs(allVars, analVars, h1) || Vdecay1==RooSpin::kVdecayType_GammaOnshell) code *= prime_h1; } if (checkFundamentalType(h2)){ if (matchArgs(allVars, analVars, h2) || Vdecay2==RooSpin::kVdecayType_GammaOnshell) code *= prime_h2; } @@ -308,7 +310,7 @@ Int_t RooSpinZero_7DComplex_withAccep_ggH::getAnalyticalIntegral(RooArgSet& allV if (code==1) code=0; return code; } -Double_t RooSpinZero_7DComplex_withAccep_ggH::analyticalIntegral(Int_t code, const char* /*rangeName*/) const{ +Double_t RooSpinZero_7DComplex_withAccep_HVV::analyticalIntegral(Int_t code, const char* /*rangeName*/) const{ Double_t mV; getMVGamV(&mV); bool isZZ = (mV >= 90.); @@ -316,7 +318,7 @@ Double_t RooSpinZero_7DComplex_withAccep_ggH::analyticalIntegral(Int_t code, con Double_t m1_=m1; if (Vdecay1==RooSpin::kVdecayType_GammaOnshell) m1_=0; Double_t m2_=m2; if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) m2_=0; if (isZZ && Vdecay1==Vdecay2){ - if ((m1_+m2_) > m12 || (fabs(m2_-mV) m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; @@ -363,3 +365,4 @@ Double_t RooSpinZero_7DComplex_withAccep_ggH::analyticalIntegral(Int_t code, con return value; } +void RooSpinZero_7DComplex_withAccep_HVV::setZZ4fOrdering(Bool_t flag){ ZZ4fOrdering=flag; } diff --git a/MELA/src/ScalarPdfFactory_ggH.cc b/MELA/src/ScalarPdfFactory_HVV.cc similarity index 94% rename from MELA/src/ScalarPdfFactory_ggH.cc rename to MELA/src/ScalarPdfFactory_HVV.cc index 07573b26..b7a884ef 100644 --- a/MELA/src/ScalarPdfFactory_ggH.cc +++ b/MELA/src/ScalarPdfFactory_HVV.cc @@ -1,7 +1,7 @@ -#include "ScalarPdfFactory_ggH.h" +#include "ScalarPdfFactory_HVV.h" -ScalarPdfFactory_ggH::ScalarPdfFactory_ggH(RooSpinZero::modelMeasurables measurables_, bool acceptance_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) : +ScalarPdfFactory_HVV::ScalarPdfFactory_HVV(RooSpinZero::modelMeasurables measurables_, bool acceptance_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) : ScalarPdfFactory(measurables_, acceptance_, V1decay_, V2decay_, OnshellH_) { measurables.Y=0; @@ -9,7 +9,7 @@ ScalarPdfFactory(measurables_, acceptance_, V1decay_, V2decay_, OnshellH_) makeParamsConst(true); initPDF(); } -ScalarPdfFactory_ggH::ScalarPdfFactory_ggH(RooSpinZero::modelMeasurables measurables_, double gRatio_[4][8], double gZGsRatio_[4][1], double gGsGsRatio_[3][1], bool pmf_applied_, bool acceptance_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) : +ScalarPdfFactory_HVV::ScalarPdfFactory_HVV(RooSpinZero::modelMeasurables measurables_, double gRatio_[4][8], double gZGsRatio_[4][1], double gGsGsRatio_[3][1], bool pmf_applied_, bool acceptance_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) : ScalarPdfFactory(measurables_, gRatio_, gZGsRatio_, gGsGsRatio_, pmf_applied_, acceptance_, V1decay_, V2decay_, OnshellH_) { measurables.Y=0; @@ -18,12 +18,12 @@ ScalarPdfFactory(measurables_, gRatio_, gZGsRatio_, gGsGsRatio_, pmf_applied_, a initPDF(); } -ScalarPdfFactory_ggH::~ScalarPdfFactory_ggH(){ +ScalarPdfFactory_HVV::~ScalarPdfFactory_HVV(){ destroyPDF(); destroyAcceptanceParams(); } -void ScalarPdfFactory_ggH::initAcceptanceParams(){ +void ScalarPdfFactory_HVV::initAcceptanceParams(){ if (acceptance){ accepParams.aPhi = new RooRealVar("aPhi", "aPhi", 1.); accepParams.bPhi = new RooRealVar("bPhi", "bPhi", 4.88199e-03); @@ -107,7 +107,7 @@ void ScalarPdfFactory_ggH::initAcceptanceParams(){ accepParams.dM2 = new RooRealVar("dM2", "dM2", 0.); } } -void ScalarPdfFactory_ggH::destroyAcceptanceParams(){ +void ScalarPdfFactory_HVV::destroyAcceptanceParams(){ delete accepParams.aM1; delete accepParams.bM1; delete accepParams.cM1; @@ -143,7 +143,7 @@ void ScalarPdfFactory_ggH::destroyAcceptanceParams(){ delete accepParams.eHs; } -void ScalarPdfFactory_ggH::makeParamsConst(bool yesNo){ +void ScalarPdfFactory_HVV::makeParamsConst(bool yesNo){ couplings.Lambda->setConstant(true); couplings.Lambda_zgs1->setConstant(true); couplings.Lambda_z1->setConstant(true); @@ -244,9 +244,10 @@ void ScalarPdfFactory_ggH::makeParamsConst(bool yesNo){ accepParams.dM2->setConstant(kTRUE); } } +void ScalarPdfFactory_HVV::setZZ4fOrdering(bool flag){ PDF->setZZ4fOrdering(flag); } -void ScalarPdfFactory_ggH::initPDF(){ - PDF = new RooSpinZero_7DComplex_withAccep_ggH( +void ScalarPdfFactory_HVV::initPDF(){ + PDF = new RooSpinZero_7DComplex_withAccep_HVV( "PDF", "PDF", measurables, parameters, diff --git a/MELA/src/TensorPdfFactory_HVV.cc b/MELA/src/TensorPdfFactory_ppHVV.cc similarity index 60% rename from MELA/src/TensorPdfFactory_HVV.cc rename to MELA/src/TensorPdfFactory_ppHVV.cc index f7ee4a2f..8f2465db 100644 --- a/MELA/src/TensorPdfFactory_HVV.cc +++ b/MELA/src/TensorPdfFactory_ppHVV.cc @@ -1,7 +1,7 @@ -#include "TensorPdfFactory_HVV.h" +#include "TensorPdfFactory_ppHVV.h" -TensorPdfFactory_HVV::TensorPdfFactory_HVV(RooSpin::modelMeasurables measurables_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) : +TensorPdfFactory_ppHVV::TensorPdfFactory_ppHVV(RooSpin::modelMeasurables measurables_, RooSpin::VdecayType V1decay_, RooSpin::VdecayType V2decay_, Bool_t OnshellH_) : TensorPdfFactory(measurables_, V1decay_, V2decay_, OnshellH_) { measurables.Y=0; @@ -9,11 +9,11 @@ TensorPdfFactory(measurables_, V1decay_, V2decay_, OnshellH_) initPDF(); } -TensorPdfFactory_HVV::~TensorPdfFactory_HVV(){ +TensorPdfFactory_ppHVV::~TensorPdfFactory_ppHVV(){ destroyPDF(); } -void TensorPdfFactory_HVV::makeParamsConst(bool yesNo){ +void TensorPdfFactory_ppHVV::makeParamsConst(bool yesNo){ couplings.Lambda->setConstant(true); ((RooRealVar*)parameters.mX)->setConstant(yesNo); @@ -25,9 +25,10 @@ void TensorPdfFactory_HVV::makeParamsConst(bool yesNo){ ((RooRealVar*)parameters.Sin2ThetaW)->setConstant(yesNo); ((RooRealVar*)parameters.vev)->setConstant(yesNo); } +void TensorPdfFactory_ppHVV::setZZ4fOrdering(bool flag){ PDF->setZZ4fOrdering(flag); } -void TensorPdfFactory_HVV::initPDF(){ - PDF = new RooSpinTwo_7DComplex_HVV( +void TensorPdfFactory_ppHVV::initPDF(){ + PDF = new RooSpinTwo_7DComplex_ppHVV( "PDF", "PDF", measurables, parameters, From 92d6e6711c86e35c51232ad040fd3062c1f34c31 Mon Sep 17 00:00:00 2001 From: Ulascan Sarica Date: Wed, 1 Feb 2017 18:32:41 +0100 Subject: [PATCH 2/3] GeV units as in JHUGen --- MELA/interface/RooSpin.h | 13 ++++----- MELA/interface/ScalarPdfFactory.h | 1 + MELA/interface/ScalarPdfFactory_HVV.h | 7 ++--- MELA/interface/ScalarPdfFactory_VH.h | 7 ++--- MELA/interface/SpinPdfFactory.h | 1 + MELA/interface/TensorPdfFactory.h | 3 ++- MELA/interface/TensorPdfFactory_ppHVV.h | 7 ++--- MELA/src/RooSpin.cc | 27 ++++++++++++++----- MELA/src/RooSpinTwo.cc | 11 +++++++- MELA/src/RooSpinTwo_7DComplex_ppHVV.cc | 8 +++--- MELA/src/RooSpinZero.cc | 2 +- MELA/src/RooSpinZero_3D_pp_VH.cc | 8 +++--- MELA/src/RooSpinZero_5D_VH.cc | 8 +++--- .../RooSpinZero_7DComplex_withAccep_HVV.cc | 8 +++--- MELA/src/ScalarPdfFactory_VH.cc | 1 + 15 files changed, 71 insertions(+), 41 deletions(-) diff --git a/MELA/interface/RooSpin.h b/MELA/interface/RooSpin.h index 6d9c467b..a02b9a11 100644 --- a/MELA/interface/RooSpin.h +++ b/MELA/interface/RooSpin.h @@ -71,7 +71,7 @@ class RooSpin : public RooAbsPdf { RooAbsReal* vev; }; - RooSpin(){}; + RooSpin(); RooSpin( const char* name, const char* title, modelMeasurables _measurables, @@ -95,11 +95,6 @@ class RooSpin : public RooAbsPdf { protected: - RooSpin::VdecayType Vdecay1; - RooSpin::VdecayType Vdecay2; - - Int_t intCodeStart; - RooRealProxy h1; RooRealProxy h2; RooRealProxy Phi; @@ -119,6 +114,12 @@ class RooSpin : public RooAbsPdf { RooRealProxy Sin2ThetaW; RooRealProxy vev; + RooSpin::VdecayType Vdecay1; + RooSpin::VdecayType Vdecay2; + + Int_t intCodeStart; + const Double_t GeVunit; + virtual void calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t mass, Int_t propType=1) const; virtual void calculateGVGA(Double_t& gV, Double_t& gA, RooSpin::VdecayType Vdecay, bool isGamma=false) const; virtual void calculateR1R2(Double_t& R1Val, Double_t& R2Val, bool isGammaV1=false, bool isGammaV2=false) const; diff --git a/MELA/interface/ScalarPdfFactory.h b/MELA/interface/ScalarPdfFactory.h index af63c21d..8561ecfe 100755 --- a/MELA/interface/ScalarPdfFactory.h +++ b/MELA/interface/ScalarPdfFactory.h @@ -81,6 +81,7 @@ class ScalarPdfFactory : public SpinPdfFactory{ virtual void initPDF()=0; virtual void destroyPDF()=0; + }; diff --git a/MELA/interface/ScalarPdfFactory_HVV.h b/MELA/interface/ScalarPdfFactory_HVV.h index 73307e4c..2bf352c5 100755 --- a/MELA/interface/ScalarPdfFactory_HVV.h +++ b/MELA/interface/ScalarPdfFactory_HVV.h @@ -5,7 +5,7 @@ #include "RooSpinZero_7DComplex_withAccep_HVV.h" -class ScalarPdfFactory_HVV : public ScalarPdfFactory { +class ScalarPdfFactory_HVV : public ScalarPdfFactory{ public: RooSpinZero_7DComplex_withAccep_HVV::accepParameters accepParams; @@ -23,8 +23,9 @@ class ScalarPdfFactory_HVV : public ScalarPdfFactory { virtual void initAcceptanceParams(); virtual void destroyAcceptanceParams(); - void initPDF(); - void destroyPDF(){ delete PDF; } + virtual void initPDF(); + virtual void destroyPDF(){ delete PDF; PDF=0; PDF_base=0; } + }; diff --git a/MELA/interface/ScalarPdfFactory_VH.h b/MELA/interface/ScalarPdfFactory_VH.h index 2390861f..9385c586 100644 --- a/MELA/interface/ScalarPdfFactory_VH.h +++ b/MELA/interface/ScalarPdfFactory_VH.h @@ -6,7 +6,7 @@ #include "ScalarPdfFactory.h" -class ScalarPdfFactory_VH : public ScalarPdfFactory { +class ScalarPdfFactory_VH : public ScalarPdfFactory{ public: ScalarPdfFactory_VH(RooSpin::modelMeasurables measurables_, double sqrts_, RooSpin::VdecayType VHmode1_=RooSpin::kVdecayType_Zud, RooSpin::VdecayType VHmode2_=RooSpin::kVdecayType_Zud, Bool_t OnshellH_=true); @@ -22,8 +22,9 @@ class ScalarPdfFactory_VH : public ScalarPdfFactory { double sqrts; int PDFType; - void initPDF(); - void destroyPDF(); + virtual void initPDF(); + virtual void destroyPDF(); + }; #endif diff --git a/MELA/interface/SpinPdfFactory.h b/MELA/interface/SpinPdfFactory.h index 767225a9..230da34d 100644 --- a/MELA/interface/SpinPdfFactory.h +++ b/MELA/interface/SpinPdfFactory.h @@ -47,6 +47,7 @@ class SpinPdfFactory{ virtual void destroyGVals()=0; virtual void initPDF()=0; virtual void destroyPDF()=0; + }; diff --git a/MELA/interface/TensorPdfFactory.h b/MELA/interface/TensorPdfFactory.h index e29660c7..66d5fe09 100755 --- a/MELA/interface/TensorPdfFactory.h +++ b/MELA/interface/TensorPdfFactory.h @@ -7,7 +7,7 @@ #include "TString.h" -class TensorPdfFactory : public SpinPdfFactory { +class TensorPdfFactory : public SpinPdfFactory{ public: RooSpinTwo::modelCouplings couplings; @@ -27,6 +27,7 @@ class TensorPdfFactory : public SpinPdfFactory { virtual void initPDF()=0; virtual void destroyPDF()=0; + }; diff --git a/MELA/interface/TensorPdfFactory_ppHVV.h b/MELA/interface/TensorPdfFactory_ppHVV.h index 4931b19d..120d28d1 100644 --- a/MELA/interface/TensorPdfFactory_ppHVV.h +++ b/MELA/interface/TensorPdfFactory_ppHVV.h @@ -5,7 +5,7 @@ #include "TensorPdfFactory.h" -class TensorPdfFactory_ppHVV : public TensorPdfFactory { +class TensorPdfFactory_ppHVV : public TensorPdfFactory{ public: TensorPdfFactory_ppHVV(RooSpin::modelMeasurables measurables_, RooSpin::VdecayType V1decay_=RooSpin::kVdecayType_Zll, RooSpin::VdecayType V2decay_=RooSpin::kVdecayType_Zll, Bool_t OnshellH_=true); @@ -18,8 +18,9 @@ class TensorPdfFactory_ppHVV : public TensorPdfFactory { protected: RooSpinTwo_7DComplex_ppHVV* PDF; - void initPDF(); - void destroyPDF(){ delete PDF; } + virtual void initPDF(); + virtual void destroyPDF(){ delete PDF; PDF=0; PDF_base=0; } + }; diff --git a/MELA/src/RooSpin.cc b/MELA/src/RooSpin.cc index 364f6e47..265fe4e1 100644 --- a/MELA/src/RooSpin.cc +++ b/MELA/src/RooSpin.cc @@ -32,6 +32,9 @@ void AnaMelaHelpers::multiplyComplexNumbers(std::vector reals, std::ve } } +RooSpin::RooSpin() : RooAbsPdf(), +GeVunit(1e-2) +{} RooSpin::RooSpin( const char* name, const char* title, @@ -40,8 +43,6 @@ RooSpin::RooSpin( RooSpin::VdecayType _Vdecay1, RooSpin::VdecayType _Vdecay2 ) : RooAbsPdf(name, title), - Vdecay1(_Vdecay1), Vdecay2(_Vdecay2), intCodeStart(1), - h1("h1", "h1", this), h2("h2", "h2", this), Phi("Phi", "Phi", this), @@ -59,17 +60,19 @@ RooSpin::RooSpin( mZ("mZ", "mZ", this, (RooAbsReal&)*(_parameters.mZ)), gamZ("gamZ", "gamZ", this, (RooAbsReal&)*(_parameters.gamZ)), Sin2ThetaW("Sin2ThetaW", "Sin2ThetaW", this, (RooAbsReal&)*(_parameters.Sin2ThetaW)), - vev("vev", "vev", this, (RooAbsReal&)*(_parameters.vev)) + vev("vev", "vev", this, (RooAbsReal&)*(_parameters.vev)), + + Vdecay1(_Vdecay1), Vdecay2(_Vdecay2), + intCodeStart(1), + + GeVunit(1e-2) { setProxies(_measurables); } - RooSpin::RooSpin(const RooSpin& other, const char* name) : RooAbsPdf(other, name), -Vdecay1(other.Vdecay1), Vdecay2(other.Vdecay2), intCodeStart(other.intCodeStart), - h1("h1", this, other.h1), h2("h2", this, other.h2), Phi("Phi", this, other.Phi), @@ -87,7 +90,12 @@ gamW("gamW", this, other.gamW), mZ("mZ", this, other.mZ), gamZ("gamZ", this, other.gamZ), Sin2ThetaW("Sin2ThetaW", this, other.Sin2ThetaW), -vev("vev", this, other.vev) +vev("vev", this, other.vev), + +Vdecay1(other.Vdecay1), Vdecay2(other.Vdecay2), +intCodeStart(other.intCodeStart), + +GeVunit(other.GeVunit) {} void RooSpin::alwaysIntegrate(Int_t code){ @@ -108,6 +116,7 @@ void RooSpin::calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t m if (propType==0){ propRe = 0.; propIm = (mass!=0. ? -1./pow(mass, 2) : 0.); + propIm *= pow(GeVunit, -2); } else if (propType==1){ Double_t mV, gamV; @@ -116,6 +125,8 @@ void RooSpin::calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t m Double_t denominator = pow(mV*gamV, 2)+pow(pow(mass, 2)-pow(mV, 2), 2); propRe = -mV*gamV/denominator; propIm = -(pow(mass, 2)-pow(mV, 2))/denominator; + propRe *= pow(GeVunit, -2); + propIm *= pow(GeVunit, -2); } else{ propRe = (mass==mV ? 1. : 0.); @@ -127,6 +138,8 @@ void RooSpin::calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t m Double_t denominator = pow(mX*gamX, 2)+pow(pow(mass, 2)-pow(mX, 2), 2); propRe = mX*gamX/denominator; propIm = (pow(mass, 2)-pow(mX, 2))/denominator; + propRe *= pow(GeVunit, -2); + propIm *= pow(GeVunit, -2); } else{ propRe = (mass==mX ? 1. : 0.); diff --git a/MELA/src/RooSpinTwo.cc b/MELA/src/RooSpinTwo.cc index 49237aa6..f7de17ce 100644 --- a/MELA/src/RooSpinTwo.cc +++ b/MELA/src/RooSpinTwo.cc @@ -152,7 +152,7 @@ void RooSpinTwo::calculateAmplitudes( if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) calculatePropagator(propV2Re, propV2Im, m2_, (isGammaV2 ? 0 : 1)); calculatePropagator(propHRe, propHIm, m12, 2); - Double_t ampScale = calculateAmplitudeScale(isGammaV1, isGammaV2); + Double_t ampScale = calculateAmplitudeScale(isGammaV1, isGammaV2)*pow(GeVunit/Lambda, 2); Double_t c1Re = ciRe.at(0); Double_t c2Re = ciRe.at(1); @@ -421,6 +421,15 @@ void RooSpinTwo::calculateAmplitudes( Ap0Re_tmp *= ampScale; AmpRe_tmp *= ampScale; ApmRe_tmp *= ampScale; + A00Im_tmp *= ampScale; + AmmIm_tmp *= ampScale; + AppIm_tmp *= ampScale; + A0mIm_tmp *= ampScale; + A0pIm_tmp *= ampScale; + Am0Im_tmp *= ampScale; + Ap0Im_tmp *= ampScale; + AmpIm_tmp *= ampScale; + ApmIm_tmp *= ampScale; std::vector A00_reals, A00_imags; A00_reals.push_back(A00Re_tmp); A00_imags.push_back(A00Im_tmp); A00_reals.push_back(propV1Re); A00_imags.push_back(propV1Im); A00_reals.push_back(propV2Re); A00_imags.push_back(propV2Im); A00_reals.push_back(propHRe); A00_imags.push_back(propHIm); AnaMelaHelpers::multiplyComplexNumbers(A00_reals, A00_imags, A00Re, A00Im); std::vector Amm_reals, Amm_imags; Amm_reals.push_back(AmmRe_tmp); Amm_imags.push_back(AmmIm_tmp); Amm_reals.push_back(propV1Re); Amm_imags.push_back(propV1Im); Amm_reals.push_back(propV2Re); Amm_imags.push_back(propV2Im); Amm_reals.push_back(propHRe); Amm_imags.push_back(propHIm); AnaMelaHelpers::multiplyComplexNumbers(Amm_reals, Amm_imags, AmmRe, AmmIm); diff --git a/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc b/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc index 97e6d247..45a294d6 100644 --- a/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc +++ b/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc @@ -302,8 +302,8 @@ Double_t RooSpinTwo_7DComplex_ppHVV::evaluate() const{ Double_t term1Coeff = 1; Double_t term2Coeff = 1; - if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_; - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_*GeVunit; + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; std::vector Axxyyterm; evaluatePolarizationTerms(Axxyyterm, code); @@ -347,8 +347,8 @@ Double_t RooSpinTwo_7DComplex_ppHVV::analyticalIntegral(Int_t code, const char* Double_t term1Coeff = 1; Double_t term2Coeff = 1; - if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_; - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_*GeVunit; + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; std::vector Axxyyterm; evaluatePolarizationTerms(Axxyyterm, code); diff --git a/MELA/src/RooSpinZero.cc b/MELA/src/RooSpinZero.cc index b6f1026b..9411ea6e 100755 --- a/MELA/src/RooSpinZero.cc +++ b/MELA/src/RooSpinZero.cc @@ -446,7 +446,7 @@ void RooSpinZero::calculateAmplitudes(Double_t& A00Re, Double_t& A00Im, Double_t if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) calculatePropagator(propV2Re, propV2Im, m2_, (isGammaV2 ? 0 : 1)); calculatePropagator(propHRe, propHIm, m12, 2); - Double_t ampScale = calculateAmplitudeScale(isGammaV1, isGammaV2); + Double_t ampScale = calculateAmplitudeScale(isGammaV1, isGammaV2)*pow(GeVunit, 2); Double_t eta1 = m1_ / m12; Double_t eta2 = m2_ / m12; diff --git a/MELA/src/RooSpinZero_3D_pp_VH.cc b/MELA/src/RooSpinZero_3D_pp_VH.cc index 77d99990..e8aebcd3 100644 --- a/MELA/src/RooSpinZero_3D_pp_VH.cc +++ b/MELA/src/RooSpinZero_3D_pp_VH.cc @@ -163,8 +163,8 @@ Double_t RooSpinZero_3D_pp_VH::evaluate() const{ Double_t term1Coeff = 1; Double_t term2Coeff = 1; - term1Coeff = pow(m1_, -2); - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + term1Coeff = pow(m1_*GeVunit, -2); + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; Double_t plumi = partonicLuminosity(m1_, Y, sqrts); Double_t value = 0; @@ -197,8 +197,8 @@ Double_t RooSpinZero_3D_pp_VH::analyticalIntegral(Int_t code, const char* /*rang Double_t term1Coeff = 1; Double_t term2Coeff = 1; - term1Coeff = pow(m1_, -2); - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + term1Coeff = pow(m1_*GeVunit, -2); + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; Double_t plumi = partonicLuminosity(m1_, Y, sqrts); Double_t value = 0; diff --git a/MELA/src/RooSpinZero_5D_VH.cc b/MELA/src/RooSpinZero_5D_VH.cc index f268a788..c74e2f5b 100644 --- a/MELA/src/RooSpinZero_5D_VH.cc +++ b/MELA/src/RooSpinZero_5D_VH.cc @@ -158,8 +158,8 @@ Double_t RooSpinZero_5D_VH::evaluate() const{ Double_t term1Coeff = 1; Double_t term2Coeff = 1; - term1Coeff = pow(m1_, -2); - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + term1Coeff = pow(m1_*GeVunit, -2); + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; Double_t value = 0; Double_t val_A00=0, val_App=0, val_Amm=0, val_A0p=0, val_A0m=0, val_Amp=0; @@ -191,8 +191,8 @@ Double_t RooSpinZero_5D_VH::analyticalIntegral(Int_t code, const char* /*rangeNa Double_t term1Coeff = 1; Double_t term2Coeff = 1; - term1Coeff = pow(m1_, -2); - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + term1Coeff = pow(m1_*GeVunit, -2); + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; Double_t value = 0; Double_t val_A00=0, val_App=0, val_Amm=0, val_A0p=0, val_A0m=0, val_Amp=0; diff --git a/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc b/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc index 8d9721a5..b6e55c23 100755 --- a/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc +++ b/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc @@ -263,8 +263,8 @@ Double_t RooSpinZero_7DComplex_withAccep_HVV::evaluate() const{ Double_t term1Coeff = 1; Double_t term2Coeff = 1; - if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_; // dm**2 = 2m dm - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_*GeVunit; // dm**2 = 2m dm + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; Double_t value = 0; Double_t val_A00=0, val_App=0, val_Amm=0, val_A0p=0, val_A0m=0, val_Amp=0; @@ -328,8 +328,8 @@ Double_t RooSpinZero_7DComplex_withAccep_HVV::analyticalIntegral(Int_t code, con Double_t term1Coeff = 1; Double_t term2Coeff = 1; - if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_; // dm**2 = 2m dm - if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_; + if (Vdecay1!=RooSpin::kVdecayType_GammaOnshell) term1Coeff = 2.*m1_*GeVunit; // dm**2 = 2m dm + if (Vdecay2!=RooSpin::kVdecayType_GammaOnshell) term2Coeff = 2.*m2_*GeVunit; Double_t value = 0; Double_t val_A00=0, val_App=0, val_Amm=0, val_A0p=0, val_A0m=0, val_Amp=0; diff --git a/MELA/src/ScalarPdfFactory_VH.cc b/MELA/src/ScalarPdfFactory_VH.cc index 234b3e49..2831f42b 100644 --- a/MELA/src/ScalarPdfFactory_VH.cc +++ b/MELA/src/ScalarPdfFactory_VH.cc @@ -81,6 +81,7 @@ RooSpinZero* ScalarPdfFactory_VH::getPDF(){ void ScalarPdfFactory_VH::destroyPDF(){ if (PDF_ILC_5D!=0) delete PDF_ILC_5D; if (PDF_LHC_3D!=0) delete PDF_LHC_3D; + PDF_ILC_5D=0; PDF_LHC_3D=0; PDF_base=0; } From 0876b8f59a2671a06535b11ef193f6ffb163c341 Mon Sep 17 00:00:00 2001 From: Ulascan Sarica Date: Thu, 16 Feb 2017 02:29:33 +0100 Subject: [PATCH 3/3] Changes in anaPDFs --- MELA/interface/RooSpin.h | 2 +- MELA/src/RooSpinTwo_7DComplex_ppHVV.cc | 24 +++++++++++-------- MELA/src/RooSpinZero_3D_pp_VH.cc | 4 ++-- MELA/src/RooSpinZero_5D_VH.cc | 4 ++-- .../RooSpinZero_7DComplex_withAccep_HVV.cc | 24 +++++++++++-------- 5 files changed, 33 insertions(+), 25 deletions(-) diff --git a/MELA/interface/RooSpin.h b/MELA/interface/RooSpin.h index a02b9a11..815e496f 100644 --- a/MELA/interface/RooSpin.h +++ b/MELA/interface/RooSpin.h @@ -88,6 +88,7 @@ class RooSpin : public RooAbsPdf { virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const = 0; virtual void setDecayModes(RooSpin::VdecayType Vdecay1_, RooSpin::VdecayType Vdecay2_){ Vdecay1=Vdecay1_; Vdecay2=Vdecay2_; } + virtual void getMVGamV(Double_t* mV=0, Double_t* gamV=0) const; virtual void defaultIntegration(){ intCodeStart=1; } virtual void alwaysIntegrate(Int_t code=1); @@ -124,7 +125,6 @@ class RooSpin : public RooAbsPdf { virtual void calculateGVGA(Double_t& gV, Double_t& gA, RooSpin::VdecayType Vdecay, bool isGamma=false) const; virtual void calculateR1R2(Double_t& R1Val, Double_t& R2Val, bool isGammaV1=false, bool isGammaV2=false) const; virtual Double_t calculateAmplitudeScale(bool isGammaV1=false, bool isGammaV2=false) const; - virtual void getMVGamV(Double_t* mV=0, Double_t* gamV=0) const; virtual void setProxies(modelMeasurables _measurables); virtual void setProxy(RooRealProxy& proxy, RooAbsReal* objectPtr); diff --git a/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc b/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc index 45a294d6..57b27c3a 100644 --- a/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc +++ b/MELA/src/RooSpinTwo_7DComplex_ppHVV.cc @@ -283,10 +283,12 @@ Double_t RooSpinTwo_7DComplex_ppHVV::evaluate() const{ Double_t epsilon=1e-15; Double_t m1_=m1; if (Vdecay1==RooSpin::kVdecayType_GammaOnshell) m1_=0; Double_t m2_=m2; if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) m2_=0; - if (isZZ && Vdecay1==Vdecay2){ - if ((m1_+m2_) > m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; + if ( + (m1_+m2_)>m12 || + (isZZ && Vdecay1==Vdecay2 && ZZ4fOrdering && fabs(m2_-mV) m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; + if ( + (m1_+m2_)>m12 || + (isZZ && Vdecay1==Vdecay2 && ZZ4fOrdering && fabs(m2_-mV) m1_ || (m2_ <= 0. && Vdecay2!=RooSpin::kVdecayType_GammaOnshell) || m1_ <= 0.) return epsilon; Double_t betaValSq = (1.-(pow(m12-m2_, 2)/pow(m1_, 2)))*(1.-(pow(m12+m2_, 2)/pow(m1_, 2))); - if (betaValSq<0) return epsilon; + if (betaValSq<=0.) return epsilon; Double_t betaVal = sqrt(betaValSq); Double_t term1Coeff = 1; diff --git a/MELA/src/RooSpinZero_5D_VH.cc b/MELA/src/RooSpinZero_5D_VH.cc index c74e2f5b..deb9ef09 100644 --- a/MELA/src/RooSpinZero_5D_VH.cc +++ b/MELA/src/RooSpinZero_5D_VH.cc @@ -153,7 +153,7 @@ Double_t RooSpinZero_5D_VH::evaluate() const{ if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) code *= prime_h2*prime_Phi; Double_t betaValSq = (1.-(pow(m12-m2_, 2)/pow(m1_, 2)))*(1.-(pow(m12+m2_, 2)/pow(m1_, 2))); - if (betaValSq<0) return epsilon; + if (betaValSq<=0.) return epsilon; Double_t betaVal = sqrt(betaValSq); Double_t term1Coeff = 1; @@ -186,7 +186,7 @@ Double_t RooSpinZero_5D_VH::analyticalIntegral(Int_t code, const char* /*rangeNa if ((m12+m2_) > m1_ || (m2_ <= 0. && Vdecay2!=RooSpin::kVdecayType_GammaOnshell) || m1_ <= 0.) return epsilon; Double_t betaValSq = (1.-(pow(m12-m2_, 2)/pow(m1_, 2)))*(1.-(pow(m12+m2_, 2)/pow(m1_, 2))); - if (betaValSq<0) return epsilon; + if (betaValSq<=0.) return epsilon; Double_t betaVal = sqrt(betaValSq); Double_t term1Coeff = 1; diff --git a/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc b/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc index b6e55c23..1dd5ac1e 100755 --- a/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc +++ b/MELA/src/RooSpinZero_7DComplex_withAccep_HVV.cc @@ -244,10 +244,12 @@ Double_t RooSpinZero_7DComplex_withAccep_HVV::evaluate() const{ Double_t epsilon=1e-15; Double_t m1_=m1; if (Vdecay1==RooSpin::kVdecayType_GammaOnshell) m1_=0; Double_t m2_=m2; if (Vdecay2==RooSpin::kVdecayType_GammaOnshell) m2_=0; - if (isZZ && Vdecay1==Vdecay2){ - if ((m1_+m2_) > m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; + if ( + (m1_+m2_)>m12 || + (isZZ && Vdecay1==Vdecay2 && ZZ4fOrdering && fabs(m2_-mV) m12 || (fabs(m2_-mV) m12 || ((m2_ <= 0. || m1_ <= 0.) && Vdecay1!=RooSpin::kVdecayType_GammaOnshell && Vdecay2!=RooSpin::kVdecayType_GammaOnshell)) return epsilon; + if ( + (m1_+m2_)>m12 || + (isZZ && Vdecay1==Vdecay2 && ZZ4fOrdering && fabs(m2_-mV)