ROOT logo
/*****************************************************************************
 * Project: RooFit                                                           *
 * Package: RooFitCore                                                       *
 * @(#)root/roofitcore:$Id: RooMCStudy.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
// RooMCStudy is a help class to facilitate Monte Carlo studies
// such as 'goodness-of-fit' studies, that involve fitting a PDF 
// to multiple toy Monte Carlo sets generated from the same PDF 
// or another PDF.
// <p>
// Given a fit PDF and a generator PDF, RooMCStudy can produce
// large numbers of toyMC samples and/or fit these samples
// and acculumate the final parameters of each fit in a dataset.
// <p>
// Additional plotting routines simplify the task of plotting
// the distribution of the minimized likelihood, each parameters fitted value, 
// fitted error and pull distribution.
// <p>
// Class RooMCStudy provides the option to insert add-in modules
// that modify the generate and fit cycle and allow to perform
// extra steps in the cycle. Output of these modules can be stored
// alongside the fit results in the aggregate results dataset.
// These study modules should derive from classs RooAbsMCStudyModel
//
// END_HTML
//



#include "RooFit.h"
#include "Riostream.h"

#include "RooMCStudy.h"
#include "RooAbsMCStudyModule.h"

#include "RooGenContext.h"
#include "RooAbsPdf.h"
#include "RooDataSet.h"
#include "RooDataHist.h"
#include "RooRealVar.h"
#include "RooFitResult.h"
#include "RooErrorVar.h"
#include "RooFormulaVar.h"
#include "RooArgList.h"
#include "RooPlot.h"
#include "RooGenericPdf.h"
#include "RooRandom.h"
#include "RooCmdConfig.h"
#include "RooGlobalFunc.h"
#include "RooPullVar.h"
#include "RooMsgService.h"
#include "RooProdPdf.h"

using namespace std ;

ClassImp(RooMCStudy)
  ;


//_____________________________________________________________________________
RooMCStudy::RooMCStudy(const RooAbsPdf& model, const RooArgSet& observables,
   		       RooCmdArg arg1, RooCmdArg arg2,
   		       RooCmdArg arg3,RooCmdArg arg4,RooCmdArg arg5,
   		       RooCmdArg arg6,RooCmdArg arg7,RooCmdArg arg8) : TNamed("mcstudy","mcstudy")

{
  // Construct Monte Carlo Study Manager. This class automates generating data from a given PDF,
  // fitting the PDF to that data and accumulating the fit statistics.
  //
  // The constructor accepts the following arguments
  //
  // model       -- The PDF to be studied
  // observables -- The variables of the PDF to be considered the observables
  //
  // Silence()                         -- Suppress all RooFit messages during running below PROGRESS level
  // FitModel(const RooAbsPdf&)        -- The PDF for fitting, if it is different from the PDF for generating
  // ConditionalObservables
  //           (const RooArgSet& set)  -- The set of observables that the PDF should _not_ be normalized over
  // Binned(Bool_t flag)               -- Bin the dataset before fitting it. Speeds up fitting of large data samples
  // FitOptions(const char*)           -- Classic fit options, provided for backward compatibility
  // FitOptions(....)                  -- Options to be used for fitting. All named arguments inside FitOptions()
  //                                                   are passed to RooAbsPdf::fitTo();
  // Verbose(Bool_t flag)              -- Activate informational messages in event generation phase
  // Extended(Bool_t flag)             -- Determine number of events for each sample anew from a Poisson distribution
  // Constrain(const RooArgSet& pars)  -- Apply internal constraints on given parameters in fit and sample constrained parameter
  //                                      values from constraint p.d.f for each toy.
  // ExternalConstraints(const RooArgSet& ) -- Apply internal constraints on given parameters in fit and sample constrained parameter
  //                                      values from constraint p.d.f for each toy.
  // ProtoData(const RooDataSet&, 
  //                 Bool_t randOrder) -- Prototype data for the event generation. If the randOrder flag is
  //                                      set, the order of the dataset will be re-randomized for each generation
  //                                      cycle to protect against systematic biases if the number of generated
  //                                      events does not exactly match the number of events in the prototype dataset
  //                                      at the cost of reduced precision
  //                                      with mu equal to the specified number of events

  // Stuff all arguments in a list
  RooLinkedList cmdList;
  cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;

  // Select the pdf-specific commands 
  RooCmdConfig pc(Form("RooMCStudy::RooMCStudy(%s)",model.GetName())) ;
  
  pc.defineObject("fitModel","FitModel",0,0) ;
  pc.defineObject("condObs","ProjectedDependents",0,0) ;
  pc.defineObject("protoData","PrototypeData",0,0) ;
  pc.defineObject("cPars","Constrain",0,0) ;
  pc.defineObject("extCons","ExternalConstraints",0,0) ;
  pc.defineInt("silence","Silence",0,0) ;
  pc.defineInt("randProtoData","PrototypeData",0,0) ;
  pc.defineInt("verboseGen","Verbose",0,0) ;
  pc.defineInt("extendedGen","Extended",0,0) ;
  pc.defineInt("binGenData","Binned",0,0) ;
  pc.defineString("fitOpts","FitOptions",0,"") ;
  pc.defineInt("dummy","FitOptArgs",0,0) ;
  pc.defineMutex("FitOptions","FitOptArgs") ; // can have either classic or new-style fit options
  pc.defineMutex("Constrain","FitOptions") ; // constraints only work with new-style fit options
  pc.defineMutex("ExternalConstraints","FitOptions") ; // constraints only work with new-style fit options
  
  // Process and check varargs 
  pc.process(cmdList) ;
  if (!pc.ok(kTRUE)) {
    // WVE do something here
    return ;
  }
  
  // Save fit command options
  if (pc.hasProcessed("FitOptArgs")) {
    RooCmdArg* fitOptArg = static_cast<RooCmdArg*>(cmdList.FindObject("FitOptArgs")) ;
    for (Int_t i=0 ; i<fitOptArg->subArgs().GetSize() ;i++) {
      _fitOptList.Add(new RooCmdArg(static_cast<RooCmdArg&>(*fitOptArg->subArgs().At(i)))) ;
    }
  }

  // Decode command line arguments
  _silence = pc.getInt("silence") ;
  _verboseGen = pc.getInt("verboseGen") ;
  _extendedGen = pc.getInt("extendedGen") ;
  _binGenData = pc.getInt("binGenData") ;
  _randProto = pc.getInt("randProtoData") ;

  // Process constraints specifications
  const RooArgSet* cPars = static_cast<RooArgSet*>(pc.getObject("cPars")) ;
  const RooArgSet* extCons = static_cast<RooArgSet*>(pc.getObject("extCons")) ;
  
  // If constraints are specified, add to fit options
  if (cPars) {
    _fitOptList.Add(RooFit::Constrain(*cPars).Clone()) ;
  }
  if (extCons) {
    _fitOptList.Add(RooFit::ExternalConstraints(*extCons).Clone()) ;
  }

  // Make list of all constraints
  RooArgSet allConstraints ;
  RooArgSet consPars ;
  if (cPars) {
    RooArgSet* constraints = model.getConstraints(observables,*cPars) ;
    allConstraints.add(*constraints) ;
    delete constraints ;
  }

  // Construct constraint p.d.f
  if (allConstraints.getSize()>0) {
    _constrPdf = new RooProdPdf("mcs_constr_prod","RooMCStudy constraints product",allConstraints) ;

    if (cPars) {
      consPars.add(*cPars) ;
    } else {
      RooArgSet* params = model.getParameters(observables) ;
      RooArgSet* cparams = _constrPdf->getObservables(*params) ;
      consPars.add(*cparams) ;
      delete params ;
      delete cparams ;
    }
    _constrGenContext = _constrPdf->genContext(consPars,0,0,_verboseGen) ;

    _perExptGenParams = kTRUE ;

  } else {
    _constrPdf = 0 ;
    _constrGenContext=0 ;

    _perExptGenParams = kFALSE ;
  }
  
  // Extract generator and fit models
  _genModel = const_cast<RooAbsPdf*>(&model) ;
  RooAbsPdf* fitModel = static_cast<RooAbsPdf*>(pc.getObject("fitModel",0)) ;
  _fitModel = fitModel ? fitModel : _genModel ;
  
  // Extract conditional observables and prototype data
  _genProtoData = static_cast<RooDataSet*>(pc.getObject("protoData",0)) ;
  if (pc.getObject("condObs",0)) {
    _projDeps.add(static_cast<RooArgSet&>(*pc.getObject("condObs",0))) ;
  }
  
  _dependents.add(observables) ;
     
  _allDependents.add(_dependents) ;  
  _fitOptions = pc.getString("fitOpts") ;
  _canAddFitResults = kTRUE ;
  
  if (_extendedGen && _genProtoData && !_randProto) {
    oocoutW(_fitModel,Generation) << "RooMCStudy::RooMCStudy: WARNING Using generator option 'e' (Poisson distribution of #events) together " << endl
				  << "                        with a prototype dataset implies incomplete sampling or oversampling of proto data." << endl
				  << "                        Use option \"r\" to randomize prototype dataset order and thus to randomize" << endl
				  << "                        the set of over/undersampled prototype events for each generation cycle." << endl ;
  }
  
  _genParams = _genModel->getParameters(&_dependents) ;
  if (!_binGenData) {
    _genContext = _genModel->genContext(_dependents,_genProtoData,0,_verboseGen) ;
    _genContext->attach(*_genParams) ;
  } else {
    _genContext = 0 ;
  }

  _genInitParams = (RooArgSet*) _genParams->snapshot(kFALSE) ;

  // Store list of parameters and save initial values separately
  _fitParams = _fitModel->getParameters(&_dependents) ;
  _fitInitParams = (RooArgSet*) _fitParams->snapshot(kTRUE) ;
  
  _nExpGen = _extendedGen ? _genModel->expectedEvents(&_dependents) : 0 ;
  
  // Place holder for NLL
  _nllVar = new RooRealVar("NLL","-log(Likelihood)",0) ;

  // Place holder for number of generated events
  _ngenVar = new RooRealVar("ngen","number of generated events",0) ;
  
  // Create data set containing parameter values, errors and pulls
  RooArgSet tmp2(*_fitParams) ;
  tmp2.add(*_nllVar) ;
  tmp2.add(*_ngenVar) ;

  // Mark all variable to store their errors in the dataset
  tmp2.setAttribAll("StoreError",kTRUE) ;
  tmp2.setAttribAll("StoreAsymError",kTRUE) ;
  TString fpdName ;
  if (_fitModel==_genModel) {
    fpdName = Form("fitParData_%s",_fitModel->GetName()) ;
  } else {
    fpdName= Form("fitParData_%s_%s",_fitModel->GetName(),_genModel->GetName()) ;
  }

  _fitParData = new RooDataSet(fpdName.Data(),"Fit Parameters DataSet",tmp2) ;
  tmp2.setAttribAll("StoreError",kFALSE) ;
  tmp2.setAttribAll("StoreAsymError",kFALSE) ;

  if (_perExptGenParams) {
    _genParData = new RooDataSet("genParData","Generated Parameters dataset",*_genParams) ;
  } else {
    _genParData = 0 ;
  }
  
  // Append proto variables to allDependents
  if (_genProtoData) {
    _allDependents.add(*_genProtoData->get(),kTRUE) ;
  }

  // Call module initializers
  list<RooAbsMCStudyModule*>::iterator iter ;
  for (iter=_modList.begin() ; iter!= _modList.end() ; ++iter) {
    Bool_t ok = (*iter)->doInitializeInstance(*this) ;
    if (!ok) {
      oocoutE(_fitModel,Generation) << "RooMCStudy::ctor: removing study module " << (*iter)->GetName() << " from analysis chain because initialization failed" << endl ;
      iter = _modList.erase(iter) ;
    }
  }
  
}


//_____________________________________________________________________________
RooMCStudy::RooMCStudy(const RooAbsPdf& genModel, const RooAbsPdf& fitModel, 
   		       const RooArgSet& dependents, const char* genOptions, 
   		       const char* fitOptions, const RooDataSet* genProtoData, 
   		       const RooArgSet& projDeps) :
  TNamed("mcstudy","mcstudy"),
  _genModel((RooAbsPdf*)&genModel), 
  _genProtoData(genProtoData),
  _projDeps(projDeps),
  _constrPdf(0),
  _constrGenContext(0),
  _dependents(dependents), 
  _allDependents(dependents), 
  _fitModel((RooAbsPdf*)&fitModel), 
  _nllVar(0),
  _ngenVar(0),
  _genParData(0),
  _fitOptions(fitOptions),
  _canAddFitResults(kTRUE),
  _perExptGenParams(0)
{
  // OBSOLETE, RETAINED FOR BACKWARD COMPATIBILY. PLEASE
  // USE CONSTRUCTOR WITH NAMED ARGUMENTS
  //
  // Constructor with a generator and fit model. Both models may point
  // to the same object. The 'dependents' set of variables is generated 
  // in the generator phase. The optional prototype dataset is passed to
  // the generator
  //
  // Available generator options
  //  v  - Verbose
  //  e  - Extended: use Poisson distribution for Nevts generated
  //
  // Available fit options
  //  See RooAbsPdf::fitTo()
  //
  
  // Decode generator options
  TString genOpt(genOptions) ;
  genOpt.ToLower() ;
  _verboseGen = genOpt.Contains("v") ;
  _extendedGen = genOpt.Contains("e") ;
  _binGenData = genOpt.Contains("b") ;
  _randProto = genOpt.Contains("r") ;
  
  if (_extendedGen && genProtoData && !_randProto) {
    oocoutE(_fitModel,Generation) << "RooMCStudy::RooMCStudy: WARNING Using generator option 'e' (Poisson distribution of #events) together " << endl
				  << "                        with a prototype dataset implies incomplete sampling or oversampling of proto data." << endl
				  << "                        Use option \"r\" to randomize prototype dataset order and thus to randomize" << endl
				  << "                        the set of over/undersampled prototype events for each generation cycle." << endl ;
  }
  
  if (!_binGenData) {
    _genContext = genModel.genContext(dependents,genProtoData,0,_verboseGen) ;
  } else {
    _genContext = 0 ;
  }
  _genParams = _genModel->getParameters(&_dependents) ;
  RooArgSet* tmp = genModel.getParameters(&dependents) ;
  _genInitParams = (RooArgSet*) tmp->snapshot(kFALSE) ;
  delete tmp ;
  
  // Store list of parameters and save initial values separately
  _fitParams = fitModel.getParameters(&dependents) ;
  _fitInitParams = (RooArgSet*) _fitParams->snapshot(kTRUE) ;
  
  _nExpGen = _extendedGen ? genModel.expectedEvents(&dependents) : 0 ;
  
  // Place holder for NLL
  _nllVar = new RooRealVar("NLL","-log(Likelihood)",0) ;
  
  // Place holder for number of generated events
  _ngenVar = new RooRealVar("ngen","number of generated events",0) ;
  
  // Create data set containing parameter values, errors and pulls
  RooArgSet tmp2(*_fitParams) ;
  tmp2.add(*_nllVar) ;
  tmp2.add(*_ngenVar) ;
  
  // Mark all variable to store their errors in the dataset
  tmp2.setAttribAll("StoreError",kTRUE) ;
  tmp2.setAttribAll("StoreAsymError",kTRUE) ;
  _fitParData = new RooDataSet("fitParData","Fit Parameters DataSet",tmp2) ;
  tmp2.setAttribAll("StoreError",kFALSE) ;
  tmp2.setAttribAll("StoreAsymError",kFALSE) ;
  
  // Append proto variables to allDependents
  if (genProtoData) {
    _allDependents.add(*genProtoData->get(),kTRUE) ;
  }

  // Call module initializers
  list<RooAbsMCStudyModule*>::iterator iter ;
  for (iter=_modList.begin() ; iter!= _modList.end() ; ++iter) {
    Bool_t ok = (*iter)->doInitializeInstance(*this) ;
    if (!ok) {
      oocoutE(_fitModel,Generation) << "RooMCStudy::ctor: removing study module " << (*iter)->GetName() << " from analysis chain because initialization failed" << endl ;
      iter = _modList.erase(iter) ;
    }
  }
  
}



//_____________________________________________________________________________
RooMCStudy::~RooMCStudy() 
{  
  // Destructor 
  
  _genDataList.Delete() ;
  _fitResList.Delete() ;
  _fitOptList.Delete() ;
  delete _ngenVar ;
  delete _fitParData ;
  delete _genParData ;
  delete _fitInitParams ;
  delete _fitParams ;
  delete _genInitParams ;
  delete _genParams ;
  delete _genContext ;
  delete _nllVar ;
  delete _constrPdf ;
  delete _constrGenContext ;
}



//_____________________________________________________________________________
void RooMCStudy::addModule(RooAbsMCStudyModule& module) 
{
  // Insert given RooMCStudy add-on module to the processing chain
  // of this MCStudy object

  module.doInitializeInstance(*this) ;
  _modList.push_back(&module) ;        
}



//_____________________________________________________________________________
Bool_t RooMCStudy::run(Bool_t doGenerate, Bool_t DoFit, Int_t nSamples, Int_t nEvtPerSample, Bool_t keepGenData, const char* asciiFilePat) 
{
  // Run engine method. Generate and/or fit, according to flags, 'nSamples' samples of 'nEvtPerSample' events.
  // If keepGenData is set, all generated data sets will be kept in memory and can be accessed
  // later via genData().
  //
  // When generating, data sets will be written out in ascii form if the pattern string is supplied
  // The pattern, which is a template for sprintf, should look something like "data/toymc_%04d.dat"
  // and should contain one integer field that encodes the sample serial number.
  //
  // When fitting only, data sets may optionally be read from ascii files, using the same file
  // pattern.
  //

  RooFit::MsgLevel oldLevel(RooFit::FATAL) ;
  if (_silence) {
    oldLevel = RooMsgService::instance().globalKillBelow() ;
    RooMsgService::instance().setGlobalKillBelow(RooFit::PROGRESS) ;
  }

  list<RooAbsMCStudyModule*>::iterator iter ;
  for (iter=_modList.begin() ; iter!= _modList.end() ; ++iter) {
    (*iter)->initializeRun(nSamples) ;
  }  
  
  Int_t prescale = nSamples>100 ? Int_t(nSamples/100) : 1 ;

  while(nSamples--) {
    
    if (nSamples%prescale==0) {
      oocoutP(_fitModel,Generation) << "RooMCStudy::run: " ;
      if (doGenerate) ooccoutI(_fitModel,Generation) << "Generating " ;
      if (doGenerate && DoFit) ooccoutI(_fitModel,Generation) << "and " ;
      if (DoFit) ooccoutI(_fitModel,Generation) << "fitting " ;
      ooccoutP(_fitModel,Generation) << "sample " << nSamples << endl ;
    }

    _genSample = 0;
    Bool_t existingData = kFALSE ;
    if (doGenerate) {
      // Generate sample
      Int_t nEvt(nEvtPerSample) ;

      // Reset generator parameters to initial values
      *_genParams = *_genInitParams ;

      // If constraints are present, sample generator values from constraints
      if (_constrPdf) {
	RooDataSet* tmp = _constrGenContext->generate(1) ;
	*_genParams = *tmp->get() ;
	delete tmp ;
      }

      // Save generated parameters if required
      if (_genParData) {
	_genParData->add(*_genParams) ;
      }

      // Call module before-generation hook
      list<RooAbsMCStudyModule*>::iterator iter2 ;
      for (iter2=_modList.begin() ; iter2!= _modList.end() ; ++iter2) {
	(*iter2)->processBeforeGen(nSamples) ;
      }  

      if (_binGenData) {

	// Binned generation
	_genSample = _genModel->generateBinned(_dependents,nEvtPerSample) ;

      } else {

	// Calculate the number of (extended) events for this run
	if (_extendedGen) {
	  _nExpGen = _genModel->expectedEvents(&_dependents) ;
	  nEvt = RooRandom::randomGenerator()->Poisson(nEvtPerSample==0?_nExpGen:nEvtPerSample) ;
	}
	
	// Optional randomization of protodata for this run
	if (_randProto && _genProtoData && _genProtoData->numEntries()!=nEvt) {
	  oocoutI(_fitModel,Generation) << "RooMCStudy: (Re)randomizing event order in prototype dataset (Nevt=" << nEvt << ")" << endl ;
	  Int_t* newOrder = _genModel->randomizeProtoOrder(_genProtoData->numEntries(),nEvt) ;
	  _genContext->setProtoDataOrder(newOrder) ;
	  delete[] newOrder ;
	}
	
	// Actual generation of events
	_genSample = _genContext->generate(nEvt) ;
      } 

	
    //} else if (asciiFilePat && &asciiFilePat) { //warning: the address of 'asciiFilePat' will always evaluate as 'true'
    } else if (asciiFilePat) {

      // Load sample from ASCII file
      char asciiFile[1024] ;
      sprintf(asciiFile,asciiFilePat,nSamples) ;
      RooArgList depList(_allDependents) ;
      _genSample = RooDataSet::read(asciiFile,depList,"q") ;      
      
    } else {
      
      // Load sample from internal list
      _genSample = (RooDataSet*) _genDataList.At(nSamples) ;
      existingData = kTRUE ;
      if (!_genSample) {
   	oocoutW(_fitModel,Generation) << "RooMCStudy::run: WARNING: Sample #" << nSamples << " not loaded, skipping" << endl ;
   	continue ;
      }
    }

    // Save number of generated events
    _ngenVar->setVal(_genSample->sumEntries()) ;

    // Call module between generation and fitting hook
    list<RooAbsMCStudyModule*>::iterator iter3 ;
    for (iter3=_modList.begin() ; iter3!= _modList.end() ; ++iter3) {
      (*iter3)->processBetweenGenAndFit(nSamples) ;
    }  
    
    if (DoFit) fitSample(_genSample) ;

    // Call module between generation and fitting hook
    for (iter3=_modList.begin() ; iter3!= _modList.end() ; ++iter3) {
      (*iter3)->processAfterFit(nSamples) ;
    }  
    
    // Optionally write to ascii file
    if (doGenerate && asciiFilePat && *asciiFilePat) {
      char asciiFile[1024] ;
      sprintf(asciiFile,asciiFilePat,nSamples) ;
      RooDataSet* unbinnedData = dynamic_cast<RooDataSet*>(_genSample) ;
      if (unbinnedData) {
	unbinnedData->write(asciiFile) ;
      } else {
	coutE(InputArguments) << "RooMCStudy::run(" << GetName() << ") ERROR: ASCII writing of binned datasets is not supported" << endl ;
      }
    }
    
    // Add to list or delete
    if (!existingData) {
      if (keepGenData) {
	_genDataList.Add(_genSample) ;
      } else {
	delete _genSample ;
      }
    }
  }

  for (iter=_modList.begin() ; iter!= _modList.end() ; ++iter) {
    RooDataSet* auxData = (*iter)->finalizeRun() ;
    if (auxData) {
      _fitParData->merge(auxData) ;
    }
  }  

  _canAddFitResults = kFALSE ;

  if (_genParData) {
    const RooArgSet* genPars = _genParData->get() ;
    TIterator* iter2 = genPars->createIterator() ;
    RooAbsArg* arg ;
    while((arg=(RooAbsArg*)iter2->Next())) {
      _genParData->changeObservableName(arg->GetName(),Form("%s_gen",arg->GetName())) ;
    }
    delete iter2 ;
    
    _fitParData->merge(_genParData) ;
  }

  if (DoFit) calcPulls() ;

  if (_silence) {
    RooMsgService::instance().setGlobalKillBelow(oldLevel) ;
  }

  return kFALSE ;
}






//_____________________________________________________________________________
Bool_t RooMCStudy::generateAndFit(Int_t nSamples, Int_t nEvtPerSample, Bool_t keepGenData, const char* asciiFilePat) 
{
  // Generate and fit 'nSamples' samples of 'nEvtPerSample' events.
  // If keepGenData is set, all generated data sets will be kept in memory and can be accessed
  // later via genData().
  //
  // Data sets will be written out is ascii form if the pattern string is supplied.
  // The pattern, which is a template for sprintf, should look something like "data/toymc_%04d.dat"
  // and should contain one integer field that encodes the sample serial number.
  //
  
  // Clear any previous data in memory
  _fitResList.Delete() ;
  _genDataList.Delete() ;
  _fitParData->reset() ;
  
  return run(kTRUE,kTRUE,nSamples,nEvtPerSample,keepGenData,asciiFilePat) ;
}



//_____________________________________________________________________________
Bool_t RooMCStudy::generate(Int_t nSamples, Int_t nEvtPerSample, Bool_t keepGenData, const char* asciiFilePat) 
{
  // Generate 'nSamples' samples of 'nEvtPerSample' events.
  // If keepGenData is set, all generated data sets will be kept in memory 
  // and can be accessed later via genData().
  //
  // Data sets will be written out in ascii form if the pattern string is supplied.
  // The pattern, which is a template for sprintf, should look something like "data/toymc_%04d.dat"
  // and should contain one integer field that encodes the sample serial number.
  //
  
  // Clear any previous data in memory
  _genDataList.Delete() ;
  
  return run(kTRUE,kFALSE,nSamples,nEvtPerSample,keepGenData,asciiFilePat) ;
}



//_____________________________________________________________________________
Bool_t RooMCStudy::fit(Int_t nSamples, const char* asciiFilePat) 
{
  // Fit 'nSamples' datasets, which are read from ASCII files.
  //
  // The ascii file pattern, which is a template for sprintf, should look something like "data/toymc_%04d.dat"
  // and should contain one integer field that encodes the sample serial number.
  //
  
  // Clear any previous data in memory
  _fitResList.Delete() ;
  _fitParData->reset() ;
  
  return run(kFALSE,kTRUE,nSamples,0,kFALSE,asciiFilePat) ;
}



//_____________________________________________________________________________
Bool_t RooMCStudy::fit(Int_t nSamples, TList& dataSetList) 
{
  // Fit 'nSamples' datasets, as supplied in 'dataSetList'
  // 
  
  // Clear any previous data in memory
  _fitResList.Delete() ;
  _genDataList.Delete() ;
  _fitParData->reset() ;
  
  // Load list of data sets
  TIterator* iter = dataSetList.MakeIterator() ;
  RooAbsData* gset ;
  while((gset=(RooAbsData*)iter->Next())) {
    _genDataList.Add(gset) ;
  }
  delete iter ;
  
  return run(kFALSE,kTRUE,nSamples,0,kTRUE,0) ;
}



//_____________________________________________________________________________
void RooMCStudy::resetFitParams()
{
  // Reset all fit parameters to the initial model
  // parameters at the time of the RooMCStudy constructor

  *_fitParams = *_fitInitParams ;
}



//_____________________________________________________________________________
RooFitResult* RooMCStudy::doFit(RooAbsData* genSample)
{
  // Internal function. Performs actual fit according to specifications

  // Fit model to data set
  TString fitOpt2(_fitOptions) ; fitOpt2.Append("r") ;
  if (_silence) {
    fitOpt2.Append("b") ;
  }
  
  // Optionally bin dataset before fitting
  RooAbsData* data ;
  if (_binGenData) {    
    RooArgSet* depList = _fitModel->getObservables(genSample) ;
    data = new RooDataHist(genSample->GetName(),genSample->GetTitle(),*depList,*genSample) ;
    delete depList ;
  } else {
    data = genSample ;
  }
  
  RooFitResult* fr ;
  if (_fitOptList.GetSize()==0) {
    if (_projDeps.getSize()>0) {
      fr = (RooFitResult*) _fitModel->fitTo(*data,RooFit::ConditionalObservables(_projDeps),RooFit::FitOptions(fitOpt2)) ;
    } else {
      fr = (RooFitResult*) _fitModel->fitTo(*data,RooFit::FitOptions(fitOpt2)) ;
    }
  } else {
    RooCmdArg save  = RooFit::Save() ;
    RooCmdArg condo = RooFit::ConditionalObservables(_projDeps) ;
    RooCmdArg plevel = RooFit::PrintLevel(-1) ;
    RooLinkedList fitOptList(_fitOptList) ;
    fitOptList.Add(&save) ;
    if (_projDeps.getSize()>0) {
      fitOptList.Add(&condo) ;
    }
    if (_silence) {
      fitOptList.Add(&plevel) ;
    }
    fr = (RooFitResult*) _fitModel->fitTo(*data,fitOptList) ;
  }

  if (_binGenData) delete data ;

  return fr ;
}



//_____________________________________________________________________________
RooFitResult* RooMCStudy::refit(RooAbsData* genSample) 
{
  // Redo fit on 'current' toy sample, or if genSample is not NULL
  // do fit on given sample instead

  if (!genSample) {
    genSample = _genSample ;
  }

  RooFitResult* fr = doFit(genSample) ;
    
  return fr ;
}



//_____________________________________________________________________________
Bool_t RooMCStudy::fitSample(RooAbsData* genSample) 
{  
  // Internal method. Fit given dataset with fit model. If fit
  // converges (TMinuit status code zero) The fit results are appended
  // to the fit results dataset
  //
  // If the fit option "r" is supplied, the RooFitResult
  // objects will always be saved, regardless of the
  // fit status. RooFitResults objects can be retrieved
  // later via fitResult().
  //  
  
  // Reset all fit parameters to their initial values  
  resetFitParams() ;

  // Perform actual fit
  RooFitResult* fr = doFit(genSample) ;

  // If fit converged, store parameters and NLL
  Bool_t ok = (fr->status()==0) ;
  if (ok) {
    _nllVar->setVal(fr->minNll()) ;
    RooArgSet tmp(*_fitParams) ;
    tmp.add(*_nllVar) ;
    tmp.add(*_ngenVar) ;
    _fitParData->add(tmp) ;
  }
  
  // Store fit result if requested by user
  Bool_t userSaveRequest = kFALSE ;
  if (_fitOptList.GetSize()>0) {
    if (_fitOptList.FindObject("Save")) userSaveRequest = kTRUE ;
  } else {
    if (_fitOptions.Contains("r")) userSaveRequest = kTRUE ;
  }

  if (userSaveRequest) {
    _fitResList.Add(fr) ;
  } else {
    delete fr ;
  }
    
  return !ok ;
}



//_____________________________________________________________________________
Bool_t RooMCStudy::addFitResult(const RooFitResult& fr) 
{  
  // Utility function to add fit result from external fit to this RooMCStudy
  // and process its results through the standard RooMCStudy statistics gathering tools.
  // This function allows users to run the toy MC generation and/or fitting
  // in a distributed way and to collect and analyze the results in a RooMCStudy
  // as if they were run locally.
  //
  // This method is only functional if this RooMCStudy object is cleanm, i.e. it was not used
  // to generate and/or fit any samples.

  if (!_canAddFitResults) {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::addFitResult: ERROR cannot add fit results in current state" << endl ;
    return kTRUE ;
  }
  
  // Transfer contents of fit result to fitParams ;
  *_fitParams = RooArgSet(fr.floatParsFinal()) ;
  
  // If fit converged, store parameters and NLL
  Bool_t ok = (fr.status()==0) ;
  if (ok) {
    _nllVar->setVal(fr.minNll()) ;
    RooArgSet tmp(*_fitParams) ;
    tmp.add(*_nllVar) ;
    tmp.add(*_ngenVar) ;
    _fitParData->add(tmp) ;
  }
  
  // Store fit result if requested by user
  if (_fitOptions.Contains("r")) {
    _fitResList.Add((TObject*)&fr) ;
  }  
  
  return kFALSE ;
}



//_____________________________________________________________________________
void RooMCStudy::calcPulls() 
{
  // Calculate the pulls for all fit parameters in
  // the fit results data set, and add them to that dataset
  
  TIterator* iter = _fitParams->createIterator()  ;
  RooRealVar* par ;
  while((par=(RooRealVar*)iter->Next())) {
    
    RooErrorVar* err = par->errorVar() ;
    _fitParData->addColumn(*err) ;
    delete err ;
    
    TString name(par->GetName()), title(par->GetTitle()) ;
    name.Append("pull") ;
    title.Append(" Pull") ;    

    // First look in fitParDataset to see if per-experiment generated value has been stored
    RooAbsReal* genParOrig = (RooAbsReal*) _fitParData->get()->find(Form("%s_gen",par->GetName())) ;    
    if (genParOrig && _perExptGenParams) {

      RooPullVar pull(name,title,*par,*genParOrig) ;
      _fitParData->addColumn(pull,kFALSE) ;

    } else {
      // If not use fixed generator value
      genParOrig = (RooAbsReal*)_genInitParams->find(par->GetName()) ;
      
      if (genParOrig) {
	RooAbsReal* genPar = (RooAbsReal*) genParOrig->Clone("truth") ;
	RooPullVar pull(name,title,*par,*genPar) ;
	
	_fitParData->addColumn(pull,kFALSE) ;
	delete genPar ;
	
      }

    }

  }
  delete iter ;
  
}




//_____________________________________________________________________________
const RooDataSet& RooMCStudy::fitParDataSet()
{
  // Return a RooDataSet the resulting fit parameters of each toy cycle.
  // This dataset also contains any additional output that was generated
  // by study modules that were added to this RooMCStudy

  if (_canAddFitResults) {
    calcPulls() ;  
    _canAddFitResults = kFALSE ; 
  }
  
  return *_fitParData ;
}



//_____________________________________________________________________________
const RooArgSet* RooMCStudy::fitParams(Int_t sampleNum) const 
{
  // Return an argset with the fit parameters for the given sample number
  //
  // NB: The fit parameters are only stored for successfull fits,
  //     thus the maximum sampleNum can be less that the number
  //     of generated samples and if so, the indeces will
  //     be out of synch with genData() and fitResult()
  
  // Check if sampleNum is in range
  if (sampleNum<0 || sampleNum>=_fitParData->numEntries()) {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::fitParams: ERROR, invalid sample number: " << sampleNum << endl ;    
    return 0 ;
  }
  
  return _fitParData->get(sampleNum) ;
}



//_____________________________________________________________________________
const RooFitResult* RooMCStudy::fitResult(Int_t sampleNum) const
{
  // Return the RooFitResult object of the fit to given sample 
  
  // Check if sampleNum is in range
  if (sampleNum<0 || sampleNum>=_fitResList.GetSize()) {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::fitResult: ERROR, invalid sample number: " << sampleNum << endl ;    
    return 0 ;
  }
  
  // Retrieve fit result object
  const RooFitResult* fr = (RooFitResult*) _fitResList.At(sampleNum) ;
  if (fr) {
    return fr ;
  } else {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::fitResult: ERROR, no fit result saved for sample " 
			  << sampleNum << ", did you use the 'r; fit option?" << endl ;
  }
  return 0 ;
}



//_____________________________________________________________________________
const RooDataSet* RooMCStudy::genData(Int_t sampleNum) const 
{
  // Return the given generated dataset. This method will only return datasets
  // if during the run cycle it was indicated that generator data should be saved.
  
  // Check that generated data was saved
  if (_genDataList.GetSize()==0) {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::genData() ERROR, generated data was not saved" << endl ;
    return 0 ;
  }
  
  // Check if sampleNum is in range
  if (sampleNum<0 || sampleNum>=_genDataList.GetSize()) {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::genData() ERROR, invalid sample number: " << sampleNum << endl ;    
    return 0 ;
  }
  
  return (RooDataSet*) _genDataList.At(sampleNum) ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotParamOn(RooPlot* frame, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3, const RooCmdArg& arg4, 
   				 const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) 
{
  // Plot the distribution of fitted values of a parameter. The parameter shown is the one from which the RooPlot
  // was created, e.g.
  //
  // RooPlot* frame = param.frame(100,-10,10) ;
  // mcstudy.paramOn(frame,LineStyle(kDashed)) ;
  // 
  // Any named arguments passed to plotParamOn() are forwarded to the underlying plotOn() call
  
  _fitParData->plotOn(frame,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
  return frame ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotParam(const char* paramName, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3, const RooCmdArg& arg4, 
   			       const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) 
{
  // Plot the distribution of the fitted value of the given parameter on a newly created frame.
  //
  // This function accepts the following optional arguments
  // FrameRange(double lo, double hi) -- Set range of frame to given specification
  // FrameBins(int bins)              -- Set default number of bins of frame to given number
  // Frame(...)                       -- Pass supplied named arguments to RooAbsRealLValue::frame() function. See frame() function
  //                                     for list of allowed arguments
  //
  // If no frame specifications are given, the AutoRange() feature will be used to set the range
  // Any other named argument is passed to the RooAbsData::plotOn() call. See that function for allowed options


  // Find parameter in fitParDataSet
  RooRealVar* param = static_cast<RooRealVar*>(_fitParData->get()->find(paramName)) ;
  if (!param) {
    oocoutE(_fitModel,InputArguments) << "RooMCStudy::plotParam: ERROR: no parameter defined with name " << paramName << endl ;  
    return 0 ;
  }

  // Forward to implementation below
  return plotParam(*param,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotParam(const RooRealVar& param, const RooCmdArg& arg1, const RooCmdArg& arg2, const RooCmdArg& arg3, const RooCmdArg& arg4, 
   			       const RooCmdArg& arg5, const RooCmdArg& arg6, const RooCmdArg& arg7, const RooCmdArg& arg8) 
{
  // Plot the distribution of the fitted value of the given parameter on a newly created frame.
  //
  // This function accepts the following optional arguments
  // FrameRange(double lo, double hi) -- Set range of frame to given specification
  // FrameBins(int bins)              -- Set default number of bins of frame to given number
  // Frame(...)                       -- Pass supplied named arguments to RooAbsRealLValue::frame() function. See frame() function
  //                                     for list of allowed arguments
  //
  // If no frame specifications are given, the AutoRange() feature will be used to set the range
  // Any other named argument is passed to the RooAbsData::plotOn() call. See that function for allowed options

  // Stuff all arguments in a list
  RooLinkedList cmdList;
  cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;
  
  RooPlot* frame = makeFrameAndPlotCmd(param, cmdList) ;
  if (frame) {
    _fitParData->plotOn(frame, cmdList) ;
  }

  return frame ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotNLL(const RooCmdArg& arg1, const RooCmdArg& arg2,
                     const RooCmdArg& arg3, const RooCmdArg& arg4,
                     const RooCmdArg& arg5, const RooCmdArg& arg6,
                     const RooCmdArg& arg7, const RooCmdArg& arg8) 
{
  // Plot the distribution of the -log(L) values on a newly created frame.
  //
  // This function accepts the following optional arguments
  // FrameRange(double lo, double hi) -- Set range of frame to given specification
  // FrameBins(int bins)              -- Set default number of bins of frame to given number
  // Frame(...)                       -- Pass supplied named arguments to RooAbsRealLValue::frame() function. See frame() function
  //                                     for list of allowed arguments
  //
  // If no frame specifications are given, the AutoRange() feature will be used to set the range
  // Any other named argument is passed to the RooAbsData::plotOn() call. See that function for allowed options

  return plotParam(*_nllVar,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotError(const RooRealVar& param, const RooCmdArg& arg1, const RooCmdArg& arg2,
                     const RooCmdArg& arg3, const RooCmdArg& arg4,
                     const RooCmdArg& arg5, const RooCmdArg& arg6,
                     const RooCmdArg& arg7, const RooCmdArg& arg8) 
{
  // Plot the distribution of the fit errors for the specified parameter on a newly created frame.
  //
  // This function accepts the following optional arguments
  // FrameRange(double lo, double hi) -- Set range of frame to given specification
  // FrameBins(int bins)              -- Set default number of bins of frame to given number
  // Frame(...)                       -- Pass supplied named arguments to RooAbsRealLValue::frame() function. See frame() function
  //                                     for list of allowed arguments
  //
  // If no frame specifications are given, the AutoRange() feature will be used to set the range
  // Any other named argument is passed to the RooAbsData::plotOn() call. See that function for allowed options

  if (_canAddFitResults) {
    calcPulls() ;
    _canAddFitResults=kFALSE ;
  }

  RooErrorVar* evar = param.errorVar() ;
  RooRealVar* evar_rrv = static_cast<RooRealVar*>(evar->createFundamental()) ;
  RooPlot* frame = plotParam(*evar_rrv,arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8) ;
  delete evar_rrv ;
  delete evar ;
  return frame ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotPull(const RooRealVar& param, const RooCmdArg& arg1, const RooCmdArg& arg2,
                     const RooCmdArg& arg3, const RooCmdArg& arg4,
                     const RooCmdArg& arg5, const RooCmdArg& arg6,
                     const RooCmdArg& arg7, const RooCmdArg& arg8) 
{
  // Plot the distribution of pull values for the specified parameter on a newly created frame. If asymmetric
  // errors are calculated in the fit (by MINOS) those will be used in the pull calculation
  //
  // This function accepts the following optional arguments
  // FrameRange(double lo, double hi) -- Set range of frame to given specification
  // FrameBins(int bins)              -- Set default number of bins of frame to given number
  // Frame(...)                       -- Pass supplied named arguments to RooAbsRealLValue::frame() function. See frame() function
  //                                     for list of allowed arguments
  // FitGauss(Bool_t flag)            -- Add a gaussian fit to the frame
  //
  // If no frame specifications are given, the AutoSymRange() feature will be used to set the range
  // Any other named argument is passed to the RooAbsData::plotOn() call. See that function for allowed options

  // Stuff all arguments in a list
  RooLinkedList cmdList;
  cmdList.Add(const_cast<RooCmdArg*>(&arg1)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg2)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg3)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg4)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg5)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg6)) ;
  cmdList.Add(const_cast<RooCmdArg*>(&arg7)) ;  cmdList.Add(const_cast<RooCmdArg*>(&arg8)) ;

  TString name(param.GetName()), title(param.GetTitle()) ;
  name.Append("pull") ; title.Append(" Pull") ;
  RooRealVar pvar(name,title,-100,100) ;
  pvar.setBins(100) ;


  RooPlot* frame = makeFrameAndPlotCmd(pvar, cmdList, kTRUE) ;
  if (frame) {

    // Pick up optonal FitGauss command from list
    RooCmdConfig pc(Form("RooMCStudy::plotPull(%s)",_genModel->GetName())) ;
    pc.defineInt("fitGauss","FitGauss",0,0) ;
    pc.allowUndefined() ;
    pc.process(cmdList) ;
    Bool_t fitGauss=pc.getInt("fitGauss") ;

    // Pass stripped command list to plotOn()
    pc.stripCmdList(cmdList,"FitGauss") ;
    _fitParData->plotOn(frame,cmdList) ;

    // Add Gaussian fit if requested
    if (fitGauss) {
      RooRealVar pullMean("pullMean","Mean of pull",0,-100,100) ;
      RooRealVar pullSigma("pullSigma","Width of pull",1,0.1,5) ;
      RooGenericPdf pullGauss("pullGauss","Gaussian of pull",
			      "exp(-0.5*(@0-@1)*(@0-@1)/(@2*@2))",
			      RooArgSet(pvar,pullMean,pullSigma)) ;
      pullGauss.fitTo(*_fitParData,RooFit::Minos(0),RooFit::PrintLevel(-1)) ;
      pullGauss.plotOn(frame) ;
      pullGauss.paramOn(frame,_fitParData) ;
    }
  }
  return frame ; ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::makeFrameAndPlotCmd(const RooRealVar& param, RooLinkedList& cmdList, Bool_t symRange) const 
{
  // Internal function. Construct RooPlot from given parameter and modify the list of named
  // arguments 'cmdList' to only contain the plot arguments that should be forwarded to 
  // RooAbsData::plotOn()

  // Select the frame-specific commands 
  RooCmdConfig pc(Form("RooMCStudy::plotParam(%s)",_genModel->GetName())) ;
  pc.defineInt("nbins","Bins",0,0) ;
  pc.defineDouble("xlo","Range",0,0) ;
  pc.defineDouble("xhi","Range",1,0) ;
  pc.defineInt("dummy","FrameArgs",0,0) ;
  pc.defineMutex("Bins","FrameArgs") ;
  pc.defineMutex("Range","FrameArgs") ;

  // Process and check varargs 
  pc.allowUndefined() ;
  pc.process(cmdList) ;
  if (!pc.ok(kTRUE)) {
    return 0 ;
  }
  
  // Make frame according to specs
  Int_t nbins = pc.getInt("nbins") ;
  Double_t xlo = pc.getDouble("xlo") ;
  Double_t xhi = pc.getDouble("xhi") ;
  RooPlot* frame ; 

  if (pc.hasProcessed("FrameArgs")) {
    // Explicit frame arguments are given, pass them on
    RooCmdArg* frameArg = static_cast<RooCmdArg*>(cmdList.FindObject("FrameArgs")) ;
    frame = param.frame(frameArg->subArgs()) ;
  } else {
    // FrameBins, FrameRange or none are given, build custom frame command list
    RooCmdArg bins = RooFit::Bins(nbins) ;
    RooCmdArg range = RooFit::Range(xlo,xhi) ;
    RooCmdArg autor = symRange ? RooFit::AutoSymRange(*_fitParData,0.2) : RooFit::AutoRange(*_fitParData,0.2) ;
    RooLinkedList frameCmdList ;

    if (pc.hasProcessed("Bins")) frameCmdList.Add(&bins) ;
    if (pc.hasProcessed("Range")) {
      frameCmdList.Add(&range) ;
    } else {
      frameCmdList.Add(&autor) ;
    }
    frame = param.frame(frameCmdList) ;
  }
  
  // Filter frame command from list and pass on to plotOn() 
  pc.stripCmdList(cmdList,"FrameArgs,Bins,Range") ;

  return frame ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotNLL(Double_t lo, Double_t hi, Int_t nBins) 
{
  // Create a RooPlot of the -log(L) distribution in the range lo-hi
  // with 'nBins' bins

  RooPlot* frame = _nllVar->frame(lo,hi,nBins) ;
  
  _fitParData->plotOn(frame) ;
  return frame ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotError(const RooRealVar& param, Double_t lo, Double_t hi, Int_t nbins) 
{
  // Create a RooPlot of the distribution of the fitted errors of the given parameter. 
  // The frame is created with a range [lo,hi] and plotted data will be binned in 'nbins' bins

  if (_canAddFitResults) {
    calcPulls() ;
    _canAddFitResults=kFALSE ;
  }

  RooErrorVar* evar = param.errorVar() ;
  RooPlot* frame = evar->frame(lo,hi,nbins) ;
  _fitParData->plotOn(frame) ;

  delete evar ;
  return frame ;
}



//_____________________________________________________________________________
RooPlot* RooMCStudy::plotPull(const RooRealVar& param, Double_t lo, Double_t hi, Int_t nbins, Bool_t fitGauss) 
{
  // Create a RooPlot of the pull distribution for the given
  // parameter.  The range lo-hi is plotted in nbins.  If fitGauss is
  // set, an unbinned ML fit of the distribution to a Gaussian p.d.f
  // is performed. The fit result is overlaid on the returned RooPlot
  // and a box with the fitted mean and sigma is added.

  if (_canAddFitResults) {
    calcPulls() ;
    _canAddFitResults=kFALSE ;
  }


  TString name(param.GetName()), title(param.GetTitle()) ;
  name.Append("pull") ; title.Append(" Pull") ;
  RooRealVar pvar(name,title,lo,hi) ;
  pvar.setBins(nbins) ;

  RooPlot* frame = pvar.frame() ;
  _fitParData->plotOn(frame) ;

  if (fitGauss) {
    RooRealVar pullMean("pullMean","Mean of pull",0,lo,hi) ;
    RooRealVar pullSigma("pullSigma","Width of pull",1,0,5) ;
    RooGenericPdf pullGauss("pullGauss","Gaussian of pull",
			    "exp(-0.5*(@0-@1)*(@0-@1)/(@2*@2))",
			    RooArgSet(pvar,pullMean,pullSigma)) ;
    pullGauss.fitTo(*_fitParData,"mh") ;
    pullGauss.plotOn(frame) ;
    pullGauss.paramOn(frame,_fitParData) ;
  }

  return frame ;
}



 RooMCStudy.cxx:1
 RooMCStudy.cxx:2
 RooMCStudy.cxx:3
 RooMCStudy.cxx:4
 RooMCStudy.cxx:5
 RooMCStudy.cxx:6
 RooMCStudy.cxx:7
 RooMCStudy.cxx:8
 RooMCStudy.cxx:9
 RooMCStudy.cxx:10
 RooMCStudy.cxx:11
 RooMCStudy.cxx:12
 RooMCStudy.cxx:13
 RooMCStudy.cxx:14
 RooMCStudy.cxx:15
 RooMCStudy.cxx:16
 RooMCStudy.cxx:17
 RooMCStudy.cxx:18
 RooMCStudy.cxx:19
 RooMCStudy.cxx:20
 RooMCStudy.cxx:21
 RooMCStudy.cxx:22
 RooMCStudy.cxx:23
 RooMCStudy.cxx:24
 RooMCStudy.cxx:25
 RooMCStudy.cxx:26
 RooMCStudy.cxx:27
 RooMCStudy.cxx:28
 RooMCStudy.cxx:29
 RooMCStudy.cxx:30
 RooMCStudy.cxx:31
 RooMCStudy.cxx:32
 RooMCStudy.cxx:33
 RooMCStudy.cxx:34
 RooMCStudy.cxx:35
 RooMCStudy.cxx:36
 RooMCStudy.cxx:37
 RooMCStudy.cxx:38
 RooMCStudy.cxx:39
 RooMCStudy.cxx:40
 RooMCStudy.cxx:41
 RooMCStudy.cxx:42
 RooMCStudy.cxx:43
 RooMCStudy.cxx:44
 RooMCStudy.cxx:45
 RooMCStudy.cxx:46
 RooMCStudy.cxx:47
 RooMCStudy.cxx:48
 RooMCStudy.cxx:49
 RooMCStudy.cxx:50
 RooMCStudy.cxx:51
 RooMCStudy.cxx:52
 RooMCStudy.cxx:53
 RooMCStudy.cxx:54
 RooMCStudy.cxx:55
 RooMCStudy.cxx:56
 RooMCStudy.cxx:57
 RooMCStudy.cxx:58
 RooMCStudy.cxx:59
 RooMCStudy.cxx:60
 RooMCStudy.cxx:61
 RooMCStudy.cxx:62
 RooMCStudy.cxx:63
 RooMCStudy.cxx:64
 RooMCStudy.cxx:65
 RooMCStudy.cxx:66
 RooMCStudy.cxx:67
 RooMCStudy.cxx:68
 RooMCStudy.cxx:69
 RooMCStudy.cxx:70
 RooMCStudy.cxx:71
 RooMCStudy.cxx:72
 RooMCStudy.cxx:73
 RooMCStudy.cxx:74
 RooMCStudy.cxx:75
 RooMCStudy.cxx:76
 RooMCStudy.cxx:77
 RooMCStudy.cxx:78
 RooMCStudy.cxx:79
 RooMCStudy.cxx:80
 RooMCStudy.cxx:81
 RooMCStudy.cxx:82
 RooMCStudy.cxx:83
 RooMCStudy.cxx:84
 RooMCStudy.cxx:85
 RooMCStudy.cxx:86
 RooMCStudy.cxx:87
 RooMCStudy.cxx:88
 RooMCStudy.cxx:89
 RooMCStudy.cxx:90
 RooMCStudy.cxx:91
 RooMCStudy.cxx:92
 RooMCStudy.cxx:93
 RooMCStudy.cxx:94
 RooMCStudy.cxx:95
 RooMCStudy.cxx:96
 RooMCStudy.cxx:97
 RooMCStudy.cxx:98
 RooMCStudy.cxx:99
 RooMCStudy.cxx:100
 RooMCStudy.cxx:101
 RooMCStudy.cxx:102
 RooMCStudy.cxx:103
 RooMCStudy.cxx:104
 RooMCStudy.cxx:105
 RooMCStudy.cxx:106
 RooMCStudy.cxx:107
 RooMCStudy.cxx:108
 RooMCStudy.cxx:109
 RooMCStudy.cxx:110
 RooMCStudy.cxx:111
 RooMCStudy.cxx:112
 RooMCStudy.cxx:113
 RooMCStudy.cxx:114
 RooMCStudy.cxx:115
 RooMCStudy.cxx:116
 RooMCStudy.cxx:117
 RooMCStudy.cxx:118
 RooMCStudy.cxx:119
 RooMCStudy.cxx:120
 RooMCStudy.cxx:121
 RooMCStudy.cxx:122
 RooMCStudy.cxx:123
 RooMCStudy.cxx:124
 RooMCStudy.cxx:125
 RooMCStudy.cxx:126
 RooMCStudy.cxx:127
 RooMCStudy.cxx:128
 RooMCStudy.cxx:129
 RooMCStudy.cxx:130
 RooMCStudy.cxx:131
 RooMCStudy.cxx:132
 RooMCStudy.cxx:133
 RooMCStudy.cxx:134
 RooMCStudy.cxx:135
 RooMCStudy.cxx:136
 RooMCStudy.cxx:137
 RooMCStudy.cxx:138
 RooMCStudy.cxx:139
 RooMCStudy.cxx:140
 RooMCStudy.cxx:141
 RooMCStudy.cxx:142
 RooMCStudy.cxx:143
 RooMCStudy.cxx:144
 RooMCStudy.cxx:145
 RooMCStudy.cxx:146
 RooMCStudy.cxx:147
 RooMCStudy.cxx:148
 RooMCStudy.cxx:149
 RooMCStudy.cxx:150
 RooMCStudy.cxx:151
 RooMCStudy.cxx:152
 RooMCStudy.cxx:153
 RooMCStudy.cxx:154
 RooMCStudy.cxx:155
 RooMCStudy.cxx:156
 RooMCStudy.cxx:157
 RooMCStudy.cxx:158
 RooMCStudy.cxx:159
 RooMCStudy.cxx:160
 RooMCStudy.cxx:161
 RooMCStudy.cxx:162
 RooMCStudy.cxx:163
 RooMCStudy.cxx:164
 RooMCStudy.cxx:165
 RooMCStudy.cxx:166
 RooMCStudy.cxx:167
 RooMCStudy.cxx:168
 RooMCStudy.cxx:169
 RooMCStudy.cxx:170
 RooMCStudy.cxx:171
 RooMCStudy.cxx:172
 RooMCStudy.cxx:173
 RooMCStudy.cxx:174
 RooMCStudy.cxx:175
 RooMCStudy.cxx:176
 RooMCStudy.cxx:177
 RooMCStudy.cxx:178
 RooMCStudy.cxx:179
 RooMCStudy.cxx:180
 RooMCStudy.cxx:181
 RooMCStudy.cxx:182
 RooMCStudy.cxx:183
 RooMCStudy.cxx:184
 RooMCStudy.cxx:185
 RooMCStudy.cxx:186
 RooMCStudy.cxx:187
 RooMCStudy.cxx:188
 RooMCStudy.cxx:189
 RooMCStudy.cxx:190
 RooMCStudy.cxx:191
 RooMCStudy.cxx:192
 RooMCStudy.cxx:193
 RooMCStudy.cxx:194
 RooMCStudy.cxx:195
 RooMCStudy.cxx:196
 RooMCStudy.cxx:197
 RooMCStudy.cxx:198
 RooMCStudy.cxx:199
 RooMCStudy.cxx:200
 RooMCStudy.cxx:201
 RooMCStudy.cxx:202
 RooMCStudy.cxx:203
 RooMCStudy.cxx:204
 RooMCStudy.cxx:205
 RooMCStudy.cxx:206
 RooMCStudy.cxx:207
 RooMCStudy.cxx:208
 RooMCStudy.cxx:209
 RooMCStudy.cxx:210
 RooMCStudy.cxx:211
 RooMCStudy.cxx:212
 RooMCStudy.cxx:213
 RooMCStudy.cxx:214
 RooMCStudy.cxx:215
 RooMCStudy.cxx:216
 RooMCStudy.cxx:217
 RooMCStudy.cxx:218
 RooMCStudy.cxx:219
 RooMCStudy.cxx:220
 RooMCStudy.cxx:221
 RooMCStudy.cxx:222
 RooMCStudy.cxx:223
 RooMCStudy.cxx:224
 RooMCStudy.cxx:225
 RooMCStudy.cxx:226
 RooMCStudy.cxx:227
 RooMCStudy.cxx:228
 RooMCStudy.cxx:229
 RooMCStudy.cxx:230
 RooMCStudy.cxx:231
 RooMCStudy.cxx:232
 RooMCStudy.cxx:233
 RooMCStudy.cxx:234
 RooMCStudy.cxx:235
 RooMCStudy.cxx:236
 RooMCStudy.cxx:237
 RooMCStudy.cxx:238
 RooMCStudy.cxx:239
 RooMCStudy.cxx:240
 RooMCStudy.cxx:241
 RooMCStudy.cxx:242
 RooMCStudy.cxx:243
 RooMCStudy.cxx:244
 RooMCStudy.cxx:245
 RooMCStudy.cxx:246
 RooMCStudy.cxx:247
 RooMCStudy.cxx:248
 RooMCStudy.cxx:249
 RooMCStudy.cxx:250
 RooMCStudy.cxx:251
 RooMCStudy.cxx:252
 RooMCStudy.cxx:253
 RooMCStudy.cxx:254
 RooMCStudy.cxx:255
 RooMCStudy.cxx:256
 RooMCStudy.cxx:257
 RooMCStudy.cxx:258
 RooMCStudy.cxx:259
 RooMCStudy.cxx:260
 RooMCStudy.cxx:261
 RooMCStudy.cxx:262
 RooMCStudy.cxx:263
 RooMCStudy.cxx:264
 RooMCStudy.cxx:265
 RooMCStudy.cxx:266
 RooMCStudy.cxx:267
 RooMCStudy.cxx:268
 RooMCStudy.cxx:269
 RooMCStudy.cxx:270
 RooMCStudy.cxx:271
 RooMCStudy.cxx:272
 RooMCStudy.cxx:273
 RooMCStudy.cxx:274
 RooMCStudy.cxx:275
 RooMCStudy.cxx:276
 RooMCStudy.cxx:277
 RooMCStudy.cxx:278
 RooMCStudy.cxx:279
 RooMCStudy.cxx:280
 RooMCStudy.cxx:281
 RooMCStudy.cxx:282
 RooMCStudy.cxx:283
 RooMCStudy.cxx:284
 RooMCStudy.cxx:285
 RooMCStudy.cxx:286
 RooMCStudy.cxx:287
 RooMCStudy.cxx:288
 RooMCStudy.cxx:289
 RooMCStudy.cxx:290
 RooMCStudy.cxx:291
 RooMCStudy.cxx:292
 RooMCStudy.cxx:293
 RooMCStudy.cxx:294
 RooMCStudy.cxx:295
 RooMCStudy.cxx:296
 RooMCStudy.cxx:297
 RooMCStudy.cxx:298
 RooMCStudy.cxx:299
 RooMCStudy.cxx:300
 RooMCStudy.cxx:301
 RooMCStudy.cxx:302
 RooMCStudy.cxx:303
 RooMCStudy.cxx:304
 RooMCStudy.cxx:305
 RooMCStudy.cxx:306
 RooMCStudy.cxx:307
 RooMCStudy.cxx:308
 RooMCStudy.cxx:309
 RooMCStudy.cxx:310
 RooMCStudy.cxx:311
 RooMCStudy.cxx:312
 RooMCStudy.cxx:313
 RooMCStudy.cxx:314
 RooMCStudy.cxx:315
 RooMCStudy.cxx:316
 RooMCStudy.cxx:317
 RooMCStudy.cxx:318
 RooMCStudy.cxx:319
 RooMCStudy.cxx:320
 RooMCStudy.cxx:321
 RooMCStudy.cxx:322
 RooMCStudy.cxx:323
 RooMCStudy.cxx:324
 RooMCStudy.cxx:325
 RooMCStudy.cxx:326
 RooMCStudy.cxx:327
 RooMCStudy.cxx:328
 RooMCStudy.cxx:329
 RooMCStudy.cxx:330
 RooMCStudy.cxx:331
 RooMCStudy.cxx:332
 RooMCStudy.cxx:333
 RooMCStudy.cxx:334
 RooMCStudy.cxx:335
 RooMCStudy.cxx:336
 RooMCStudy.cxx:337
 RooMCStudy.cxx:338
 RooMCStudy.cxx:339
 RooMCStudy.cxx:340
 RooMCStudy.cxx:341
 RooMCStudy.cxx:342
 RooMCStudy.cxx:343
 RooMCStudy.cxx:344
 RooMCStudy.cxx:345
 RooMCStudy.cxx:346
 RooMCStudy.cxx:347
 RooMCStudy.cxx:348
 RooMCStudy.cxx:349
 RooMCStudy.cxx:350
 RooMCStudy.cxx:351
 RooMCStudy.cxx:352
 RooMCStudy.cxx:353
 RooMCStudy.cxx:354
 RooMCStudy.cxx:355
 RooMCStudy.cxx:356
 RooMCStudy.cxx:357
 RooMCStudy.cxx:358
 RooMCStudy.cxx:359
 RooMCStudy.cxx:360
 RooMCStudy.cxx:361
 RooMCStudy.cxx:362
 RooMCStudy.cxx:363
 RooMCStudy.cxx:364
 RooMCStudy.cxx:365
 RooMCStudy.cxx:366
 RooMCStudy.cxx:367
 RooMCStudy.cxx:368
 RooMCStudy.cxx:369
 RooMCStudy.cxx:370
 RooMCStudy.cxx:371
 RooMCStudy.cxx:372
 RooMCStudy.cxx:373
 RooMCStudy.cxx:374
 RooMCStudy.cxx:375
 RooMCStudy.cxx:376
 RooMCStudy.cxx:377
 RooMCStudy.cxx:378
 RooMCStudy.cxx:379
 RooMCStudy.cxx:380
 RooMCStudy.cxx:381
 RooMCStudy.cxx:382
 RooMCStudy.cxx:383
 RooMCStudy.cxx:384
 RooMCStudy.cxx:385
 RooMCStudy.cxx:386
 RooMCStudy.cxx:387
 RooMCStudy.cxx:388
 RooMCStudy.cxx:389
 RooMCStudy.cxx:390
 RooMCStudy.cxx:391
 RooMCStudy.cxx:392
 RooMCStudy.cxx:393
 RooMCStudy.cxx:394
 RooMCStudy.cxx:395
 RooMCStudy.cxx:396
 RooMCStudy.cxx:397
 RooMCStudy.cxx:398
 RooMCStudy.cxx:399
 RooMCStudy.cxx:400
 RooMCStudy.cxx:401
 RooMCStudy.cxx:402
 RooMCStudy.cxx:403
 RooMCStudy.cxx:404
 RooMCStudy.cxx:405
 RooMCStudy.cxx:406
 RooMCStudy.cxx:407
 RooMCStudy.cxx:408
 RooMCStudy.cxx:409
 RooMCStudy.cxx:410
 RooMCStudy.cxx:411
 RooMCStudy.cxx:412
 RooMCStudy.cxx:413
 RooMCStudy.cxx:414
 RooMCStudy.cxx:415
 RooMCStudy.cxx:416
 RooMCStudy.cxx:417
 RooMCStudy.cxx:418
 RooMCStudy.cxx:419
 RooMCStudy.cxx:420
 RooMCStudy.cxx:421
 RooMCStudy.cxx:422
 RooMCStudy.cxx:423
 RooMCStudy.cxx:424
 RooMCStudy.cxx:425
 RooMCStudy.cxx:426
 RooMCStudy.cxx:427
 RooMCStudy.cxx:428
 RooMCStudy.cxx:429
 RooMCStudy.cxx:430
 RooMCStudy.cxx:431
 RooMCStudy.cxx:432
 RooMCStudy.cxx:433
 RooMCStudy.cxx:434
 RooMCStudy.cxx:435
 RooMCStudy.cxx:436
 RooMCStudy.cxx:437
 RooMCStudy.cxx:438
 RooMCStudy.cxx:439
 RooMCStudy.cxx:440
 RooMCStudy.cxx:441
 RooMCStudy.cxx:442
 RooMCStudy.cxx:443
 RooMCStudy.cxx:444
 RooMCStudy.cxx:445
 RooMCStudy.cxx:446
 RooMCStudy.cxx:447
 RooMCStudy.cxx:448
 RooMCStudy.cxx:449
 RooMCStudy.cxx:450
 RooMCStudy.cxx:451
 RooMCStudy.cxx:452
 RooMCStudy.cxx:453
 RooMCStudy.cxx:454
 RooMCStudy.cxx:455
 RooMCStudy.cxx:456
 RooMCStudy.cxx:457
 RooMCStudy.cxx:458
 RooMCStudy.cxx:459
 RooMCStudy.cxx:460
 RooMCStudy.cxx:461
 RooMCStudy.cxx:462
 RooMCStudy.cxx:463
 RooMCStudy.cxx:464
 RooMCStudy.cxx:465
 RooMCStudy.cxx:466
 RooMCStudy.cxx:467
 RooMCStudy.cxx:468
 RooMCStudy.cxx:469
 RooMCStudy.cxx:470
 RooMCStudy.cxx:471
 RooMCStudy.cxx:472
 RooMCStudy.cxx:473
 RooMCStudy.cxx:474
 RooMCStudy.cxx:475
 RooMCStudy.cxx:476
 RooMCStudy.cxx:477
 RooMCStudy.cxx:478
 RooMCStudy.cxx:479
 RooMCStudy.cxx:480
 RooMCStudy.cxx:481
 RooMCStudy.cxx:482
 RooMCStudy.cxx:483
 RooMCStudy.cxx:484
 RooMCStudy.cxx:485
 RooMCStudy.cxx:486
 RooMCStudy.cxx:487
 RooMCStudy.cxx:488
 RooMCStudy.cxx:489
 RooMCStudy.cxx:490
 RooMCStudy.cxx:491
 RooMCStudy.cxx:492
 RooMCStudy.cxx:493
 RooMCStudy.cxx:494
 RooMCStudy.cxx:495
 RooMCStudy.cxx:496
 RooMCStudy.cxx:497
 RooMCStudy.cxx:498
 RooMCStudy.cxx:499
 RooMCStudy.cxx:500
 RooMCStudy.cxx:501
 RooMCStudy.cxx:502
 RooMCStudy.cxx:503
 RooMCStudy.cxx:504
 RooMCStudy.cxx:505
 RooMCStudy.cxx:506
 RooMCStudy.cxx:507
 RooMCStudy.cxx:508
 RooMCStudy.cxx:509
 RooMCStudy.cxx:510
 RooMCStudy.cxx:511
 RooMCStudy.cxx:512
 RooMCStudy.cxx:513
 RooMCStudy.cxx:514
 RooMCStudy.cxx:515
 RooMCStudy.cxx:516
 RooMCStudy.cxx:517
 RooMCStudy.cxx:518
 RooMCStudy.cxx:519
 RooMCStudy.cxx:520
 RooMCStudy.cxx:521
 RooMCStudy.cxx:522
 RooMCStudy.cxx:523
 RooMCStudy.cxx:524
 RooMCStudy.cxx:525
 RooMCStudy.cxx:526
 RooMCStudy.cxx:527
 RooMCStudy.cxx:528
 RooMCStudy.cxx:529
 RooMCStudy.cxx:530
 RooMCStudy.cxx:531
 RooMCStudy.cxx:532
 RooMCStudy.cxx:533
 RooMCStudy.cxx:534
 RooMCStudy.cxx:535
 RooMCStudy.cxx:536
 RooMCStudy.cxx:537
 RooMCStudy.cxx:538
 RooMCStudy.cxx:539
 RooMCStudy.cxx:540
 RooMCStudy.cxx:541
 RooMCStudy.cxx:542
 RooMCStudy.cxx:543
 RooMCStudy.cxx:544
 RooMCStudy.cxx:545
 RooMCStudy.cxx:546
 RooMCStudy.cxx:547
 RooMCStudy.cxx:548
 RooMCStudy.cxx:549
 RooMCStudy.cxx:550
 RooMCStudy.cxx:551
 RooMCStudy.cxx:552
 RooMCStudy.cxx:553
 RooMCStudy.cxx:554
 RooMCStudy.cxx:555
 RooMCStudy.cxx:556
 RooMCStudy.cxx:557
 RooMCStudy.cxx:558
 RooMCStudy.cxx:559
 RooMCStudy.cxx:560
 RooMCStudy.cxx:561
 RooMCStudy.cxx:562
 RooMCStudy.cxx:563
 RooMCStudy.cxx:564
 RooMCStudy.cxx:565
 RooMCStudy.cxx:566
 RooMCStudy.cxx:567
 RooMCStudy.cxx:568
 RooMCStudy.cxx:569
 RooMCStudy.cxx:570
 RooMCStudy.cxx:571
 RooMCStudy.cxx:572
 RooMCStudy.cxx:573
 RooMCStudy.cxx:574
 RooMCStudy.cxx:575
 RooMCStudy.cxx:576
 RooMCStudy.cxx:577
 RooMCStudy.cxx:578
 RooMCStudy.cxx:579
 RooMCStudy.cxx:580
 RooMCStudy.cxx:581
 RooMCStudy.cxx:582
 RooMCStudy.cxx:583
 RooMCStudy.cxx:584
 RooMCStudy.cxx:585
 RooMCStudy.cxx:586
 RooMCStudy.cxx:587
 RooMCStudy.cxx:588
 RooMCStudy.cxx:589
 RooMCStudy.cxx:590
 RooMCStudy.cxx:591
 RooMCStudy.cxx:592
 RooMCStudy.cxx:593
 RooMCStudy.cxx:594
 RooMCStudy.cxx:595
 RooMCStudy.cxx:596
 RooMCStudy.cxx:597
 RooMCStudy.cxx:598
 RooMCStudy.cxx:599
 RooMCStudy.cxx:600
 RooMCStudy.cxx:601
 RooMCStudy.cxx:602
 RooMCStudy.cxx:603
 RooMCStudy.cxx:604
 RooMCStudy.cxx:605
 RooMCStudy.cxx:606
 RooMCStudy.cxx:607
 RooMCStudy.cxx:608
 RooMCStudy.cxx:609
 RooMCStudy.cxx:610
 RooMCStudy.cxx:611
 RooMCStudy.cxx:612
 RooMCStudy.cxx:613
 RooMCStudy.cxx:614
 RooMCStudy.cxx:615
 RooMCStudy.cxx:616
 RooMCStudy.cxx:617
 RooMCStudy.cxx:618
 RooMCStudy.cxx:619
 RooMCStudy.cxx:620
 RooMCStudy.cxx:621
 RooMCStudy.cxx:622
 RooMCStudy.cxx:623
 RooMCStudy.cxx:624
 RooMCStudy.cxx:625
 RooMCStudy.cxx:626
 RooMCStudy.cxx:627
 RooMCStudy.cxx:628
 RooMCStudy.cxx:629
 RooMCStudy.cxx:630
 RooMCStudy.cxx:631
 RooMCStudy.cxx:632
 RooMCStudy.cxx:633
 RooMCStudy.cxx:634
 RooMCStudy.cxx:635
 RooMCStudy.cxx:636
 RooMCStudy.cxx:637
 RooMCStudy.cxx:638
 RooMCStudy.cxx:639
 RooMCStudy.cxx:640
 RooMCStudy.cxx:641
 RooMCStudy.cxx:642
 RooMCStudy.cxx:643
 RooMCStudy.cxx:644
 RooMCStudy.cxx:645
 RooMCStudy.cxx:646
 RooMCStudy.cxx:647
 RooMCStudy.cxx:648
 RooMCStudy.cxx:649
 RooMCStudy.cxx:650
 RooMCStudy.cxx:651
 RooMCStudy.cxx:652
 RooMCStudy.cxx:653
 RooMCStudy.cxx:654
 RooMCStudy.cxx:655
 RooMCStudy.cxx:656
 RooMCStudy.cxx:657
 RooMCStudy.cxx:658
 RooMCStudy.cxx:659
 RooMCStudy.cxx:660
 RooMCStudy.cxx:661
 RooMCStudy.cxx:662
 RooMCStudy.cxx:663
 RooMCStudy.cxx:664
 RooMCStudy.cxx:665
 RooMCStudy.cxx:666
 RooMCStudy.cxx:667
 RooMCStudy.cxx:668
 RooMCStudy.cxx:669
 RooMCStudy.cxx:670
 RooMCStudy.cxx:671
 RooMCStudy.cxx:672
 RooMCStudy.cxx:673
 RooMCStudy.cxx:674
 RooMCStudy.cxx:675
 RooMCStudy.cxx:676
 RooMCStudy.cxx:677
 RooMCStudy.cxx:678
 RooMCStudy.cxx:679
 RooMCStudy.cxx:680
 RooMCStudy.cxx:681
 RooMCStudy.cxx:682
 RooMCStudy.cxx:683
 RooMCStudy.cxx:684
 RooMCStudy.cxx:685
 RooMCStudy.cxx:686
 RooMCStudy.cxx:687
 RooMCStudy.cxx:688
 RooMCStudy.cxx:689
 RooMCStudy.cxx:690
 RooMCStudy.cxx:691
 RooMCStudy.cxx:692
 RooMCStudy.cxx:693
 RooMCStudy.cxx:694
 RooMCStudy.cxx:695
 RooMCStudy.cxx:696
 RooMCStudy.cxx:697
 RooMCStudy.cxx:698
 RooMCStudy.cxx:699
 RooMCStudy.cxx:700
 RooMCStudy.cxx:701
 RooMCStudy.cxx:702
 RooMCStudy.cxx:703
 RooMCStudy.cxx:704
 RooMCStudy.cxx:705
 RooMCStudy.cxx:706
 RooMCStudy.cxx:707
 RooMCStudy.cxx:708
 RooMCStudy.cxx:709
 RooMCStudy.cxx:710
 RooMCStudy.cxx:711
 RooMCStudy.cxx:712
 RooMCStudy.cxx:713
 RooMCStudy.cxx:714
 RooMCStudy.cxx:715
 RooMCStudy.cxx:716
 RooMCStudy.cxx:717
 RooMCStudy.cxx:718
 RooMCStudy.cxx:719
 RooMCStudy.cxx:720
 RooMCStudy.cxx:721
 RooMCStudy.cxx:722
 RooMCStudy.cxx:723
 RooMCStudy.cxx:724
 RooMCStudy.cxx:725
 RooMCStudy.cxx:726
 RooMCStudy.cxx:727
 RooMCStudy.cxx:728
 RooMCStudy.cxx:729
 RooMCStudy.cxx:730
 RooMCStudy.cxx:731
 RooMCStudy.cxx:732
 RooMCStudy.cxx:733
 RooMCStudy.cxx:734
 RooMCStudy.cxx:735
 RooMCStudy.cxx:736
 RooMCStudy.cxx:737
 RooMCStudy.cxx:738
 RooMCStudy.cxx:739
 RooMCStudy.cxx:740
 RooMCStudy.cxx:741
 RooMCStudy.cxx:742
 RooMCStudy.cxx:743
 RooMCStudy.cxx:744
 RooMCStudy.cxx:745
 RooMCStudy.cxx:746
 RooMCStudy.cxx:747
 RooMCStudy.cxx:748
 RooMCStudy.cxx:749
 RooMCStudy.cxx:750
 RooMCStudy.cxx:751
 RooMCStudy.cxx:752
 RooMCStudy.cxx:753
 RooMCStudy.cxx:754
 RooMCStudy.cxx:755
 RooMCStudy.cxx:756
 RooMCStudy.cxx:757
 RooMCStudy.cxx:758
 RooMCStudy.cxx:759
 RooMCStudy.cxx:760
 RooMCStudy.cxx:761
 RooMCStudy.cxx:762
 RooMCStudy.cxx:763
 RooMCStudy.cxx:764
 RooMCStudy.cxx:765
 RooMCStudy.cxx:766
 RooMCStudy.cxx:767
 RooMCStudy.cxx:768
 RooMCStudy.cxx:769
 RooMCStudy.cxx:770
 RooMCStudy.cxx:771
 RooMCStudy.cxx:772
 RooMCStudy.cxx:773
 RooMCStudy.cxx:774
 RooMCStudy.cxx:775
 RooMCStudy.cxx:776
 RooMCStudy.cxx:777
 RooMCStudy.cxx:778
 RooMCStudy.cxx:779
 RooMCStudy.cxx:780
 RooMCStudy.cxx:781
 RooMCStudy.cxx:782
 RooMCStudy.cxx:783
 RooMCStudy.cxx:784
 RooMCStudy.cxx:785
 RooMCStudy.cxx:786
 RooMCStudy.cxx:787
 RooMCStudy.cxx:788
 RooMCStudy.cxx:789
 RooMCStudy.cxx:790
 RooMCStudy.cxx:791
 RooMCStudy.cxx:792
 RooMCStudy.cxx:793
 RooMCStudy.cxx:794
 RooMCStudy.cxx:795
 RooMCStudy.cxx:796
 RooMCStudy.cxx:797
 RooMCStudy.cxx:798
 RooMCStudy.cxx:799
 RooMCStudy.cxx:800
 RooMCStudy.cxx:801
 RooMCStudy.cxx:802
 RooMCStudy.cxx:803
 RooMCStudy.cxx:804
 RooMCStudy.cxx:805
 RooMCStudy.cxx:806
 RooMCStudy.cxx:807
 RooMCStudy.cxx:808
 RooMCStudy.cxx:809
 RooMCStudy.cxx:810
 RooMCStudy.cxx:811
 RooMCStudy.cxx:812
 RooMCStudy.cxx:813
 RooMCStudy.cxx:814
 RooMCStudy.cxx:815
 RooMCStudy.cxx:816
 RooMCStudy.cxx:817
 RooMCStudy.cxx:818
 RooMCStudy.cxx:819
 RooMCStudy.cxx:820
 RooMCStudy.cxx:821
 RooMCStudy.cxx:822
 RooMCStudy.cxx:823
 RooMCStudy.cxx:824
 RooMCStudy.cxx:825
 RooMCStudy.cxx:826
 RooMCStudy.cxx:827
 RooMCStudy.cxx:828
 RooMCStudy.cxx:829
 RooMCStudy.cxx:830
 RooMCStudy.cxx:831
 RooMCStudy.cxx:832
 RooMCStudy.cxx:833
 RooMCStudy.cxx:834
 RooMCStudy.cxx:835
 RooMCStudy.cxx:836
 RooMCStudy.cxx:837
 RooMCStudy.cxx:838
 RooMCStudy.cxx:839
 RooMCStudy.cxx:840
 RooMCStudy.cxx:841
 RooMCStudy.cxx:842
 RooMCStudy.cxx:843
 RooMCStudy.cxx:844
 RooMCStudy.cxx:845
 RooMCStudy.cxx:846
 RooMCStudy.cxx:847
 RooMCStudy.cxx:848
 RooMCStudy.cxx:849
 RooMCStudy.cxx:850
 RooMCStudy.cxx:851
 RooMCStudy.cxx:852
 RooMCStudy.cxx:853
 RooMCStudy.cxx:854
 RooMCStudy.cxx:855
 RooMCStudy.cxx:856
 RooMCStudy.cxx:857
 RooMCStudy.cxx:858
 RooMCStudy.cxx:859
 RooMCStudy.cxx:860
 RooMCStudy.cxx:861
 RooMCStudy.cxx:862
 RooMCStudy.cxx:863
 RooMCStudy.cxx:864
 RooMCStudy.cxx:865
 RooMCStudy.cxx:866
 RooMCStudy.cxx:867
 RooMCStudy.cxx:868
 RooMCStudy.cxx:869
 RooMCStudy.cxx:870
 RooMCStudy.cxx:871
 RooMCStudy.cxx:872
 RooMCStudy.cxx:873
 RooMCStudy.cxx:874
 RooMCStudy.cxx:875
 RooMCStudy.cxx:876
 RooMCStudy.cxx:877
 RooMCStudy.cxx:878
 RooMCStudy.cxx:879
 RooMCStudy.cxx:880
 RooMCStudy.cxx:881
 RooMCStudy.cxx:882
 RooMCStudy.cxx:883
 RooMCStudy.cxx:884
 RooMCStudy.cxx:885
 RooMCStudy.cxx:886
 RooMCStudy.cxx:887
 RooMCStudy.cxx:888
 RooMCStudy.cxx:889
 RooMCStudy.cxx:890
 RooMCStudy.cxx:891
 RooMCStudy.cxx:892
 RooMCStudy.cxx:893
 RooMCStudy.cxx:894
 RooMCStudy.cxx:895
 RooMCStudy.cxx:896
 RooMCStudy.cxx:897
 RooMCStudy.cxx:898
 RooMCStudy.cxx:899
 RooMCStudy.cxx:900
 RooMCStudy.cxx:901
 RooMCStudy.cxx:902
 RooMCStudy.cxx:903
 RooMCStudy.cxx:904
 RooMCStudy.cxx:905
 RooMCStudy.cxx:906
 RooMCStudy.cxx:907
 RooMCStudy.cxx:908
 RooMCStudy.cxx:909
 RooMCStudy.cxx:910
 RooMCStudy.cxx:911
 RooMCStudy.cxx:912
 RooMCStudy.cxx:913
 RooMCStudy.cxx:914
 RooMCStudy.cxx:915
 RooMCStudy.cxx:916
 RooMCStudy.cxx:917
 RooMCStudy.cxx:918
 RooMCStudy.cxx:919
 RooMCStudy.cxx:920
 RooMCStudy.cxx:921
 RooMCStudy.cxx:922
 RooMCStudy.cxx:923
 RooMCStudy.cxx:924
 RooMCStudy.cxx:925
 RooMCStudy.cxx:926
 RooMCStudy.cxx:927
 RooMCStudy.cxx:928
 RooMCStudy.cxx:929
 RooMCStudy.cxx:930
 RooMCStudy.cxx:931
 RooMCStudy.cxx:932
 RooMCStudy.cxx:933
 RooMCStudy.cxx:934
 RooMCStudy.cxx:935
 RooMCStudy.cxx:936
 RooMCStudy.cxx:937
 RooMCStudy.cxx:938
 RooMCStudy.cxx:939
 RooMCStudy.cxx:940
 RooMCStudy.cxx:941
 RooMCStudy.cxx:942
 RooMCStudy.cxx:943
 RooMCStudy.cxx:944
 RooMCStudy.cxx:945
 RooMCStudy.cxx:946
 RooMCStudy.cxx:947
 RooMCStudy.cxx:948
 RooMCStudy.cxx:949
 RooMCStudy.cxx:950
 RooMCStudy.cxx:951
 RooMCStudy.cxx:952
 RooMCStudy.cxx:953
 RooMCStudy.cxx:954
 RooMCStudy.cxx:955
 RooMCStudy.cxx:956
 RooMCStudy.cxx:957
 RooMCStudy.cxx:958
 RooMCStudy.cxx:959
 RooMCStudy.cxx:960
 RooMCStudy.cxx:961
 RooMCStudy.cxx:962
 RooMCStudy.cxx:963
 RooMCStudy.cxx:964
 RooMCStudy.cxx:965
 RooMCStudy.cxx:966
 RooMCStudy.cxx:967
 RooMCStudy.cxx:968
 RooMCStudy.cxx:969
 RooMCStudy.cxx:970
 RooMCStudy.cxx:971
 RooMCStudy.cxx:972
 RooMCStudy.cxx:973
 RooMCStudy.cxx:974
 RooMCStudy.cxx:975
 RooMCStudy.cxx:976
 RooMCStudy.cxx:977
 RooMCStudy.cxx:978
 RooMCStudy.cxx:979
 RooMCStudy.cxx:980
 RooMCStudy.cxx:981
 RooMCStudy.cxx:982
 RooMCStudy.cxx:983
 RooMCStudy.cxx:984
 RooMCStudy.cxx:985
 RooMCStudy.cxx:986
 RooMCStudy.cxx:987
 RooMCStudy.cxx:988
 RooMCStudy.cxx:989
 RooMCStudy.cxx:990
 RooMCStudy.cxx:991
 RooMCStudy.cxx:992
 RooMCStudy.cxx:993
 RooMCStudy.cxx:994
 RooMCStudy.cxx:995
 RooMCStudy.cxx:996
 RooMCStudy.cxx:997
 RooMCStudy.cxx:998
 RooMCStudy.cxx:999
 RooMCStudy.cxx:1000
 RooMCStudy.cxx:1001
 RooMCStudy.cxx:1002
 RooMCStudy.cxx:1003
 RooMCStudy.cxx:1004
 RooMCStudy.cxx:1005
 RooMCStudy.cxx:1006
 RooMCStudy.cxx:1007
 RooMCStudy.cxx:1008
 RooMCStudy.cxx:1009
 RooMCStudy.cxx:1010
 RooMCStudy.cxx:1011
 RooMCStudy.cxx:1012
 RooMCStudy.cxx:1013
 RooMCStudy.cxx:1014
 RooMCStudy.cxx:1015
 RooMCStudy.cxx:1016
 RooMCStudy.cxx:1017
 RooMCStudy.cxx:1018
 RooMCStudy.cxx:1019
 RooMCStudy.cxx:1020
 RooMCStudy.cxx:1021
 RooMCStudy.cxx:1022
 RooMCStudy.cxx:1023
 RooMCStudy.cxx:1024
 RooMCStudy.cxx:1025
 RooMCStudy.cxx:1026
 RooMCStudy.cxx:1027
 RooMCStudy.cxx:1028
 RooMCStudy.cxx:1029
 RooMCStudy.cxx:1030
 RooMCStudy.cxx:1031
 RooMCStudy.cxx:1032
 RooMCStudy.cxx:1033
 RooMCStudy.cxx:1034
 RooMCStudy.cxx:1035
 RooMCStudy.cxx:1036
 RooMCStudy.cxx:1037
 RooMCStudy.cxx:1038
 RooMCStudy.cxx:1039
 RooMCStudy.cxx:1040
 RooMCStudy.cxx:1041
 RooMCStudy.cxx:1042
 RooMCStudy.cxx:1043
 RooMCStudy.cxx:1044
 RooMCStudy.cxx:1045
 RooMCStudy.cxx:1046
 RooMCStudy.cxx:1047
 RooMCStudy.cxx:1048
 RooMCStudy.cxx:1049
 RooMCStudy.cxx:1050
 RooMCStudy.cxx:1051
 RooMCStudy.cxx:1052
 RooMCStudy.cxx:1053
 RooMCStudy.cxx:1054
 RooMCStudy.cxx:1055
 RooMCStudy.cxx:1056
 RooMCStudy.cxx:1057
 RooMCStudy.cxx:1058
 RooMCStudy.cxx:1059
 RooMCStudy.cxx:1060
 RooMCStudy.cxx:1061
 RooMCStudy.cxx:1062
 RooMCStudy.cxx:1063
 RooMCStudy.cxx:1064
 RooMCStudy.cxx:1065
 RooMCStudy.cxx:1066
 RooMCStudy.cxx:1067
 RooMCStudy.cxx:1068
 RooMCStudy.cxx:1069
 RooMCStudy.cxx:1070
 RooMCStudy.cxx:1071
 RooMCStudy.cxx:1072
 RooMCStudy.cxx:1073
 RooMCStudy.cxx:1074
 RooMCStudy.cxx:1075
 RooMCStudy.cxx:1076
 RooMCStudy.cxx:1077
 RooMCStudy.cxx:1078
 RooMCStudy.cxx:1079
 RooMCStudy.cxx:1080
 RooMCStudy.cxx:1081
 RooMCStudy.cxx:1082
 RooMCStudy.cxx:1083
 RooMCStudy.cxx:1084
 RooMCStudy.cxx:1085
 RooMCStudy.cxx:1086
 RooMCStudy.cxx:1087
 RooMCStudy.cxx:1088
 RooMCStudy.cxx:1089
 RooMCStudy.cxx:1090
 RooMCStudy.cxx:1091
 RooMCStudy.cxx:1092
 RooMCStudy.cxx:1093
 RooMCStudy.cxx:1094
 RooMCStudy.cxx:1095
 RooMCStudy.cxx:1096
 RooMCStudy.cxx:1097
 RooMCStudy.cxx:1098
 RooMCStudy.cxx:1099
 RooMCStudy.cxx:1100
 RooMCStudy.cxx:1101
 RooMCStudy.cxx:1102
 RooMCStudy.cxx:1103
 RooMCStudy.cxx:1104
 RooMCStudy.cxx:1105
 RooMCStudy.cxx:1106
 RooMCStudy.cxx:1107
 RooMCStudy.cxx:1108
 RooMCStudy.cxx:1109
 RooMCStudy.cxx:1110
 RooMCStudy.cxx:1111
 RooMCStudy.cxx:1112
 RooMCStudy.cxx:1113
 RooMCStudy.cxx:1114
 RooMCStudy.cxx:1115
 RooMCStudy.cxx:1116
 RooMCStudy.cxx:1117
 RooMCStudy.cxx:1118
 RooMCStudy.cxx:1119
 RooMCStudy.cxx:1120
 RooMCStudy.cxx:1121
 RooMCStudy.cxx:1122
 RooMCStudy.cxx:1123
 RooMCStudy.cxx:1124
 RooMCStudy.cxx:1125
 RooMCStudy.cxx:1126
 RooMCStudy.cxx:1127
 RooMCStudy.cxx:1128
 RooMCStudy.cxx:1129
 RooMCStudy.cxx:1130
 RooMCStudy.cxx:1131
 RooMCStudy.cxx:1132
 RooMCStudy.cxx:1133
 RooMCStudy.cxx:1134
 RooMCStudy.cxx:1135
 RooMCStudy.cxx:1136
 RooMCStudy.cxx:1137
 RooMCStudy.cxx:1138
 RooMCStudy.cxx:1139
 RooMCStudy.cxx:1140
 RooMCStudy.cxx:1141
 RooMCStudy.cxx:1142
 RooMCStudy.cxx:1143
 RooMCStudy.cxx:1144
 RooMCStudy.cxx:1145
 RooMCStudy.cxx:1146
 RooMCStudy.cxx:1147
 RooMCStudy.cxx:1148
 RooMCStudy.cxx:1149
 RooMCStudy.cxx:1150
 RooMCStudy.cxx:1151
 RooMCStudy.cxx:1152
 RooMCStudy.cxx:1153
 RooMCStudy.cxx:1154
 RooMCStudy.cxx:1155
 RooMCStudy.cxx:1156
 RooMCStudy.cxx:1157
 RooMCStudy.cxx:1158
 RooMCStudy.cxx:1159
 RooMCStudy.cxx:1160
 RooMCStudy.cxx:1161
 RooMCStudy.cxx:1162
 RooMCStudy.cxx:1163
 RooMCStudy.cxx:1164
 RooMCStudy.cxx:1165
 RooMCStudy.cxx:1166
 RooMCStudy.cxx:1167
 RooMCStudy.cxx:1168
 RooMCStudy.cxx:1169
 RooMCStudy.cxx:1170
 RooMCStudy.cxx:1171
 RooMCStudy.cxx:1172
 RooMCStudy.cxx:1173
 RooMCStudy.cxx:1174
 RooMCStudy.cxx:1175
 RooMCStudy.cxx:1176
 RooMCStudy.cxx:1177
 RooMCStudy.cxx:1178
 RooMCStudy.cxx:1179
 RooMCStudy.cxx:1180
 RooMCStudy.cxx:1181
 RooMCStudy.cxx:1182
 RooMCStudy.cxx:1183
 RooMCStudy.cxx:1184
 RooMCStudy.cxx:1185
 RooMCStudy.cxx:1186
 RooMCStudy.cxx:1187
 RooMCStudy.cxx:1188
 RooMCStudy.cxx:1189
 RooMCStudy.cxx:1190
 RooMCStudy.cxx:1191
 RooMCStudy.cxx:1192
 RooMCStudy.cxx:1193
 RooMCStudy.cxx:1194
 RooMCStudy.cxx:1195
 RooMCStudy.cxx:1196
 RooMCStudy.cxx:1197
 RooMCStudy.cxx:1198
 RooMCStudy.cxx:1199
 RooMCStudy.cxx:1200
 RooMCStudy.cxx:1201
 RooMCStudy.cxx:1202
 RooMCStudy.cxx:1203
 RooMCStudy.cxx:1204
 RooMCStudy.cxx:1205
 RooMCStudy.cxx:1206
 RooMCStudy.cxx:1207
 RooMCStudy.cxx:1208
 RooMCStudy.cxx:1209
 RooMCStudy.cxx:1210
 RooMCStudy.cxx:1211
 RooMCStudy.cxx:1212
 RooMCStudy.cxx:1213
 RooMCStudy.cxx:1214
 RooMCStudy.cxx:1215
 RooMCStudy.cxx:1216
 RooMCStudy.cxx:1217
 RooMCStudy.cxx:1218
 RooMCStudy.cxx:1219
 RooMCStudy.cxx:1220
 RooMCStudy.cxx:1221
 RooMCStudy.cxx:1222
 RooMCStudy.cxx:1223
 RooMCStudy.cxx:1224
 RooMCStudy.cxx:1225
 RooMCStudy.cxx:1226
 RooMCStudy.cxx:1227
 RooMCStudy.cxx:1228
 RooMCStudy.cxx:1229
 RooMCStudy.cxx:1230
 RooMCStudy.cxx:1231
 RooMCStudy.cxx:1232
 RooMCStudy.cxx:1233
 RooMCStudy.cxx:1234
 RooMCStudy.cxx:1235
 RooMCStudy.cxx:1236
 RooMCStudy.cxx:1237
 RooMCStudy.cxx:1238
 RooMCStudy.cxx:1239
 RooMCStudy.cxx:1240
 RooMCStudy.cxx:1241
 RooMCStudy.cxx:1242
 RooMCStudy.cxx:1243
 RooMCStudy.cxx:1244
 RooMCStudy.cxx:1245
 RooMCStudy.cxx:1246
 RooMCStudy.cxx:1247
 RooMCStudy.cxx:1248
 RooMCStudy.cxx:1249
 RooMCStudy.cxx:1250
 RooMCStudy.cxx:1251
 RooMCStudy.cxx:1252
 RooMCStudy.cxx:1253
 RooMCStudy.cxx:1254
 RooMCStudy.cxx:1255
 RooMCStudy.cxx:1256
 RooMCStudy.cxx:1257
 RooMCStudy.cxx:1258
 RooMCStudy.cxx:1259
 RooMCStudy.cxx:1260
 RooMCStudy.cxx:1261
 RooMCStudy.cxx:1262
 RooMCStudy.cxx:1263
 RooMCStudy.cxx:1264
 RooMCStudy.cxx:1265
 RooMCStudy.cxx:1266
 RooMCStudy.cxx:1267
 RooMCStudy.cxx:1268
 RooMCStudy.cxx:1269
 RooMCStudy.cxx:1270
 RooMCStudy.cxx:1271
 RooMCStudy.cxx:1272
 RooMCStudy.cxx:1273
 RooMCStudy.cxx:1274
 RooMCStudy.cxx:1275
 RooMCStudy.cxx:1276
 RooMCStudy.cxx:1277
 RooMCStudy.cxx:1278
 RooMCStudy.cxx:1279
 RooMCStudy.cxx:1280
 RooMCStudy.cxx:1281
 RooMCStudy.cxx:1282
 RooMCStudy.cxx:1283
 RooMCStudy.cxx:1284
 RooMCStudy.cxx:1285
 RooMCStudy.cxx:1286
 RooMCStudy.cxx:1287
 RooMCStudy.cxx:1288
 RooMCStudy.cxx:1289
 RooMCStudy.cxx:1290
 RooMCStudy.cxx:1291
 RooMCStudy.cxx:1292
 RooMCStudy.cxx:1293
 RooMCStudy.cxx:1294
 RooMCStudy.cxx:1295
 RooMCStudy.cxx:1296
 RooMCStudy.cxx:1297
 RooMCStudy.cxx:1298
 RooMCStudy.cxx:1299
 RooMCStudy.cxx:1300
 RooMCStudy.cxx:1301
 RooMCStudy.cxx:1302
 RooMCStudy.cxx:1303
 RooMCStudy.cxx:1304
 RooMCStudy.cxx:1305
 RooMCStudy.cxx:1306
 RooMCStudy.cxx:1307
 RooMCStudy.cxx:1308
 RooMCStudy.cxx:1309
 RooMCStudy.cxx:1310
 RooMCStudy.cxx:1311
 RooMCStudy.cxx:1312
 RooMCStudy.cxx:1313
 RooMCStudy.cxx:1314
 RooMCStudy.cxx:1315
 RooMCStudy.cxx:1316
 RooMCStudy.cxx:1317
 RooMCStudy.cxx:1318
 RooMCStudy.cxx:1319
 RooMCStudy.cxx:1320
 RooMCStudy.cxx:1321
 RooMCStudy.cxx:1322
 RooMCStudy.cxx:1323
 RooMCStudy.cxx:1324
 RooMCStudy.cxx:1325
 RooMCStudy.cxx:1326