source: fact/tools/rootmacros/test.C@ 17633

Last change on this file since 17633 was 12205, checked in by neise, 13 years ago
removed CRLF
File size: 1.1 KB
Line 
1#include "fits.h"
2
3#include <stdint.h>
4
5int test(const char *name)
6{
7 fits file(name);
8 if (!file)
9 {
10 cout << "Couldn't properly open the file." << endl;
11 return 1;
12 }
13
14 cout << "-------------------- Header -------------------" << endl;
15 file.PrintKeys();
16 cout << "------------------- Columns -------------------" << endl;
17 file.PrintColumns();
18
19 cout << "--------------------- Data --------------------" << endl;
20
21 unsigned int num;
22 short type;
23
24 const size_t n = file.GetN("Data"); // Size of column "Data"
25 const UInt_t roi = file.GetUInt("NROI"); // Value from header
26
27 vector<int16_t> data(n);
28
29 file.SetRefAddress("EventNum", num);
30 file.SetRefAddress("TriggerType", type);
31 file.SetVecAddress("Data", data);
32
33 for (size_t i=0; i<file.GetNumRows(); i++)
34 {
35 file.GetRow(i);
36 cout << "Event number: " << num << endl;
37
38 for (int j=0; j<1440; j++)
39 for (UInt_t k=0; k<roi; k++)
40 {
41 int16_t sample = data[j*roi+k];
42 sample+=0; // Supress compiler warning
43 }
44 }
45
46 return 0;
47}
Note: See TracBrowser for help on using the repository browser.