Logo ROOT   6.12/07
Reference Guide
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 <TNamed.h>
45 #include <TObjArray.h>
46 #include <TObjString.h>
47 #include <TXMLNode.h>
48 #include <TXMLDocument.h>
49 #include <iostream>
50 
51 class TXMLNode;
52 class TXMLDocument;
53 
54 
56  public:
57  /********************** XML interface to read binning schemes *************/
58 static TUnfoldBinningXML *ImportXML(const TXMLDocument *document,const char *name); // import binning scheme
59  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
60  Int_t ExportXML(const char *fileName) const; // export this binning scheme
61  static void WriteDTD(const char *fileName="tunfoldbinning.dtd"); // write DTD file
62  static void WriteDTD(std::ostream &out); // write DTD to stream
63 
64  /// construct a new binning scheme, for use with the root streamer
65  TUnfoldBinningXML (const char *name=0,Int_t nBins=0,const char *binNames=0)
66  : TUnfoldBinning (name,nBins,binNames) { }
67  protected:
68  static TUnfoldBinningXML *ImportXMLNode(TXMLNode *node); // import the given node as binning scheme
69  void AddAxisXML(TXMLNode *node); // import axis information
70 protected:
71 
72  ClassDef(TUnfoldBinningXML, TUnfold_CLASS_VERSION) //Complex binning schemes for TUnfoldDensity
73 };
74 
75 #endif
TUnfoldBinningXML(const char *name=0, Int_t nBins=0, const char *binNames=0)
construct a new binning scheme, for use with the root streamer
void AddAxisXML(TXMLNode *node)
Import axis from XML node.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
XML interfate to 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 ...
Definition: TXMLDocument.h:24
static TUnfoldBinningXML * ImportXMLNode(TXMLNode *node)
Recursively import one node from the XML tree.
#define ClassDef(name, id)
Definition: Rtypes.h:320
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 writeHeader(THtml &html, ostream &out, const char *title, const char *relPath="../")
static TUnfoldBinningXML * ImportXML(const TXMLDocument *document, const char *name)
Import a binning scheme from an XML file.
Binning schemes for use with the unfolding algorithm TUnfoldDensity.
static void WriteDTD(const char *fileName="tunfoldbinning.dtd")
Write dtd file.
#define TUnfold_CLASS_VERSION
Definition: TUnfold.h:101
TXMLNode contains a pointer to xmlNode, which is a node under the DOM tree.
Definition: TXMLNode.h:22
char name[80]
Definition: TGX11.cxx:109