ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id: RooClassFactory.cxx 28963 2009-06-12 15:47:45Z wouter $
 * Authors:                                                                  *
 *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
 *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
 *                                                                           *
 * Copyright (c) 2000-2005, Regents of the University of California          *
 *                          and Stanford University. 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)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
// 
// BEGIN_HTML
// RooClassFactory is a clase like TTree::MakeClass() that generates
// skeleton code for RooAbsPdf and RooAbsReal functions given
// a list of input parameter names. The factory can also compile
// the generated code on the fly, and on request also immediate
// instantiate objects.
// END_HTML
//

#include "RooFit.h"
#include "TClass.h"
#include "RooClassFactory.h"
#include "RooClassFactory.h"
#include "RooAbsReal.h"
#include "RooAbsCategory.h"
#include "RooArgList.h"
#include "RooMsgService.h"
#include "TInterpreter.h"
#include "RooWorkspace.h"
#include "RooGlobalFunc.h"
#include "RooAbsPdf.h"
#include <fstream>
#include <vector>
#include <string>

using namespace std ;

ClassImp(RooClassFactory) 
;

static Int_t init()
{
  RooFactoryWSTool::IFace* iface = new RooClassFactory::ClassFacIFace ;
  RooFactoryWSTool::registerSpecial("CEXPR",iface) ;
  RooFactoryWSTool::registerSpecial("cexpr",iface) ;
  return 0 ;
}
static Int_t dummy = init() ;




//_____________________________________________________________________________
RooClassFactory::RooClassFactory()
{
  // Default constructor
}



//_____________________________________________________________________________
RooClassFactory::~RooClassFactory() 
{
  // Destructor
}



//_____________________________________________________________________________
Bool_t RooClassFactory::makeAndCompilePdf(const char* name, const char* expression, const RooArgList& vars, const char* intExpression) 
{

  string realArgNames,catArgNames ;
  TIterator* iter = vars.createIterator() ;
  RooAbsArg* arg ;
  while((arg=(RooAbsArg*)iter->Next())) {
    if (dynamic_cast<RooAbsReal*>(arg)) {
      if (realArgNames.size()>0) realArgNames += "," ;
      realArgNames += arg->GetName() ;
    } else if (dynamic_cast<RooAbsCategory*>(arg)) {
      if (catArgNames.size()>0) catArgNames += "," ;
      catArgNames += arg->GetName() ;
    } else {
      oocoutE((RooAbsArg*)0,InputArguments) << "RooClassFactory::makeAndCompilePdf ERROR input argument " << arg->GetName() 
					      << " is neither RooAbsReal nor RooAbsCategory and is ignored" << endl ;
    }
  }
  delete iter ;

  Bool_t ret = makePdf(name,realArgNames.c_str(),catArgNames.c_str(),expression,intExpression?kTRUE:kFALSE,kFALSE,intExpression) ;
  if (ret) {
    return ret ;
  }
 
  if (gInterpreter->GetRootMapFiles()==0) {
    gInterpreter->EnableAutoLoading() ;
  }

  TInterpreter::EErrorCode ecode;
  gInterpreter->ProcessLineSynch(Form(".L %s.cxx+",name),&ecode) ;
  return (ecode!=TInterpreter::kNoError) ;
}



//_____________________________________________________________________________
Bool_t RooClassFactory::makeAndCompileFunction(const char* name, const char* expression, const RooArgList& vars, const char* intExpression) 
{
  // Write, compile and load code for a RooAbsReal implementation with
  // class name 'name', taking all elements of 'vars' as constructor
  // arguments. The initial value expression is taken to be
  // 'expression' which can be any one-line C++ expression in terms of
  // variables that occur in 'vars'. You can add optional expressions
  // for analytical integrals to be advertised by your class in the
  // syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral.

  string realArgNames,catArgNames ;
  TIterator* iter = vars.createIterator() ;
  RooAbsArg* arg ;
  while((arg=(RooAbsArg*)iter->Next())) {
    if (dynamic_cast<RooAbsReal*>(arg)) {
      if (realArgNames.size()>0) realArgNames += "," ;
      realArgNames += arg->GetName() ;
    } else if (dynamic_cast<RooAbsCategory*>(arg)) {
      if (catArgNames.size()>0) catArgNames += "," ;
      catArgNames += arg->GetName() ;
    } else {
      oocoutE((RooAbsArg*)0,InputArguments) << "RooClassFactory::makeAndCompileFunction ERROR input argument " << arg->GetName() 
					    << " is neither RooAbsReal nor RooAbsCategory and is ignored" << endl ;
    }
  }
  delete iter ;

  Bool_t ret = makeFunction(name,realArgNames.c_str(),catArgNames.c_str(),expression,intExpression?kTRUE:kFALSE,intExpression) ;
  if (ret) {
    return ret ;
  }

  if (gInterpreter->GetRootMapFiles()==0) {
    gInterpreter->EnableAutoLoading() ;
  }

  TInterpreter::EErrorCode ecode;
  gInterpreter->ProcessLineSynch(Form(".L %s.cxx+",name),&ecode) ;
  return (ecode!=TInterpreter::kNoError) ;
}


//_____________________________________________________________________________
RooAbsReal* RooClassFactory::makeFunctionInstance(const char* name, const char* expression, const RooArgList& vars, const char* intExpression) 
{
  // Write, compile and load code and instantiate object for a
  // RooAbsReal implementation with class name 'name', taking all
  // elements of 'vars' as constructor arguments. The initial value
  // expression is taken to be 'expression' which can be any one-line
  // C++ expression in terms of variables that occur in 'vars'. 
  //
  // The returned object is an instance of the object you just defined
  // connected to the variables listed in 'vars'. The name of the
  // object is 'name', its class name Roo<name>Class.
  //
  // This function is an effective compiled replacement of RooFormulaVar
  //
  // You can add optional expressions for analytical integrals to be
  // advertised by your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral.

  // Construct unique class name for this function expression
  string tmpName(name) ;
  tmpName[0] = toupper(tmpName[0]) ;
  string className = Form("Roo%sFunc",tmpName.c_str()) ;

  return makeFunctionInstance(className.c_str(),name,expression,vars,intExpression) ;
}

//_____________________________________________________________________________
RooAbsReal* RooClassFactory::makeFunctionInstance(const char* className, const char* name, const char* expression, const RooArgList& vars, const char* intExpression) 
{
  // Write, compile and load code and instantiate object for a
  // RooAbsReal implementation with class name 'name', taking all
  // elements of 'vars' as constructor arguments. The initial value
  // expression is taken to be 'expression' which can be any one-line
  // C++ expression in terms of variables that occur in 'vars'. 
  //
  // The returned object is an instance of the object you just defined
  // connected to the variables listed in 'vars'. The name of the
  // object is 'name', its class name Roo<name>Class.
  //
  // This function is an effective compiled replacement of RooFormulaVar
  //
  // You can add optional expressions for analytical integrals to be
  // advertised by your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral.

  if (gInterpreter->GetRootMapFiles()==0) {
    gInterpreter->EnableAutoLoading() ;
  }

  // Use class factory to compile and link specialized function
  Bool_t error = makeAndCompileFunction(className,expression,vars,intExpression) ;

  // Check that class was created OK
  if (error) {
    RooErrorHandler::softAbort() ;
  }

  // Create CINT line that instantiates specialized object
  string line = Form("new %s(\"%s\",\"%s\"",className,name,name) ;

  // Make list of pointer values (represented in hex ascii) to be passed to cint  
  // Note that the order of passing arguments must match the convention in which
  // the class code is generated: first all reals, then all categories

  TIterator* iter = vars.createIterator() ;
  string argList ;
  // First pass the RooAbsReal arguments in the list order
  RooAbsArg* var ;
  while((var=(RooAbsArg*)iter->Next())) {
    if (dynamic_cast<RooAbsReal*>(var)) {
      argList += Form(",*((RooAbsReal*)%p)",var) ;
    }
  }
  iter->Reset() ;
  // Next pass the RooAbsCategory arguments in the list order
  while((var=(RooAbsArg*)iter->Next())) {
    if (dynamic_cast<RooAbsCategory*>(var)) {
      argList += Form(",*((RooAbsCategory*)%p)",var) ;
    }
  }
  delete iter ;

  line += argList + ") ;" ;

  // Let CINT instantiate specialized formula
  return (RooAbsReal*) gInterpreter->ProcessLineSynch(line.c_str()) ;
}




