Belle II Software  release-05-01-25
RawFTSWFormat.cc
1 //+
2 // File : RawFTSWFormat.cc
3 // Description : Module to handle raw data from COPPER.
4 //
5 // Author : Satoru Yamada, IPNS, KEK
6 // Date : 2 - Aug - 2013
7 //-
8 #include <rawdata/dataobjects/RawFTSWFormat.h>
9 
10 
11 using namespace std;
12 using namespace Belle2;
13 
14 RawFTSWFormat::RawFTSWFormat()
15 {
16 }
17 
18 RawFTSWFormat::~RawFTSWFormat()
19 {
20 }
21 
22 // This function is only available in RawFTSW ver.1 (for DESY test)
23 int RawFTSWFormat::Get15bitTLUTag(int n)
24 {
25  char err_buf[500];
26  sprintf(err_buf,
27  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
28  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
29  printf("%s\n", err_buf); fflush(stdout);
30  B2FATAL(err_buf);
31  return -1;
32 }
33 
34 // This function is only available in RawFTSW ver.2
35 int RawFTSWFormat::GetIsHER(int n)
36 {
37  char err_buf[500];
38  sprintf(err_buf,
39  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
40  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
41  printf("%s\n", err_buf); fflush(stdout);
42  B2FATAL(err_buf);
43  return -1;
44 }
45 
46 
47 
48 unsigned int RawFTSWFormat::GetTimeSinceLastInjection(int n)
49 {
50  char err_buf[500];
51  sprintf(err_buf,
52  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
53  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
54  printf("%s\n", err_buf); fflush(stdout);
55  B2FATAL(err_buf);
56  return -1;
57 
58 }
59 
60 unsigned int RawFTSWFormat::GetTimeSincePrevTrigger(int n)
61 {
62  char err_buf[500];
63  sprintf(err_buf,
64  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
65  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
66  printf("%s\n", err_buf); fflush(stdout);
67  B2FATAL(err_buf);
68  return -1;
69 }
70 
71 unsigned int RawFTSWFormat::GetBunchNumber(int n)
72 {
73  char err_buf[500];
74  sprintf(err_buf,
75  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
76  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
77  printf("%s\n", err_buf); fflush(stdout);
78  B2FATAL(err_buf);
79  return -1;
80 }
81 
82 unsigned int RawFTSWFormat::GetFrameCount(int n)
83 {
84  char err_buf[500];
85  sprintf(err_buf,
86  "[FATAL] This function is not supported in the version of RawFTSW format that you're using. n=%d : %s %s %d: Exiting...\n",
87  n, __FILE__, __PRETTY_FUNCTION__, __LINE__);
88  printf("%s\n", err_buf); fflush(stdout);
89  B2FATAL(err_buf);
90  return -1;
91 }
92 
93 void RawFTSWFormat::GetPCTimeVal(int n, struct timeval* tv)
94 {
95  // 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.
96  // 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.)
97  tv->tv_sec = 0;
98  tv->tv_usec = 0;
99 
100  return;
101 
102 }
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19