#include <iostream>
#include <fstream>
#include <iomanip>
#include <map>
using std::cout, std::vector, std::map, std::setw;
void testUnfold6()
{
dtdFile.close();
if(error) cout<<"error="<<error<<" from TDOMParser\n";
if(!binning) {
cout<<"error: can not read binning (document empty?)\n";
} else {
cout<<"Binning scheme:\n =================================\n";
PrintBinMap(binning,"CreateEmptyBinMap",binMap);
PrintBinMap(binning,"branch1->FillBinMap1D(...,\"y[C]\",...,2)",binMap);
delete [] binMap;
PrintBinMap(binning,"branch2->FillBinMap1D(...,\"x[C]\",...,7)",binMap);
delete [] binMap;
PrintBinMap(binning,"binning->FillBinMap1D(...,\"y[C]\",...,1)",binMap);
delete [] binMap;
}
}
cout<<"\n"<<where<<"\n=======================\n";
cout<<"global bin:";
cout<<setw(3)<<i;
}
cout<<"\n";
cout<<"mapped to: ";
cout<<setw(3)<<binMap[i];
}
cout<<"\n";
destBin[binMap[i]].push_back(i);
}
bool printed=false;
for(
map<
int,
vector<int> >::const_iterator i=destBin.begin();i!=destBin.end();i++) {
if((*i).first>=0) {
if(!printed) {
cout<<"\ndest |contributing bins\n"
<<"=====+======================================\n";
printed=true;
}
for(size_t j=0;j<(*i).second.size();j++) {
cout<<setw(4)<<(*i).first<<" |";
cout<<setw(3)<<binning->
GetBinName((*i).second[j])<<
"\n";
}
cout<<"=====+======================================\n";
}
}
}
int Int_t
Signed integer 4 bytes (int).
virtual TXMLDocument * GetXMLDocument() const
Returns the TXMLDocument.
Int_t ParseFile(const char *filename) override
Parse the XML file where filename is the XML file name.
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 ...
This file is part of TUnfold.
TUnfold is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
TUnfold is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with TUnfold. If not, see http://www.gnu.org/licenses/.