Changeset 12381
- Timestamp:
- 11/04/11 20:25:04 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
fact/tools/rootmacros/plotraw.C
r12260 r12381 8 8 #define HAVE_ZLIB 9 9 #include "fits.h" 10 11 #include "FOpenDataFile.h" 10 12 #include "FOpenDataFile.c" 11 13 … … 20 22 { 21 23 gROOT->SetStyle("Plain"); 22 23 fits datafile(name);24 if (!datafile)25 {26 cout << "Couldn't properly open the datafile." << endl;27 return 1;28 }29 30 //-------------------------------------------31 //Get the data32 //-------------------------------------------33 24 vector<int16_t> data; 34 25 vector<int16_t> data_offset; … … 37 28 UInt_t data_px; 38 29 UInt_t data_roi; 39 FOpenDataFile(datafile, data, data_offset, data_num, data_n, data_roi, data_px); 30 size_t rc_open; 31 32 fits * datafile; 33 rc_open = OpenDataFile( name, &datafile, data, data_offset, data_num, data_roi, data_px, data_n, 0); 34 35 if (rc_open == 0){ 36 cout << "some error occured during file opening ... aborting." << endl; 37 return 1; 38 } 40 39 41 40 … … 45 44 char title[500]; 46 45 std::sprintf(title,"Data: %s, Px %i Ev %i",name,pixelnr,eventnr); 47 48 //------------------------------------------- 49 //Get the event 50 //------------------------------------------- 51 cout << "--------------------- Data --------------------" << endl;52 datafile .GetRow(eventnr);46 47 if (datafile == NULL){ 48 cout << "Error: FOpenDataFile was ok, but now datafile pointer not vaild... abort." << endl; 49 return 1; 50 } 51 datafile->GetRow(eventnr); 53 52 cout << "Event number: " << data_num << endl; 54 55 //-------------------------------------------56 //Draw the data57 //-------------------------------------------58 53 plotevent(title, data, data_roi, pixelnr); 54 55 delete datafile; 59 56 return 0; 60 57 } … … 82 79 return 0; 83 80 } 81
Note:
See TracChangeset
for help on using the changeset viewer.