//_____________________________________________________________________________
RooAbsPdf* RooClassFactory::makePdfInstance(const char* name, const char* expression, 
					    const RooArgList& vars, const char* intExpression)
{
  // Write, compile and load code and instantiate object for a
  // RooAbsPdf implementation with class name 'name', taking all
  // elements of 'vars' as constructor arguments. The initial value
  // expression is taken to be 'expression' which can be any one-line
  // C++ expression in terms of variables that occur in 'vars'. 
  //
  // The returned object is an instance of the object you just defined
  // connected to the variables listed in 'vars'. The name of the
  // object is 'name', its class name Roo<name>Class.
  //
  // This function is an effective compiled replacement of RooGenericPdf
  //
  // You can add optional expressions for analytical integrals to be
  // advertised by your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral.

  // Construct unique class name for this function expression
  string tmpName(name) ;
  tmpName[0] = toupper(tmpName[0]) ;
  string className = Form("Roo%sPdf",tmpName.c_str()) ;
  
  return makePdfInstance(className.c_str(),name,expression,vars,intExpression) ;
}

//_____________________________________________________________________________
RooAbsPdf* RooClassFactory::makePdfInstance(const char* className, const char* name, const char* expression, 
					    const RooArgList& vars, const char* intExpression)
{
  // Write, compile and load code and instantiate object for a
  // RooAbsPdf implementation with class name 'name', taking all
  // elements of 'vars' as constructor arguments. The initial value
  // expression is taken to be 'expression' which can be any one-line
  // C++ expression in terms of variables that occur in 'vars'. 
  //
  // The returned object is an instance of the object you just defined
  // connected to the variables listed in 'vars'. The name of the
  // object is 'name', its class name Roo<name>Class.
  //
  // This function is an effective compiled replacement of RooGenericPdf
  //
  // You can add optional expressions for analytical integrals to be
  // advertised by your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral.

  if (gInterpreter->GetRootMapFiles()==0) {
    gInterpreter->EnableAutoLoading() ;
  }

  // Use class factory to compile and link specialized function
  Bool_t error = makeAndCompilePdf(className,expression,vars,intExpression) ;

  // Check that class was created OK
  if (error) {
    RooErrorHandler::softAbort() ;
  }

  // Create CINT line that instantiates specialized object
  string line = Form("new %s(\"%s\",\"%s\"",className,name,name) ;

  // Make list of pointer values (represented in hex ascii) to be passed to cint  
  // Note that the order of passing arguments must match the convention in which
  // the class code is generated: first all reals, then all categories

  TIterator* iter = vars.createIterator() ;
  string argList ;
  // First pass the RooAbsReal arguments in the list order
  RooAbsArg* var ;
  while((var=(RooAbsArg*)iter->Next())) {
    if (dynamic_cast<RooAbsReal*>(var)) {
      argList += Form(",*((RooAbsReal*)%p)",var) ;
    }
  }
  iter->Reset() ;
  // Next pass the RooAbsCategory arguments in the list order
  while((var=(RooAbsArg*)iter->Next())) {
    if (dynamic_cast<RooAbsCategory*>(var)) {
      argList += Form(",*((RooAbsCategory*)%p)",var) ;
    }
  }
  delete iter ;

  line += argList + ") ;" ;

  // Let CINT instantiate specialized formula
  return (RooAbsPdf*) gInterpreter->ProcessLineSynch(line.c_str()) ;
}



//_____________________________________________________________________________
Bool_t RooClassFactory::makePdf(const char* name, const char* argNames, const char* catArgNames, const char* expression, 
				Bool_t hasAnaInt, Bool_t hasIntGen, const char* intExpression) 
{
  // Write code for a RooAbsPdf implementation with class name 'name',
  // taking RooAbsReal arguments with names listed in argNames and
  // RooAbsCategory arguments with names listed in catArgNames as
  // constructor arguments (use a comma separated list for multiple
  // arguments). The initial value expression is taken to be
  // 'expression' which can be any one-line C++ expression in terms of
  // variables that occur in 'vars'. Skeleton code for handling of
  // analytical integrals is added if hasAnaInt is true. You can add
  // optional expressions for analytical integrals to be advertised by
  // your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral. Skeleton code for internal event generation is added
  // if hasIntGen is true
  // 

  return makeClass("RooAbsPdf",name,argNames,catArgNames,expression,hasAnaInt,hasIntGen,intExpression) ;
}


//_____________________________________________________________________________
Bool_t RooClassFactory::makeFunction(const char* name, const char* argNames, const char* catArgNames, const char* expression, Bool_t hasAnaInt, const char* intExpression) 
{
  // Write code for a RooAbsReal implementation with class name 'name',
  // taking RooAbsReal arguments with names listed in argNames and
  // RooAbsCategory arguments with names listed in catArgNames as
  // constructor arguments (use a comma separated list for multiple
  // arguments). The initial value expression is taken to be
  // 'expression' which can be any one-line C++ expression in terms of
  // variables that occur in 'vars'. Skeleton code for handling of
  // analytical integrals is added if hasAnaInt is true. You can add
  // optional expressions for analytical integrals to be advertised by
  // your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral. 

  return makeClass("RooAbsReal",name,argNames,catArgNames,expression,hasAnaInt,kFALSE,intExpression) ;
}


