TUnfoldBinningXMLV17 Class Reference

XML interfate to binning schemes, for use with the unfolding algorithm TUnfoldDensity. More...

#include <TUnfoldBinningXML.h>

Inherits TUnfoldBinningV17.

Collaboration diagram for TUnfoldBinningXMLV17:
Collaboration graph
[legend]

List of all members.

Public Member Functions

Int_t ExportXML (const char *fileName) const
 export this binning scheme to a file
 TUnfoldBinningXMLV17 (const char *name=0, Int_t nBins=0, const char *binNames=0)
 construct a new binning scheme, for use with the root streamer

Static Public Member Functions

static TUnfoldBinningXMLV17ImportXML (const TXMLDocument *document, const char *name)
 import a binning scheme from an XML file
static Int_t ExportXML (const TUnfoldBinningV17 &binning, std::ostream &out, Bool_t writeHeader, Bool_t writeFooter, Int_t indent=0)
 export a binning scheme to a stream in XML format
static void WriteDTD (const char *fileName="tunfoldbinning.dtd")
 write dtd file
static void WriteDTD (std::ostream &out)

Protected Member Functions

void AddAxisXML (TXMLNode *node)
 import axis from XML node

Static Protected Member Functions

static TUnfoldBinningXMLV17ImportXMLNode (TXMLNode *node)
 recursively import one node from the XML tree

Detailed Description

XML interfate to binning schemes, for use with the unfolding algorithm TUnfoldDensity.

Binning schemes are used to map analysis bins on a single histogram axis and back. The analysis bins may include unconnected bins (e.g nuisances for background normalisation) or various multidimensional histograms (signal bins, differential background normalisation bins, etc).
If you use this software, please consider the following citation
S.Schmitt, JINST 7 (2012) T10003 [arXiv:1205.6201]
Detailed documentation and updates are available on http://desy.de/~sschmitt

Please consult the documentation of the class TUnfoldBinning about how to use binning schemes. This class provides methods to read and write binning schemes in the XML language. There is also a method which writes out a dtd file for validation.

Example XML code

The example below encodes two binning schemes, detector and generator. The detecor scheme consists of a single, three-dimensional distribution (pt,eta,discriminator). The generator scheme consists of two two-dimensional distributions, signal and background.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE TUnfoldBinning SYSTEM "tunfoldbinning.dtd">
<TUnfoldBinning>
<BinningNode name="detector" firstbin="1" factor="1">
 <BinningNode name="detectordistribution" firstbin="1" factor="1">
  <Axis name="pt" lowedge="3.5">
   <Bin repeat="3" width="0.5">
   <Bin repeat="3" width="1">
   <Bin width="2">
   <Bin width="3">
   <Bin location="overflow">
   <Axis name="eta" lowedge="-3">
    <Bin repeat="2" width="0.5">
    <Bin width="1">
    <Bin repeat="4" width="0.5">
    <Bin width="1">
    <Bin repeat="2" width="0.5">
    <Axis name="discriminator" lowedge="0">
     <Bin width="0.15">
     <Bin repeat="2" width="0.35">
     <Bin width="0.15">
    </Axis>
   </Axis>
  </Axis>
 </BinningNode>
</BinningNode>
<BinningNode name="generator" firstbin="1" factor="1">
 <BinningNode name="signal" firstbin="1" factor="1">
  <Axis name="ptgen" lowedge="4">
   <Bin location="underflow">
   <Bin width="1">
   <Bin width="2">
   <Bin width="3">
   <Bin location="overflow">
   <Axis name="etagen" lowedge="-2">
    <Bin location="underflow">
    <Bin width="1.5">
    <Bin width="1">
    <Bin width="1.5">
    <Bin location="overflow">
   </Axis>
  </Axis>
 </BinningNode>
 <BinningNode name="background" firstbin="26" factor="1">
  <Axis name="ptrec" lowedge="3.5">
   <Bin repeat="3" width="0.5">
   <Bin repeat="3" width="1">
   <Bin width="2">
   <Bin width="3">
   <Bin location="overflow">
   <Axis name="etarec" lowedge="-3">
    <Bin repeat="2" width="0.5">
    <Bin width="1">
    <Bin repeat="4" width="0.5">
    <Bin width="1">
    <Bin repeat="2" width="0.5">
   </Axis>
  </Axis>
 </BinningNode>
</BinningNode>
</TUnfoldBinning>

Definition at line 56 of file TUnfoldBinningXML.h.


Constructor & Destructor Documentation

TUnfoldBinningXMLV17::TUnfoldBinningXMLV17 ( const char *  name = 0,
Int_t  nBins = 0,
const char *  binNames = 0 
) [inline]

construct a new binning scheme, for use with the root streamer

Definition at line 66 of file TUnfoldBinningXML.h.


Member Function Documentation

void TUnfoldBinningXMLV17::AddAxisXML ( TXMLNode *  node  )  [protected]

import axis from XML node

Parameters:
[in] node node in the XML document tree

Definition at line 374 of file TUnfoldBinningXMLV17.cxx.

Referenced by ImportXMLNode().

Int_t TUnfoldBinningXMLV17::ExportXML ( const char *  fileName  )  const

export this binning scheme to a file

Parameters:
[in] fileName name of the file

returns true if the writing succeeded

Definition at line 575 of file TUnfoldBinningXMLV17.cxx.

Int_t TUnfoldBinningXMLV17::ExportXML ( const TUnfoldBinningV17 binning,
std::ostream &  out,
Bool_t  writeHeader,
Bool_t  writeFooter,
Int_t  indent = 0 
) [static]

export a binning scheme to a stream in XML format

Parameters:
[in] binning the binning scheme to export
[out] stream to write to
[in] writeHeader set true when writing the first binning scheme to this stream
[in] writeFooter set true when writing the last binning scheme to this stream
[in] indent indentation of the XML output

returns true if the writing succeeded

Definition at line 477 of file TUnfoldBinningXMLV17.cxx.

Referenced by ExportXML().

TUnfoldBinningXMLV17 * TUnfoldBinningXMLV17::ImportXML ( const TXMLDocument *  document,
const char *  name 
) [static]

import a binning scheme from an XML file

Parameters:
[in] document XMP document tree
[in] name identifier of the binning scheme

returns a new TUnfoldBinningXML, if name is found in document

Definition at line 182 of file TUnfoldBinningXMLV17.cxx.

TUnfoldBinningXMLV17 * TUnfoldBinningXMLV17::ImportXMLNode ( TXMLNode *  node  )  [static, protected]

recursively import one node from the XML tree

Parameters:
[in] node node in the XML document tree

returns a new TUnfoldBinningXML

Definition at line 226 of file TUnfoldBinningXMLV17.cxx.

static void TUnfoldBinningXMLV17::WriteDTD ( std::ostream &  out  )  [static]
void TUnfoldBinningXMLV17::WriteDTD ( const char *  file = "tunfoldbinning.dtd"  )  [static]

write dtd file

Parameters:
[in] file regular file for writing the dtd

Definition at line 169 of file TUnfoldBinningXMLV17.cxx.


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Enumerations Enumerator Defines

Generated on 17 Nov 2016 for TUnfold by  doxygen 1.6.1