CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes | Private Attributes | Friends
RBCInput Class Reference

#include <interface/RBCInput.h>

Public Member Functions

void force (const std::vector< int > &)
 
void mask (const std::vector< int > &)
 
RBCInputoperator= (const RBCInput &rhs)
 
void printinfo ()
 
 RBCInput ()
 Standard constructor. More...
 
 RBCInput (const RBCInput &in)
 Destructor. More...
 
void setWheelId (int wid)
 
int wheelId () const
 
virtual ~RBCInput ()
 

Public Attributes

bool hasData
 
bool input [30]
 
std::bitset< 15 > * input_sec
 
bool needmapping
 

Private Attributes

bool m_debug
 
int m_wheelId
 

Friends

std::ostream & operator<< (std::ostream &ostr, RBCInput &)
 
std::istream & operator>> (std::istream &istr, RBCInput &)
 

Detailed Description

Author
Andres Osorio

email: aosor.nosp@m.io@u.nosp@m.niand.nosp@m.es.e.nosp@m.du.co

Date
2008-10-16

Definition at line 22 of file RBCInput.h.

Constructor & Destructor Documentation

RBCInput::RBCInput ( )
inline

Standard constructor.

Definition at line 25 of file RBCInput.h.

References hasData, input_sec, m_debug, and needmapping.

25  {
26  input_sec = new std::bitset<15>[2];
27  needmapping = false;
28  m_debug = false;
29  hasData = false;
30  };
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
bool needmapping
Definition: RBCInput.h:76
bool hasData
Definition: RBCInput.h:75
bool m_debug
Definition: RBCInput.h:84
virtual RBCInput::~RBCInput ( )
inlinevirtual

Definition at line 32 of file RBCInput.h.

References input_sec.

32  {
33  if ( input_sec ) delete[] input_sec;
34  };
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
RBCInput::RBCInput ( const RBCInput in)
inline

Destructor.

Definition at line 36 of file RBCInput.h.

References hasData, i, input, input_sec, m_debug, m_wheelId, and needmapping.

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  };
int i
Definition: DBlmapReader.cc:9
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
bool needmapping
Definition: RBCInput.h:76
bool input[30]
Definition: RBCInput.h:64
bool hasData
Definition: RBCInput.h:75
int m_wheelId
Definition: RBCInput.h:91
bool m_debug
Definition: RBCInput.h:84

Member Function Documentation

void RBCInput::force ( const std::vector< int > &  forcevec)

Definition at line 53 of file RBCInput.cc.

References gather_cfg::cout, i, input_sec, m_debug, and tmp.

Referenced by RBCBasicConfig::preprocess().

54 {
55 
56  if( m_debug ) std::cout << forcevec.size() << std::endl;
57 
58  std::bitset<15> tmp;
59 
60  for(int i=0; i < 15; ++i)
61  tmp.set(i,forcevec[i]);
62 
63  //... operate on the first sector
64  input_sec[0]|=tmp;
65  tmp.reset();
66 
67  for(int i=15; i < 30; ++i)
68  tmp.set( (i-15),forcevec[i]);
69 
70  input_sec[1]|=tmp;
71 
72  tmp.reset();
73 
74 }
int i
Definition: DBlmapReader.cc:9
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
tuple cout
Definition: gather_cfg.py:121
bool m_debug
Definition: RBCInput.h:84
void RBCInput::mask ( const std::vector< int > &  maskvec)

Definition at line 38 of file RBCInput.cc.

References i, and input_sec.

Referenced by RBCBasicConfig::preprocess().

39 {
40 
41  //... operate on the first sector
42 
43  for(int i=0; i < 15; ++i)
44  if ( maskvec[i] ) input_sec[0].set(i,0);
45 
46  //... operate on the second sector
47 
48  for(int i=15; i < 30; ++i)
49  if ( maskvec[i] ) input_sec[1].set( (i-15),0);
50 
51 }
int i
Definition: DBlmapReader.cc:9
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
RBCInput& RBCInput::operator= ( const RBCInput rhs)
inline

Definition at line 46 of file RBCInput.h.

References gather_cfg::cout, hasData, i, input, input_sec, m_debug, m_wheelId, and needmapping.

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  };
int i
Definition: DBlmapReader.cc:9
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
bool needmapping
Definition: RBCInput.h:76
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
void RBCInput::printinfo ( )
inline

Definition at line 67 of file RBCInput.h.

References gather_cfg::cout.

67  {
68  std::cout << "RBCInput: " << (*this);
69  };
tuple cout
Definition: gather_cfg.py:121
void RBCInput::setWheelId ( int  wid)
inline

Definition at line 78 of file RBCInput.h.

References m_wheelId.

Referenced by RBCEmulator::emulate().

78  {
79  m_wheelId = wid;
80  };
int m_wheelId
Definition: RBCInput.h:91
int RBCInput::wheelId ( ) const
inline

Definition at line 82 of file RBCInput.h.

References m_wheelId.

Referenced by RBCChamberORLogic::process().

82  {
83  return m_wheelId;
84  };
int m_wheelId
Definition: RBCInput.h:91

Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  ostr,
RBCInput rhs 
)
friend

Definition at line 27 of file RBCInput.cc.

27  {
28 
29  for(int i=0; i < 15; ++i) ostr << rhs.input_sec[0][i];
30  ostr << '\t';
31  for(int i=0; i < 15; ++i) ostr << rhs.input_sec[1][i];
32  ostr << '\n';
33 
34  return ostr;
35 
36 }
int i
Definition: DBlmapReader.cc:9
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
std::istream& operator>> ( std::istream &  istr,
RBCInput rhs 
)
friend

Definition at line 13 of file RBCInput.cc.

13  {
14 
15  int _ks=0;
16 
17  for(int i=0 ; i < 30; ++i) {
18  istr >> rhs.input[i];
19  if ( i < 15 ) _ks = 0;
20  else _ks = 1;
21  rhs.input_sec[_ks].set(i-(15*_ks), rhs.input[i]);
22  }
23  return istr;
24 
25 }
int i
Definition: DBlmapReader.cc:9
std::bitset< 15 > * input_sec
Definition: RBCInput.h:65
bool input[30]
Definition: RBCInput.h:64

Member Data Documentation

bool RBCInput::hasData
bool RBCInput::input[30]

Definition at line 64 of file RBCInput.h.

Referenced by operator=(), operator>>(), and RBCInput().

std::bitset<15>* RBCInput::input_sec
bool RBCInput::m_debug
private

Definition at line 84 of file RBCInput.h.

Referenced by force(), operator=(), and RBCInput().

int RBCInput::m_wheelId
private

Definition at line 91 of file RBCInput.h.

Referenced by operator=(), RBCInput(), setWheelId(), and wheelId().

bool RBCInput::needmapping