/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitModels                                                     *
 *    File: $Id$
 * Authors:                                                                  *
 *   GR, Gerhard Raven,   Nikhef & VU, Gerhard.Raven@nikhef.nl
 *                                                                           *
 * Copyright (c) 2010, Nikhef & VU. All rights reserved.
 *                                                                           *
 * Redistribution and use in source and binary forms,                        *
 * with or without modification, are permitted according to the terms        *
 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
 *****************************************************************************/
#ifndef ROO_LEGENDRE
#define ROO_LEGENDRE

#include "RooAbsReal.h"
#include "RooRealProxy.h"

class RooLegendre : public RooAbsReal {
public:
  RooLegendre() ;
  // an (associated) Legendre polynomial, P_l^m(x)
  // note: P_l(x) == P_l^0(x)
  RooLegendre(const char *name, const char *title, RooAbsReal& ctheta, int l, int m=0);
  // product of two associated Legendre polynomials, P_l1^m1(ctheta) * P_l2^m2(ctheta)
  RooLegendre(const char *name, const char *title, RooAbsReal& ctheta, int l1, int m1, int l2, int m2);

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

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

  virtual Int_t getMaxVal( const RooArgSet& vars) const;
  virtual Double_t maxVal( Int_t code) const;

protected: // allow RooSpHarmonic access...
  RooRealProxy _ctheta;
  int _l1,_m1;
  int _l2,_m2;

  Double_t evaluate() const;

  ClassDef(RooLegendre,1) // Legendre polynomial
};

#endif
 RooLegendre.h:1
 RooLegendre.h:2
 RooLegendre.h:3
 RooLegendre.h:4
 RooLegendre.h:5
 RooLegendre.h:6
 RooLegendre.h:7
 RooLegendre.h:8
 RooLegendre.h:9
 RooLegendre.h:10
 RooLegendre.h:11
 RooLegendre.h:12
 RooLegendre.h:13
 RooLegendre.h:14
 RooLegendre.h:15
 RooLegendre.h:16
 RooLegendre.h:17
 RooLegendre.h:18
 RooLegendre.h:19
 RooLegendre.h:20
 RooLegendre.h:21
 RooLegendre.h:22
 RooLegendre.h:23
 RooLegendre.h:24
 RooLegendre.h:25
 RooLegendre.h:26
 RooLegendre.h:27
 RooLegendre.h:28
 RooLegendre.h:29
 RooLegendre.h:30
 RooLegendre.h:31
 RooLegendre.h:32
 RooLegendre.h:33
 RooLegendre.h:34
 RooLegendre.h:35
 RooLegendre.h:36
 RooLegendre.h:37
 RooLegendre.h:38
 RooLegendre.h:39
 RooLegendre.h:40
 RooLegendre.h:41
 RooLegendre.h:42
 RooLegendre.h:43
 RooLegendre.h:44
 RooLegendre.h:45
 RooLegendre.h:46
 RooLegendre.h:47
 RooLegendre.h:48
 RooLegendre.h:49