#include #include #include #include #include #define HAVE_ZLIB #include "fits.h" #include "FOpenDataFile.h" #include "FOpenDataFile.c" int plotevent( char *title, vector &data, UInt_t data_roi, size_t pixelnr); int plotraw(const char *name = "../raw/20110916_025.fits", size_t eventnr = 0, size_t pixelnr = 0) { gROOT->SetStyle("Plain"); vector data; vector data_offset; unsigned int data_num; size_t data_n; UInt_t data_px; UInt_t data_roi; size_t rc_open; fits * datafile; rc_open = OpenDataFile( name, &datafile, data, data_offset, data_num, data_roi, data_px, data_n, 0); if (rc_open == 0){ cout << "some error occured during file opening ... aborting." << endl; return 1; } //------------------------------------------- //Create the title //------------------------------------------- char title[500]; std::sprintf(title,"Data: %s, Px %i Ev %i",name,pixelnr,eventnr); if (datafile == NULL){ cout << "Error: FOpenDataFile was ok, but now datafile pointer not vaild... abort." << endl; return 1; } datafile->GetRow(eventnr); cout << "Event number: " << data_num << endl; plotevent(title, data, data_roi, pixelnr); delete datafile; return 0; } int plotevent( char *title, vector &data, UInt_t data_roi, size_t pixelnr) { TCanvas *canv = new TCanvas( "canv", "Mean values of the first event", 100, 10, 700, 500 ); TProfile *pix = new TProfile("pix", title, 1024, -0.5, 1023.5); for (UInt_t k=0; kFill(k,sample); } pix->Draw(); canv->Modified(); canv->Update(); return 0; }