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 21 of file RBCInput.h.

Constructor & Destructor Documentation

RBCInput::RBCInput ( )
inline

Standard constructor.

Definition at line 24 of file RBCInput.h.

References hasData, input_sec, m_debug, and needmapping.

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

Definition at line 31 of file RBCInput.h.

References input_sec.

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

Destructor.

Definition at line 35 of file RBCInput.h.

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

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

Member Function Documentation

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

Definition at line 52 of file RBCInput.cc.

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

Referenced by RBCBasicConfig::preprocess().

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

Definition at line 37 of file RBCInput.cc.

References i, and input_sec.

Referenced by RBCBasicConfig::preprocess().

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

Definition at line 45 of file RBCInput.h.

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

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

Definition at line 66 of file RBCInput.h.

References gather_cfg::cout.

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

Definition at line 77 of file RBCInput.h.

References m_wheelId.

Referenced by RBCEmulator::emulate().

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

Definition at line 81 of file RBCInput.h.

References m_wheelId.

Referenced by RBCChamberORLogic::process().

81  {
82  return m_wheelId;
83  };
int m_wheelId
Definition: RBCInput.h:90

Friends And Related Function Documentation

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

Definition at line 26 of file RBCInput.cc.

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

Definition at line 12 of file RBCInput.cc.

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

Member Data Documentation

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

Definition at line 63 of file RBCInput.h.

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

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

Definition at line 83 of file RBCInput.h.

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

int RBCInput::m_wheelId
private

Definition at line 90 of file RBCInput.h.

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

bool RBCInput::needmapping