Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
PreprocessFunction.cxx
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer, George Lewis
3 /*************************************************************************
4  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. *
5  * All rights reserved. *
6  * *
7  * For the licensing terms see $ROOTSYS/LICENSE. *
8  * For the list of contributors see $ROOTSYS/README/CREDITS. *
9  *************************************************************************/
10 
11 ////////////////////////////////////////////////////////////////////////////////
12 /**
13  * \ingroup HistFactory
14  */
15 
17 
18 
19 RooStats::HistFactory::PreprocessFunction::PreprocessFunction() {;}
20 
21 RooStats::HistFactory::PreprocessFunction::PreprocessFunction(std::string Name, std::string Expression, std::string Dependents) :
22  fName(Name), fExpression(Expression), fDependents(Dependents) {
23  fCommand = GetCommand(Name, Expression, Dependents);
24 }
25 
26 std::string RooStats::HistFactory::PreprocessFunction::GetCommand(std::string Name, std::string Expression, std::string Dependents) {
27  std::string command = "expr::"+Name+"('"+Expression+"',{"+Dependents+"})";
28  return command;
29 }
30 
31 
32 void RooStats::HistFactory::PreprocessFunction::Print( std::ostream& stream ) {
33 
34  stream << "\t \t Name: " << fName
35  << "\t \t Expression: " << fExpression
36  << "\t \t Dependents: " << fDependents
37  << std::endl;
38 
39 }
40 
41 void RooStats::HistFactory::PreprocessFunction::PrintXML( std::ostream& xml ) {
42  xml << "<Function Name=\"" << GetName() << "\" "
43  << "Expression=\"" << GetExpression() << "\" "
44  << "Dependents=\"" << GetDependents() << "\" "
45  << "/>" << std::endl;
46 }