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);
76 PrintBinMap(binning,
"branch2->FillBinMap1D(...,\"x[C]\",...,7)",binMap);
81 PrintBinMap(binning,
"binning->FillBinMap1D(...,\"y[C]\",...,1)",binMap);
83 binning->
ExportXML(
"testUnfold6.out.xml");
91 const Int_t *binMap) {
93 cout<<
"\n"<<where<<
"\n=======================\n";
95 for(
int i=0;i<binning->
GetEndBin()+1;i++) {
100 for(
int i=0;i<binning->
GetEndBin()+1;i++) {
101 cout<<setw(3)<<binMap[i];
104 map<int,vector<int> > destBin;
105 for(
int i=0;i<binning->
GetEndBin()+1;i++) {
106 destBin[binMap[i]].push_back(i);
109 for(map<
int,vector<int> >::const_iterator i=destBin.begin();i!=destBin.end();i++) {
112 cout<<
"\ndest |contributing bins\n"
113 <<
"=====+======================================\n";
116 for(
size_t j=0;j<(*i).second.size();j++) {
117 cout<<setw(4)<<(*i).first<<
" |";
118 cout<<setw(3)<<binning->
GetBinName((*i).second[j])<<
"\n";
120 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 * UnixPathName(const char *unixpathname)
Convert from a local pathname to a Unix pathname.
virtual TString GetDirName(const char *pathname)
Return the directory name in 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 ...