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