Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #38 from usarica/newVH
Browse files Browse the repository at this point in the history
anaMELA decay checks
  • Loading branch information
usarica authored Dec 9, 2018
2 parents c5515cf + 0ddac7a commit 5d79e1f
Show file tree
Hide file tree
Showing 23 changed files with 935 additions and 238 deletions.
1 change: 1 addition & 0 deletions MELA/data/slc7_amd64_gcc530/download.url
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
http://spin.pha.jhu.edu/Generator/MCFM-precompiled/v2/
14 changes: 8 additions & 6 deletions MELA/interface/RooSpin.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
#include "Riostream.h"
#include "TMath.h"
#include "TCouplingsBase.hh"

using namespace TMath;
using namespace std;
#include "MELAStreamHelpers.hh"


namespace AnaMelaHelpers{
Expand Down Expand Up @@ -84,7 +82,8 @@ class RooSpin : public RooAbsPdf {
const char* name, const char* title,
modelMeasurables _measurables,
modelParameters _parameters,
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);
RooSpin(const RooSpin& other, const char* name=0);
inline virtual ~RooSpin(){}
Expand All @@ -95,13 +94,14 @@ class RooSpin : public RooAbsPdf {
virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const = 0;
virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const = 0;

void setVerbosity(TVar::VerbosityLevel verbosity_);
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 getMVprimeGamVprime(Double_t* mV=0, Double_t* gamV=0) const;

virtual void defaultIntegration(){ intCodeStart=1; }
virtual void alwaysIntegrate(Int_t code=1);

virtual void printParameters() const;

protected:

Expand Down Expand Up @@ -136,7 +136,9 @@ class RooSpin : public RooAbsPdf {
RooSpin::VdecayType Vdecay2;

Int_t intCodeStart;
const Double_t GeVunit;
TVar::VerbosityLevel verbosity;

static constexpr Double_t GeVunit=1e-2;

virtual void calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t mass, Int_t propType=1) const;
virtual void calculateVffGVGA(Double_t& gV, Double_t& gA, RooSpin::VdecayType Vdecay, bool isGamma=false) const;
Expand Down
50 changes: 26 additions & 24 deletions MELA/interface/RooSpinTwo.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "RooSpin.h"


class RooSpinTwo : public RooSpin {
class RooSpinTwo : public RooSpin{
public:

struct modelCouplings{
Expand All @@ -15,14 +15,15 @@ class RooSpinTwo : public RooSpin {
// There is no equivalent to graviton_qq_left/right yet!
};

RooSpinTwo(){};
RooSpinTwo();
RooSpinTwo(
const char* name, const char* title,
modelMeasurables _measurables,
modelParameters _parameters,
modelCouplings _couplings,
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll
);
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);

RooSpinTwo(const RooSpinTwo& other, const char* name=0);
virtual TObject* clone(const char* newname) const = 0;
Expand All @@ -31,30 +32,31 @@ class RooSpinTwo : public RooSpin {
virtual Double_t evaluate() const = 0;
virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const = 0;
virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const = 0;
virtual void printParameters() const;

protected:

RooRealProxy b1Val;
RooRealProxy b2Val;
RooRealProxy b3Val;
RooRealProxy b4Val;
RooRealProxy b5Val;
RooRealProxy b6Val;
RooRealProxy b7Val;
RooRealProxy b8Val;
RooRealProxy b9Val;
RooRealProxy b10Val;
RooRealProxy b1Val;
RooRealProxy b2Val;
RooRealProxy b3Val;
RooRealProxy b4Val;
RooRealProxy b5Val;
RooRealProxy b6Val;
RooRealProxy b7Val;
RooRealProxy b8Val;
RooRealProxy b9Val;
RooRealProxy b10Val;

RooRealProxy b1ValIm;
RooRealProxy b2ValIm;
RooRealProxy b3ValIm;
RooRealProxy b4ValIm;
RooRealProxy b5ValIm;
RooRealProxy b6ValIm;
RooRealProxy b7ValIm;
RooRealProxy b8ValIm;
RooRealProxy b9ValIm;
RooRealProxy b10ValIm;
RooRealProxy b1ValIm;
RooRealProxy b2ValIm;
RooRealProxy b3ValIm;
RooRealProxy b4ValIm;
RooRealProxy b5ValIm;
RooRealProxy b6ValIm;
RooRealProxy b7ValIm;
RooRealProxy b8ValIm;
RooRealProxy b9ValIm;
RooRealProxy b10ValIm;

RooRealProxy Lambda;

Expand Down
7 changes: 4 additions & 3 deletions MELA/interface/RooSpinTwo_7DComplex_ppHVV.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
class RooSpinTwo_7DComplex_ppHVV : public RooSpinTwo {
public:

RooSpinTwo_7DComplex_ppHVV(){}
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
);
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);
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(){}
Expand Down
8 changes: 5 additions & 3 deletions MELA/interface/RooSpinZero.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,15 @@ class RooSpinZero : public RooSpin {
RooAbsReal* gvpvp1List[1][2];
};

RooSpinZero(){};
RooSpinZero();
RooSpinZero(
const char* name, const char* title,
modelMeasurables _measurables,
modelParameters _parameters,
modelCouplings _couplings,
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll
);
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);

RooSpinZero(const RooSpinZero& other, const char* name=0);
virtual TObject* clone(const char* newname) const = 0;
Expand All @@ -55,6 +56,7 @@ class RooSpinZero : public RooSpin {
virtual Double_t evaluate() const = 0;
virtual Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const = 0;
virtual Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const = 0;
virtual void printParameters() const;

protected:

Expand Down
7 changes: 4 additions & 3 deletions MELA/interface/RooSpinZero_3D_pp_VH.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,16 @@ class RooSpinZero_3D_pp_VH : public RooSpinZero {

Double_t sqrts;

RooSpinZero_3D_pp_VH(){}
RooSpinZero_3D_pp_VH();
RooSpinZero_3D_pp_VH(
const char *name, const char *title,
modelMeasurables _measurables,
modelParameters _parameters,
modelCouplings _couplings,
Double_t _sqrts,
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll
);
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);

RooSpinZero_3D_pp_VH(const RooSpinZero_3D_pp_VH& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooSpinZero_3D_pp_VH(*this, newname); }
Expand Down
7 changes: 4 additions & 3 deletions MELA/interface/RooSpinZero_5D_VH.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@
class RooSpinZero_5D_VH : public RooSpinZero {
public:

RooSpinZero_5D_VH(){}
RooSpinZero_5D_VH();
RooSpinZero_5D_VH(
const char *name, const char *title,
modelMeasurables _measurables,
modelParameters _parameters,
modelCouplings _couplings,
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll
);
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);

RooSpinZero_5D_VH(const RooSpinZero_5D_VH& other, const char* name=0);
virtual TObject* clone(const char* newname) const { return new RooSpinZero_5D_VH(*this, newname); }
Expand Down
7 changes: 4 additions & 3 deletions MELA/interface/RooSpinZero_7DComplex_withAccep_HVV.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,16 @@ class RooSpinZero_7DComplex_withAccep_HVV : public RooSpinZero {
RooRealVar* dM2;
};

RooSpinZero_7DComplex_withAccep_HVV(){}
RooSpinZero_7DComplex_withAccep_HVV();
RooSpinZero_7DComplex_withAccep_HVV(
const char *name, const char *title,
modelMeasurables _measurables,
modelParameters _parameters,
modelCouplings _couplings,
accepParameters _accepParams,
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll
);
RooSpin::VdecayType _Vdecay1=RooSpin::kVdecayType_Zll, RooSpin::VdecayType _Vdecay2=RooSpin::kVdecayType_Zll,
TVar::VerbosityLevel verbosity_=TVar::ERROR
);
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(){}
Expand Down
2 changes: 2 additions & 0 deletions MELA/interface/SpinPdfFactory.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ class SpinPdfFactory{

static void setVariableValue(RooRealVar* var, Double_t val);

void setVerbosity(TVar::VerbosityLevel verbosity);

protected:

RooSpin::VdecayType V1decay;
Expand Down
2 changes: 2 additions & 0 deletions MELA/src/LinkDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
#include "MELANCSplineFactory_3D.h"
#include "MELAFuncPdf.h"
#include "Mela.h"
#include "ZZMatrixElement.h"
// Note that Mela.h does NOT contain ZZMatrixElement.h but it still declares that class. This is why you include ZZMatrixelement.h here, and AFTER Mela.h.

#ifdef __CINT__

Expand Down
8 changes: 5 additions & 3 deletions MELA/src/Mela.cc
Original file line number Diff line number Diff line change
Expand Up @@ -270,9 +270,11 @@ void Mela::setProcess(TVar::Process myModel, TVar::MatrixElement myME, TVar::Pro
}
void Mela::setVerbosity(TVar::VerbosityLevel verbosity_){
myVerbosity_=verbosity_;
if (ZZME!=0) ZZME->set_Verbosity(myVerbosity_);
if (super!=0) super->SetVerbosity((myVerbosity_>=TVar::DEBUG));
if (superDijet!=0) superDijet->SetVerbosity(myVerbosity_);
if (ZZME) ZZME->set_Verbosity(myVerbosity_);
if (super) super->SetVerbosity((myVerbosity_>=TVar::DEBUG));
if (superDijet) superDijet->SetVerbosity(myVerbosity_);
if (ggSpin0Model) ggSpin0Model->setVerbosity(myVerbosity_);
if (spin2Model) spin2Model->setVerbosity(myVerbosity_);
}
TVar::VerbosityLevel Mela::getVerbosity(){ return myVerbosity_; }
// Should be called per-event
Expand Down
38 changes: 34 additions & 4 deletions MELA/src/RooSpin.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "RooSpin.h"

using namespace std;
using namespace MELAStreamHelpers;


void AnaMelaHelpers::multiplyComplexNumbers(std::vector<Double_t> reals, std::vector<Double_t> imags, Double_t& resRe, Double_t& resIm){
Expand Down Expand Up @@ -33,14 +34,15 @@ void AnaMelaHelpers::multiplyComplexNumbers(std::vector<Double_t> reals, std::ve
}

RooSpin::RooSpin() : RooAbsPdf(),
GeVunit(1e-2)
verbosity(TVar::ERROR)
{}

RooSpin::RooSpin(
const char* name, const char* title,
modelMeasurables _measurables,
modelParameters _parameters,
RooSpin::VdecayType _Vdecay1, RooSpin::VdecayType _Vdecay2
RooSpin::VdecayType _Vdecay1, RooSpin::VdecayType _Vdecay2,
TVar::VerbosityLevel verbosity_
) : RooAbsPdf(name, title),

h1("h1", "h1", this),
Expand Down Expand Up @@ -74,7 +76,7 @@ gVprimeff_decay2_right("gVprimeff_decay2_right", "gVprimeff_decay2_right", this,
Vdecay1(_Vdecay1), Vdecay2(_Vdecay2),
intCodeStart(1),

GeVunit(1e-2)
verbosity(verbosity_)
{
setProxies(_measurables);
}
Expand Down Expand Up @@ -112,7 +114,7 @@ RooSpin::RooSpin(const RooSpin& other, const char* name) :
Vdecay1(other.Vdecay1), Vdecay2(other.Vdecay2),
intCodeStart(other.intCodeStart),

GeVunit(other.GeVunit)
verbosity(other.verbosity)
{}

void RooSpin::alwaysIntegrate(Int_t code){
Expand All @@ -129,6 +131,7 @@ void RooSpin::alwaysIntegrate(Int_t code){
}

void RooSpin::calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t mass, Int_t propType)const{
if (verbosity>=TVar::DEBUG) MELAout << "RooSpin::calculatePropagator: Calling propagator with type " << propType << " and mass " << mass << endl;
// prop = -i / ((m**2-mV**2) + i*mV*GaV) = - ( mV*GaV + i*(m**2-mV**2) ) / ((m**2-mV**2)**2 + (mV*GaV)**2)
if (propType==0){ // Photon
propRe = 0.;
Expand All @@ -149,6 +152,7 @@ void RooSpin::calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t m
propRe = (mass==mV ? 1. : 0.);
propIm = 0.;
}
if (verbosity>=TVar::DEBUG) MELAout << "RooSpin::calculatePropagator: mV / gamV = " << mV << " / " << gamV << endl;
}
else if (propType==2){ // Higgs prop = i / ((m**2-mX**2) + i*mX*GaX) = - ( mX*GaX + i*(m**2-mX**2) ) / ((m**2-mX**2)**2 + (mX*GaX)**2)
if (gamX>0.){
Expand Down Expand Up @@ -181,11 +185,13 @@ void RooSpin::calculatePropagator(Double_t& propRe, Double_t& propIm, Double_t m
propRe = 0;
propIm = 0;
}
if (verbosity>=TVar::DEBUG) MELAout << "RooSpin::calculatePropagator: mV / gamV = " << mV << " / " << gamV << endl;
}
else{
propRe = 1.;
propIm = 0.;
}
if (verbosity>=TVar::DEBUG) MELAout << "RooSpin::calculatePropagator: Final propagator = " << propRe << ", " << propIm << endl;
}
void RooSpin::calculateVffGVGA(Double_t& gV, Double_t& gA, RooSpin::VdecayType Vdecay, bool isGamma)const{
const Double_t atomicT3 = 0.5;
Expand Down Expand Up @@ -286,6 +292,7 @@ void RooSpin::calculateVffGVGA(Double_t& gV, Double_t& gA, RooSpin::VdecayType V
gV = 1;
gA = 0;
}
if (verbosity>=TVar::DEBUG) MELAout << "RooSpin::calculateVffGVGA( " << gV << " , " << gA << " , " << Vdecay << " , " << isGamma << " )" << endl;
}
void RooSpin::calculateVffR1R2(Double_t& R1Val, Double_t& R2Val, bool isGammaV1, bool isGammaV2)const{
R1Val=0; R2Val=0;
Expand Down Expand Up @@ -330,6 +337,8 @@ void RooSpin::calculateVprimeffGVGA(Double_t& gV, Double_t& gA, int whichVprime/

gV=(gL+gR)/2.*overallFactor;
gA=(gL-gR)/2.*overallFactor;

if (verbosity>=TVar::DEBUG) MELAout << "RooSpin::calculateVprimeffGVGA( " << gV << " , " << gA << " , " << whichVprime << " )" << endl;
}
void RooSpin::calculateVprimeffR1R2(Double_t& R1Val, Double_t& R2Val) const{
R1Val=0; R2Val=0;
Expand Down Expand Up @@ -364,6 +373,8 @@ Double_t RooSpin::calculateAmplitudeScale(int VGammaVpmode1, int VGammaVpmode2)c
return ampScale;
}

void RooSpin::setVerbosity(TVar::VerbosityLevel verbosity_){ this->verbosity=verbosity_; }

void RooSpin::setProxies(modelMeasurables _measurables){
setProxy(h1, (RooAbsReal*) _measurables.h1);
setProxy(h2, (RooAbsReal*) _measurables.h2);
Expand All @@ -382,3 +393,22 @@ Bool_t RooSpin::checkFundamentalType(const RooRealProxy& proxy)const{
RooAbsArg* arg = proxy.absArg();
return (dynamic_cast<RooRealVar*>(arg)!=0);
}

void RooSpin::printParameters() const{
MELAout << "mX: " << mX << endl;
MELAout << "gamX: " << gamX << endl;
MELAout << "mW: " << mW << endl;
MELAout << "gamW: " << gamW << endl;
MELAout << "mZ: " << mZ << endl;
MELAout << "gamZ: " << gamZ << endl;
MELAout << "mWprime: " << mWprime << endl;
MELAout << "gamWprime: " << gamWprime << endl;
MELAout << "mZprime: " << mZprime << endl;
MELAout << "gamZprime: " << gamZprime << endl;
MELAout << "Sin2ThetaW: " << Sin2ThetaW << endl;
MELAout << "vev: " << vev << endl;
MELAout << "gVprimeff_decay1_left: " << gVprimeff_decay1_left << endl;
MELAout << "gVprimeff_decay1_right: " << gVprimeff_decay1_right << endl;
MELAout << "gVprimeff_decay2_left: " << gVprimeff_decay2_left << endl;
MELAout << "gVprimeff_decay2_right: " << gVprimeff_decay2_right << endl;
}
Loading

0 comments on commit 5d79e1f

Please sign in to comment.