CMS 3D CMS Logo

Public Member Functions | Protected Member Functions | Protected Attributes

Triangle Class Reference

#include <HZZ2L2QRooPdfs.h>

List of all members.

Public Member Functions

Double_t analyticalIntegral (Int_t code, const char *rangeName=0) const
virtual TObject * clone (const char *newname) const
Int_t getAnalyticalIntegral (RooArgSet &allVars, RooArgSet &analVars, const char *rangeName=0) const
 Triangle ()
 Triangle (const char *name, const char *title, RooAbsReal &_m, RooAbsReal &_start, RooAbsReal &_turn, RooAbsReal &_stop)
 Triangle (const Triangle &other, const char *name=0)
virtual ~Triangle ()

Protected Member Functions

Double_t evaluate () const

Protected Attributes

RooRealProxy m
RooRealProxy start
RooRealProxy stop
RooRealProxy turn

Detailed Description

Definition at line 126 of file HZZ2L2QRooPdfs.h.


Constructor & Destructor Documentation

Triangle::Triangle ( )

Referenced by clone().

Triangle::Triangle ( const char *  name,
const char *  title,
RooAbsReal &  _m,
RooAbsReal &  _start,
RooAbsReal &  _turn,
RooAbsReal &  _stop 
)

Definition at line 199 of file HZZ2L2QRooPdfs.cc.

                    :
  RooAbsPdf(name, title),
  m("m", "Dependent", this, _m),
  start("start","start",this,_start),
  turn("turn","turn",this,_turn),
  stop("stop","stop",this,_stop)
{
}
Triangle::Triangle ( const Triangle other,
const char *  name = 0 
)

Definition at line 213 of file HZZ2L2QRooPdfs.cc.

                                                          :
  RooAbsPdf(other, name), m("m", this, other.m),start("start", this, other.start), turn("turn", this, other.turn), stop("stop", this, other.stop)
{
}
virtual Triangle::~Triangle ( ) [inline, virtual]

Definition at line 140 of file HZZ2L2QRooPdfs.h.

{ }

Member Function Documentation

Double_t Triangle::analyticalIntegral ( Int_t  code,
const char *  rangeName = 0 
) const

Definition at line 236 of file HZZ2L2QRooPdfs.cc.

References m, mathSSE::sqrt(), start, stop, and turn.

{

  // WARNING, ASSSUMES TURN TO BE IN INTERVAL
  assert(code==1) ;
  //whole triangle
  Double_t sumleft = sqrt(1+ (turn+start)*(turn+start) ) ;
  Double_t sumright= sqrt(1+ (turn+stop)*(turn+stop) );


  if(m.min() < turn+start)// correct for left missing bit
    sumleft -= sumleft*(m.min()-(turn+start))/fabs(start);


  if(m.max() > turn+stop)// correct for right missing bit
    sumright -= sumright*(turn+stop -m.max())/fabs(stop);

  

  return sumleft+sumright;    
}
virtual TObject* Triangle::clone ( const char *  newname) const [inline, virtual]

Definition at line 137 of file HZZ2L2QRooPdfs.h.

References Triangle().

                                                    { 
    return new Triangle(*this,newname); }
Double_t Triangle::evaluate ( ) const [protected]

Definition at line 218 of file HZZ2L2QRooPdfs.cc.

References m, start, stop, and turn.

{
  //std::cout << m << " "<<1.+(start-m)/turn << " " << 1+(turn-m)/stop << std::endl;
  if(m<turn  && m > turn+start)
    return 1.+(turn-m)/start;
  if(m>=turn && m < turn+stop)
    return 1.+(turn-m)/stop;
  
  return 0;
}
Int_t Triangle::getAnalyticalIntegral ( RooArgSet &  allVars,
RooArgSet &  analVars,
const char *  rangeName = 0 
) const

Definition at line 230 of file HZZ2L2QRooPdfs.cc.

References m.

{
  if (matchArgs(allVars,analVars,m)) return 1;
  return 0;
}

Member Data Documentation

RooRealProxy Triangle::m [protected]

Definition at line 146 of file HZZ2L2QRooPdfs.h.

Referenced by analyticalIntegral(), evaluate(), and getAnalyticalIntegral().

RooRealProxy Triangle::start [protected]

Definition at line 147 of file HZZ2L2QRooPdfs.h.

Referenced by analyticalIntegral(), and evaluate().

RooRealProxy Triangle::stop [protected]

Definition at line 149 of file HZZ2L2QRooPdfs.h.

Referenced by analyticalIntegral(), and evaluate().

RooRealProxy Triangle::turn [protected]

Definition at line 148 of file HZZ2L2QRooPdfs.h.

Referenced by analyticalIntegral(), and evaluate().