Logo ROOT   6.30.04
Reference Guide
 All Namespaces Files Pages
ConfigParser.h
Go to the documentation of this file.
1 // @(#)root/roostats:$Id$
2 // Author: Kyle Cranmer, Akira Shibata
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 #ifndef ROOSTATS_CONFIGPARSER_h
13 #define ROOSTATS_CONFIGPARSER_h
14 
18 
19 #include "TList.h"
20 #include "TFile.h"
21 #include "TXMLAttr.h"
22 #include <TXMLNode.h>
23 
24 #include <cstdlib>
25 #include <string>
26 
27 namespace RooStats{
28  namespace HistFactory {
29 
30  class ConfigParser {
31 
32  public:
33 
34  /// The "main" method
35  std::vector< RooStats::HistFactory::Measurement > GetMeasurementsFromXML(std::string input);
36  RooStats::HistFactory::Measurement CreateMeasurementFromDriverNode( TXMLNode* node );
37  RooStats::HistFactory::Channel ParseChannelXMLFile( std::string filen );
38 
39  /// Helpers used to process a channel
40  HistFactory::Data CreateDataElement( TXMLNode* node );
41  HistFactory::Sample CreateSampleElement( TXMLNode* node );
42  HistFactory::StatErrorConfig CreateStatErrorConfigElement( TXMLNode* node );
43 
44  /// Helpers used when processing a Sample
45  HistFactory::NormFactor MakeNormFactor( TXMLNode* node );
46  HistFactory::HistoSys MakeHistoSys( TXMLNode* node );
47  HistFactory::HistoFactor MakeHistoFactor( TXMLNode* node );
48  HistFactory::OverallSys MakeOverallSys( TXMLNode* node );
49  HistFactory::ShapeFactor MakeShapeFactor( TXMLNode* node );
50  HistFactory::ShapeSys MakeShapeSys( TXMLNode* node );
51  HistFactory::StatError ActivateStatError( TXMLNode* node );
52  HistFactory::PreprocessFunction ParseFunctionConfig( TXMLNode* functionNode );
53 
54  protected:
55 
56  bool CheckTrueFalse( std::string val, std::string Name );
57  bool IsAcceptableNode( TXMLNode* functionNode );
58 
59  /// To facilitate writing xml, when not
60  /// specified, files and paths default
61  /// to these cached values
62  std::string m_currentInputFile;
63  std::string m_currentChannel;
64  std::string m_currentHistoPath;
65 
66  };
67  }
68 }
69 
70 #endif