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.9, parallel to changes in TUnfold
5//
6// History:
7// Version 17.8, relaxed DTD definition
8// Version 17.7, in parallel to changes in TUnfold
9// Version 17.6, with updated doxygen comments
10// Version 17.5, in parallel to changes in TUnfold
11// Version 17.4, in parallel to changes in TUnfoldBinning
12// Version 17.3, support for repeated bins with the same width
13// Version 17.2, XML interface for class TUnfoldBinning
14
15#ifndef ROOT_TUnfoldBinningXML
16#define ROOT_TUnfoldBinningXML
17
18
19//////////////////////////////////////////////////////////////////////////
20// //
21// //
22// TUnfoldBinningXML, an auxillary class to read and write //
23// complex binning schemes in XML //
24// //
25// Citation: S.Schmitt, JINST 7 (2012) T10003 [arXiv:1205.6201] //
26// //
27//////////////////////////////////////////////////////////////////////////
28
29/*
30 This file is part of TUnfold.
31
32 TUnfold is free software: you can redistribute it and/or modify
33 it under the terms of the GNU General Public License as published by
34 the Free Software Foundation, either version 3 of the License, or
35 (at your option) any later version.
36
37 TUnfold is distributed in the hope that it will be useful,
38 but WITHOUT ANY WARRANTY; without even the implied warranty of
39 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
40 GNU General Public License for more details.
41
42 You should have received a copy of the GNU General Public License
43 along with TUnfold. If not, see <http://www.gnu.org/licenses/>.
44*/
45
46#include "TUnfoldBinning.h"
47#include <iostream>
48#include <TNamed.h>
49#include <TObjArray.h>
50#include <TObjString.h>
51#include <TXMLNode.h>
52#include <TXMLDocument.h>
53#include <iostream>
54
55class TXMLNode;
56class TXMLDocument;
57
58
60 public:
61 /********************** XML interface to read binning schemes *************/
62static TUnfoldBinningXML *ImportXML(const TXMLDocument *document,const char *name); // import binning scheme
63 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
64 Int_t ExportXML(const char *fileName) const; // export this binning scheme
65 static void WriteDTD(const char *fileName="tunfoldbinning.dtd"); // write DTD file
66 static void WriteDTD(std::ostream &out); // write DTD to stream
67
68 /// construct a new binning scheme, for use with the root streamer
69 TUnfoldBinningXML (const char *name=nullptr,Int_t nBins=0,const char *binNames=nullptr)
70 : TUnfoldBinning (name,nBins,binNames) { }
71 protected:
72 static TUnfoldBinningXML *ImportXMLNode(TXMLNode *node); // import the given node as binning scheme
73 void AddAxisXML(TXMLNode *node); // import axis information
74protected:
75
76 ClassDefOverride(TUnfoldBinningXML, TUnfold_CLASS_VERSION) //Complex binning schemes for TUnfoldDensity
77};
78
79#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:346
static void indent(ostringstream &buf, int indent_level)
char name[80]
Definition TGX11.cxx:110
#define TUnfold_CLASS_VERSION
Definition TUnfold.h:105
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
static void WriteDTD(std::ostream &out)
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
TUnfoldBinningXML(const char *name=nullptr, Int_t nBins=0, const char *binNames=nullptr)
construct a new binning scheme, for use with the root streamer
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