Belle II Software  release-05-01-25
SVDModeByte.cc
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2010 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Martin Ritter, Peter Kvasnicka *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #include <svd/dataobjects/SVDModeByte.h>
12 #include <sstream>
13 
14 using namespace std;
15 
16 namespace Belle2 {
22  const SVDModeByte::baseType SVDModeByte::c_DefaultID = 151;
23 
24  SVDModeByte::operator string() const
25  {
26  stringstream os;
27  switch (m_id.parts.runType) {
28  case SVDRunType::raw:
29  os << "raw";
30  break;
31  case SVDRunType::transparent:
32  os << "transpt";
33  break;
34  case SVDRunType::zero_suppressed:
35  os << "0-suppr";
36  break;
37  case SVDRunType::zero_suppressed_timefit:
38  os << "0-suppr+tfit";
39  break;
40  }
41  os << "/";
42  switch (m_id.parts.eventType) {
43  case SVDEventType::global_run:
44  os << "global";
45  break;
46  case SVDEventType::local_run:
47  os << "local";
48  break;
49  }
50  os << "/";
51  switch (m_id.parts.daqMode) {
52  case SVDDAQModeType::daq_1sample:
53  os << "1 sample";
54  break;
55  case SVDDAQModeType::daq_3samples:
56  os << "3 samples";
57  break;
58  case SVDDAQModeType::daq_6samples:
59  os << "6 samples";
60  break;
61  default:
62  os << "unknown";
63  }
64  os << "/";
65  if (m_id.parts.triggerBin <= MaxGoodTriggerBin) {
66  os << static_cast<int>(m_id.parts.triggerBin);
67  } else {
68  os << "???";
69  }
70  return os.str();
71  }
72 
73  std::ostream& operator<<(std::ostream& out, const SVDModeByte& id)
74  {
75  out << ((string)id);
76  return out;
77  }
78 
80 }
Belle2::operator<<
std::ostream & operator<<(std::ostream &output, const IntervalOfValidity &iov)
Definition: IntervalOfValidity.cc:196
Belle2::SVDModeByte
Class to store SVD mode information.
Definition: SVDModeByte.h:79
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19