00001 // $Id: $ 00002 00003 #include "Rivet/RivetAIDA.hh" 00004 #include "AIDA/IHistogram1D.h" 00005 using namespace AIDA; 00006 00007 #include <iostream> 00008 #include <fstream> 00009 00010 00011 /// Plugin function to return an AIDA system (LWH impl.) 00012 #include "LWH/AnalysisFactory.h" 00013 extern "C" AIDA::IAnalysisFactory* AIDA_createAnalysisFactory() { 00014 return new LWH::AnalysisFactory(); 00015 } 00016 00017 00018 /// Test the histogramming 00019 int main(int argc, char* argv[]) { 00020 IAnalysisFactory* af = AIDA_createAnalysisFactory(); 00021 //ITree* tree = af->createTreeFactory()->create("test.data", "flat", false, true); 00022 ITree* tree = af->createTreeFactory()->create("test.aida.xml", "xml", false, true); 00023 IHistogramFactory* hf = af->createHistogramFactory(*tree); 00024 IHistogram1D* h1 = hf->createHistogram1D("/test1", "Testing histo", 100, 0.0, 5.0); 00025 00026 for (int i = 0 ; i < 10000 ; ++i) { 00027 double x = i/2000.0; 00028 double y = sin(x); 00029 //std::cout << "Filling: " << x << ", " << y << std::endl; 00030 h1->fill(x, y*y); 00031 } 00032 00033 tree->commit(); 00034 00035 return EXIT_SUCCESS; 00036 }