//_____________________________________________________________________________
Bool_t RooClassFactory::makeClass(const char* baseName, const char* className, const char* realArgNames, const char* catArgNames, 
				  const char* expression,  Bool_t hasAnaInt, Bool_t hasIntGen, const char* intExpression)
{
  // Write code for a 'baseName' implementation with class name 'className',
  // taking RooAbsReal arguments with names listed in argNames and
  // RooAbsCategory arguments with names listed in catArgNames as
  // constructor arguments (use a comma separated list for multiple
  // arguments). The initial value expression is taken to be
  // 'expression' which can be any one-line C++ expression in terms of
  // variables that occur in 'vars'. Skeleton code for handling of
  // analytical integrals is added if hasAnaInt is true. You can add
  // optional expressions for analytical integrals to be advertised by
  // your class in the syntax
  // "<intObsName>:<CPPAnaIntExpression>;<intObsName,intObsName>:<CPPAnaIntExpression>"
  // where <intObsName> a name of the observable integrated over and
  // <CPPAnaIntExpression> is the C++ expression that calculates that
  // integral. Skeleton code for internal event generation is added
  // if hasIntGen is true
  // 

  // Check that arguments were given
  if (!baseName) {
    oocoutE((TObject*)0,InputArguments) << "RooClassFactory::makeClass: ERROR: a base class name must be given" << endl ;
    return kTRUE ;
  }

  if (!className) {
    oocoutE((TObject*)0,InputArguments) << "RooClassFactory::makeClass: ERROR: a class name must be given" << endl ;
    return kTRUE ;
  }

  if ((!realArgNames || !*realArgNames) && (!catArgNames || !*catArgNames)) {
    oocoutE((TObject*)0,InputArguments) << "RooClassFactory::makeClass: ERROR: A list of input argument names must be given" << endl ;
    return kTRUE ;
  }

  if (intExpression && !hasAnaInt) {
    oocoutE((TObject*)0,InputArguments) << "RooClassFactory::makeClass: ERROR no analytical integration code requestion, but expression for analytical integral provided" << endl ;
    return kTRUE ;
  }

  // Parse comma separated list of argument names into list of strings
  vector<string> alist ;
  vector<bool> isCat ;

  if (realArgNames && *realArgNames) {
    char* buf = new char[strlen(realArgNames)+1] ;
    strcpy(buf,realArgNames) ;
    char* token = strtok(buf,",") ;
    while(token) {
      alist.push_back(token) ;
      isCat.push_back(false) ;
      token = strtok(0,",") ;
    }
    delete[] buf ;
  }
  if (catArgNames && *catArgNames) {
    char* buf = new char[strlen(catArgNames)+1] ;
    strcpy(buf,catArgNames) ;
    char* token = strtok(buf,",") ;
    while(token) {
      alist.push_back(token) ;
      isCat.push_back(true) ;      
      token = strtok(0,",") ;
    }
    delete[] buf ;
  }
  
  TString impFileName(className), hdrFileName(className) ;
  impFileName += ".cxx" ;
  hdrFileName += ".h" ;

  TString ifdefName(className) ;
  ifdefName.ToUpper() ;
  
  ofstream hf(hdrFileName) ;
  hf << "/*****************************************************************************" << endl
     << " * Project: RooFit                                                           *" << endl
     << " *                                                                           *" << endl
     << "  * This code was autogenerated by RooClassFactory                            * " << endl 
     << " *****************************************************************************/" << endl
     << endl
     << "#ifndef " << ifdefName << endl
     << "#define " << ifdefName << endl
     << "" << endl     
     << "#include \"" << baseName << ".h\"" << endl
     << "#include \"RooRealProxy.h\"" << endl
     << "#include \"RooCategoryProxy.h\"" << endl
     << "#include \"RooAbsReal.h\"" << endl
     << "#include \"RooAbsCategory.h\"" << endl
     << " " << endl
     << "class " << className << " : public " << baseName << " {" << endl
     << "public:" << endl
     << "  " << className << "() {} ; " << endl 
     << "  " << className << "(const char *name, const char *title," << endl ;
  
  // Insert list of input arguments
  unsigned int i ;
  for (i=0 ; i<alist.size() ; i++) { 
    if (!isCat[i]) {
      hf << "	      RooAbsReal& _" ;
    } else {
      hf << "	      RooAbsCategory& _" ;
    }
    hf << alist[i] ;
    if (i==alist.size()-1) {
      hf << ");" << endl ;
    } else {
      hf << "," << endl ;
    }    
  }
  
  hf << "  " << className << "(const " << className << "& other, const char* name=0) ;" << endl
     << "  virtual TObject* clone(const char* newname) const { return new " << className << "(*this,newname); }" << endl
     << "  inline virtual ~" << className << "() { }" << endl
     << endl ;

  if (hasAnaInt) {
    hf << "  Int_t getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* rangeName=0) const ;" << endl
       << "  Double_t analyticalIntegral(Int_t code, const char* rangeName=0) const ;" << endl
       << "" << endl ;
  }

  if (hasIntGen) {
     hf << "  Int_t getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t staticInitOK=kTRUE) const;" << endl
	<< "  void initGenerator(Int_t code) {} ; // optional pre-generation initialization" << endl
	<< "  void generateEvent(Int_t code);" << endl
	<< endl ;
  }
       
  hf << "protected:" << endl
     << "" << endl ;

  // Insert list of input arguments
  for (i=0 ; i<alist.size() ; i++) { 
    if (!isCat[i]) {
      hf << "  RooRealProxy " << alist[i] << " ;" << endl ;
    } else {
      hf << "  RooCategoryProxy " << alist[i] << " ;" << endl ;
    }
  }
  
  hf << "  " << endl 
     << "  Double_t evaluate() const ;" << endl
     << "" << endl
     << "private:" << endl
     << "" << endl
     << "  ClassDef(" << className << ",1) // Your description goes here..." << endl
     << "};" << endl
     << " " << endl
     << "#endif" << endl ;


  ofstream cf(impFileName) ;

  cf << " /***************************************************************************** " << endl 
     << "  * Project: RooFit                                                           * " << endl 
     << "  *                                                                           * " << endl 
     << "  * This code was autogenerated by RooClassFactory                            * " << endl 
     << "  *****************************************************************************/ " << endl 
     << endl 
     << " // Your description goes here... " << endl 
     << endl 

     << " #include \"Riostream.h\" " << endl 
     << endl 

     << " #include \"" << className << ".h\" " << endl 
     << " #include \"RooAbsReal.h\" " << endl 
     << " #include \"RooAbsCategory.h\" " << endl 
     << " #include <math.h> " << endl 
     << " #include \"TMath.h\" " << endl
     << endl 

     << " ClassImp(" << className << ") " << endl 
     << endl 

     << " " << className << "::" << className << "(const char *name, const char *title, " << endl ;

  // Insert list of proxy constructors
  for (i=0 ; i<alist.size() ; i++) { 
    if (!isCat[i]) {
      cf << "                        RooAbsReal& _" << alist[i] ;
    } else {
      cf << "                        RooAbsCategory& _" << alist[i] ;
    }
    if (i<alist.size()-1) {
      cf << "," ;
    } else {
      cf << ") :" ;
    }
    cf << endl ;
  }

  // Insert base class constructor
  cf << "   " << baseName << "(name,title), " << endl ;
  
  // Insert list of proxy constructors
  for (i=0 ; i<alist.size() ; i++) { 
    cf << "   " << alist[i] << "(\"" << alist[i] << "\",\"" << alist[i] << "\",this,_" << alist[i] << ")" ;
    if (i<alist.size()-1) {
      cf << "," ;
    }
    cf << endl ;
  }
  
  cf << " { " << endl 
     << " } " << endl 
     << endl 
     << endl 

     << " " << className << "::" << className << "(const " << className << "& other, const char* name) :  " << endl 
     << "   " << baseName << "(other,name), " << endl ;

  for (i=0 ; i<alist.size() ; i++) { 
    cf << "   " << alist[i] << "(\"" << alist[i] << "\",this,other." << alist[i] << ")" ;
    if (i<alist.size()-1) {
      cf << "," ;
    }
    cf << endl ;
  }

  cf << " { " << endl 
     << " } " << endl 
     << endl 
     << endl 
     << endl 

     << " Double_t " << className << "::evaluate() const " << endl 
     << " { " << endl 
     << "   // ENTER EXPRESSION IN TERMS OF VARIABLE ARGUMENTS HERE " << endl 
     << "   return " << expression << " ; " << endl
     << " } " << endl 
     << endl 
     << endl 
     << endl ;

  if (hasAnaInt) {

    vector<string> intObs ;
    vector<string> intExpr ;
    // Parse analytical integration expression if provided
    // Expected form is observable:expression,observable,observable:expression;[...]
    if (intExpression && *intExpression) {
      char* buf = new char[strlen(intExpression)+1] ;
      strcpy(buf,intExpression) ;
      char* ptr = strtok(buf,":") ;
      while(ptr) {
	intObs.push_back(ptr) ;
	intExpr.push_back(strtok(0,";")) ;
	ptr = strtok(0,":") ;
      }
      delete[] buf ;
    }
    
    cf << " Int_t " << className << "::getAnalyticalIntegral(RooArgSet& allVars, RooArgSet& analVars, const char* /*rangeName*/) const  " << endl 
       << " { " << endl 
       << "   // LIST HERE OVER WHICH VARIABLES ANALYTICAL INTEGRATION IS SUPPORTED, " << endl 
       << "   // ASSIGN A NUMERIC CODE FOR EACH SUPPORTED (SET OF) PARAMETERS " << endl 
       << "   // THE EXAMPLE BELOW ASSIGNS CODE 1 TO INTEGRATION OVER VARIABLE X" << endl 
       << "   // YOU CAN ALSO IMPLEMENT MORE THAN ONE ANALYTICAL INTEGRAL BY REPEATING THE matchArgs " << endl
       << "   // EXPRESSION MULTIPLE TIMES" << endl 
       << endl  ;

    if (intObs.size()>0) {
      for (UInt_t ii=0 ; ii<intObs.size() ; ii++) {
	cf << "   if (matchArgs(allVars,analVars," << intObs[ii] << ")) return " << ii+1 << " ; " << endl ;
      }
    } else {
      cf << "   // if (matchArgs(allVars,analVars,x)) return 1 ; " << endl ;
    }

    cf << "   return 0 ; " << endl 
       << " } " << endl 
       << endl 
       << endl 
       << endl 

       << " Double_t " << className << "::analyticalIntegral(Int_t code, const char* rangeName) const  " << endl 
       << " { " << endl 
       << "   // RETURN ANALYTICAL INTEGRAL DEFINED BY RETURN CODE ASSIGNED BY getAnalyticalIntegral" << endl
       << "   // THE MEMBER FUNCTION x.min(rangeName) AND x.max(rangeName) WILL RETURN THE INTEGRATION" << endl
       << "   // BOUNDARIES FOR EACH OBSERVABLE x" << endl 
       << endl ;

    if (intObs.size()>0) {
      for (UInt_t ii=0 ; ii<intObs.size() ; ii++) {
	cf << "   if (code==" << ii+1 << ") { return (" << intExpr[ii] << ") ; } " << endl ;
      }      
    } else {
      cf << "   // assert(code==1) ; " << endl 
	 << "   // return (x.max(rangeName)-x.min(rangeName)) ; " << endl ;
    }

    cf << "   return 0 ; " << endl
       << " } " << endl 
       << endl 
       << endl 
       << endl ;
  }
  
  if (hasIntGen) {
    cf << " Int_t " << className << "::getGenerator(const RooArgSet& directVars, RooArgSet &generateVars, Bool_t /*staticInitOK*/) const " << endl 
       << " { " << endl 
       << "   // LIST HERE OVER WHICH VARIABLES INTERNAL GENERATION IS SUPPORTED, " << endl 
       << "   // ASSIGN A NUMERIC CODE FOR EACH SUPPORTED (SET OF) PARAMETERS " << endl 
       << "   // THE EXAMPLE BELOW ASSIGNS CODE 1 TO INTEGRATION OVER VARIABLE X" << endl 
       << "   // YOU CAN ALSO IMPLEMENT MORE THAN ONE GENERATOR CONFIGURATION BY REPEATING THE matchArgs " << endl
       << "   // EXPRESSION MULTIPLE TIMES. IF THE FLAG staticInitOK IS TRUE THEN IT IS SAFE TO PRECALCULATE " << endl 
       << "   // INTERMEDIATE QUANTITIES IN initGenerator(), IF IT IS NOT SET THEN YOU SHOULD NOT ADVERTISE" << endl
       << "   // ANY GENERATOR METHOD THAT RELIES ON PRECALCULATIONS IN initGenerator()" << endl 
       << endl 
       << "   // if (matchArgs(directVars,generateVars,x)) return 1 ;   " << endl 
       << "   return 0 ; " << endl 
       << " } " << endl 
       << endl 
       << endl 
       << endl 

       << " void " << className << "::generateEvent(Int_t code) " << endl 
       << " { " << endl 
       << "   // GENERATE SET OF OBSERVABLES DEFINED BY RETURN CODE ASSIGNED BY getGenerator()" << endl
       << "   // RETURN THE GENERATED VALUES BY ASSIGNING THEM TO THE PROXY DATA MEMBERS THAT" << endl
       << "   // REPRESENT THE CHOSEN OBSERVABLES" << endl
       << endl 
       << "   // assert(code==1) ; " << endl 
       << "   // x = 0 ; " << endl 
       << "   return; " << endl 
       << " } " << endl 
       << endl 
       << endl 
       << endl ;
  }

  
  return kFALSE ;
}

