CMS 3D CMS Logo

RBCInput.cc
Go to the documentation of this file.
1 // Include files
2 
3 // local
5 
6 //-----------------------------------------------------------------------------
7 // Implementation file for class : RBCInput
8 //
9 // 2008-10-10 : Andres Osorio
10 //-----------------------------------------------------------------------------
11 
12 std::istream& operator>>(std::istream& istr, RBCInput& rhs) {
13  int _ks = 0;
14 
15  for (int i = 0; i < 30; ++i) {
16  istr >> rhs.input[i];
17  if (i < 15)
18  _ks = 0;
19  else
20  _ks = 1;
21  rhs.input_sec[_ks].set(i - (15 * _ks), rhs.input[i]);
22  }
23  return istr;
24 }
25 
26 std::ostream& operator<<(std::ostream& ostr, RBCInput const& rhs) {
27  for (int i = 0; i < 15; ++i)
28  ostr << rhs.input_sec[0][i];
29  ostr << '\t';
30  for (int i = 0; i < 15; ++i)
31  ostr << rhs.input_sec[1][i];
32  ostr << '\n';
33 
34  return ostr;
35 }
36 
37 void RBCInput::mask(const std::vector<int>& maskvec) {
38  //... operate on the first sector
39 
40  for (int i = 0; i < 15; ++i)
41  if (maskvec[i])
42  input_sec[0].set(i, false);
43 
44  //... operate on the second sector
45 
46  for (int i = 15; i < 30; ++i)
47  if (maskvec[i])
48  input_sec[1].set((i - 15), false);
49 }
50 
51 void RBCInput::force(const std::vector<int>& forcevec) {
52  if (m_debug)
53  std::cout << forcevec.size() << std::endl;
54 
55  std::bitset<15> tmp;
56 
57  for (int i = 0; i < 15; ++i)
58  tmp.set(i, forcevec[i]);
59 
60  //... operate on the first sector
61  input_sec[0] |= tmp;
62  tmp.reset();
63 
64  for (int i = 15; i < 30; ++i)
65  tmp.set((i - 15), forcevec[i]);
66 
67  input_sec[1] |= tmp;
68 
69  tmp.reset();
70 }
mps_fire.i
i
Definition: mps_fire.py:355
RBCInput::mask
void mask(const std::vector< int > &)
Definition: RBCInput.cc:37
gather_cfg.cout
cout
Definition: gather_cfg.py:144
RBCInput::force
void force(const std::vector< int > &)
Definition: RBCInput.cc:51
createJobs.tmp
tmp
align.sh
Definition: createJobs.py:716
RBCInput::input_sec
std::array< std::bitset< 15 >, 2 > input_sec
Definition: RBCInput.h:41
RBCInput.h
operator>>
std::istream & operator>>(std::istream &istr, RBCInput &rhs)
Definition: RBCInput.cc:12
cms::cuda::for
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
Definition: HistoContainer.h:27
RBCInput::m_debug
bool m_debug
Definition: RBCInput.h:54
operator<<
std::ostream & operator<<(std::ostream &ostr, RBCInput const &rhs)
Definition: RBCInput.cc:26
RBCInput::input
bool input[30]
Definition: RBCInput.h:40
RBCInput
Definition: RBCInput.h:22