#include #include #include #include "AIDA_Proxy/AIDA_Proxy.h" #include "AIDA_Proxy/Proxy_Store.h" int main( int, char** ) { // Creating a 2 D data point set (x-y) // create some vector of points to fill the data point set std::vector x,y,ex,ey; std::srand(0); int nPoints = 10; for (int i = 0; i < nPoints; ++i) { x.push_back(i); y.push_back( 10 * static_cast( std::rand() ) / RAND_MAX); ex.push_back(0.5); ey.push_back(1); } std::cout << "Creating an 2-d (x-y) DataPointSet" << std::endl; pi_aida::DataPointSet dpsa("dps1","Example of an x-y data point set",x,y,ex,ey); std::cout << "DataPointSet : " << dpsa.title() << std::endl; std::cout << "Number of points : " << dpsa.size() << std::endl; std::cout << "Dimension : " << dpsa.dimension() << std::endl; // store the data point in an XML file // storing histogram to an XLM file std::cout << "Storing the histograms to a compress XML file ....." << std::endl; std::string fileName = "exa11.aida"; // open the store pi_aida::Proxy_Store s(fileName,"XML",true); // write the object s.write(dpsa); // close the store flushing the object into the file s.close(); std::cout << "done - data point set is stored in " << fileName << std::endl; return 0; }