Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TUnfoldBinningXML.h
Go to the documentation of this file.
1// Author: Stefan Schmitt
2// DESY, 10/08/11
3
4// Version 17.5, in parallel to changes in TUnfold
5//
6// History:
7// Version 17.4, in parallel to changes in TUnfoldBinning
8// Version 17.3, support for repeated bins with the same width
9// Version 17.2, XML interface for class TUnfoldBinning
10
11#ifndef ROOT_TUnfoldBinningXML
12#define ROOT_TUnfoldBinningXML
13
14
15//////////////////////////////////////////////////////////////////////////
16// //
17// //
18// TUnfoldBinningXML, an auxillary class to read and write //
19// complex binning schemes in XML //
20// //
21// Citation: S.Schmitt, JINST 7 (2012) T10003 [arXiv:1205.6201] //
22// //
23//////////////////////////////////////////////////////////////////////////
24
25/*
26 This file is part of TUnfold.
27
28 TUnfold is free software: you can redistribute it and/or modify
29 it under the terms of the GNU General Public License as published by
30 the Free Software Foundation, either version 3 of the License, or
31 (at your option) any later version.
32
33 TUnfold is distributed in the hope that it will be useful,
34 but WITHOUT ANY WARRANTY; without even the implied warranty of
35 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 GNU General Public License for more details.
37
38 You should have received a copy of the GNU General Public License
39 along with TUnfold. If not, see <http://www.gnu.org/licenses/>.
40*/
41
42#include "TUnfoldBinning.h"
43#include <iostream>
44#include <TXMLNode.h>
45#include <TXMLDocument.h>
46
47class TXMLNode;
48class TXMLDocument;
49
50
52 public:
53 /********************** XML interface to read binning schemes *************/
54static TUnfoldBinningXML *ImportXML(const TXMLDocument *document,const char *name); // import binning scheme
55 static Int_t ExportXML(const TUnfoldBinning &binning,std::ostream &out,Bool_t writeHeader,Bool_t writeFooter,Int_t indent=0); // append binning scheme to file
56 Int_t ExportXML(const char *fileName) const; // export this binning scheme
57 static void WriteDTD(const char *fileName="tunfoldbinning.dtd"); // write DTD file
58 static void WriteDTD(std::ostream &out); // write DTD to stream
59
60 /// construct a new binning scheme, for use with the root streamer
61 TUnfoldBinningXML (const char *name=0,Int_t nBins=0,const char *binNames=0)
62 : TUnfoldBinning (name,nBins,binNames) { }
63 protected:
64 static TUnfoldBinningXML *ImportXMLNode(TXMLNode *node); // import the given node as binning scheme
65 void AddAxisXML(TXMLNode *node); // import axis information
66protected:
67
68 ClassDef(TUnfoldBinningXML, TUnfold_CLASS_VERSION) //Complex binning schemes for TUnfoldDensity
69};
70
71#endif
void writeHeader(THtml &html, ostream &out, const char *title, const char *relPath="../")
#define ClassDef(name, id)
Definition Rtypes.h:325
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
#define TUnfold_CLASS_VERSION
Definition TUnfold.h:100
XML interfate to binning schemes, for use with the unfolding algorithm TUnfoldDensity.
static Int_t ExportXML(const TUnfoldBinning &binning, std::ostream &out, Bool_t writeHeader, Bool_t writeFooter, Int_t indent=0)
Export a binning scheme to a stream in XML format.
void AddAxisXML(TXMLNode *node)
Import axis from XML node.
TUnfoldBinningXML(const char *name=0, Int_t nBins=0, const char *binNames=0)
construct a new binning scheme, for use with the root streamer
static TUnfoldBinningXML * ImportXMLNode(TXMLNode *node)
Recursively import one node from the XML tree.
static TUnfoldBinningXML * ImportXML(const TXMLDocument *document, const char *name)
Import a binning scheme from an XML file.
static void WriteDTD(const char *fileName="tunfoldbinning.dtd")
Write dtd file.
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
TXMLDocument contains a pointer to an xmlDoc structure, after the parser returns a tree built during ...
TXMLNode contains a pointer to xmlNode, which is a node under the DOM tree.
Definition TXMLNode.h:20