CMS 3D CMS Logo

RPCData.cc
Go to the documentation of this file.
1 // Include files
2 
3 
4 
5 // local
7 
8 //-----------------------------------------------------------------------------
9 // Implementation file for class : RPCData
10 //
11 // 2008-11-18 : Andres Osorio
12 //-----------------------------------------------------------------------------
13 
14 //=============================================================================
15 // Standard constructor, initializes variables
16 //=============================================================================
17 
18 namespace l1trigger {
19 
21  {
22  m_wheelid = wheel;
23  int maxsectors=12;
24 
25  for(int k=1; k <= maxsectors; ++k)
26  m_sector[k] = 0;
27  m_nearSide = 0;
28  m_farSide = 0;
29  m_wheel=0;
30 
31  }
32 
34  {
35 
36  std::map<int,int>::iterator itr;
37  for(itr = m_sector.begin(); itr != m_sector.end(); ++itr)
38  m_wheel += (*itr).second;
39 
40  std::vector<int> far;
41  std::vector<int> near;
42 
43  far.push_back(3);
44  far.push_back(4);
45  far.push_back(5);
46  far.push_back(6);
47  far.push_back(7);
48  far.push_back(8);
49 
50  near.push_back(1);
51  near.push_back(2);
52  near.push_back(12);
53  near.push_back(11);
54  near.push_back(10);
55  near.push_back(9);
56 
57  std::vector<int>::iterator sec;
58  for( sec = far.begin(); sec != far.end(); ++sec) {
59  std::map<int, int>::iterator sector;
60  sector = m_sector.find( (*sec) );
61  m_farSide += (*sector).second;
62  }
63 
64  for( sec = near.begin(); sec != near.end(); ++sec) {
65  std::map<int, int>::iterator sector;
66  sector = m_sector.find( (*sec) );
67  m_nearSide += (*sector).second;
68  }
69 
70 
71  }
72 
74  {
75 
76  std::cout << m_wheelid << std::endl;
77  std::map<int,int>::iterator itr;
78  for(auto const& s :m_sector)
79  std::cout << s.first << ": " << s.second << '\t';
80  std::cout << '\n';
81 
82  std::cout << "total wheel: "
83  << m_wheel << " " << m_farSide << " " << m_nearSide << '\n';
84  }
85 
86  void Counters::incrementSector( int sector )
87  {
88  m_sector[ sector ] += 1;
89  }
90 }
91 
93  m_wheel = 10;
94 }
95 
96 //=============================================================================
97 
98 std::istream& operator>>(std::istream &istr , RPCData & rhs)
99 {
100 
101  (istr) >> rhs.m_wheel;
102  for(int k=0; k < 6; ++k)
103  {
104  (istr) >> rhs.m_sec1[k] >> rhs.m_sec2[k];
105  (istr) >> rhs.m_orsignals[k];
106  }
107 
108  return istr;
109 
110 }
111 
112 std::ostream& operator<<(std::ostream& ostr , RPCData const & rhs)
113 {
114 
115  ostr << rhs.m_wheel << '\t';
116  for(int k=0; k < 6; ++k)
117  {
118  ostr << rhs.m_sec1[k] << '\t' << rhs.m_sec2[k] << '\n';
119  ostr << rhs.m_orsignals[k];
120  }
121 
122  return ostr;
123 
124 }
RPCData()
Standard constructor.
Definition: RPCData.cc:92
std::array< RBCInput, 6 > m_orsignals
Definition: RPCData.h:52
void printSummary() const
Definition: RPCData.cc:73
std::istream & operator>>(std::istream &istr, RPCData &rhs)
Definition: RPCData.cc:98
void evalCounters()
Definition: RPCData.cc:33
std::map< int, int > m_sector
Definition: RPCData.h:39
int m_wheel
Definition: RPCData.h:49
int k[5][pyjets_maxn]
std::ostream & operator<<(std::ostream &ostr, RPCData const &rhs)
Definition: RPCData.cc:112
void incrementSector(int)
Definition: RPCData.cc:86
std::array< int,6 > m_sec2
Definition: RPCData.h:51
std::array< int, 6 > m_sec1
Definition: RPCData.h:50