Skip to content

Commit

Permalink
Add ATLAS classes needed for CMS+ATLAS combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
lviliani committed Feb 15, 2024
1 parent ec1fa76 commit 5c7b121
Show file tree
Hide file tree
Showing 3 changed files with 671 additions and 0 deletions.
126 changes: 126 additions & 0 deletions interface/AtlasPdfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -387,4 +387,130 @@ class RooStarMomentMorph : public RooAbsPdf {

#endif

#ifndef QuickStats_Shapes_RooTwoSidedCBShape
#define QuickStats_Shapes_RooTwoSidedCBShape

#include "RooAbsPdf.h"
#include "RooRealProxy.h"
#include "RooAbsReal.h"
#include "RooArgSet.h"
#include "RooRealVar.h"

class RooRealVar;

class RooTwoSidedCBShape : public RooAbsPdf {
public:
RooTwoSidedCBShape() {}
RooTwoSidedCBShape(const char *name, const char *title, RooAbsReal& _m,
RooAbsReal& _m0, RooAbsReal& _sigma,
RooAbsReal& _alphaLo, RooAbsReal& _nLo,
RooAbsReal& _alphaHi, RooAbsReal& _nHi);

RooTwoSidedCBShape(const RooTwoSidedCBShape& other, const char* name = 0);
virtual TObject* clone(const char* newname) const { return new RooTwoSidedCBShape(*this,newname); }

inline virtual ~RooTwoSidedCBShape() { }

Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const;
Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const;

protected:

Double_t gaussianIntegral(Double_t tmin, Double_t tmax) const;
Double_t powerLawIntegral(Double_t tmin, Double_t tmax, Double_t alpha, Double_t n) const;
Double_t evaluate() const;

RooRealProxy m;
RooRealProxy m0;
RooRealProxy sigma;
RooRealProxy alphaLo;
RooRealProxy nLo;
RooRealProxy alphaHi;
RooRealProxy nHi;


private:

ClassDef(RooTwoSidedCBShape,1)
};


#endif

// @(#)root/roostats:$Id: cranmer $
// Author: Kyle Cranmer, Akira Shibata
// Modified by Hongtao Yang for xmlAnaWSBuilder: we need to have both upper and lower uncertainties as functions, not just numbers
/*************************************************************************
* Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

#ifndef ROOSTATS_ResponseFunction
#define ROOSTATS_ResponseFunction

#include <TIterator.h>
#include <RooListProxy.h>
#include <RooAbsReal.h>
#include <vector>
#include <ostream>

class RooRealVar;
class RooArgList;

class ResponseFunction : public RooAbsReal
{
public:
ResponseFunction();
ResponseFunction(const char *name, const char *title,
const RooArgList &_paramList,
std::vector<double> nominal, const RooArgList &lowList, const RooArgList &highList, std::vector<int> code);

ResponseFunction(const ResponseFunction &, const char *);

void setInterpCode(RooAbsReal &param, int code);
void setAllInterpCodes(int code);
void setGlobalBoundary(double boundary) { _interpBoundary = boundary; }

virtual TObject *clone(const char *newname) const { return new ResponseFunction(*this, newname); }
virtual ~ResponseFunction();

virtual void printMultiline(std::ostream &os, Int_t contents, Bool_t verbose = kFALSE, TString indent = "") const;
virtual void printResponseFunctions(std::ostream &os) const;

private:
double PolyInterpValue(int i, double x) const;
inline double logn(double nominal, double delta, double theta) const { return pow(1 + delta / nominal, theta); };
inline void cacheCoef(unsigned j) const;

protected:
RooListProxy _paramList;
std::vector<double> _nominal;
RooListProxy _lowList;
RooListProxy _highList;
std::vector<int> _interpCode;
Double_t _interpBoundary;

mutable Bool_t _logInit; //! flag used for chaching polynomial coefficients
mutable std::vector<double> _polCoeff; //! cached polynomial coefficients

Double_t evaluate() const;

public:
double interpolationBoundary() const { return _interpBoundary; }
const std::vector<int>& interpolationCodes() const { return _interpCode; }
const std::vector<double>& nominal() const { return _nominal; }
#if ROOT_VERSION_CODE >= ROOT_VERSION(6,26,0)
const RooAbsCollection::Storage_t& parameters() const { return _paramList.get(); }
const RooAbsCollection::Storage_t& low() const { return _lowList.get(); }
const RooAbsCollection::Storage_t& high() const { return _highList.get(); }
#endif


ClassDef(ResponseFunction, 2) // flexible interpolation
};

#endif

Loading

0 comments on commit 5c7b121

Please sign in to comment.