Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:29:43

0001 // @(#)root/roostats:$Id$
0002 // Author: Kyle Cranmer, Akira Shibata
0003 /*************************************************************************
0004  * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers.               *
0005  * All rights reserved.                                                  *
0006  *                                                                       *
0007  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0008  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0009  *************************************************************************/
0010 
0011 
0012 #ifndef ROOSTATS_CONFIGPARSER_h
0013 #define ROOSTATS_CONFIGPARSER_h
0014 
0015 #include "RooStats/HistFactory/Channel.h"
0016 #include "RooStats/HistFactory/Measurement.h"
0017 #include "RooStats/HistFactory/Sample.h"
0018 
0019 #include <cstdlib>
0020 #include <string>
0021 #include <vector>
0022 
0023 class TXMLNode;
0024 
0025 namespace RooStats{
0026    namespace HistFactory {
0027 
0028      class ConfigParser {
0029 
0030      public:
0031 
0032        /// The "main" method
0033        std::vector< RooStats::HistFactory::Measurement > GetMeasurementsFromXML(std::string input);
0034        RooStats::HistFactory::Measurement CreateMeasurementFromDriverNode( TXMLNode* node );
0035        RooStats::HistFactory::Channel ParseChannelXMLFile( std::string filen );
0036 
0037        /// Helpers used to process a channel
0038        HistFactory::Data CreateDataElement( TXMLNode* node );
0039        HistFactory::Sample CreateSampleElement( TXMLNode* node );
0040        HistFactory::StatErrorConfig CreateStatErrorConfigElement( TXMLNode* node );
0041 
0042        /// Helpers used when processing a Sample
0043        HistFactory::NormFactor  MakeNormFactor( TXMLNode* node );
0044        HistFactory::HistoSys    MakeHistoSys( TXMLNode* node );
0045        HistFactory::HistoFactor MakeHistoFactor( TXMLNode* node );
0046        HistFactory::OverallSys  MakeOverallSys( TXMLNode* node );
0047        HistFactory::ShapeFactor MakeShapeFactor( TXMLNode* node );
0048        HistFactory::ShapeSys    MakeShapeSys( TXMLNode* node );
0049        HistFactory::StatError   ActivateStatError( TXMLNode* node );
0050        HistFactory::PreprocessFunction ParseFunctionConfig( TXMLNode* functionNode );
0051 
0052      protected:
0053 
0054        bool CheckTrueFalse( std::string val, std::string Name );
0055        bool IsAcceptableNode( TXMLNode* functionNode );
0056 
0057        /// To facilitate writing xml, when not
0058        /// specified, files and paths default
0059        /// to these cached values
0060        std::string m_currentInputFile;
0061        std::string m_currentChannel;
0062        std::string m_currentHistoPath;
0063 
0064      };
0065    }
0066 }
0067 
0068 #endif