Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFs for HZZ high mass searches #861

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 62 additions & 0 deletions interface/HZZ4L_RooHighmass.h
Original file line number Diff line number Diff line change
@@ -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
62 changes: 62 additions & 0 deletions interface/HZZ4L_RooHighmass_WoInt.h
Original file line number Diff line number Diff line change
@@ -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
110 changes: 110 additions & 0 deletions src/HZZ4L_RooHighmass.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#include "Riostream.h"
#include "../interface/HZZ4L_RooHighmass.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include <math.h>
#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<RooAbsReal*>(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<const RooHistFunc*>(_coefList.at(0))->getVal();
Double_t T2 = dynamic_cast<const RooHistFunc*>(_coefList.at(1))->getVal();
// RooArgSet *nset = new RooArgSet(mass.arg());
Double_t T3 = dynamic_cast<const RooHistFunc*>(_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<const RooHistFunc*>(_coefList.at(0))-> analyticalIntegral(1000);
double Int_T2 = dynamic_cast<const RooHistFunc*>(_coefList.at(1))-> analyticalIntegral(1000);
Double_t T3_int= dynamic_cast<const RooHistFunc*>(_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 ;
}

110 changes: 110 additions & 0 deletions src/HZZ4L_RooHighmass_WoInt.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
#include "Riostream.h"
#include "../interface/HZZ4L_RooHighmass_WoInt.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include <math.h>
#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<RooAbsReal*>(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<const RooHistFunc*>(_coefList.at(0))->getVal();
// Double_t T2 = dynamic_cast<const RooHistFunc*>(_coefList.at(1))->getVal();
// RooArgSet *nset = new RooArgSet(mass.arg());
// Double_t T3 = dynamic_cast<const RooHistFunc*>(_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<const RooHistFunc*>(_coefList.at(0))-> analyticalIntegral(1000);
//double Int_T2 = dynamic_cast<const RooHistFunc*>(_coefList.at(1))-> analyticalIntegral(1000);
// Double_t T3_int= dynamic_cast<const RooHistFunc*>(_coefList.at(2))->analyticalIntegral(1000);


//double mysgn = 1.;
// if(coupl < 0.)
// {
// mysgn = -1.;
// }

double integral = coupl*Int_T1 ;
return integral;
}

}

assert(0) ;
return 0 ;
}

4 changes: 4 additions & 0 deletions src/classes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

3 changes: 3 additions & 0 deletions src/classes_def.xml
Original file line number Diff line number Diff line change
Expand Up @@ -223,4 +223,7 @@
<class name="CMSHggFormulaD2" />
<class name="SimpleProdPdf" />
<class name="RooEFTScalingFunction" />
<class name="HZZ4L_RooHighmass" />
<class name="HZZ4L_RooHighmass_WoInt" />

</lcgdict>
Loading