CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Protected Attributes
Triangle Class Reference

#include <HZZ2L2QRooPdfs.h>

Inheritance diagram for Triangle:

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 ( )

Definition at line 197 of file HZZ2L2QRooPdfs.cc.

Referenced by clone().

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

Definition at line 199 of file HZZ2L2QRooPdfs.cc.

204  :
205  RooAbsPdf(name, title),
206  m("m", "Dependent", this, _m),
207  start("start","start",this,_start),
208  turn("turn","turn",this,_turn),
209  stop("stop","stop",this,_stop)
210 {
211 }
RooRealProxy start
RooRealProxy m
RooRealProxy stop
RooRealProxy turn
Triangle::Triangle ( const Triangle other,
const char *  name = 0 
)

Definition at line 213 of file HZZ2L2QRooPdfs.cc.

213  :
214  RooAbsPdf(other, name), m("m", this, other.m),start("start", this, other.start), turn("turn", this, other.turn), stop("stop", this, other.stop)
215 {
216 }
RooRealProxy start
RooRealProxy m
RooRealProxy stop
RooRealProxy turn
virtual Triangle::~Triangle ( )
inlinevirtual

Definition at line 140 of file HZZ2L2QRooPdfs.h.

140 { }

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.

237 {
238 
239  // WARNING, ASSSUMES TURN TO BE IN INTERVAL
240  assert(code==1) ;
241  //whole triangle
242  Double_t sumleft = sqrt(1+ (turn+start)*(turn+start) ) ;
243  Double_t sumright= sqrt(1+ (turn+stop)*(turn+stop) );
244 
245 
246  if(m.min() < turn+start)// correct for left missing bit
247  sumleft -= sumleft*(m.min()-(turn+start))/fabs(start);
248 
249 
250  if(m.max() > turn+stop)// correct for right missing bit
251  sumright -= sumright*(turn+stop -m.max())/fabs(stop);
252 
253 
254 
255  return sumleft+sumright;
256 }
RooRealProxy start
RooRealProxy m
T sqrt(T t)
Definition: SSEVec.h:46
RooRealProxy stop
RooRealProxy turn
virtual TObject* Triangle::clone ( const char *  newname) const
inlinevirtual

Definition at line 137 of file HZZ2L2QRooPdfs.h.

References Triangle().

137  {
138  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.

219 {
220  //std::cout << m << " "<<1.+(start-m)/turn << " " << 1+(turn-m)/stop << std::endl;
221  if(m<turn && m > turn+start)
222  return 1.+(turn-m)/start;
223  if(m>=turn && m < turn+stop)
224  return 1.+(turn-m)/stop;
225 
226  return 0;
227 }
RooRealProxy start
RooRealProxy m
RooRealProxy stop
RooRealProxy turn
Int_t Triangle::getAnalyticalIntegral ( RooArgSet &  allVars,
RooArgSet &  analVars,
const char *  rangeName = 0 
) const

Definition at line 230 of file HZZ2L2QRooPdfs.cc.

References m.

231 {
232  if (matchArgs(allVars,analVars,m)) return 1;
233  return 0;
234 }
RooRealProxy m

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
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().