/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id$
 * 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)             *
 *****************************************************************************/

//////////////////////////////////////////////////////////////////////////////
//
// Class RooSimWSTool is a tool operating on RooWorkspace objects that
// can clone p.d.f.s into a series of variations that are joined together
// into a RooSimultanous p.d.f.
//
// The simplest use case to take a workspace p.d.f as prototype and
// 'split' a parameter of that p.d.f into two specialized parameters
// depending on a category in the dataset. 
// 
// For example, given a Gaussian
// p.d.f G(x,m,s) we want to construct a G_a(x,m_a,s) and a G_b(x,m_b,s)
// with different mean parameters to be fit to a dataset with observables
// (x,c) where c is a category with states 'a' and 'b'
//
// Using RooSimWSTool one can create a simultaneous p.d.f from G_a and G_b
// from G with the following command
//
//   RooSimWSTool wst(wspace) ;
//   wst.build("G_sim","G",SplitParam("m","c")) ;
//
// From this simple example one can go to builds of arbitrary complexity
// by specifying multiple SplitParam arguments on multiple parameters
// involving multiple splitting categories. Splits can also be performed
// in the product multiple categories, e.g. 
//
//      SplitParam("m","c,d")) ;
//
// splits parameter m in the product of states of c and d. Another possibility
// is the 'constrained' split which clones the parameter for all but one state
// and insert a formula specialization in a chosen state that evaluates
// to 1 - sum_i(a_i) where a_i are all other specializations. For example,
// given a category c with state "A","B","C","D" the specification
//
//     SplitParamConstrained("m","c","D")
//
// will result in parameters m_A,m_B,m_C and a formula expression m_D
// that evaluates to (1-(m_A+m_B+m_C)). Constrained split can also be
// specified in product of categories. In that case the name of the
// remainder state follows the syntax "{State1;State2}" where State1 and
// State2 are the state names of the two spitting categories.
//
// The examples so far deal with a single prototype p.d.f. It is also
// possible to build with multiple prototype p.d.fs by specifying a 
// mapping between the prototype to use and the names of states of
// a 'master' splitting category. To specify these configurations
// an intermediate MultiBuildConfig must be composed with all
// the necessary specifications. For example, this code
// 
//  RooSimWSTool::MultiBuildConfig mbc("mc") ;
//  mbc.addPdf("I","G",SplitParam("m,s","c")) ;
//  mbc.addPdf("II,III","F",SplitParam("a","c,d")) ;
//
// configures a build with two prototype p.d.f.s G and F.
// Prototype G is used for state "I" of master split category
// mc and prototype F is used for states "II" and "III" of
// master split category mc. Furthermore parameters m,s of prototype G are split
// in category c while parameter a of prototype F is split in
// the product of categories c and d. The actual build is then
// performed by passing the build configuration to RooSimWSTool, e.g.
//
//  wst.build("MASTER",mbc) ;
//
// By default, a specialization is built for each permutation of
// states of the spitting categories that are used. It is possible
// to restrict the building of specialized p.d.f to a subset of states
// by adding a restriction on the number of states to build as follows
//
//  mbc.restrictBuild("c","A,B") ;  
//
// The restrictBuild method can be called multiple times, but at most
// once for each used splitting category. For simple builds with a single
// prototype, restriction can be specified with a Restrict() argument
// on the build command line
//


#include "RooFit.h"
#include "RooSimWSTool.h"
#include "RooMsgService.h"
#include "RooCategory.h"
#include "RooRealVar.h"
#include "RooAbsPdf.h"
#include "RooStringVar.h"
#include "RooSuperCategory.h"
#include "RooCatType.h"
#include "RooCustomizer.h"
#include "RooMultiCategory.h"
#include "RooSimultaneous.h"
#include "RooGlobalFunc.h"
#include "RooFracRemainder.h"
#include "RooFactoryWSTool.h"

ClassImp(RooSimWSTool) 
ClassImp(RooSimWSTool::BuildConfig) 
ClassImp(RooSimWSTool::MultiBuildConfig) 
ClassImp(RooSimWSTool::SplitRule) 
ClassImp(RooSimWSTool::ObjBuildConfig) 
ClassImp(RooSimWSTool::ObjSplitRule) 
;

using namespace std ;


static Int_t init();

static Int_t dummy = init() ;

static Int_t init()
{
  RooFactoryWSTool::IFace* iface = new RooSimWSTool::SimWSIFace ;
  RooFactoryWSTool::registerSpecial("SIMCLONE",iface) ;
  RooFactoryWSTool::registerSpecial("MSIMCLONE",iface) ;
  (void) dummy;
  return 0 ;
}


//_____________________________________________________________________________
RooSimWSTool::RooSimWSTool(RooWorkspace& ws) : _ws(&ws) 
{
  // Constructor of SimWSTool on given workspace. All input is taken from the workspace
  // All output is stored in the workspace
}



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



