Last change
on this file since 19004 was 18309, checked in by Daniela Dorner, 9 years ago |
macros to read the thresholds from the auxiliary files
|
File size:
697 bytes
|
Line | |
---|
1 | void lastth(const char *fname, double beg=0)
|
---|
2 | {
|
---|
3 | fits file(fname);
|
---|
4 |
|
---|
5 | //file.PrintColumns();
|
---|
6 | //file.PrintKeys();
|
---|
7 |
|
---|
8 | Double_t time;
|
---|
9 | UShort_t th;
|
---|
10 | file.SetPtrAddress("Time", &time);
|
---|
11 | file.SetPtrAddress("threshold", &th);
|
---|
12 |
|
---|
13 | UInt_t offset = file.GetUInt("MJDREF");
|
---|
14 | if (beg<30000)
|
---|
15 | beg += offset;
|
---|
16 |
|
---|
17 | UShort_t th_last = 0;
|
---|
18 | Double_t time_last = -1;
|
---|
19 |
|
---|
20 | while (file.GetNextRow())
|
---|
21 | {
|
---|
22 | time += offset;
|
---|
23 |
|
---|
24 | if (time>beg && fabs(beg-time)>fabs(time_last))
|
---|
25 | break;
|
---|
26 |
|
---|
27 | th_last = th;
|
---|
28 | time_last = beg-time;
|
---|
29 | }
|
---|
30 |
|
---|
31 | if (th_last>0)
|
---|
32 | cout << "result " << th_last << " " << TMath::Nint(time_last*24*3600) << endl;
|
---|
33 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.