CMS 3D CMS Logo

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 &)=default
 
RBCInputoperator= (RBCInput &&)=default
 
void printinfo () const
 
 RBCInput ()
 Standard constructor. More...
 
 RBCInput (const RBCInput &)=default
 
 RBCInput (RBCInput &&)=default
 
void setWheelId (int wid)
 
int wheelId () const
 

Public Attributes

bool hasData
 
bool input [30]
 
std::array< std::bitset< 15 >, 2 > input_sec
 
bool needmapping
 

Private Attributes

bool m_debug
 
int m_wheelId
 

Friends

std::ostream & operator<< (std::ostream &ostr, RBCInput const &)
 
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, m_debug, needmapping, operator<<, operator=(), and operator>>.

25  {
26  needmapping = false;
27  m_debug = false;
28  hasData = false;
29  };
bool needmapping
Definition: RBCInput.h:52
bool hasData
Definition: RBCInput.h:51
bool m_debug
Definition: RBCInput.h:60
RBCInput::RBCInput ( const RBCInput )
default
RBCInput::RBCInput ( RBCInput &&  )
default

Member Function Documentation

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

Definition at line 52 of file RBCInput.cc.

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

Referenced by RBCBasicConfig::preprocess(), and printinfo().

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 }
std::array< std::bitset< 15 >, 2 > input_sec
Definition: RBCInput.h:41
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
bool m_debug
Definition: RBCInput.h:60
void RBCInput::mask ( const std::vector< int > &  maskvec)

Definition at line 37 of file RBCInput.cc.

References mps_fire::i, and input_sec.

Referenced by RBCBasicConfig::preprocess(), and printinfo().

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,false);
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),false);
49 
50 }
std::array< std::bitset< 15 >, 2 > input_sec
Definition: RBCInput.h:41
RBCInput& RBCInput::operator= ( const RBCInput )
default

Referenced by RBCInput().

RBCInput& RBCInput::operator= ( RBCInput &&  )
default
void RBCInput::printinfo ( ) const
inline

Definition at line 43 of file RBCInput.h.

References gather_cfg::cout, force(), and mask().

43  {
44  std::cout << "RBCInput: " << (*this);
45  };
void RBCInput::setWheelId ( int  wid)
inline

Definition at line 54 of file RBCInput.h.

References m_wheelId.

Referenced by RBCEmulator::emulate().

54  {
55  m_wheelId = wid;
56  };
int m_wheelId
Definition: RBCInput.h:67
int RBCInput::wheelId ( ) const
inline

Definition at line 58 of file RBCInput.h.

References m_wheelId.

Referenced by RBCChamberORLogic::process().

58  {
59  return m_wheelId;
60  };
int m_wheelId
Definition: RBCInput.h:67

Friends And Related Function Documentation

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

Definition at line 26 of file RBCInput.cc.

Referenced by RBCInput().

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 }
std::istream& operator>> ( std::istream &  istr,
RBCInput rhs 
)
friend

Definition at line 12 of file RBCInput.cc.

Referenced by RBCInput().

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 }
std::array< std::bitset< 15 >, 2 > input_sec
Definition: RBCInput.h:41
bool input[30]
Definition: RBCInput.h:40

Member Data Documentation

bool RBCInput::hasData

Definition at line 51 of file RBCInput.h.

Referenced by RBCInput().

bool RBCInput::input[30]

Definition at line 40 of file RBCInput.h.

Referenced by operator>>().

std::array<std::bitset<15>,2> RBCInput::input_sec
bool RBCInput::m_debug
private

Definition at line 60 of file RBCInput.h.

Referenced by force(), and RBCInput().

int RBCInput::m_wheelId
private

Definition at line 67 of file RBCInput.h.

Referenced by setWheelId(), and wheelId().

bool RBCInput::needmapping