51 ofstream dtdFile(
"tunfoldbinning.dtd");
56 if(error) cout<<
"error="<<error<<
" from TDOMParser\n";
61 cout<<
"error: can not read binning (document empty?)\n";
63 cout<<
"Binning scheme:\n =================================\n";
66 PrintBinMap(binning,
"CreateEmptyBinMap",binMap);
70 PrintBinMap(binning,
"branch1->FillBinMap1D(...,\"y[C]\",...,2)",binMap);
75 PrintBinMap(binning,
"branch2->FillBinMap1D(...,\"x[C]\",...,7)",binMap);
79 PrintBinMap(binning,
"binning->FillBinMap1D(...,\"y[C]\",...,1)",binMap);
81 binning->
ExportXML(
"testUnfold6.out.xml");
86 const Int_t *binMap) {
88 cout<<
"\n"<<where<<
"\n=======================\n";
90 for(
int i=0;i<binning->
GetEndBin()+1;i++) {
95 for(
int i=0;i<binning->
GetEndBin()+1;i++) {
96 cout<<setw(3)<<binMap[i];
99 map<int,vector<int> > destBin;
100 for(
int i=0;i<binning->
GetEndBin()+1;i++) {
101 destBin[binMap[i]].push_back(i);
104 for(map<
int,vector<int> >::const_iterator i=destBin.begin();i!=destBin.end();i++) {
107 cout<<
"\ndest |contributing bins\n"
108 <<
"=====+======================================\n";
111 for(
size_t j=0;j<(*i).second.size();j++) {
112 cout<<setw(4)<<(*i).first<<
" |";
113 cout<<setw(3)<<binning->
GetBinName((*i).second[j])<<
"\n";
115 cout<<
"=====+======================================\n";
R__EXTERN TSystem * gSystem
virtual TXMLDocument * GetXMLDocument() const
Returns the TXMLDocument.
virtual Int_t ParseFile(const char *filename)
Parse the XML file where filename is the XML file name.
virtual const char * DirName(const char *pathname)
Return the directory name in pathname.
virtual const char * UnixPathName(const char *unixpathname)
Convert from a Unix pathname to a local pathname.
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.
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.
void PrintStream(std::ostream &out, Int_t indent=0, int debug=0) const
Print some information about this binning tree.
Int_t FillBinMap1D(Int_t *binMap, const char *axisSteering, Int_t firstBinX) const
Map all global bins referenced by this node to the one-dimensional histogram destHist,...
TString GetBinName(Int_t iBin) const
Get the name of a bin.
Int_t GetEndBin(void) const
last+1 bin of this node (includes children)
Int_t * CreateEmptyBinMap(void) const
Create an empty bin map, useful together with the getter methods of class TUnfold and TUnfoldSys.
TUnfoldBinning const * FindNode(char const *name) const
Traverse the tree and return the first node which matches the given name.
TXMLDocument contains a pointer to an xmlDoc structure, after the parser returns a tree built during ...