Last change
on this file since 19907 was 17962, checked in by dneise, 10 years ago |
these modifications I found in the Mars.svn.2014.05.26 folder of Simona and added them to this branch without further thinking about them.
|
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.