//_____________________________________________________________________________
RooSimultaneous* RooSimWSTool::build(const char* simPdfName, const char* protoPdfName, const RooCmdArg& arg1,const RooCmdArg& arg2,
					const RooCmdArg& arg3,const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
{
  // Build a RooSimultaneous p.d.f with name simPdfName from cloning specializations of protytpe p.d.f protoPdfName.
  // The following named arguments are supported
  //
  // SplitParam(varname, catname)                   -- Split parameter(s) with given name(s) in category(s) with given names
  // SplitParam(var, cat)                           -- Split given parameter(s) in givem category(s) 
  // SplitParamConstrained(vname, cname, remainder) -- Make constrained split in parameter(s) with given name(s) in category(s) with given names
  //                                                   putting remainder fraction formula in state with name "remainder"
  // SplitParamConstrained(var,cat,remainder)       -- Make constrained split in parameter(s) with given name(s) in category(s) with given names
  //                                                   putting remainder fraction formula in state with name "remainder"
  // Restrict(catName,stateNameList)                -- Restrict build by only considered listed state names of category with given name

  BuildConfig bc(protoPdfName,arg1,arg2,arg3,arg4,arg5,arg6) ;
  return build(simPdfName,bc) ;
}



//_____________________________________________________________________________
RooSimultaneous* RooSimWSTool::build(const char* simPdfName,BuildConfig& bc, Bool_t verbose) 
{
  // Build a RooSimultaneous p.d.f with name simPdfName from cloning specializations of protytpe p.d.f protoPdfName.
  // Use the provided BuildConfig or MultiBuildConfig object to configure the build

  ObjBuildConfig* obc = validateConfig(bc) ;
  if (!obc) return 0 ;
  
  if (verbose) {
    obc->print() ;
  }
  
  RooSimultaneous* ret =  executeBuild(simPdfName,*obc,verbose) ;

  delete obc ;
  return ret ;
}



//_____________________________________________________________________________
RooSimWSTool::ObjBuildConfig* RooSimWSTool::validateConfig(BuildConfig& bc)
{
  // Validate build configuration. If not syntax errors or missing objects are found,
  // return an ObjBuildConfig in which all names are replaced with object pointers.

  // Create empty object version of build config
  ObjBuildConfig* obc = new ObjBuildConfig ;

  if (bc._masterCatName.length()>0) {
    obc->_masterCat = _ws->cat(bc._masterCatName.c_str()) ;
    if (!obc->_masterCat) {
      coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: associated workspace " << _ws->GetName() 
			    << " does not contain a category named " << bc._masterCatName 
			    << " that was designated as master index category in the build configuration" << endl ;
      delete obc ;
      return 0 ;
    }
  } else {
    obc->_masterCat = 0 ;
  }
  
  map<string,SplitRule>::iterator pdfiter ;
  // Check that we have the p.d.f.s
  for (pdfiter = bc._pdfmap.begin() ; pdfiter != bc._pdfmap.end() ; ++pdfiter) {    

    // Check that p.d.f exists
    RooAbsPdf* pdf = _ws->pdf(pdfiter->second.GetName()) ;
    if (!pdf) {
      coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: associated workspace " << _ws->GetName() 
			    << " does not contain a pdf named " << pdfiter->second.GetName() << endl ;
      delete obc ;
      return 0 ;
    }      

    // Create empty object version of split rule set
    ObjSplitRule osr ;

    // Convert names of parameters and splitting categories to objects in workspace, fill object split rule
    SplitRule& sr = pdfiter->second ;

    map<string, pair<list<string>,string> >::iterator pariter ;
    for (pariter=sr._paramSplitMap.begin() ; pariter!=sr._paramSplitMap.end() ; ++pariter) {
      
      // Check that variable with given name exists in workspace
      RooAbsArg* farg = _ws->fundArg(pariter->first.c_str()) ;
      if (!farg) {
	coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: associated workspace " << _ws->GetName() 
			      << " does not contain a variable named " << pariter->first.c_str() 
			      << " as specified in splitting rule of parameter " << pariter->first << " of p.d.f " << pdf << endl ;
	delete obc ;
	return 0 ;
      } 
      
      // Check that given variable is indeed related to given p.d.f
      if (!pdf->dependsOn(*farg)) {
	coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: specified parameter " << pariter->first 
			      << " in split is not function of p.d.f " << pdf->GetName() << endl ;
	delete obc ;
	return 0 ;
      }
      
      
      RooArgSet splitCatSet ;
      list<string>::iterator catiter ;
      for (catiter = pariter->second.first.begin() ; catiter!=pariter->second.first.end() ; ++catiter) {
	RooAbsCategory* cat = _ws->catfunc(catiter->c_str()) ;
	if (!cat) {
	  coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: associated workspace " << _ws->GetName() 
				<< " does not contain a category named " << catiter->c_str() 
				<< " as specified in splitting rule of parameter " << pariter->first << " of p.d.f " << pdf << endl ;
	  delete obc ;
	  return 0 ;
	}
	splitCatSet.add(*cat) ;
      }      

      // Check if composite splitCatSet does not contain category functions that depend on other categories used in the same split
      TIterator* iter = splitCatSet.createIterator() ;
      RooAbsArg* arg ;
      while((arg=(RooAbsArg*)iter->Next())) {
	RooArgSet tmp(splitCatSet) ;
	tmp.remove(*arg) ;
	if (arg->dependsOnValue(tmp)) {
	  coutE(InputArguments) << "RooSimWSTool::build(" << GetName() << ") ERROR: Ill defined split: splitting category function " << arg->GetName() 
				<< " used in composite split " << splitCatSet << " of parameter " << farg->GetName() << " of pdf " << pdf->GetName() 
				<< " depends on one or more of the other splitting categories in the composite split" << endl ;
	  delete obc ;
	  delete iter ;
	  return 0 ;
	}
      }
      delete iter ;

      // If a constrained split is specified, check that split parameter is a real-valued type
      if (pariter->second.second.size()>0) {
	if (!dynamic_cast<RooAbsReal*>(farg)) {
	  coutE(InputArguments) << "RooSimWSTool::build(" << GetName() << ") ERROR: Constrained split specified in non real-valued parameter " << farg->GetName() << endl ;
	  delete obc ;
	  return 0 ;
	}
      }

      // Fill object build config with object split rule
      osr._paramSplitMap[farg].first.add(splitCatSet) ;
      osr._paramSplitMap[farg].second = pariter->second.second ;

      // For multi-pdf configurations, check that the master index state name associated with this p.d.f exists as a state in the master category
      if (obc->_masterCat) {
	list<string>::iterator misi ;
	for (misi=sr._miStateNameList.begin() ; misi!=sr._miStateNameList.end() ; ++misi) {
	  const RooCatType* ctype = obc->_masterCat->lookupType(misi->c_str(),kFALSE) ;
	  if (ctype==0) {	  
	    coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: master index category " << obc->_masterCat->GetName() 
				  << " does not have a state named " << *misi << " which was specified as state associated with p.d.f " 
				  << sr.GetName() << endl ;
	    delete obc ;
	    return 0 ;	    
	  }
	  osr._miStateList.push_back(ctype) ;
	}	
      }

      // Add specified split cats to global list of all splitting categories
      obc->_usedSplitCats.add(splitCatSet,kTRUE) ;
      
    }
    // Need to add clause here for SplitRules without any split (which can happen in MultiBuildConfigs)
    if (sr._paramSplitMap.size()==0) {

      if (obc->_masterCat) {
	list<string>::iterator misi ;
	for (misi=sr._miStateNameList.begin() ; misi!=sr._miStateNameList.end() ; ++misi) {
	  const RooCatType* ctype = obc->_masterCat->lookupType(misi->c_str(),kFALSE) ;
	  if (ctype==0) {	  
	    coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: master index category " << obc->_masterCat->GetName() 
				  << " does not have a state named " << *misi << " which was specified as state associated with p.d.f " 
				  << sr.GetName() << endl ;
	    delete obc ;
	    return 0 ;	    
	  }
	  osr._miStateList.push_back(ctype) ;
	}	
      }
    }

    obc->_pdfmap[pdf] = osr ;

  }

  // Check validity of build restriction specifications, if any
  map<string,string>::iterator riter ;
  for (riter=bc._restr.begin() ; riter!=bc._restr.end() ; ++riter) {
    RooCategory* cat = _ws->cat(riter->first.c_str()) ;
    if (!cat) {
      coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: associated workspace " << _ws->GetName() 
			    << " does not contain a category named " << riter->first
			    << " for which build was requested to be restricted to states " << riter->second << endl ;
      delete obc ;
      return 0 ;
    }	

    char buf[4096] ;
    list<const RooCatType*> rlist ;
    strlcpy(buf,riter->second.c_str(),4096) ;
    
    char* tok = strtok(buf,"{,}") ;
    while(tok) {
      const RooCatType* ctype = cat->lookupType(tok,kFALSE) ;
      if (!ctype) {
	coutE(ObjectHandling) << "RooSimWSTool::build(" << GetName() << ") ERROR: restricted build category " << cat->GetName() 
			      << " does not have state " << tok << " as specified in restriction list" << endl ;	
	delete obc ;
	return 0 ;
      }
      rlist.push_back(ctype) ;
      tok = strtok(0,"{,}") ;
    }
    
    obc->_restr[cat] = rlist ;
  }
   
  return obc ;
}




//_____________________________________________________________________________
RooSimultaneous* RooSimWSTool::executeBuild(const char* simPdfName, ObjBuildConfig& obc, Bool_t verbose)
{
  // Internal build driver from validation ObjBuildConfig.

  RooArgSet cleanupList ;

  RooAbsCategoryLValue* physCat = obc._masterCat ;

  RooArgSet physModelSet ;
  map<string,RooAbsPdf*> stateMap ;

  map<RooAbsPdf*,ObjSplitRule>::iterator physIter = obc._pdfmap.begin() ;
  while(physIter!=obc._pdfmap.end()) {

    
    RooAbsPdf* physModel = physIter->first ;
    physModelSet.add(*physModel,kTRUE) ; // silence duplicate insertion warnings

    list<const RooCatType*>::iterator stiter ;
    for (stiter=physIter->second._miStateList.begin() ; stiter!=physIter->second._miStateList.end() ; ++stiter) {
      stateMap[(*stiter)->GetName()] = physModel ;
    }

    // Continue with next mapping
    ++physIter ;
  }
  if (verbose) coutI(ObjectHandling) << "RooSimWSTool::executeBuild: list of prototype pdfs " << physModelSet << endl ;

  RooArgSet splitCatSet(obc._usedSplitCats) ;
  if (physCat) splitCatSet.add(*physCat) ;

  RooArgSet splitCatSetFund ;
  TIterator* scsiter = splitCatSet.createIterator() ;
  RooAbsCategory* scat ;
  while((scat=(RooAbsCategory*)scsiter->Next())) {
    if (scat->isFundamental()) {
      splitCatSetFund.add(*scat) ;
    } else {
      RooArgSet* scatvars = scat->getVariables() ;
      splitCatSetFund.add(*scatvars) ;
      delete scatvars ;
    }
  }
  delete scsiter ;


  RooAbsCategoryLValue* masterSplitCat ;
  if (splitCatSetFund.getSize()>1) {
    masterSplitCat = new RooSuperCategory("masterSplitCat","Master splitting category",splitCatSetFund) ;
  } else {
    masterSplitCat = (RooAbsCategoryLValue*) splitCatSetFund.first() ;
  }
  if (verbose) coutI(ObjectHandling) << "RooSimWSTool::executeBuild: list of splitting categories " << splitCatSet << endl ;

  RooArgSet splitNodeListOwned ; // owns all newly created components
  RooArgSet splitNodeListAll ; // all leaf nodes, preload with ws contents to auto-connect existing specializations
  TList* customizerList = new TList ;

  // Loop over requested physics models and build components
  TIterator* physMIter = physModelSet.createIterator() ;
  RooAbsPdf* physModel ;
  while((physModel=(RooAbsPdf*)physMIter->Next())) {
    if (verbose) coutI(ObjectHandling) << "RooSimPdfBuilder::executeBuild: processing prototype pdf " << physModel->GetName() << endl ;

    RooCustomizer* physCustomizer = new RooCustomizer(*physModel,*masterSplitCat,splitNodeListOwned,&splitNodeListAll) ;
    customizerList->Add(physCustomizer) ;

    map<RooAbsArg*, pair<RooArgSet,string> >::iterator splitIter ;
    for (splitIter = obc._pdfmap[physModel]._paramSplitMap.begin() ; splitIter != obc._pdfmap[physModel]._paramSplitMap.end() ; ++splitIter) {

      // If split is composite, first make multicategory with name 'A,B,C' and insert in WS
      
      // Construct name of (composite) split category (function)
      RooArgSet& splitCatSetTmp = splitIter->second.first ;
      string splitName = makeSplitName(splitCatSetTmp) ;

      // If composite split object does not exist yet, create it now
      RooAbsCategory* splitCat = _ws->catfunc(splitName.c_str()) ;
      if (!splitCat) {
	splitCat = new RooMultiCategory(splitName.c_str(),splitName.c_str(),splitCatSetTmp) ;
	cleanupList.addOwned(*splitCat) ;
	_ws->import(*splitCat,RooFit::Silence(!verbose)) ;
      }
            
      // If remainder category needs to be made, create RFV of appropriate for that and insert in WS
      if(splitIter->second.second.size()>0) {
	
	// Check that specified split name is in fact valid
	if (!splitCat->lookupType(splitIter->second.second.c_str())) {
	  coutE(InputArguments) << "RooSimWSTool::executeBuild(" << GetName() << ") ERROR: name of remainder state for constrained split, '" 
				<< splitIter->second.second << "' , does not match any state name of (composite) split category " << splitCat->GetName() << endl ;
	  return 0 ;
	}

	// First build manually the specializations of all non-remainder states, as the remainder state depends on these
	RooArgSet fracLeafList ;
	TIterator* sctiter = splitCat->typeIterator() ;
	RooCatType* type ;
	while((type=(RooCatType*)sctiter->Next())) {
	  
	  // Skip remainder state
	  if (splitIter->second.second == type->GetName()) continue ;
	  	  
	  // Construct name of split leaf
	  TString splitLeafName(splitIter->first->GetName()) ;
	  splitLeafName.Append("_") ;
	  splitLeafName.Append(type->GetName()) ;
	  
	  // Check if split leaf already exists	  
	  RooAbsArg* splitLeaf = _ws->fundArg(splitLeafName) ;
	  if (!splitLeaf) {
	    // If not create it now
	    splitLeaf = (RooAbsArg*) splitIter->first->clone(splitLeafName) ;
	    _ws->import(*splitLeaf,RooFit::Silence(!verbose)) ;
	  }
	  fracLeafList.add(*splitLeaf) ;
	}
	delete sctiter ;		
	

	// Build specialization for remainder state and insert in workspace 
	RooFracRemainder* fracRem = new RooFracRemainder(Form("%s_%s",splitIter->first->GetName(),splitIter->second.second.c_str()),"Remainder fraction",fracLeafList) ;
	cleanupList.addOwned(*fracRem) ;
	_ws->import(*fracRem) ;

      }
      

      // Add split definition to customizer
      physCustomizer->splitArgs(*splitIter->first,*splitCat) ;
    }
  }
  delete physMIter ;

  // List all existing workspace components as prebuilt items for the customizers at this point
  splitNodeListAll.add(_ws->components()) ;

  if (verbose) coutI(ObjectHandling)  << "RooSimWSTool::executeBuild: configured customizers for all prototype pdfs" << endl ;

  // Create fit category from physCat and splitCatList ;
  RooArgSet fitCatList ;
  if (physCat) fitCatList.add(*physCat) ;

  // Add observables of splitCatSet members, rather than splitCatSet members directly
  // as there may be cat->cat functions in here
  scsiter = splitCatSet.createIterator() ;
  while((scat=(RooAbsCategory*)scsiter->Next())) {
    if (scat->isFundamental()) {
      fitCatList.add(*scat) ;
    } else {
      RooArgSet* scatvars = scat->getVariables() ;
      fitCatList.add(*scatvars) ;
      delete scatvars ;
    }
  }
  delete scsiter ;


  TIterator* fclIter = fitCatList.createIterator() ;
  string mcatname = string(simPdfName) + "_index" ;
  RooAbsCategoryLValue* fitCat = 0 ;
  if (fitCatList.getSize()>1) {
    fitCat = new RooSuperCategory(mcatname.c_str(),mcatname.c_str(),fitCatList) ;
    cleanupList.addOwned(*fitCat) ;
  } else {
    fitCat = (RooAbsCategoryLValue*) fitCatList.first() ;
  }

  // Create master PDF 
  RooSimultaneous* simPdf = new RooSimultaneous(simPdfName,simPdfName,*fitCat) ;
  cleanupList.addOwned(*simPdf) ;
  
  // Add component PDFs to master PDF
  TIterator* fcIter = fitCat->typeIterator() ;

  RooCatType* fcState ;  
  while((fcState=(RooCatType*)fcIter->Next())) {
    // Select fitCat state
    fitCat->setLabel(fcState->GetName()) ;

    // Check if this fitCat state is selected
    fclIter->Reset() ;
    RooAbsCategory* splitCat ;
    Bool_t select(kFALSE) ;
    if (obc._restr.size()>0) {
      while((splitCat=(RooAbsCategory*)fclIter->Next())) {
	// Find selected state list 
	
	list<const RooCatType*> slist = obc._restr[splitCat] ;    
	if (slist.size()==0) {
	  continue ;
	}
	
	list<const RooCatType*>::iterator sli ;
	for (sli=slist.begin() ; sli!=slist.end() ; ++sli) {
	  if (string(splitCat->getLabel())==(*sli)->GetName()) {
	    select=kTRUE ;
	  }
	}      
      }
      if (!select) continue ;
    } else {
      select = kTRUE ;
    }
    
    // Select appropriate PDF for this physCat state
    RooCustomizer* physCustomizer ;
    if (physCat) {      
      RooAbsPdf* pdf = stateMap[physCat->getLabel()] ;
      if (pdf==0) {
	continue ;
      }
      physCustomizer = (RooCustomizer*) customizerList->FindObject(pdf->GetName());  
    } else {
      physCustomizer = (RooCustomizer*) customizerList->First() ;
    }

    if (verbose) coutI(ObjectHandling) << "RooSimWSTool::executeBuild: Customizing prototype pdf " << physCustomizer->GetName() 
				       << " for mode " << fcState->GetName() << endl ;    

    // Customizer PDF for current state and add to master simPdf
    RooAbsPdf* fcPdf = (RooAbsPdf*) physCustomizer->build(masterSplitCat->getLabel(),kFALSE) ;
    simPdf->addPdf(*fcPdf,fcState->GetName()) ;
  }
  delete fcIter ;
  
  _ws->import(*simPdf,obc._conflProtocol,RooFit::Silence(!verbose)) ;

  // Delete customizers
  customizerList->Delete() ;
  delete customizerList ;
  delete fclIter ;
  return (RooSimultaneous*) _ws->pdf(simPdf->GetName()) ;
}



//_____________________________________________________________________________
std::string RooSimWSTool::makeSplitName(const RooArgSet& splitCatSet) 
{
  // Construct name of composite split
  string name ;

  TIterator* iter = splitCatSet.createIterator() ;
  RooAbsArg* arg ;
  Bool_t first=kTRUE ;
  while((arg=(RooAbsArg*)iter->Next())) {
    if (first) {
      first=kFALSE;
    } else {
      name += "," ;
    }
    name += arg->GetName() ;
  }
  delete iter ;

  return name ;
}




//_____________________________________________________________________________
void RooSimWSTool::SplitRule::splitParameter(const char* paramNameList, const char* categoryNameList) 
{
  // Specify that parameters names listed in paramNameList be split in (product of) category(s)
  // listed in categoryNameList

  char paramBuf[4096] ;
  char catBuf[4096] ;
  strlcpy(paramBuf,paramNameList,4096) ;
  strlcpy(catBuf,categoryNameList,4096) ;

  // First parse category list
  list<string> catList ;
  char* cat = strtok(catBuf,"{,}") ;
  while(cat) {
    catList.push_back(cat) ;
    cat = strtok(0,"{,}") ;
  }

  // Now parse parameter list
  char* param = strtok(paramBuf,"{,}") ;
  while(param) {
    _paramSplitMap[param] = pair<list<string>,string>(catList,"") ;
    param = strtok(0,"{,}") ;
  }
}


//_____________________________________________________________________________
void RooSimWSTool::SplitRule::splitParameterConstrained(const char* paramNameList, const char* categoryNameList, const char* remainderStateName) 
{
  // Specify that parameters names listed in paramNameList be split in constrained way in (product of) category(s)
  // listed in categoryNameList and that remainder fraction formula be put in state with name remainderStateName

  char paramBuf[4096] ;
  char catBuf[4096] ;
  strlcpy(paramBuf,paramNameList,4096) ;
  strlcpy(catBuf,categoryNameList,4096) ;

  // First parse category list
  list<string> catList ;
  char* cat = strtok(catBuf,"{,}") ;
  while(cat) {
    catList.push_back(cat) ;
    cat = strtok(0,"{,}") ;
  }

  // Now parse parameter list
  char* param = strtok(paramBuf,"{,}") ;
  while(param) {
    _paramSplitMap[param] = pair<list<string>,string>(catList,remainderStateName) ;
    param = strtok(0,"{,}") ;
  }
}


//_____________________________________________________________________________
void RooSimWSTool::SplitRule::configure(const RooCmdArg& arg1,const RooCmdArg& arg2,const RooCmdArg& arg3,
					   const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
{
  // Construct the SplitRule object from a list of named arguments past to RooSimWSTool::build
  // This method parses any SplitParam and SplitParamComstrained argument in the list

  list<const RooCmdArg*> cmdList ;  
  cmdList.push_back(&arg1) ;  cmdList.push_back(&arg2) ;
  cmdList.push_back(&arg3) ;  cmdList.push_back(&arg4) ;
  cmdList.push_back(&arg5) ;  cmdList.push_back(&arg6) ;

  list<const RooCmdArg*>::iterator iter ;
  for (iter=cmdList.begin() ; iter!=cmdList.end() ; ++iter) {

    if ((*iter)->opcode()==0) continue ;

    string name = (*iter)->opcode() ;

    if (name=="SplitParam") {
      splitParameter((*iter)->getString(0),(*iter)->getString(1)) ;
    } else if (name=="SplitParamConstrained") {
      splitParameterConstrained((*iter)->getString(0),(*iter)->getString(1),(*iter)->getString(2)) ;
    }
  }
}




//_____________________________________________________________________________
RooSimWSTool::BuildConfig::BuildConfig(const char* pdfName, SplitRule& sr)
{
  // Add prototype p.d.f pdfName to build configuration with associated split rules 'sr'

  internalAddPdf(pdfName,"",sr) ;
}


//_____________________________________________________________________________
RooSimWSTool::BuildConfig::BuildConfig(const char* pdfName, const RooCmdArg& arg1,const RooCmdArg& arg2,
					  const RooCmdArg& arg3,const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
{
  // Construct build configuration from single prototype 'pdfName' and list of arguments
  // that can be passed to RooSimWSTool::build() method. This routine parses SplitParam()
  // SplitParamConstrained() and Restrict() arguments.

  SplitRule sr(pdfName) ;
  sr.configure(arg1,arg2,arg3,arg4,arg5,arg6) ;
  internalAddPdf(pdfName,"",sr) ;
  _conflProtocol = RooFit::RenameConflictNodes(pdfName) ;

  list<const RooCmdArg*> cmdList ;  
  cmdList.push_back(&arg1) ;  cmdList.push_back(&arg2) ;
  cmdList.push_back(&arg3) ;  cmdList.push_back(&arg4) ;
  cmdList.push_back(&arg5) ;  cmdList.push_back(&arg6) ;

  list<const RooCmdArg*>::iterator iter ;
  for (iter=cmdList.begin() ; iter!=cmdList.end() ; ++iter) {
    if ((*iter)->opcode()==0) continue ;
    string name = (*iter)->opcode() ;
    if (name=="Restrict") {
      restrictBuild((*iter)->getString(0),(*iter)->getString(1)) ;
    }    
    if (name=="RenameConflictNodes") {
      _conflProtocol = *(*iter) ;
    }
  }
}


//_____________________________________________________________________________
RooSimWSTool::BuildConfig::BuildConfig(const RooArgSet& /*legacyBuildConfig*/) 
{
  // Constructor to make BuildConfig from legacy RooSimPdfBuilder configuration
  // Empty for now
}


//_____________________________________________________________________________
void RooSimWSTool::BuildConfig::internalAddPdf(const char* pdfName, const char* miStateNameList,SplitRule& sr) 
{
  // Internal routine to add prototype pdf 'pdfName' with list of associated master states 'miStateNameList
  // and split rules 'sr' to configuration

  char buf[4096] ;
  strlcpy(buf,miStateNameList,4096) ;
  
  char* tok = strtok(buf,",") ;
  while(tok) {
    sr._miStateNameList.push_back(tok) ;
    tok = strtok(0,",") ;
  }
    
  _pdfmap[pdfName] = sr ;  
}


//_____________________________________________________________________________
void RooSimWSTool::BuildConfig::restrictBuild(const char* catName, const char* stateList) 
{
  // Restrict build by only considering state names in stateList for split in category catName
  _restr[catName] = stateList ;
}




//_____________________________________________________________________________
RooSimWSTool::MultiBuildConfig::MultiBuildConfig(const char* masterIndexCat)  
{
  // Construct MultiBuildConfig for build configuration with multiple prototype p.d.f.s
  // masterIndexCat is the name of the master index category that decides which
  // prototype is used.

  _masterCatName = masterIndexCat ;
}



//_____________________________________________________________________________
void RooSimWSTool::MultiBuildConfig::addPdf(const char* miStateList, const char* pdfName, const RooCmdArg& arg1,const RooCmdArg& arg2,
					       const RooCmdArg& arg3,const RooCmdArg& arg4, const RooCmdArg& arg5,const RooCmdArg& arg6)
{
  // Add protytpe p.d.f 'pdfName' to MultiBuildConfig associated with master indes states 'miStateList'. This
  // method parses the SplitParam() and SplitParamConstrained() arguments

  SplitRule sr(pdfName) ;
  sr.configure(arg1,arg2,arg3,arg4,arg5,arg6) ;
  internalAddPdf(pdfName,miStateList,sr) ;
}



//_____________________________________________________________________________
void RooSimWSTool::MultiBuildConfig::addPdf(const char* miStateList, const char* pdfName, SplitRule& sr) 
{
  // Add protytpe p.d.f 'pdfName' to MultiBuildConfig associated with master indes states 'miStateList'. 

  internalAddPdf(pdfName,miStateList,sr) ;
}




//_____________________________________________________________________________
RooSimWSTool::ObjSplitRule::~ObjSplitRule()
{
  // Destructor
}




//_____________________________________________________________________________
void RooSimWSTool::ObjBuildConfig::print()
{
  // Print details of a validated build configuration

  // --- Dump contents of object build config ---
  map<RooAbsPdf*,ObjSplitRule>::iterator ri ;
  for (ri = _pdfmap.begin() ; ri != _pdfmap.end() ; ++ri ) {    
    cout << "Splitrule for p.d.f " << ri->first->GetName() << " with state list " ;
    for (std::list<const RooCatType*>::iterator misi= ri->second._miStateList.begin() ; misi!=ri->second._miStateList.end() ; misi++) {
      cout << (*misi)->GetName() << " " ;
    }
    cout << endl ;

    map<RooAbsArg*,pair<RooArgSet,string> >::iterator csi ;
    for (csi = ri->second._paramSplitMap.begin() ; csi != ri->second._paramSplitMap.end() ; ++csi ) {    
      if (csi->second.second.length()>0) {
	cout << " parameter " << csi->first->GetName() << " is split with constraint in categories " << csi->second.first 
	     << " with remainder in state " << csi->second.second << endl ;      
      } else {
	cout << " parameter " << csi->first->GetName() << " is split with constraint in categories " << csi->second.first << endl ;      
      }
    }        
  }

  map<RooAbsCategory*,list<const RooCatType*> >::iterator riter ;
  for (riter=_restr.begin() ; riter!=_restr.end() ; ++riter) {
    cout << "Restricting build in category " << riter->first->GetName() << " to states " ;
    list<const RooCatType*>::iterator i ;
    for (i=riter->second.begin() ; i!=riter->second.end() ; i++) {
      if (i!=riter->second.begin()) cout << "," ;
      cout << (*i)->GetName() ;
    }
    cout << endl ;
  }

}




//_____________________________________________________________________________
std::string RooSimWSTool::SimWSIFace::create(RooFactoryWSTool& ft, const char* typeName, const char* instanceName, std::vector<std::string> args) 
{
  string tn(typeName) ;
  if (tn=="SIMCLONE") {

    // Perform syntax check. Warn about any meta parameters other than $SplitParam, $SplitParamConstrained, $Restrict and $Verbose
    for (unsigned int i=1 ; i<args.size() ; i++) {
      if (args[i].find("$SplitParam(")!=0 &&
	  args[i].find("$SplitParamConstrained(")!=0 &&
	  args[i].find("$SplitRestrict(")!=0 &&
	  args[i].find("$Verbose(")!=0) {
	throw string(Form("RooSimWSTool::SimWSIFace::create() ERROR: unknown token %s encountered",args[i].c_str())) ;
      }
    }

    // Make SplitRule object from $SplitParam and $SplitParamConstrained arguments
    RooSimWSTool::SplitRule sr(args[0].c_str()) ;
    for (unsigned int i=1 ; i<args.size() ; i++) {
      if (args[i].find("$SplitParam(")==0) {
	vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
	if (subargs.size()!=2) {
	  throw string(Form("Incorrect number of arguments in $SplitParam, have %d, expect 2",(Int_t)subargs.size())) ;
	}
	sr.splitParameter(subargs[0].c_str(),subargs[1].c_str()) ;
      } else if (args[i].find("$SplitParamConstrained(")==0) {
	vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
	if (subargs.size()!=3) {
	  throw string(Form("Incorrect number of arguments in $SplitParamConstrained, have %d, expect 3",(Int_t)subargs.size())) ;
	}
	sr.splitParameterConstrained(subargs[0].c_str(), subargs[1].c_str(), subargs[2].c_str()) ;	
      } 
    }

    // Make BuildConfig object
    RooSimWSTool::BuildConfig bc(args[0].c_str(),sr) ;
    for (unsigned int i=1 ; i<args.size() ; i++) {
      if (args[i].find("$Restrict(")==0) {
	vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
	if (subargs.size()!=2) {
	  throw string(Form("Incorrect number of arguments in $Restrict, have %d, expect 2",(Int_t)subargs.size())) ;
	}
	bc.restrictBuild(subargs[0].c_str(),subargs[1].c_str()) ;
      }
    }

    // Look for verbose flag
    Bool_t verbose(kFALSE) ;
    for (unsigned int i=1 ; i<args.size() ; i++) {
      if (args[i].find("$Verbose(")==0) {
	vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
	if (subargs.size()>0) {
	  verbose = atoi(subargs[0].c_str()) ;
	}
      }
    }

    // Build pdf clone
    RooSimWSTool sct(ft.ws()) ;    
    RooAbsPdf* pdf = sct.build(instanceName,bc,verbose) ;
    if (!pdf) {
      throw string(Form("RooSimWSTool::SimWSIFace::create() error in RooSimWSTool::build() for %s",instanceName)) ;
    }
    
    // Import into workspace
    ft.ws().import(*pdf,RooFit::Silence()) ;

  } else if (tn=="MSIMCLONE") {

    // First make a multibuild config from the master index cat
    RooSimWSTool::MultiBuildConfig mbc(args[0].c_str()) ;

    for (unsigned int i=1 ; i<args.size() ; i++) {
      if (args[i].find("$AddPdf(")==0) {
	// Process an add-pdf operation
	vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;

	// Make SplitRule object from $SplitParam and $SplitParamConstrained arguments
	RooSimWSTool::SplitRule sr(subargs[1].c_str()) ;
	for (unsigned int j=2 ; j<subargs.size() ; j++) {
	  if (subargs[j].find("$SplitParam(")==0) {
	    vector<string> subsubargs = ft.splitFunctionArgs(subargs[j].c_str()) ;
	    if (subsubargs.size()!=2) {
	      throw string(Form("Incorrect number of arguments in $SplitParam, have %d, expect 2",(Int_t)subsubargs.size())) ;
	    }
	    sr.splitParameter(subsubargs[0].c_str(),subsubargs[1].c_str()) ;
	  } else if (subargs[j].find("$SplitParamConstrained(")==0) {
	    vector<string> subsubargs = ft.splitFunctionArgs(subargs[j].c_str()) ;
	    if (subsubargs.size()!=3) {
	      throw string(Form("Incorrect number of arguments in $SplitParamConstrained, have %d, expect 3",(Int_t)subsubargs.size())) ;
	    }
	    sr.splitParameterConstrained(subsubargs[0].c_str(), subsubargs[1].c_str(), subsubargs[2].c_str()) ;	
	  } 
	}     
	mbc.addPdf(subargs[0].c_str(),subargs[1].c_str(),sr) ;

      } else if (args[i].find("$Restrict(")==0) {
	
	// Process a restrict operation 	
	vector<string> subargs = ft.splitFunctionArgs(args[i].c_str()) ;
	if (subargs.size()!=2) {
	  throw string(Form("Incorrect number of arguments in $Restrict, have %d, expect 2",(Int_t)subargs.size())) ;
	}
	mbc.restrictBuild(subargs[0].c_str(),subargs[1].c_str()) ;
	
      } else {
	throw string(Form("RooSimWSTool::SimWSIFace::create() ERROR: unknown token in MSIMCLONE: %s",args[i].c_str())) ;
      }
    }    

    // Build pdf clone
    RooSimWSTool sct(ft.ws()) ;    
    RooAbsPdf* pdf = sct.build(instanceName,mbc,kFALSE) ;
    if (!pdf) {
      throw string(Form("RooSimWSTool::SimWSIFace::create() error in RooSimWSTool::build() for %s",instanceName)) ;
    }
    
    // Import into workspace
    ft.ws().import(*pdf,RooFit::Silence()) ;

    
  } else {
    throw string(Form("RooSimWSTool::SimWSIFace::create() ERROR: Unknown meta-type %s requested",typeName)) ;
  }
  
  return string(instanceName) ;
}
 RooSimWSTool.cxx:1
 RooSimWSTool.cxx:2
 RooSimWSTool.cxx:3
 RooSimWSTool.cxx:4
 RooSimWSTool.cxx:5
 RooSimWSTool.cxx:6
 RooSimWSTool.cxx:7
 RooSimWSTool.cxx:8
 RooSimWSTool.cxx:9
 RooSimWSTool.cxx:10
 RooSimWSTool.cxx:11
 RooSimWSTool.cxx:12
 RooSimWSTool.cxx:13
 RooSimWSTool.cxx:14
 RooSimWSTool.cxx:15
 RooSimWSTool.cxx:16
 RooSimWSTool.cxx:17
 RooSimWSTool.cxx:18
 RooSimWSTool.cxx:19
 RooSimWSTool.cxx:20
 RooSimWSTool.cxx:21
 RooSimWSTool.cxx:22
 RooSimWSTool.cxx:23
 RooSimWSTool.cxx:24
 RooSimWSTool.cxx:25
 RooSimWSTool.cxx:26
 RooSimWSTool.cxx:27
 RooSimWSTool.cxx:28
 RooSimWSTool.cxx:29
 RooSimWSTool.cxx:30
 RooSimWSTool.cxx:31
 RooSimWSTool.cxx:32
 RooSimWSTool.cxx:33
 RooSimWSTool.cxx:34
 RooSimWSTool.cxx:35
 RooSimWSTool.cxx:36
 RooSimWSTool.cxx:37
 RooSimWSTool.cxx:38
 RooSimWSTool.cxx:39
 RooSimWSTool.cxx:40
 RooSimWSTool.cxx:41
 RooSimWSTool.cxx:42
 RooSimWSTool.cxx:43
 RooSimWSTool.cxx:44
 RooSimWSTool.cxx:45
 RooSimWSTool.cxx:46
 RooSimWSTool.cxx:47
 RooSimWSTool.cxx:48
 RooSimWSTool.cxx:49
 RooSimWSTool.cxx:50
 RooSimWSTool.cxx:51
 RooSimWSTool.cxx:52
 RooSimWSTool.cxx:53
 RooSimWSTool.cxx:54
 RooSimWSTool.cxx:55
 RooSimWSTool.cxx:56
 RooSimWSTool.cxx:57
 RooSimWSTool.cxx:58
 RooSimWSTool.cxx:59
 RooSimWSTool.cxx:60
 RooSimWSTool.cxx:61
 RooSimWSTool.cxx:62
 RooSimWSTool.cxx:63
 RooSimWSTool.cxx:64
 RooSimWSTool.cxx:65
 RooSimWSTool.cxx:66
 RooSimWSTool.cxx:67
 RooSimWSTool.cxx:68
 RooSimWSTool.cxx:69
 RooSimWSTool.cxx:70
 RooSimWSTool.cxx:71
 RooSimWSTool.cxx:72
 RooSimWSTool.cxx:73
 RooSimWSTool.cxx:74
 RooSimWSTool.cxx:75
 RooSimWSTool.cxx:76
 RooSimWSTool.cxx:77
 RooSimWSTool.cxx:78
 RooSimWSTool.cxx:79
 RooSimWSTool.cxx:80
 RooSimWSTool.cxx:81
 RooSimWSTool.cxx:82
 RooSimWSTool.cxx:83
 RooSimWSTool.cxx:84
 RooSimWSTool.cxx:85
 RooSimWSTool.cxx:86
 RooSimWSTool.cxx:87
 RooSimWSTool.cxx:88
 RooSimWSTool.cxx:89
 RooSimWSTool.cxx:90
 RooSimWSTool.cxx:91
 RooSimWSTool.cxx:92
 RooSimWSTool.cxx:93
 RooSimWSTool.cxx:94
 RooSimWSTool.cxx:95
 RooSimWSTool.cxx:96
 RooSimWSTool.cxx:97
 RooSimWSTool.cxx:98
 RooSimWSTool.cxx:99
 RooSimWSTool.cxx:100
 RooSimWSTool.cxx:101
 RooSimWSTool.cxx:102
 RooSimWSTool.cxx:103
 RooSimWSTool.cxx:104
 RooSimWSTool.cxx:105
 RooSimWSTool.cxx:106
 RooSimWSTool.cxx:107
 RooSimWSTool.cxx:108
 RooSimWSTool.cxx:109
 RooSimWSTool.cxx:110
 RooSimWSTool.cxx:111
 RooSimWSTool.cxx:112
 RooSimWSTool.cxx:113
 RooSimWSTool.cxx:114
 RooSimWSTool.cxx:115
 RooSimWSTool.cxx:116
 RooSimWSTool.cxx:117
 RooSimWSTool.cxx:118
 RooSimWSTool.cxx:119
 RooSimWSTool.cxx:120
 RooSimWSTool.cxx:121
 RooSimWSTool.cxx:122
 RooSimWSTool.cxx:123
 RooSimWSTool.cxx:124
 RooSimWSTool.cxx:125
 RooSimWSTool.cxx:126
 RooSimWSTool.cxx:127
 RooSimWSTool.cxx:128
 RooSimWSTool.cxx:129
 RooSimWSTool.cxx:130
 RooSimWSTool.cxx:131
 RooSimWSTool.cxx:132
 RooSimWSTool.cxx:133
 RooSimWSTool.cxx:134
 RooSimWSTool.cxx:135
 RooSimWSTool.cxx:136
 RooSimWSTool.cxx:137
 RooSimWSTool.cxx:138
 RooSimWSTool.cxx:139
 RooSimWSTool.cxx:140
 RooSimWSTool.cxx:141
 RooSimWSTool.cxx:142
 RooSimWSTool.cxx:143
 RooSimWSTool.cxx:144
 RooSimWSTool.cxx:145
 RooSimWSTool.cxx:146
 RooSimWSTool.cxx:147
 RooSimWSTool.cxx:148
 RooSimWSTool.cxx:149
 RooSimWSTool.cxx:150
 RooSimWSTool.cxx:151
 RooSimWSTool.cxx:152
 RooSimWSTool.cxx:153
 RooSimWSTool.cxx:154
 RooSimWSTool.cxx:155
 RooSimWSTool.cxx:156
 RooSimWSTool.cxx:157
 RooSimWSTool.cxx:158
 RooSimWSTool.cxx:159
 RooSimWSTool.cxx:160
 RooSimWSTool.cxx:161
 RooSimWSTool.cxx:162
 RooSimWSTool.cxx:163
 RooSimWSTool.cxx:164
 RooSimWSTool.cxx:165
 RooSimWSTool.cxx:166
 RooSimWSTool.cxx:167
 RooSimWSTool.cxx:168
 RooSimWSTool.cxx:169
 RooSimWSTool.cxx:170
 RooSimWSTool.cxx:171
 RooSimWSTool.cxx:172
 RooSimWSTool.cxx:173
 RooSimWSTool.cxx:174
 RooSimWSTool.cxx:175
 RooSimWSTool.cxx:176
 RooSimWSTool.cxx:177
 RooSimWSTool.cxx:178
 RooSimWSTool.cxx:179
 RooSimWSTool.cxx:180
 RooSimWSTool.cxx:181
 RooSimWSTool.cxx:182
 RooSimWSTool.cxx:183
 RooSimWSTool.cxx:184
 RooSimWSTool.cxx:185
 RooSimWSTool.cxx:186
 RooSimWSTool.cxx:187
 RooSimWSTool.cxx:188
 RooSimWSTool.cxx:189
 RooSimWSTool.cxx:190
 RooSimWSTool.cxx:191
 RooSimWSTool.cxx:192
 RooSimWSTool.cxx:193
 RooSimWSTool.cxx:194
 RooSimWSTool.cxx:195
 RooSimWSTool.cxx:196
 RooSimWSTool.cxx:197
 RooSimWSTool.cxx:198
 RooSimWSTool.cxx:199
 RooSimWSTool.cxx:200
 RooSimWSTool.cxx:201
 RooSimWSTool.cxx:202
 RooSimWSTool.cxx:203
 RooSimWSTool.cxx:204
 RooSimWSTool.cxx:205
 RooSimWSTool.cxx:206
 RooSimWSTool.cxx:207
 RooSimWSTool.cxx:208
 RooSimWSTool.cxx:209
 RooSimWSTool.cxx:210
 RooSimWSTool.cxx:211
 RooSimWSTool.cxx:212
 RooSimWSTool.cxx:213
 RooSimWSTool.cxx:214
 RooSimWSTool.cxx:215
 RooSimWSTool.cxx:216
 RooSimWSTool.cxx:217
 RooSimWSTool.cxx:218
 RooSimWSTool.cxx:219
 RooSimWSTool.cxx:220
 RooSimWSTool.cxx:221
 RooSimWSTool.cxx:222
 RooSimWSTool.cxx:223
 RooSimWSTool.cxx:224
 RooSimWSTool.cxx:225
 RooSimWSTool.cxx:226
 RooSimWSTool.cxx:227
 RooSimWSTool.cxx:228
 RooSimWSTool.cxx:229
 RooSimWSTool.cxx:230
 RooSimWSTool.cxx:231
 RooSimWSTool.cxx:232
 RooSimWSTool.cxx:233
 RooSimWSTool.cxx:234
 RooSimWSTool.cxx:235
 RooSimWSTool.cxx:236
 RooSimWSTool.cxx:237
 RooSimWSTool.cxx:238
 RooSimWSTool.cxx:239
 RooSimWSTool.cxx:240
 RooSimWSTool.cxx:241
 RooSimWSTool.cxx:242
 RooSimWSTool.cxx:243
 RooSimWSTool.cxx:244
 RooSimWSTool.cxx:245
 RooSimWSTool.cxx:246
 RooSimWSTool.cxx:247
 RooSimWSTool.cxx:248
 RooSimWSTool.cxx:249
 RooSimWSTool.cxx:250
 RooSimWSTool.cxx:251
 RooSimWSTool.cxx:252
 RooSimWSTool.cxx:253
 RooSimWSTool.cxx:254
 RooSimWSTool.cxx:255
 RooSimWSTool.cxx:256
 RooSimWSTool.cxx:257
 RooSimWSTool.cxx:258
 RooSimWSTool.cxx:259
 RooSimWSTool.cxx:260
 RooSimWSTool.cxx:261
 RooSimWSTool.cxx:262
 RooSimWSTool.cxx:263
 RooSimWSTool.cxx:264
 RooSimWSTool.cxx:265
 RooSimWSTool.cxx:266
 RooSimWSTool.cxx:267
 RooSimWSTool.cxx:268
 RooSimWSTool.cxx:269
 RooSimWSTool.cxx:270
 RooSimWSTool.cxx:271
 RooSimWSTool.cxx:272
 RooSimWSTool.cxx:273
 RooSimWSTool.cxx:274
 RooSimWSTool.cxx:275
 RooSimWSTool.cxx:276
 RooSimWSTool.cxx:277
 RooSimWSTool.cxx:278
 RooSimWSTool.cxx:279
 RooSimWSTool.cxx:280
 RooSimWSTool.cxx:281
 RooSimWSTool.cxx:282
 RooSimWSTool.cxx:283
 RooSimWSTool.cxx:284
 RooSimWSTool.cxx:285
 RooSimWSTool.cxx:286
 RooSimWSTool.cxx:287
 RooSimWSTool.cxx:288
 RooSimWSTool.cxx:289
 RooSimWSTool.cxx:290
 RooSimWSTool.cxx:291
 RooSimWSTool.cxx:292
 RooSimWSTool.cxx:293
 RooSimWSTool.cxx:294
 RooSimWSTool.cxx:295
 RooSimWSTool.cxx:296
 RooSimWSTool.cxx:297
 RooSimWSTool.cxx:298
 RooSimWSTool.cxx:299
 RooSimWSTool.cxx:300
 RooSimWSTool.cxx:301
 RooSimWSTool.cxx:302
 RooSimWSTool.cxx:303
 RooSimWSTool.cxx:304
 RooSimWSTool.cxx:305
 RooSimWSTool.cxx:306
 RooSimWSTool.cxx:307
 RooSimWSTool.cxx:308
 RooSimWSTool.cxx:309
 RooSimWSTool.cxx:310
 RooSimWSTool.cxx:311
 RooSimWSTool.cxx:312
 RooSimWSTool.cxx:313
 RooSimWSTool.cxx:314
 RooSimWSTool.cxx:315
 RooSimWSTool.cxx:316
 RooSimWSTool.cxx:317
 RooSimWSTool.cxx:318
 RooSimWSTool.cxx:319
 RooSimWSTool.cxx:320
 RooSimWSTool.cxx:321
 RooSimWSTool.cxx:322
 RooSimWSTool.cxx:323
 RooSimWSTool.cxx:324
 RooSimWSTool.cxx:325
 RooSimWSTool.cxx:326
 RooSimWSTool.cxx:327
 RooSimWSTool.cxx:328
 RooSimWSTool.cxx:329
 RooSimWSTool.cxx:330
 RooSimWSTool.cxx:331
 RooSimWSTool.cxx:332
 RooSimWSTool.cxx:333
 RooSimWSTool.cxx:334
 RooSimWSTool.cxx:335
 RooSimWSTool.cxx:336
 RooSimWSTool.cxx:337
 RooSimWSTool.cxx:338
 RooSimWSTool.cxx:339
 RooSimWSTool.cxx:340
 RooSimWSTool.cxx:341
 RooSimWSTool.cxx:342
 RooSimWSTool.cxx:343
 RooSimWSTool.cxx:344
 RooSimWSTool.cxx:345
 RooSimWSTool.cxx:346
 RooSimWSTool.cxx:347
 RooSimWSTool.cxx:348
 RooSimWSTool.cxx:349
 RooSimWSTool.cxx:350
 RooSimWSTool.cxx:351
 RooSimWSTool.cxx:352
 RooSimWSTool.cxx:353
 RooSimWSTool.cxx:354
 RooSimWSTool.cxx:355
 RooSimWSTool.cxx:356
 RooSimWSTool.cxx:357
 RooSimWSTool.cxx:358
 RooSimWSTool.cxx:359
 RooSimWSTool.cxx:360
 RooSimWSTool.cxx:361
 RooSimWSTool.cxx:362
 RooSimWSTool.cxx:363
 RooSimWSTool.cxx:364
 RooSimWSTool.cxx:365
 RooSimWSTool.cxx:366
 RooSimWSTool.cxx:367
 RooSimWSTool.cxx:368
 RooSimWSTool.cxx:369
 RooSimWSTool.cxx:370
 RooSimWSTool.cxx:371
 RooSimWSTool.cxx:372
 RooSimWSTool.cxx:373
 RooSimWSTool.cxx:374
 RooSimWSTool.cxx:375
 RooSimWSTool.cxx:376
 RooSimWSTool.cxx:377
 RooSimWSTool.cxx:378
 RooSimWSTool.cxx:379
 RooSimWSTool.cxx:380
 RooSimWSTool.cxx:381
 RooSimWSTool.cxx:382
 RooSimWSTool.cxx:383
 RooSimWSTool.cxx:384
 RooSimWSTool.cxx:385
 RooSimWSTool.cxx:386
 RooSimWSTool.cxx:387
 RooSimWSTool.cxx:388
 RooSimWSTool.cxx:389
 RooSimWSTool.cxx:390
 RooSimWSTool.cxx:391
 RooSimWSTool.cxx:392
 RooSimWSTool.cxx:393
 RooSimWSTool.cxx:394
 RooSimWSTool.cxx:395
 RooSimWSTool.cxx:396
 RooSimWSTool.cxx:397
 RooSimWSTool.cxx:398
 RooSimWSTool.cxx:399
 RooSimWSTool.cxx:400
 RooSimWSTool.cxx:401
 RooSimWSTool.cxx:402
 RooSimWSTool.cxx:403
 RooSimWSTool.cxx:404
 RooSimWSTool.cxx:405
 RooSimWSTool.cxx:406
 RooSimWSTool.cxx:407
 RooSimWSTool.cxx:408
 RooSimWSTool.cxx:409
 RooSimWSTool.cxx:410
 RooSimWSTool.cxx:411
 RooSimWSTool.cxx:412
 RooSimWSTool.cxx:413
 RooSimWSTool.cxx:414
 RooSimWSTool.cxx:415
 RooSimWSTool.cxx:416
 RooSimWSTool.cxx:417
 RooSimWSTool.cxx:418
 RooSimWSTool.cxx:419
 RooSimWSTool.cxx:420
 RooSimWSTool.cxx:421
 RooSimWSTool.cxx:422
 RooSimWSTool.cxx:423
 RooSimWSTool.cxx:424
 RooSimWSTool.cxx:425
 RooSimWSTool.cxx:426
 RooSimWSTool.cxx:427
 RooSimWSTool.cxx:428
 RooSimWSTool.cxx:429
 RooSimWSTool.cxx:430
 RooSimWSTool.cxx:431
 RooSimWSTool.cxx:432
 RooSimWSTool.cxx:433
 RooSimWSTool.cxx:434
 RooSimWSTool.cxx:435
 RooSimWSTool.cxx:436
 RooSimWSTool.cxx:437
 RooSimWSTool.cxx:438
 RooSimWSTool.cxx:439
 RooSimWSTool.cxx:440
 RooSimWSTool.cxx:441
 RooSimWSTool.cxx:442
 RooSimWSTool.cxx:443
 RooSimWSTool.cxx:444
 RooSimWSTool.cxx:445
 RooSimWSTool.cxx:446
 RooSimWSTool.cxx:447
 RooSimWSTool.cxx:448
 RooSimWSTool.cxx:449
 RooSimWSTool.cxx:450
 RooSimWSTool.cxx:451
 RooSimWSTool.cxx:452
 RooSimWSTool.cxx:453
 RooSimWSTool.cxx:454
 RooSimWSTool.cxx:455
 RooSimWSTool.cxx:456
 RooSimWSTool.cxx:457
 RooSimWSTool.cxx:458
 RooSimWSTool.cxx:459
 RooSimWSTool.cxx:460
 RooSimWSTool.cxx:461
 RooSimWSTool.cxx:462
 RooSimWSTool.cxx:463
 RooSimWSTool.cxx:464
 RooSimWSTool.cxx:465
 RooSimWSTool.cxx:466
 RooSimWSTool.cxx:467
 RooSimWSTool.cxx:468
 RooSimWSTool.cxx:469
 RooSimWSTool.cxx:470
 RooSimWSTool.cxx:471
 RooSimWSTool.cxx:472
 RooSimWSTool.cxx:473
 RooSimWSTool.cxx:474
 RooSimWSTool.cxx:475
 RooSimWSTool.cxx:476
 RooSimWSTool.cxx:477
 RooSimWSTool.cxx:478
 RooSimWSTool.cxx:479
 RooSimWSTool.cxx:480
 RooSimWSTool.cxx:481
 RooSimWSTool.cxx:482
 RooSimWSTool.cxx:483
 RooSimWSTool.cxx:484
 RooSimWSTool.cxx:485
 RooSimWSTool.cxx:486
 RooSimWSTool.cxx:487
 RooSimWSTool.cxx:488
 RooSimWSTool.cxx:489
 RooSimWSTool.cxx:490
 RooSimWSTool.cxx:491
 RooSimWSTool.cxx:492
 RooSimWSTool.cxx:493
 RooSimWSTool.cxx:494
 RooSimWSTool.cxx:495
 RooSimWSTool.cxx:496
 RooSimWSTool.cxx:497
 RooSimWSTool.cxx:498
 RooSimWSTool.cxx:499
 RooSimWSTool.cxx:500
 RooSimWSTool.cxx:501
 RooSimWSTool.cxx:502
 RooSimWSTool.cxx:503
 RooSimWSTool.cxx:504
 RooSimWSTool.cxx:505
 RooSimWSTool.cxx:506
 RooSimWSTool.cxx:507
 RooSimWSTool.cxx:508
 RooSimWSTool.cxx:509
 RooSimWSTool.cxx:510
 RooSimWSTool.cxx:511
 RooSimWSTool.cxx:512
 RooSimWSTool.cxx:513
 RooSimWSTool.cxx:514
 RooSimWSTool.cxx:515
 RooSimWSTool.cxx:516
 RooSimWSTool.cxx:517
 RooSimWSTool.cxx:518
 RooSimWSTool.cxx:519
 RooSimWSTool.cxx:520
 RooSimWSTool.cxx:521
 RooSimWSTool.cxx:522
 RooSimWSTool.cxx:523
 RooSimWSTool.cxx:524
 RooSimWSTool.cxx:525
 RooSimWSTool.cxx:526
 RooSimWSTool.cxx:527
 RooSimWSTool.cxx:528
 RooSimWSTool.cxx:529
 RooSimWSTool.cxx:530
 RooSimWSTool.cxx:531
 RooSimWSTool.cxx:532
 RooSimWSTool.cxx:533
 RooSimWSTool.cxx:534
 RooSimWSTool.cxx:535
 RooSimWSTool.cxx:536
 RooSimWSTool.cxx:537
 RooSimWSTool.cxx:538
 RooSimWSTool.cxx:539
 RooSimWSTool.cxx:540
 RooSimWSTool.cxx:541
 RooSimWSTool.cxx:542
 RooSimWSTool.cxx:543
 RooSimWSTool.cxx:544
 RooSimWSTool.cxx:545
 RooSimWSTool.cxx:546
 RooSimWSTool.cxx:547
 RooSimWSTool.cxx:548
 RooSimWSTool.cxx:549
 RooSimWSTool.cxx:550
 RooSimWSTool.cxx:551
 RooSimWSTool.cxx:552
 RooSimWSTool.cxx:553
 RooSimWSTool.cxx:554
 RooSimWSTool.cxx:555
 RooSimWSTool.cxx:556
 RooSimWSTool.cxx:557
 RooSimWSTool.cxx:558
 RooSimWSTool.cxx:559
 RooSimWSTool.cxx:560
 RooSimWSTool.cxx:561
 RooSimWSTool.cxx:562
 RooSimWSTool.cxx:563
 RooSimWSTool.cxx:564
 RooSimWSTool.cxx:565
 RooSimWSTool.cxx:566
 RooSimWSTool.cxx:567
 RooSimWSTool.cxx:568
 RooSimWSTool.cxx:569
 RooSimWSTool.cxx:570
 RooSimWSTool.cxx:571
 RooSimWSTool.cxx:572
 RooSimWSTool.cxx:573
 RooSimWSTool.cxx:574
 RooSimWSTool.cxx:575
 RooSimWSTool.cxx:576
 RooSimWSTool.cxx:577
 RooSimWSTool.cxx:578
 RooSimWSTool.cxx:579
 RooSimWSTool.cxx:580
 RooSimWSTool.cxx:581
 RooSimWSTool.cxx:582
 RooSimWSTool.cxx:583
 RooSimWSTool.cxx:584
 RooSimWSTool.cxx:585
 RooSimWSTool.cxx:586
 RooSimWSTool.cxx:587
 RooSimWSTool.cxx:588
 RooSimWSTool.cxx:589
 RooSimWSTool.cxx:590
 RooSimWSTool.cxx:591
 RooSimWSTool.cxx:592
 RooSimWSTool.cxx:593
 RooSimWSTool.cxx:594
 RooSimWSTool.cxx:595
 RooSimWSTool.cxx:596
 RooSimWSTool.cxx:597
 RooSimWSTool.cxx:598
 RooSimWSTool.cxx:599
 RooSimWSTool.cxx:600
 RooSimWSTool.cxx:601
 RooSimWSTool.cxx:602
 RooSimWSTool.cxx:603
 RooSimWSTool.cxx:604
 RooSimWSTool.cxx:605
 RooSimWSTool.cxx:606
 RooSimWSTool.cxx:607
 RooSimWSTool.cxx:608
 RooSimWSTool.cxx:609
 RooSimWSTool.cxx:610
 RooSimWSTool.cxx:611
 RooSimWSTool.cxx:612
 RooSimWSTool.cxx:613
 RooSimWSTool.cxx:614
 RooSimWSTool.cxx:615
 RooSimWSTool.cxx:616
 RooSimWSTool.cxx:617
 RooSimWSTool.cxx:618
 RooSimWSTool.cxx:619
 RooSimWSTool.cxx:620
 RooSimWSTool.cxx:621
 RooSimWSTool.cxx:622
 RooSimWSTool.cxx:623
 RooSimWSTool.cxx:624
 RooSimWSTool.cxx:625
 RooSimWSTool.cxx:626
 RooSimWSTool.cxx:627
 RooSimWSTool.cxx:628
 RooSimWSTool.cxx:629
 RooSimWSTool.cxx:630
 RooSimWSTool.cxx:631
 RooSimWSTool.cxx:632
 RooSimWSTool.cxx:633
 RooSimWSTool.cxx:634
 RooSimWSTool.cxx:635
 RooSimWSTool.cxx:636
 RooSimWSTool.cxx:637
 RooSimWSTool.cxx:638
 RooSimWSTool.cxx:639
 RooSimWSTool.cxx:640
 RooSimWSTool.cxx:641
 RooSimWSTool.cxx:642
 RooSimWSTool.cxx:643
 RooSimWSTool.cxx:644
 RooSimWSTool.cxx:645
 RooSimWSTool.cxx:646
 RooSimWSTool.cxx:647
 RooSimWSTool.cxx:648
 RooSimWSTool.cxx:649
 RooSimWSTool.cxx:650
 RooSimWSTool.cxx:651
 RooSimWSTool.cxx:652
 RooSimWSTool.cxx:653
 RooSimWSTool.cxx:654
 RooSimWSTool.cxx:655
 RooSimWSTool.cxx:656
 RooSimWSTool.cxx:657
 RooSimWSTool.cxx:658
 RooSimWSTool.cxx:659
 RooSimWSTool.cxx:660
 RooSimWSTool.cxx:661
 RooSimWSTool.cxx:662
 RooSimWSTool.cxx:663
 RooSimWSTool.cxx:664
 RooSimWSTool.cxx:665
 RooSimWSTool.cxx:666
 RooSimWSTool.cxx:667
 RooSimWSTool.cxx:668
 RooSimWSTool.cxx:669
 RooSimWSTool.cxx:670
 RooSimWSTool.cxx:671
 RooSimWSTool.cxx:672
 RooSimWSTool.cxx:673
 RooSimWSTool.cxx:674
 RooSimWSTool.cxx:675
 RooSimWSTool.cxx:676
 RooSimWSTool.cxx:677
 RooSimWSTool.cxx:678
 RooSimWSTool.cxx:679
 RooSimWSTool.cxx:680
 RooSimWSTool.cxx:681
 RooSimWSTool.cxx:682
 RooSimWSTool.cxx:683
 RooSimWSTool.cxx:684
 RooSimWSTool.cxx:685
 RooSimWSTool.cxx:686
 RooSimWSTool.cxx:687
 RooSimWSTool.cxx:688
 RooSimWSTool.cxx:689
 RooSimWSTool.cxx:690
 RooSimWSTool.cxx:691
 RooSimWSTool.cxx:692
 RooSimWSTool.cxx:693
 RooSimWSTool.cxx:694
 RooSimWSTool.cxx:695
 RooSimWSTool.cxx:696
 RooSimWSTool.cxx:697
 RooSimWSTool.cxx:698
 RooSimWSTool.cxx:699
 RooSimWSTool.cxx:700
 RooSimWSTool.cxx:701
 RooSimWSTool.cxx:702
 RooSimWSTool.cxx:703
 RooSimWSTool.cxx:704
 RooSimWSTool.cxx:705
 RooSimWSTool.cxx:706
 RooSimWSTool.cxx:707
 RooSimWSTool.cxx:708
 RooSimWSTool.cxx:709
 RooSimWSTool.cxx:710
 RooSimWSTool.cxx:711
 RooSimWSTool.cxx:712
 RooSimWSTool.cxx:713
 RooSimWSTool.cxx:714
 RooSimWSTool.cxx:715
 RooSimWSTool.cxx:716
 RooSimWSTool.cxx:717
 RooSimWSTool.cxx:718
 RooSimWSTool.cxx:719
 RooSimWSTool.cxx:720
 RooSimWSTool.cxx:721
 RooSimWSTool.cxx:722
 RooSimWSTool.cxx:723
 RooSimWSTool.cxx:724
 RooSimWSTool.cxx:725
 RooSimWSTool.cxx:726
 RooSimWSTool.cxx:727
 RooSimWSTool.cxx:728
 RooSimWSTool.cxx:729
 RooSimWSTool.cxx:730
 RooSimWSTool.cxx:731
 RooSimWSTool.cxx:732
 RooSimWSTool.cxx:733
 RooSimWSTool.cxx:734
 RooSimWSTool.cxx:735
 RooSimWSTool.cxx:736
 RooSimWSTool.cxx:737
 RooSimWSTool.cxx:738
 RooSimWSTool.cxx:739
 RooSimWSTool.cxx:740
 RooSimWSTool.cxx:741
 RooSimWSTool.cxx:742
 RooSimWSTool.cxx:743
 RooSimWSTool.cxx:744
 RooSimWSTool.cxx:745
 RooSimWSTool.cxx:746
 RooSimWSTool.cxx:747
 RooSimWSTool.cxx:748
 RooSimWSTool.cxx:749
 RooSimWSTool.cxx:750
 RooSimWSTool.cxx:751
 RooSimWSTool.cxx:752
 RooSimWSTool.cxx:753
 RooSimWSTool.cxx:754
 RooSimWSTool.cxx:755
 RooSimWSTool.cxx:756
 RooSimWSTool.cxx:757
 RooSimWSTool.cxx:758
 RooSimWSTool.cxx:759
 RooSimWSTool.cxx:760
 RooSimWSTool.cxx:761
 RooSimWSTool.cxx:762
 RooSimWSTool.cxx:763
 RooSimWSTool.cxx:764
 RooSimWSTool.cxx:765
 RooSimWSTool.cxx:766
 RooSimWSTool.cxx:767
 RooSimWSTool.cxx:768
 RooSimWSTool.cxx:769
 RooSimWSTool.cxx:770
 RooSimWSTool.cxx:771
 RooSimWSTool.cxx:772
 RooSimWSTool.cxx:773
 RooSimWSTool.cxx:774
 RooSimWSTool.cxx:775
 RooSimWSTool.cxx:776
 RooSimWSTool.cxx:777
 RooSimWSTool.cxx:778
 RooSimWSTool.cxx:779
 RooSimWSTool.cxx:780
 RooSimWSTool.cxx:781
 RooSimWSTool.cxx:782
 RooSimWSTool.cxx:783
 RooSimWSTool.cxx:784
 RooSimWSTool.cxx:785
 RooSimWSTool.cxx:786
 RooSimWSTool.cxx:787
 RooSimWSTool.cxx:788
 RooSimWSTool.cxx:789
 RooSimWSTool.cxx:790
 RooSimWSTool.cxx:791
 RooSimWSTool.cxx:792
 RooSimWSTool.cxx:793
 RooSimWSTool.cxx:794
 RooSimWSTool.cxx:795
 RooSimWSTool.cxx:796
 RooSimWSTool.cxx:797
 RooSimWSTool.cxx:798
 RooSimWSTool.cxx:799
 RooSimWSTool.cxx:800
 RooSimWSTool.cxx:801
 RooSimWSTool.cxx:802
 RooSimWSTool.cxx:803
 RooSimWSTool.cxx:804
 RooSimWSTool.cxx:805
 RooSimWSTool.cxx:806
 RooSimWSTool.cxx:807
 RooSimWSTool.cxx:808
 RooSimWSTool.cxx:809
 RooSimWSTool.cxx:810
 RooSimWSTool.cxx:811
 RooSimWSTool.cxx:812
 RooSimWSTool.cxx:813
 RooSimWSTool.cxx:814
 RooSimWSTool.cxx:815
 RooSimWSTool.cxx:816
 RooSimWSTool.cxx:817
 RooSimWSTool.cxx:818
 RooSimWSTool.cxx:819
 RooSimWSTool.cxx:820
 RooSimWSTool.cxx:821
 RooSimWSTool.cxx:822
 RooSimWSTool.cxx:823
 RooSimWSTool.cxx:824
 RooSimWSTool.cxx:825
 RooSimWSTool.cxx:826
 RooSimWSTool.cxx:827
 RooSimWSTool.cxx:828
 RooSimWSTool.cxx:829
 RooSimWSTool.cxx:830
 RooSimWSTool.cxx:831
 RooSimWSTool.cxx:832
 RooSimWSTool.cxx:833
 RooSimWSTool.cxx:834
 RooSimWSTool.cxx:835
 RooSimWSTool.cxx:836
 RooSimWSTool.cxx:837
 RooSimWSTool.cxx:838
 RooSimWSTool.cxx:839
 RooSimWSTool.cxx:840
 RooSimWSTool.cxx:841
 RooSimWSTool.cxx:842
 RooSimWSTool.cxx:843
 RooSimWSTool.cxx:844
 RooSimWSTool.cxx:845
 RooSimWSTool.cxx:846
 RooSimWSTool.cxx:847
 RooSimWSTool.cxx:848
 RooSimWSTool.cxx:849
 RooSimWSTool.cxx:850
 RooSimWSTool.cxx:851
 RooSimWSTool.cxx:852
 RooSimWSTool.cxx:853
 RooSimWSTool.cxx:854
 RooSimWSTool.cxx:855
 RooSimWSTool.cxx:856
 RooSimWSTool.cxx:857
 RooSimWSTool.cxx:858
 RooSimWSTool.cxx:859
 RooSimWSTool.cxx:860
 RooSimWSTool.cxx:861
 RooSimWSTool.cxx:862
 RooSimWSTool.cxx:863
 RooSimWSTool.cxx:864
 RooSimWSTool.cxx:865
 RooSimWSTool.cxx:866
 RooSimWSTool.cxx:867
 RooSimWSTool.cxx:868
 RooSimWSTool.cxx:869
 RooSimWSTool.cxx:870
 RooSimWSTool.cxx:871
 RooSimWSTool.cxx:872
 RooSimWSTool.cxx:873
 RooSimWSTool.cxx:874
 RooSimWSTool.cxx:875
 RooSimWSTool.cxx:876
 RooSimWSTool.cxx:877
 RooSimWSTool.cxx:878
 RooSimWSTool.cxx:879
 RooSimWSTool.cxx:880
 RooSimWSTool.cxx:881
 RooSimWSTool.cxx:882
 RooSimWSTool.cxx:883
 RooSimWSTool.cxx:884
 RooSimWSTool.cxx:885
 RooSimWSTool.cxx:886
 RooSimWSTool.cxx:887
 RooSimWSTool.cxx:888
 RooSimWSTool.cxx:889
 RooSimWSTool.cxx:890
 RooSimWSTool.cxx:891
 RooSimWSTool.cxx:892
 RooSimWSTool.cxx:893
 RooSimWSTool.cxx:894
 RooSimWSTool.cxx:895
 RooSimWSTool.cxx:896
 RooSimWSTool.cxx:897
 RooSimWSTool.cxx:898
 RooSimWSTool.cxx:899
 RooSimWSTool.cxx:900
 RooSimWSTool.cxx:901
 RooSimWSTool.cxx:902
 RooSimWSTool.cxx:903
 RooSimWSTool.cxx:904
 RooSimWSTool.cxx:905
 RooSimWSTool.cxx:906
 RooSimWSTool.cxx:907
 RooSimWSTool.cxx:908
 RooSimWSTool.cxx:909
 RooSimWSTool.cxx:910
 RooSimWSTool.cxx:911
 RooSimWSTool.cxx:912
 RooSimWSTool.cxx:913
 RooSimWSTool.cxx:914
 RooSimWSTool.cxx:915
 RooSimWSTool.cxx:916
 RooSimWSTool.cxx:917
 RooSimWSTool.cxx:918
 RooSimWSTool.cxx:919
 RooSimWSTool.cxx:920
 RooSimWSTool.cxx:921
 RooSimWSTool.cxx:922
 RooSimWSTool.cxx:923
 RooSimWSTool.cxx:924
 RooSimWSTool.cxx:925
 RooSimWSTool.cxx:926
 RooSimWSTool.cxx:927
 RooSimWSTool.cxx:928
 RooSimWSTool.cxx:929
 RooSimWSTool.cxx:930
 RooSimWSTool.cxx:931
 RooSimWSTool.cxx:932
 RooSimWSTool.cxx:933
 RooSimWSTool.cxx:934
 RooSimWSTool.cxx:935
 RooSimWSTool.cxx:936
 RooSimWSTool.cxx:937
 RooSimWSTool.cxx:938
 RooSimWSTool.cxx:939
 RooSimWSTool.cxx:940
 RooSimWSTool.cxx:941
 RooSimWSTool.cxx:942
 RooSimWSTool.cxx:943
 RooSimWSTool.cxx:944
 RooSimWSTool.cxx:945
 RooSimWSTool.cxx:946
 RooSimWSTool.cxx:947
 RooSimWSTool.cxx:948
 RooSimWSTool.cxx:949
 RooSimWSTool.cxx:950
 RooSimWSTool.cxx:951
 RooSimWSTool.cxx:952
 RooSimWSTool.cxx:953
 RooSimWSTool.cxx:954
 RooSimWSTool.cxx:955
 RooSimWSTool.cxx:956
 RooSimWSTool.cxx:957
 RooSimWSTool.cxx:958
 RooSimWSTool.cxx:959
 RooSimWSTool.cxx:960
 RooSimWSTool.cxx:961
 RooSimWSTool.cxx:962
 RooSimWSTool.cxx:963
 RooSimWSTool.cxx:964
 RooSimWSTool.cxx:965
 RooSimWSTool.cxx:966
 RooSimWSTool.cxx:967
 RooSimWSTool.cxx:968
 RooSimWSTool.cxx:969
 RooSimWSTool.cxx:970
 RooSimWSTool.cxx:971
 RooSimWSTool.cxx:972
 RooSimWSTool.cxx:973
 RooSimWSTool.cxx:974
 RooSimWSTool.cxx:975
 RooSimWSTool.cxx:976
 RooSimWSTool.cxx:977
 RooSimWSTool.cxx:978
 RooSimWSTool.cxx:979
 RooSimWSTool.cxx:980
 RooSimWSTool.cxx:981
 RooSimWSTool.cxx:982
 RooSimWSTool.cxx:983
 RooSimWSTool.cxx:984
 RooSimWSTool.cxx:985
 RooSimWSTool.cxx:986
 RooSimWSTool.cxx:987
 RooSimWSTool.cxx:988
 RooSimWSTool.cxx:989
 RooSimWSTool.cxx:990
 RooSimWSTool.cxx:991
 RooSimWSTool.cxx:992
 RooSimWSTool.cxx:993
 RooSimWSTool.cxx:994
 RooSimWSTool.cxx:995
 RooSimWSTool.cxx:996
 RooSimWSTool.cxx:997
 RooSimWSTool.cxx:998
 RooSimWSTool.cxx:999
 RooSimWSTool.cxx:1000
 RooSimWSTool.cxx:1001
 RooSimWSTool.cxx:1002
 RooSimWSTool.cxx:1003
 RooSimWSTool.cxx:1004
 RooSimWSTool.cxx:1005
 RooSimWSTool.cxx:1006
 RooSimWSTool.cxx:1007
 RooSimWSTool.cxx:1008
 RooSimWSTool.cxx:1009
 RooSimWSTool.cxx:1010
 RooSimWSTool.cxx:1011
 RooSimWSTool.cxx:1012
 RooSimWSTool.cxx:1013
 RooSimWSTool.cxx:1014
 RooSimWSTool.cxx:1015
 RooSimWSTool.cxx:1016
 RooSimWSTool.cxx:1017
 RooSimWSTool.cxx:1018
 RooSimWSTool.cxx:1019
 RooSimWSTool.cxx:1020
 RooSimWSTool.cxx:1021
 RooSimWSTool.cxx:1022