CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RBCInput.h
Go to the documentation of this file.
1 #ifndef INTERFACE_RBCINPUT_H
2 #define INTERFACE_RBCINPUT_H 1
3 
4 // Include files
5 #include <stdlib.h>
6 #include <istream>
7 #include <ostream>
8 #include <iostream>
9 #include <bitset>
10 #include <vector>
11 
21 class RBCInput {
22 public:
24  RBCInput( ) {
25  input_sec = new std::bitset<15>[2];
26  needmapping = false;
27  m_debug = false;
28  hasData = false;
29  };
30 
31  virtual ~RBCInput( ) {
32  if ( input_sec ) delete[] input_sec;
33  };
34 
35  RBCInput( const RBCInput & in )
36  {
37  for(int i=0; i < 30; ++i) input[i] = in.input[i];
38  for(int i=0; i < 2; ++i) input_sec[i] = in.input_sec[i];
40  m_debug = in.m_debug;
41  hasData = in.hasData;
42  m_wheelId = in.m_wheelId;
43  };
44 
45  RBCInput & operator=(const RBCInput & rhs)
46  {
47  if (this == &rhs) {
48  std::cout << "RBCInput:(this=rhs)" << '\n'; return (*this);
49  };
50  for(int i=0; i < 30; ++i) (*this).input[i] = rhs.input[i];
51  for(int i=0; i < 2; ++i) (*this).input_sec[i] = rhs.input_sec[i];
52  (*this).needmapping = rhs.needmapping;
53  (*this).m_debug = rhs.m_debug;
54  (*this).hasData = rhs.hasData;
55  (*this).m_wheelId = rhs.m_wheelId;
56  return (*this);
57  };
58 
59  // io functions
60  friend std::istream& operator>>(std::istream &istr, RBCInput &);
61  friend std::ostream& operator<<(std::ostream &ostr, RBCInput &);
62 
63  bool input[30];
64  std::bitset<15> * input_sec;
65 
66  void printinfo() {
67  std::cout << "RBCInput: " << (*this);
68  };
69 
70  void mask ( const std::vector<int> & );
71 
72  void force( const std::vector<int> & );
73 
74  bool hasData;
76 
77  void setWheelId( int wid ) {
78  m_wheelId = wid;
79  };
80 
81  int wheelId() const {
82  return m_wheelId;
83  };
84 
85 
86 private:
87 
88  bool m_debug;
89 
90  int m_wheelId;
91 
92 };
93 #endif // INTERFACE_RBCINPUT_H
int i
Definition: DBlmapReader.cc:9
friend std::ostream & operator<<(std::ostream &ostr, RBCInput &)
Definition: RBCInput.cc:26
virtual ~RBCInput()
Definition: RBCInput.h:31
void mask(const std::vector< int > &)
Definition: RBCInput.cc:37
friend std::istream & operator>>(std::istream &istr, RBCInput &)
Definition: RBCInput.cc:12
void force(const std::vector< int > &)
Definition: RBCInput.cc:52
void setWheelId(int wid)
Definition: RBCInput.h:77
RBCInput & operator=(const RBCInput &rhs)
Definition: RBCInput.h:45
RBCInput(const RBCInput &in)
Destructor.
Definition: RBCInput.h:35
RBCInput()
Standard constructor.
Definition: RBCInput.h:24
std::bitset< 15 > * input_sec
Definition: RBCInput.h:64
bool needmapping
Definition: RBCInput.h:75
void printinfo()
Definition: RBCInput.h:66
int wheelId() const
Definition: RBCInput.h:81
bool input[30]
Definition: RBCInput.h:63
bool hasData
Definition: RBCInput.h:74
tuple cout
Definition: gather_cfg.py:121
int m_wheelId
Definition: RBCInput.h:90
bool m_debug
Definition: RBCInput.h:83