Ignore:
Timestamp:
11/04/11 20:25:04 (13 years ago)
Author:
neise
Message:
adjusted to the new OpenDataFile() method
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/plotraw.C

    r12260 r12381  
    88#define HAVE_ZLIB
    99#include "fits.h"
     10
     11#include "FOpenDataFile.h"
    1012#include "FOpenDataFile.c"
    1113
     
    2022{
    2123        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 data
    32 //-------------------------------------------
    3324        vector<int16_t> data;
    3425        vector<int16_t> data_offset;
     
    3728        UInt_t data_px;
    3829        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        }
    4039       
    4140       
     
    4544        char title[500];
    4645        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);
    5352        cout << "Event number: " << data_num << endl;
    54                
    55 //-------------------------------------------
    56 //Draw the data
    57 //-------------------------------------------
    5853        plotevent(title, data, data_roi, pixelnr);
     54
     55        delete datafile;
    5956        return 0;
    6057}
     
    8279        return 0;
    8380}
     81
Note: See TracChangeset for help on using the changeset viewer.