Belle II Software  release-08-01-10
SVDModeByte.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 <svd/dataobjects/SVDModeByte.h>
10 #include <sstream>
11 
12 using namespace std;
13 
14 namespace Belle2 {
20  const SVDModeByte::baseType SVDModeByte::c_DefaultID = 151;
21 
22  SVDModeByte::operator string() const
23  {
24  stringstream os;
25  switch (m_id.parts.runType) {
26  case SVDRunType::raw:
27  os << "raw";
28  break;
29  case SVDRunType::transparent:
30  os << "transpt";
31  break;
32  case SVDRunType::zero_suppressed:
33  os << "0-suppr";
34  break;
35  case SVDRunType::zero_suppressed_timefit:
36  os << "0-suppr+tfit";
37  break;
38  }
39  os << "/";
40  switch (m_id.parts.eventType) {
41  case SVDEventType::global_run:
42  os << "global";
43  break;
44  case SVDEventType::local_run:
45  os << "local";
46  break;
47  }
48  os << "/";
49  switch (m_id.parts.daqMode) {
50  case SVDDAQModeType::daq_1sample:
51  os << "1 sample";
52  break;
53  case SVDDAQModeType::daq_3samples:
54  os << "3 samples";
55  break;
56  case SVDDAQModeType::daq_6samples:
57  os << "6 samples";
58  break;
59  default:
60  os << "unknown";
61  }
62  os << "/";
63  if (m_id.parts.triggerBin <= MaxGoodTriggerBin) {
64  os << static_cast<int>(m_id.parts.triggerBin);
65  } else {
66  os << "???";
67  }
68  return os.str();
69  }
70 
71  std::ostream& operator<<(std::ostream& out, const SVDModeByte& id)
72  {
73  out << ((string)id);
74  return out;
75  }
76 
78 }
Class to store SVD mode information.
Definition: SVDModeByte.h:69
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Abstract base class for different kinds of events.