Belle II Software  release-08-01-10
RawFTSWFormat.cc
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #include <rawdata/dataobjects/RawFTSWFormat.h>
10 
11 
12 using namespace std;
13 using namespace Belle2;
14 
15 RawFTSWFormat::RawFTSWFormat()
16 {
17 }
18 
19 RawFTSWFormat::~RawFTSWFormat()
20 {
21 }
22 
23 // This function is only available in RawFTSW ver.1 (for DESY test)
24 int RawFTSWFormat::Get15bitTLUTag(int n)
25 {
26  char err_buf[500];
27  sprintf(err_buf,
28  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
29  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
30  printf("%s\n", err_buf); fflush(stdout);
31  B2FATAL(err_buf);
32  return -1;
33 }
34 
35 // This function is only available in RawFTSW ver.2
36 int RawFTSWFormat::GetIsHER(int n)
37 {
38  char err_buf[500];
39  sprintf(err_buf,
40  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
41  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
42  printf("%s\n", err_buf); fflush(stdout);
43  B2FATAL(err_buf);
44  return -1;
45 }
46 
47 
48 
49 unsigned int RawFTSWFormat::GetTimeSinceLastInjection(int n)
50 {
51  char err_buf[500];
52  sprintf(err_buf,
53  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
54  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
55  printf("%s\n", err_buf); fflush(stdout);
56  B2FATAL(err_buf);
57  return -1;
58 
59 }
60 
61 unsigned int RawFTSWFormat::GetTimeSincePrevTrigger(int n)
62 {
63  char err_buf[500];
64  sprintf(err_buf,
65  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
66  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
67  printf("%s\n", err_buf); fflush(stdout);
68  B2FATAL(err_buf);
69  return -1;
70 }
71 
72 unsigned int RawFTSWFormat::GetBunchNumber(int n)
73 {
74  char err_buf[500];
75  sprintf(err_buf,
76  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
77  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
78  printf("%s\n", err_buf); fflush(stdout);
79  B2FATAL(err_buf);
80  return -1;
81 }
82 
83 unsigned int RawFTSWFormat::GetFrameCount(int n)
84 {
85  char err_buf[500];
86  sprintf(err_buf,
87  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
88  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
89  printf("%s\n", err_buf); fflush(stdout);
90  B2FATAL(err_buf);
91  return -1;
92 }
93 
94 // The parameter n is unused: let's disable the compiler warning for this function.
95 #pragma GCC diagnostic push
96 #pragma GCC diagnostic ignored "-Wunused-parameter"
97 
98 void RawFTSWFormat::GetPCTimeVal(int n, struct timeval* tv)
99 {
100  // According to Nakao-san's comment at DAQ meeting on Feb.28, 2020. If one calls this function for older data, just returning 0 values is fine.
101  // No need to either end up with FATAL message or issue any WARNING messages (Actually, WARNING messages would be issued in every event when implemented.)
102  tv->tv_sec = 0;
103  tv->tv_usec = 0;
104 
105  return;
106 }
107 
108 #pragma GCC diagnostic pop
Abstract base class for different kinds of events.