diff --git a/interface/HZZ4L_RooHighmass.h b/interface/HZZ4L_RooHighmass.h new file mode 100755 index 00000000000..5b4d7eedd50 --- /dev/null +++ b/interface/HZZ4L_RooHighmass.h @@ -0,0 +1,62 @@ +/***************************************************************************** + * Project: RooFit * + * * + * This code was autogenerated by RooClassFactory * + *****************************************************************************/ + +//#ifndef HZZ4L_ROOHIGHMASS +//#define HZZ4L_ROOHIGHMASS + +#include "RooAbsPdf.h" +#include "RooSetProxy.h" +#include "RooRealProxy.h" +#include "RooRealVar.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" +#include "TH3F.h" +#include "TH1.h" +#include "RooDataHist.h" +#include "RooHistFunc.h" +#include "RooListProxy.h" + +using namespace RooFit; + +class HZZ4L_RooHighmass : public RooAbsPdf { +protected: + + RooRealProxy mass; +// mutable RooArgSet* _normSet ; + RooRealProxy dbkg; + RooRealProxy coupl; + RooListProxy _coefList ; // List of funcficients + TIterator* _coefIter ; //! Iterator over funcficient lis +// RooSetProxy _normSet ; // List of funcficients +// TIterator* _normIter ; //! Iterator over funcficient lis + Double_t evaluate() const ; +public: + HZZ4L_RooHighmass() {} ; + HZZ4L_RooHighmass(const char *name, const char *title, +// RooArgSet* _normSet, + RooAbsReal& _mass, + RooAbsReal& _dbkg, + RooAbsReal& _coupl, +// const RooArgSet& innormSet, + const RooArgList& inCoefList); + + HZZ4L_RooHighmass(const HZZ4L_RooHighmass& other, const char* name=0) ; + virtual TObject* clone(const char* newname) const { return new HZZ4L_RooHighmass(*this,newname); } + inline virtual ~HZZ4L_RooHighmass() {} + + Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ; + Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ; + double nsig,nbkg; +// const RooArgList& coefList() const { return _coefList ; } +// const RooArgSet& normSet() const { return _normSet; } + +private: + + ClassDef(HZZ4L_RooHighmass,1) // Your description goes here... +}; + +//#endif diff --git a/interface/HZZ4L_RooHighmass_WoInt.h b/interface/HZZ4L_RooHighmass_WoInt.h new file mode 100755 index 00000000000..406bc3ba7a7 --- /dev/null +++ b/interface/HZZ4L_RooHighmass_WoInt.h @@ -0,0 +1,62 @@ +/***************************************************************************** + * Project: RooFit * + * * + * This code was autogenerated by RooClassFactory * + *****************************************************************************/ + +//#ifndef HZZ4L_ROOHIGHMASS +//#define HZZ4L_ROOHIGHMASS + +#include "RooAbsPdf.h" +#include "RooSetProxy.h" +#include "RooRealProxy.h" +#include "RooRealVar.h" +#include "RooCategoryProxy.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" +#include "TH3F.h" +#include "TH1.h" +#include "RooDataHist.h" +#include "RooHistFunc.h" +#include "RooListProxy.h" + +using namespace RooFit; + +class HZZ4L_RooHighmass_WoInt : public RooAbsPdf { +protected: + + RooRealProxy mass; +// mutable RooArgSet* _normSet ; + RooRealProxy dbkg; + RooRealProxy coupl; + RooListProxy _coefList ; // List of funcficients + TIterator* _coefIter ; //! Iterator over funcficient lis +// RooSetProxy _normSet ; // List of funcficients +// TIterator* _normIter ; //! Iterator over funcficient lis + Double_t evaluate() const ; +public: + HZZ4L_RooHighmass_WoInt() {} ; + HZZ4L_RooHighmass_WoInt(const char *name, const char *title, +// RooArgSet* _normSet, + RooAbsReal& _mass, + RooAbsReal& _dbkg, + RooAbsReal& _coupl, +// const RooArgSet& innormSet, + const RooArgList& inCoefList); + + HZZ4L_RooHighmass_WoInt(const HZZ4L_RooHighmass_WoInt& other, const char* name=0) ; + virtual TObject* clone(const char* newname) const { return new HZZ4L_RooHighmass_WoInt(*this,newname); } + inline virtual ~HZZ4L_RooHighmass_WoInt() {} + + Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ; + Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ; + double nsig,nbkg; +// const RooArgList& coefList() const { return _coefList ; } +// const RooArgSet& normSet() const { return _normSet; } + +private: + + ClassDef(HZZ4L_RooHighmass_WoInt,1) // Your description goes here... +}; + +//#endif diff --git a/src/HZZ4L_RooHighmass.cc b/src/HZZ4L_RooHighmass.cc new file mode 100755 index 00000000000..1219fa472ab --- /dev/null +++ b/src/HZZ4L_RooHighmass.cc @@ -0,0 +1,110 @@ +#include "Riostream.h" +#include "../interface/HZZ4L_RooHighmass.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" +#include +#include "TMath.h" +#include "TH3F.h" +#include "TAxis.h" +#include "RooDataHist.h" +#include "RooExtendPdf.h" + +using namespace TMath; + +ClassImp(HZZ4L_RooHighmass) + + HZZ4L_RooHighmass::HZZ4L_RooHighmass(const char *name, const char *title, + RooAbsReal& _mass, + RooAbsReal& _dbkg, + RooAbsReal& _coupl, + const RooArgList& inCoefList): + RooAbsPdf(name,title), + mass("mass","mass",this,_mass), + dbkg("dbkg","dbkg",this,_dbkg), + coupl("coupl","coupl",this,_coupl), + // _normSet("normSet","List of observables",this), + _coefList("coefList","List of funcficients",this) + + { + TIterator* coefIter = inCoefList.createIterator() ; + RooAbsArg* func; + while((func = (RooAbsArg*)coefIter->Next())) { + if (!dynamic_cast(func)) { + coutE(InputArguments) << "ERROR: :HZZ4L_RooHighmass(" << GetName() << ") funcficient " << func->GetName() << " is not of type RooAbsReal" << std::endl; + assert(0); + } + _coefList.add(*func) ; + } + delete coefIter; + + } + + + HZZ4L_RooHighmass::HZZ4L_RooHighmass(const HZZ4L_RooHighmass& other, const char* name) : + RooAbsPdf(other,name), +// _normSet(other._normSet), + mass("mass",this,other.mass), + dbkg("dbkg",this,other.dbkg), + coupl("coupl",this,other.coupl), + //_normSet("normSet",this,other._normSet), + _coefList("coefList",this,other._coefList) + + { + _coefIter = _coefList.createIterator() ; + } + + + Double_t HZZ4L_RooHighmass::evaluate() const + { + double value = 0.; + + Double_t T1 = dynamic_cast(_coefList.at(0))->getVal(); + Double_t T2 = dynamic_cast(_coefList.at(1))->getVal(); +// RooArgSet *nset = new RooArgSet(mass.arg()); + Double_t T3 = dynamic_cast(_coefList.at(2))->getVal(); + + value = T2 + coupl*T1 + sqrt(coupl)*T3; + + if ( value <= 0.) { return 1.0e-200;} + + return value ; + + } + +Int_t HZZ4L_RooHighmass::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const +{ + + if (matchArgs(allVars,analVars,RooArgSet(*mass.absArg(),*dbkg.absArg()))) return 4 ; + + return 0 ; + +} + +Double_t HZZ4L_RooHighmass::analyticalIntegral(Int_t code, const char* rangeName) const +{ + switch(code) + { + + case 4: + { + double Int_T1 = dynamic_cast(_coefList.at(0))-> analyticalIntegral(1000); + double Int_T2 = dynamic_cast(_coefList.at(1))-> analyticalIntegral(1000); + Double_t T3_int= dynamic_cast(_coefList.at(2))->analyticalIntegral(1000); + + + double mysgn = 1.; + if(coupl < 0.) + { + mysgn = -1.; + } + + double integral = coupl*Int_T1 + Int_T2 + mysgn*sqrt(fabs(coupl)) * T3_int; ; + return integral; + } + + } + + assert(0) ; + return 0 ; +} + diff --git a/src/HZZ4L_RooHighmass_WoInt.cc b/src/HZZ4L_RooHighmass_WoInt.cc new file mode 100755 index 00000000000..37029d29966 --- /dev/null +++ b/src/HZZ4L_RooHighmass_WoInt.cc @@ -0,0 +1,110 @@ +#include "Riostream.h" +#include "../interface/HZZ4L_RooHighmass_WoInt.h" +#include "RooAbsReal.h" +#include "RooAbsCategory.h" +#include +#include "TMath.h" +#include "TH3F.h" +#include "TAxis.h" +#include "RooDataHist.h" +#include "RooExtendPdf.h" + +using namespace TMath; + +ClassImp(HZZ4L_RooHighmass_WoInt) + + HZZ4L_RooHighmass_WoInt::HZZ4L_RooHighmass_WoInt(const char *name, const char *title, + RooAbsReal& _mass, + RooAbsReal& _dbkg, + RooAbsReal& _coupl, + const RooArgList& inCoefList): + RooAbsPdf(name,title), + mass("mass","mass",this,_mass), + dbkg("dbkg","dbkg",this,_dbkg), + coupl("coupl","coupl",this,_coupl), + // _normSet("normSet","List of observables",this), + _coefList("coefList","List of funcficients",this) + + { + TIterator* coefIter = inCoefList.createIterator() ; + RooAbsArg* func; + while((func = (RooAbsArg*)coefIter->Next())) { + if (!dynamic_cast(func)) { + coutE(InputArguments) << "ERROR: :HZZ4L_RooHighmass_WoInt(" << GetName() << ") funcficient " << func->GetName() << " is not of type RooAbsReal" << std::endl; + assert(0); + } + _coefList.add(*func) ; + } + delete coefIter; + + } + + + HZZ4L_RooHighmass_WoInt::HZZ4L_RooHighmass_WoInt(const HZZ4L_RooHighmass_WoInt& other, const char* name) : + RooAbsPdf(other,name), +// _normSet(other._normSet), + mass("mass",this,other.mass), + dbkg("dbkg",this,other.dbkg), + coupl("coupl",this,other.coupl), + //_normSet("normSet",this,other._normSet), + _coefList("coefList",this,other._coefList) + + { + _coefIter = _coefList.createIterator() ; + } + + + Double_t HZZ4L_RooHighmass_WoInt::evaluate() const + { + double value = 0.; + + Double_t T1 = dynamic_cast(_coefList.at(0))->getVal(); + // Double_t T2 = dynamic_cast(_coefList.at(1))->getVal(); +// RooArgSet *nset = new RooArgSet(mass.arg()); +// Double_t T3 = dynamic_cast(_coefList.at(2))->getVal(); + + value = coupl*T1; + + if ( value <= 0.) { return 1.0e-200;} + + return value ; + + } + +Int_t HZZ4L_RooHighmass_WoInt::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const +{ + + if (matchArgs(allVars,analVars,RooArgSet(*mass.absArg(),*dbkg.absArg()))) return 4 ; + + return 0 ; + +} + +Double_t HZZ4L_RooHighmass_WoInt::analyticalIntegral(Int_t code, const char* rangeName) const +{ + switch(code) + { + + case 4: + { + double Int_T1 = dynamic_cast(_coefList.at(0))-> analyticalIntegral(1000); + //double Int_T2 = dynamic_cast(_coefList.at(1))-> analyticalIntegral(1000); + // Double_t T3_int= dynamic_cast(_coefList.at(2))->analyticalIntegral(1000); + + + //double mysgn = 1.; + // if(coupl < 0.) + // { + // mysgn = -1.; + // } + + double integral = coupl*Int_T1 ; + return integral; + } + + } + + assert(0) ; + return 0 ; +} + diff --git a/src/classes.h b/src/classes.h index 9374e48d881..6cafe7e6803 100644 --- a/src/classes.h +++ b/src/classes.h @@ -67,3 +67,7 @@ #include "HiggsAnalysis/CombinedLimit/interface/CMSHggFormula.h" #include "HiggsAnalysis/CombinedLimit/interface/SimpleProdPdf.h" #include "HiggsAnalysis/CombinedLimit/interface/RooEFTScalingFunction.h" + +#include "HiggsAnalysis/CombinedLimit/interface/HZZ4L_RooHighmass.h" +#include "HiggsAnalysis/CombinedLimit/interface/HZZ4L_RooHighmass_WoInt.h" + diff --git a/src/classes_def.xml b/src/classes_def.xml index 2c891d14a4f..f5ccb4d5af5 100644 --- a/src/classes_def.xml +++ b/src/classes_def.xml @@ -223,4 +223,7 @@ + + +