//_____________________________________________________________________________
std::string RooClassFactory::ClassFacIFace::create(RooFactoryWSTool& ft, const char* typeName, const char* instanceName, std::vector<std::string> args) 
{
  static int classCounter = 0 ;

  string tn(typeName) ;
  if (tn=="CEXPR" || tn=="cexpr") {

    if (args.size()<2) {
      throw string(Form("RooClassFactory::ClassFacIFace::create() ERROR: CEXPR requires at least 2 arguments (expr,var,...), but only %d args found",args.size())) ;      	
    }

    RooAbsArg* ret ;
    // Strip quotation marks from expression string
    char expr[1024] ;
    strncpy(expr,args[0].c_str()+1,args[0].size()-2) ;
    expr[args[0].size()-2]=0 ;

    
    RooArgList varList ;

    try {
      if (args.size()==2) {
	// Interpret 2nd arg as list
	varList.add(ft.asLIST(args[1].c_str())) ;
      } else {
	for (unsigned int i=1 ; i<args.size() ; i++) {
	  varList.add(ft.asARG(args[i].c_str())) ;
	}
      }
    } catch (string err) {
      throw string(Form("RooClassFactory::ClassFacIFace::create() ERROR: %s",err.c_str())) ;      
    }

    string className ;
    while(true) {
      className = Form("RooCFAuto%03d%s",classCounter,(tn=="CEXPR")?"Pdf":"Func") ;
      TClass* tc =  TClass::GetClass(className.c_str(),kTRUE,kTRUE) ;
      classCounter++ ;
      if (!tc) {
	break ;
      }
    }

    if (tn=="CEXPR") {
      ret = makePdfInstance(className.c_str(),instanceName,expr,varList) ;
    } else {
      ret = makeFunctionInstance(className.c_str(),instanceName,expr,varList) ;
    }
    if (!ret) {
      throw string(Form("RooClassFactory::ClassFacIFace::create() ERROR creating %s %s with RooClassFactory",((tn=="CEXPR")?"pdf":"function"),instanceName)) ;      
    }

    // Import object
    ft.ws().import(*ret,RooFit::Silence()) ;

    // Import class code as well
    ft.ws().importClassCode(ret->IsA()) ;


  } else {

    throw string(Form("RooClassFactory::ClassFacIFace::create() ERROR: Unknown meta-type %s requested",typeName)) ;

  }
  return string(instanceName) ;
}

 RooClassFactory.cxx:1
 RooClassFactory.cxx:2
 RooClassFactory.cxx:3
 RooClassFactory.cxx:4
 RooClassFactory.cxx:5
 RooClassFactory.cxx:6
 RooClassFactory.cxx:7
 RooClassFactory.cxx:8
 RooClassFactory.cxx:9
 RooClassFactory.cxx:10
 RooClassFactory.cxx:11
 RooClassFactory.cxx:12
 RooClassFactory.cxx:13
 RooClassFactory.cxx:14
 RooClassFactory.cxx:15
 RooClassFactory.cxx:16
 RooClassFactory.cxx:17
 RooClassFactory.cxx:18
 RooClassFactory.cxx:19
 RooClassFactory.cxx:20
 RooClassFactory.cxx:21
 RooClassFactory.cxx:22
 RooClassFactory.cxx:23
 RooClassFactory.cxx:24
 RooClassFactory.cxx:25
 RooClassFactory.cxx:26
 RooClassFactory.cxx:27
 RooClassFactory.cxx:28
 RooClassFactory.cxx:29
 RooClassFactory.cxx:30
 RooClassFactory.cxx:31
 RooClassFactory.cxx:32
 RooClassFactory.cxx:33
 RooClassFactory.cxx:34
 RooClassFactory.cxx:35
 RooClassFactory.cxx:36
 RooClassFactory.cxx:37
 RooClassFactory.cxx:38
 RooClassFactory.cxx:39
 RooClassFactory.cxx:40
 RooClassFactory.cxx:41
 RooClassFactory.cxx:42
 RooClassFactory.cxx:43
 RooClassFactory.cxx:44
 RooClassFactory.cxx:45
 RooClassFactory.cxx:46
 RooClassFactory.cxx:47
 RooClassFactory.cxx:48
 RooClassFactory.cxx:49
 RooClassFactory.cxx:50
 RooClassFactory.cxx:51
 RooClassFactory.cxx:52
 RooClassFactory.cxx:53
 RooClassFactory.cxx:54
 RooClassFactory.cxx:55
 RooClassFactory.cxx:56
 RooClassFactory.cxx:57
 RooClassFactory.cxx:58
 RooClassFactory.cxx:59
 RooClassFactory.cxx:60
 RooClassFactory.cxx:61
 RooClassFactory.cxx:62
 RooClassFactory.cxx:63
 RooClassFactory.cxx:64
 RooClassFactory.cxx:65
 RooClassFactory.cxx:66
 RooClassFactory.cxx:67
 RooClassFactory.cxx:68
 RooClassFactory.cxx:69
 RooClassFactory.cxx:70
 RooClassFactory.cxx:71
 RooClassFactory.cxx:72
 RooClassFactory.cxx:73
 RooClassFactory.cxx:74
 RooClassFactory.cxx:75
 RooClassFactory.cxx:76
 RooClassFactory.cxx:77
 RooClassFactory.cxx:78
 RooClassFactory.cxx:79
 RooClassFactory.cxx:80
 RooClassFactory.cxx:81
 RooClassFactory.cxx:82
 RooClassFactory.cxx:83
 RooClassFactory.cxx:84
 RooClassFactory.cxx:85
 RooClassFactory.cxx:86
 RooClassFactory.cxx:87
 RooClassFactory.cxx:88
 RooClassFactory.cxx:89
 RooClassFactory.cxx:90
 RooClassFactory.cxx:91
 RooClassFactory.cxx:92
 RooClassFactory.cxx:93
 RooClassFactory.cxx:94
 RooClassFactory.cxx:95
 RooClassFactory.cxx:96
 RooClassFactory.cxx:97
 RooClassFactory.cxx:98
 RooClassFactory.cxx:99
 RooClassFactory.cxx:100
 RooClassFactory.cxx:101
 RooClassFactory.cxx:102
 RooClassFactory.cxx:103
 RooClassFactory.cxx:104
 RooClassFactory.cxx:105
 RooClassFactory.cxx:106
 RooClassFactory.cxx:107
 RooClassFactory.cxx:108
 RooClassFactory.cxx:109
 RooClassFactory.cxx:110
 RooClassFactory.cxx:111
 RooClassFactory.cxx:112
 RooClassFactory.cxx:113
 RooClassFactory.cxx:114
 RooClassFactory.cxx:115
 RooClassFactory.cxx:116
 RooClassFactory.cxx:117
 RooClassFactory.cxx:118
 RooClassFactory.cxx:119
 RooClassFactory.cxx:120
 RooClassFactory.cxx:121
 RooClassFactory.cxx:122
 RooClassFactory.cxx:123
 RooClassFactory.cxx:124
 RooClassFactory.cxx:125
 RooClassFactory.cxx:126
 RooClassFactory.cxx:127
 RooClassFactory.cxx:128
 RooClassFactory.cxx:129
 RooClassFactory.cxx:130
 RooClassFactory.cxx:131
 RooClassFactory.cxx:132
 RooClassFactory.cxx:133
 RooClassFactory.cxx:134
 RooClassFactory.cxx:135
 RooClassFactory.cxx:136
 RooClassFactory.cxx:137
 RooClassFactory.cxx:138
 RooClassFactory.cxx:139
 RooClassFactory.cxx:140
 RooClassFactory.cxx:141
 RooClassFactory.cxx:142
 RooClassFactory.cxx:143
 RooClassFactory.cxx:144
 RooClassFactory.cxx:145
 RooClassFactory.cxx:146
 RooClassFactory.cxx:147
 RooClassFactory.cxx:148
 RooClassFactory.cxx:149
 RooClassFactory.cxx:150
 RooClassFactory.cxx:151
 RooClassFactory.cxx:152
 RooClassFactory.cxx:153
 RooClassFactory.cxx:154
 RooClassFactory.cxx:155
 RooClassFactory.cxx:156
 RooClassFactory.cxx:157
 RooClassFactory.cxx:158
 RooClassFactory.cxx:159
 RooClassFactory.cxx:160
 RooClassFactory.cxx:161
 RooClassFactory.cxx:162
 RooClassFactory.cxx:163
 RooClassFactory.cxx:164
 RooClassFactory.cxx:165
 RooClassFactory.cxx:166
 RooClassFactory.cxx:167
 RooClassFactory.cxx:168
 RooClassFactory.cxx:169
 RooClassFactory.cxx:170
 RooClassFactory.cxx:171
 RooClassFactory.cxx:172
 RooClassFactory.cxx:173
 RooClassFactory.cxx:174
 RooClassFactory.cxx:175
 RooClassFactory.cxx:176
 RooClassFactory.cxx:177
 RooClassFactory.cxx:178
 RooClassFactory.cxx:179
 RooClassFactory.cxx:180
 RooClassFactory.cxx:181
 RooClassFactory.cxx:182
 RooClassFactory.cxx:183
 RooClassFactory.cxx:184
 RooClassFactory.cxx:185
 RooClassFactory.cxx:186
 RooClassFactory.cxx:187
 RooClassFactory.cxx:188
 RooClassFactory.cxx:189
 RooClassFactory.cxx:190
 RooClassFactory.cxx:191
 RooClassFactory.cxx:192
 RooClassFactory.cxx:193
 RooClassFactory.cxx:194
 RooClassFactory.cxx:195
 RooClassFactory.cxx:196
 RooClassFactory.cxx:197
 RooClassFactory.cxx:198
 RooClassFactory.cxx:199
 RooClassFactory.cxx:200
 RooClassFactory.cxx:201
 RooClassFactory.cxx:202
 RooClassFactory.cxx:203
 RooClassFactory.cxx:204
 RooClassFactory.cxx:205
 RooClassFactory.cxx:206
 RooClassFactory.cxx:207
 RooClassFactory.cxx:208
 RooClassFactory.cxx:209
 RooClassFactory.cxx:210
 RooClassFactory.cxx:211
 RooClassFactory.cxx:212
 RooClassFactory.cxx:213
 RooClassFactory.cxx:214
 RooClassFactory.cxx:215
 RooClassFactory.cxx:216
 RooClassFactory.cxx:217
 RooClassFactory.cxx:218
 RooClassFactory.cxx:219
 RooClassFactory.cxx:220
 RooClassFactory.cxx:221
 RooClassFactory.cxx:222
 RooClassFactory.cxx:223
 RooClassFactory.cxx:224
 RooClassFactory.cxx:225
 RooClassFactory.cxx:226
 RooClassFactory.cxx:227
 RooClassFactory.cxx:228
 RooClassFactory.cxx:229
 RooClassFactory.cxx:230
 RooClassFactory.cxx:231
 RooClassFactory.cxx:232
 RooClassFactory.cxx:233
 RooClassFactory.cxx:234
 RooClassFactory.cxx:235
 RooClassFactory.cxx:236
 RooClassFactory.cxx:237
 RooClassFactory.cxx:238
 RooClassFactory.cxx:239
 RooClassFactory.cxx:240
 RooClassFactory.cxx:241
 RooClassFactory.cxx:242
 RooClassFactory.cxx:243
 RooClassFactory.cxx:244
 RooClassFactory.cxx:245
 RooClassFactory.cxx:246
 RooClassFactory.cxx:247
 RooClassFactory.cxx:248
 RooClassFactory.cxx:249
 RooClassFactory.cxx:250
 RooClassFactory.cxx:251
 RooClassFactory.cxx:252
 RooClassFactory.cxx:253
 RooClassFactory.cxx:254
 RooClassFactory.cxx:255
 RooClassFactory.cxx:256
 RooClassFactory.cxx:257
 RooClassFactory.cxx:258
 RooClassFactory.cxx:259
 RooClassFactory.cxx:260
 RooClassFactory.cxx:261
 RooClassFactory.cxx:262
 RooClassFactory.cxx:263
 RooClassFactory.cxx:264
 RooClassFactory.cxx:265
 RooClassFactory.cxx:266
 RooClassFactory.cxx:267
 RooClassFactory.cxx:268
 RooClassFactory.cxx:269
 RooClassFactory.cxx:270
 RooClassFactory.cxx:271
 RooClassFactory.cxx:272
 RooClassFactory.cxx:273
 RooClassFactory.cxx:274
 RooClassFactory.cxx:275
 RooClassFactory.cxx:276
 RooClassFactory.cxx:277
 RooClassFactory.cxx:278
 RooClassFactory.cxx:279
 RooClassFactory.cxx:280
 RooClassFactory.cxx:281
 RooClassFactory.cxx:282
 RooClassFactory.cxx:283
 RooClassFactory.cxx:284
 RooClassFactory.cxx:285
 RooClassFactory.cxx:286
 RooClassFactory.cxx:287
 RooClassFactory.cxx:288
 RooClassFactory.cxx:289
 RooClassFactory.cxx:290
 RooClassFactory.cxx:291
 RooClassFactory.cxx:292
 RooClassFactory.cxx:293
 RooClassFactory.cxx:294
 RooClassFactory.cxx:295
 RooClassFactory.cxx:296
 RooClassFactory.cxx:297
 RooClassFactory.cxx:298
 RooClassFactory.cxx:299
 RooClassFactory.cxx:300
 RooClassFactory.cxx:301
 RooClassFactory.cxx:302
 RooClassFactory.cxx:303
 RooClassFactory.cxx:304
 RooClassFactory.cxx:305
 RooClassFactory.cxx:306
 RooClassFactory.cxx:307
 RooClassFactory.cxx:308
 RooClassFactory.cxx:309
 RooClassFactory.cxx:310
 RooClassFactory.cxx:311
 RooClassFactory.cxx:312
 RooClassFactory.cxx:313
 RooClassFactory.cxx:314
 RooClassFactory.cxx:315
 RooClassFactory.cxx:316
 RooClassFactory.cxx:317
 RooClassFactory.cxx:318
 RooClassFactory.cxx:319
 RooClassFactory.cxx:320
 RooClassFactory.cxx:321
 RooClassFactory.cxx:322
 RooClassFactory.cxx:323
 RooClassFactory.cxx:324
 RooClassFactory.cxx:325
 RooClassFactory.cxx:326
 RooClassFactory.cxx:327
 RooClassFactory.cxx:328
 RooClassFactory.cxx:329
 RooClassFactory.cxx:330
 RooClassFactory.cxx:331
 RooClassFactory.cxx:332
 RooClassFactory.cxx:333
 RooClassFactory.cxx:334
 RooClassFactory.cxx:335
 RooClassFactory.cxx:336
 RooClassFactory.cxx:337
 RooClassFactory.cxx:338
 RooClassFactory.cxx:339
 RooClassFactory.cxx:340
 RooClassFactory.cxx:341
 RooClassFactory.cxx:342
 RooClassFactory.cxx:343
 RooClassFactory.cxx:344
 RooClassFactory.cxx:345
 RooClassFactory.cxx:346
 RooClassFactory.cxx:347
 RooClassFactory.cxx:348
 RooClassFactory.cxx:349
 RooClassFactory.cxx:350
 RooClassFactory.cxx:351
 RooClassFactory.cxx:352
 RooClassFactory.cxx:353
 RooClassFactory.cxx:354
 RooClassFactory.cxx:355
 RooClassFactory.cxx:356
 RooClassFactory.cxx:357
 RooClassFactory.cxx:358
 RooClassFactory.cxx:359
 RooClassFactory.cxx:360
 RooClassFactory.cxx:361
 RooClassFactory.cxx:362
 RooClassFactory.cxx:363
 RooClassFactory.cxx:364
 RooClassFactory.cxx:365
 RooClassFactory.cxx:366
 RooClassFactory.cxx:367
 RooClassFactory.cxx:368
 RooClassFactory.cxx:369
 RooClassFactory.cxx:370
 RooClassFactory.cxx:371
 RooClassFactory.cxx:372
 RooClassFactory.cxx:373
 RooClassFactory.cxx:374
 RooClassFactory.cxx:375
 RooClassFactory.cxx:376
 RooClassFactory.cxx:377
 RooClassFactory.cxx:378
 RooClassFactory.cxx:379
 RooClassFactory.cxx:380
 RooClassFactory.cxx:381
 RooClassFactory.cxx:382
 RooClassFactory.cxx:383
 RooClassFactory.cxx:384
 RooClassFactory.cxx:385
 RooClassFactory.cxx:386
 RooClassFactory.cxx:387
 RooClassFactory.cxx:388
 RooClassFactory.cxx:389
 RooClassFactory.cxx:390
 RooClassFactory.cxx:391
 RooClassFactory.cxx:392
 RooClassFactory.cxx:393
 RooClassFactory.cxx:394
 RooClassFactory.cxx:395
 RooClassFactory.cxx:396
 RooClassFactory.cxx:397
 RooClassFactory.cxx:398
 RooClassFactory.cxx:399
 RooClassFactory.cxx:400
 RooClassFactory.cxx:401
 RooClassFactory.cxx:402
 RooClassFactory.cxx:403
 RooClassFactory.cxx:404
 RooClassFactory.cxx:405
 RooClassFactory.cxx:406
 RooClassFactory.cxx:407
 RooClassFactory.cxx:408
 RooClassFactory.cxx:409
 RooClassFactory.cxx:410
 RooClassFactory.cxx:411
 RooClassFactory.cxx:412
 RooClassFactory.cxx:413
 RooClassFactory.cxx:414
 RooClassFactory.cxx:415
 RooClassFactory.cxx:416
 RooClassFactory.cxx:417
 RooClassFactory.cxx:418
 RooClassFactory.cxx:419
 RooClassFactory.cxx:420
 RooClassFactory.cxx:421
 RooClassFactory.cxx:422
 RooClassFactory.cxx:423
 RooClassFactory.cxx:424
 RooClassFactory.cxx:425
 RooClassFactory.cxx:426
 RooClassFactory.cxx:427
 RooClassFactory.cxx:428
 RooClassFactory.cxx:429
 RooClassFactory.cxx:430
 RooClassFactory.cxx:431
 RooClassFactory.cxx:432
 RooClassFactory.cxx:433
 RooClassFactory.cxx:434
 RooClassFactory.cxx:435
 RooClassFactory.cxx:436
 RooClassFactory.cxx:437
 RooClassFactory.cxx:438
 RooClassFactory.cxx:439
 RooClassFactory.cxx:440
 RooClassFactory.cxx:441
 RooClassFactory.cxx:442
 RooClassFactory.cxx:443
 RooClassFactory.cxx:444
 RooClassFactory.cxx:445
 RooClassFactory.cxx:446
 RooClassFactory.cxx:447
 RooClassFactory.cxx:448
 RooClassFactory.cxx:449
 RooClassFactory.cxx:450
 RooClassFactory.cxx:451
 RooClassFactory.cxx:452
 RooClassFactory.cxx:453
 RooClassFactory.cxx:454
 RooClassFactory.cxx:455
 RooClassFactory.cxx:456
 RooClassFactory.cxx:457
 RooClassFactory.cxx:458
 RooClassFactory.cxx:459
 RooClassFactory.cxx:460
 RooClassFactory.cxx:461
 RooClassFactory.cxx:462
 RooClassFactory.cxx:463
 RooClassFactory.cxx:464
 RooClassFactory.cxx:465
 RooClassFactory.cxx:466
 RooClassFactory.cxx:467
 RooClassFactory.cxx:468
 RooClassFactory.cxx:469
 RooClassFactory.cxx:470
 RooClassFactory.cxx:471
 RooClassFactory.cxx:472
 RooClassFactory.cxx:473
 RooClassFactory.cxx:474
 RooClassFactory.cxx:475
 RooClassFactory.cxx:476
 RooClassFactory.cxx:477
 RooClassFactory.cxx:478
 RooClassFactory.cxx:479
 RooClassFactory.cxx:480
 RooClassFactory.cxx:481
 RooClassFactory.cxx:482
 RooClassFactory.cxx:483
 RooClassFactory.cxx:484
 RooClassFactory.cxx:485
 RooClassFactory.cxx:486
 RooClassFactory.cxx:487
 RooClassFactory.cxx:488
 RooClassFactory.cxx:489
 RooClassFactory.cxx:490
 RooClassFactory.cxx:491
 RooClassFactory.cxx:492
 RooClassFactory.cxx:493
 RooClassFactory.cxx:494
 RooClassFactory.cxx:495
 RooClassFactory.cxx:496
 RooClassFactory.cxx:497
 RooClassFactory.cxx:498
 RooClassFactory.cxx:499
 RooClassFactory.cxx:500
 RooClassFactory.cxx:501
 RooClassFactory.cxx:502
 RooClassFactory.cxx:503
 RooClassFactory.cxx:504
 RooClassFactory.cxx:505
 RooClassFactory.cxx:506
 RooClassFactory.cxx:507
 RooClassFactory.cxx:508
 RooClassFactory.cxx:509
 RooClassFactory.cxx:510
 RooClassFactory.cxx:511
 RooClassFactory.cxx:512
 RooClassFactory.cxx:513
 RooClassFactory.cxx:514
 RooClassFactory.cxx:515
 RooClassFactory.cxx:516
 RooClassFactory.cxx:517
 RooClassFactory.cxx:518
 RooClassFactory.cxx:519
 RooClassFactory.cxx:520
 RooClassFactory.cxx:521
 RooClassFactory.cxx:522
 RooClassFactory.cxx:523
 RooClassFactory.cxx:524
 RooClassFactory.cxx:525
 RooClassFactory.cxx:526
 RooClassFactory.cxx:527
 RooClassFactory.cxx:528
 RooClassFactory.cxx:529
 RooClassFactory.cxx:530
 RooClassFactory.cxx:531
 RooClassFactory.cxx:532
 RooClassFactory.cxx:533
 RooClassFactory.cxx:534
 RooClassFactory.cxx:535
 RooClassFactory.cxx:536
 RooClassFactory.cxx:537
 RooClassFactory.cxx:538
 RooClassFactory.cxx:539
 RooClassFactory.cxx:540
 RooClassFactory.cxx:541
 RooClassFactory.cxx:542
 RooClassFactory.cxx:543
 RooClassFactory.cxx:544
 RooClassFactory.cxx:545
 RooClassFactory.cxx:546
 RooClassFactory.cxx:547
 RooClassFactory.cxx:548
 RooClassFactory.cxx:549
 RooClassFactory.cxx:550
 RooClassFactory.cxx:551
 RooClassFactory.cxx:552
 RooClassFactory.cxx:553
 RooClassFactory.cxx:554
 RooClassFactory.cxx:555
 RooClassFactory.cxx:556
 RooClassFactory.cxx:557
 RooClassFactory.cxx:558
 RooClassFactory.cxx:559
 RooClassFactory.cxx:560
 RooClassFactory.cxx:561
 RooClassFactory.cxx:562
 RooClassFactory.cxx:563
 RooClassFactory.cxx:564
 RooClassFactory.cxx:565
 RooClassFactory.cxx:566
 RooClassFactory.cxx:567
 RooClassFactory.cxx:568
 RooClassFactory.cxx:569
 RooClassFactory.cxx:570
 RooClassFactory.cxx:571
 RooClassFactory.cxx:572
 RooClassFactory.cxx:573
 RooClassFactory.cxx:574
 RooClassFactory.cxx:575
 RooClassFactory.cxx:576
 RooClassFactory.cxx:577
 RooClassFactory.cxx:578
 RooClassFactory.cxx:579
 RooClassFactory.cxx:580
 RooClassFactory.cxx:581
 RooClassFactory.cxx:582
 RooClassFactory.cxx:583
 RooClassFactory.cxx:584
 RooClassFactory.cxx:585
 RooClassFactory.cxx:586
 RooClassFactory.cxx:587
 RooClassFactory.cxx:588
 RooClassFactory.cxx:589
 RooClassFactory.cxx:590
 RooClassFactory.cxx:591
 RooClassFactory.cxx:592
 RooClassFactory.cxx:593
 RooClassFactory.cxx:594
 RooClassFactory.cxx:595
 RooClassFactory.cxx:596
 RooClassFactory.cxx:597
 RooClassFactory.cxx:598
 RooClassFactory.cxx:599
 RooClassFactory.cxx:600
 RooClassFactory.cxx:601
 RooClassFactory.cxx:602
 RooClassFactory.cxx:603
 RooClassFactory.cxx:604
 RooClassFactory.cxx:605
 RooClassFactory.cxx:606
 RooClassFactory.cxx:607
 RooClassFactory.cxx:608
 RooClassFactory.cxx:609
 RooClassFactory.cxx:610
 RooClassFactory.cxx:611
 RooClassFactory.cxx:612
 RooClassFactory.cxx:613
 RooClassFactory.cxx:614
 RooClassFactory.cxx:615
 RooClassFactory.cxx:616
 RooClassFactory.cxx:617
 RooClassFactory.cxx:618
 RooClassFactory.cxx:619
 RooClassFactory.cxx:620
 RooClassFactory.cxx:621
 RooClassFactory.cxx:622
 RooClassFactory.cxx:623
 RooClassFactory.cxx:624
 RooClassFactory.cxx:625
 RooClassFactory.cxx:626
 RooClassFactory.cxx:627
 RooClassFactory.cxx:628
 RooClassFactory.cxx:629
 RooClassFactory.cxx:630
 RooClassFactory.cxx:631
 RooClassFactory.cxx:632
 RooClassFactory.cxx:633
 RooClassFactory.cxx:634
 RooClassFactory.cxx:635
 RooClassFactory.cxx:636
 RooClassFactory.cxx:637
 RooClassFactory.cxx:638
 RooClassFactory.cxx:639
 RooClassFactory.cxx:640
 RooClassFactory.cxx:641
 RooClassFactory.cxx:642
 RooClassFactory.cxx:643
 RooClassFactory.cxx:644
 RooClassFactory.cxx:645
 RooClassFactory.cxx:646
 RooClassFactory.cxx:647
 RooClassFactory.cxx:648
 RooClassFactory.cxx:649
 RooClassFactory.cxx:650
 RooClassFactory.cxx:651
 RooClassFactory.cxx:652
 RooClassFactory.cxx:653
 RooClassFactory.cxx:654
 RooClassFactory.cxx:655
 RooClassFactory.cxx:656
 RooClassFactory.cxx:657
 RooClassFactory.cxx:658
 RooClassFactory.cxx:659
 RooClassFactory.cxx:660
 RooClassFactory.cxx:661
 RooClassFactory.cxx:662
 RooClassFactory.cxx:663
 RooClassFactory.cxx:664
 RooClassFactory.cxx:665
 RooClassFactory.cxx:666
 RooClassFactory.cxx:667
 RooClassFactory.cxx:668
 RooClassFactory.cxx:669
 RooClassFactory.cxx:670
 RooClassFactory.cxx:671
 RooClassFactory.cxx:672
 RooClassFactory.cxx:673
 RooClassFactory.cxx:674
 RooClassFactory.cxx:675
 RooClassFactory.cxx:676
 RooClassFactory.cxx:677
 RooClassFactory.cxx:678
 RooClassFactory.cxx:679
 RooClassFactory.cxx:680
 RooClassFactory.cxx:681
 RooClassFactory.cxx:682
 RooClassFactory.cxx:683
 RooClassFactory.cxx:684
 RooClassFactory.cxx:685
 RooClassFactory.cxx:686
 RooClassFactory.cxx:687
 RooClassFactory.cxx:688
 RooClassFactory.cxx:689
 RooClassFactory.cxx:690
 RooClassFactory.cxx:691
 RooClassFactory.cxx:692
 RooClassFactory.cxx:693
 RooClassFactory.cxx:694
 RooClassFactory.cxx:695
 RooClassFactory.cxx:696
 RooClassFactory.cxx:697
 RooClassFactory.cxx:698
 RooClassFactory.cxx:699
 RooClassFactory.cxx:700
 RooClassFactory.cxx:701
 RooClassFactory.cxx:702
 RooClassFactory.cxx:703
 RooClassFactory.cxx:704
 RooClassFactory.cxx:705
 RooClassFactory.cxx:706
 RooClassFactory.cxx:707
 RooClassFactory.cxx:708
 RooClassFactory.cxx:709
 RooClassFactory.cxx:710
 RooClassFactory.cxx:711
 RooClassFactory.cxx:712
 RooClassFactory.cxx:713
 RooClassFactory.cxx:714
 RooClassFactory.cxx:715
 RooClassFactory.cxx:716
 RooClassFactory.cxx:717
 RooClassFactory.cxx:718
 RooClassFactory.cxx:719
 RooClassFactory.cxx:720
 RooClassFactory.cxx:721
 RooClassFactory.cxx:722
 RooClassFactory.cxx:723
 RooClassFactory.cxx:724
 RooClassFactory.cxx:725
 RooClassFactory.cxx:726
 RooClassFactory.cxx:727
 RooClassFactory.cxx:728
 RooClassFactory.cxx:729
 RooClassFactory.cxx:730
 RooClassFactory.cxx:731
 RooClassFactory.cxx:732
 RooClassFactory.cxx:733
 RooClassFactory.cxx:734
 RooClassFactory.cxx:735
 RooClassFactory.cxx:736
 RooClassFactory.cxx:737
 RooClassFactory.cxx:738
 RooClassFactory.cxx:739
 RooClassFactory.cxx:740
 RooClassFactory.cxx:741
 RooClassFactory.cxx:742
 RooClassFactory.cxx:743
 RooClassFactory.cxx:744
 RooClassFactory.cxx:745
 RooClassFactory.cxx:746
 RooClassFactory.cxx:747
 RooClassFactory.cxx:748
 RooClassFactory.cxx:749
 RooClassFactory.cxx:750
 RooClassFactory.cxx:751
 RooClassFactory.cxx:752
 RooClassFactory.cxx:753
 RooClassFactory.cxx:754
 RooClassFactory.cxx:755
 RooClassFactory.cxx:756
 RooClassFactory.cxx:757
 RooClassFactory.cxx:758
 RooClassFactory.cxx:759
 RooClassFactory.cxx:760
 RooClassFactory.cxx:761
 RooClassFactory.cxx:762
 RooClassFactory.cxx:763
 RooClassFactory.cxx:764
 RooClassFactory.cxx:765
 RooClassFactory.cxx:766
 RooClassFactory.cxx:767
 RooClassFactory.cxx:768
 RooClassFactory.cxx:769
 RooClassFactory.cxx:770
 RooClassFactory.cxx:771
 RooClassFactory.cxx:772
 RooClassFactory.cxx:773
 RooClassFactory.cxx:774
 RooClassFactory.cxx:775
 RooClassFactory.cxx:776
 RooClassFactory.cxx:777
 RooClassFactory.cxx:778
 RooClassFactory.cxx:779
 RooClassFactory.cxx:780
 RooClassFactory.cxx:781
 RooClassFactory.cxx:782
 RooClassFactory.cxx:783
 RooClassFactory.cxx:784
 RooClassFactory.cxx:785
 RooClassFactory.cxx:786
 RooClassFactory.cxx:787
 RooClassFactory.cxx:788
 RooClassFactory.cxx:789
 RooClassFactory.cxx:790
 RooClassFactory.cxx:791
 RooClassFactory.cxx:792
 RooClassFactory.cxx:793
 RooClassFactory.cxx:794
 RooClassFactory.cxx:795
 RooClassFactory.cxx:796
 RooClassFactory.cxx:797
 RooClassFactory.cxx:798
 RooClassFactory.cxx:799
 RooClassFactory.cxx:800
 RooClassFactory.cxx:801
 RooClassFactory.cxx:802
 RooClassFactory.cxx:803
 RooClassFactory.cxx:804
 RooClassFactory.cxx:805
 RooClassFactory.cxx:806
 RooClassFactory.cxx:807
 RooClassFactory.cxx:808
 RooClassFactory.cxx:809
 RooClassFactory.cxx:810
 RooClassFactory.cxx:811