test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
20  Counters::Counters(int wheel)
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  m_sector.clear();
36  }
37 
39  {
40 
41  std::map<int,int>::iterator itr;
42  for(itr = m_sector.begin(); itr != m_sector.end(); ++itr)
43  m_wheel += (*itr).second;
44 
45  std::vector<int> far;
46  std::vector<int> near;
47 
48  far.push_back(3);
49  far.push_back(4);
50  far.push_back(5);
51  far.push_back(6);
52  far.push_back(7);
53  far.push_back(8);
54 
55  near.push_back(1);
56  near.push_back(2);
57  near.push_back(12);
58  near.push_back(11);
59  near.push_back(10);
60  near.push_back(9);
61 
62  std::vector<int>::iterator sec;
63  for( sec = far.begin(); sec != far.end(); ++sec) {
64  std::map<int, int>::iterator sector;
65  sector = m_sector.find( (*sec) );
66  m_farSide += (*sector).second;
67  }
68 
69  for( sec = near.begin(); sec != near.end(); ++sec) {
70  std::map<int, int>::iterator sector;
71  sector = m_sector.find( (*sec) );
72  m_nearSide += (*sector).second;
73  }
74 
75 
76  }
77 
79  {
80 
81  std::cout << m_wheelid << std::endl;
82  std::map<int,int>::iterator itr;
83  for(itr = m_sector.begin(); itr != m_sector.end(); ++itr)
84  std::cout << (*itr).first << ": " << (*itr).second << '\t';
85  std::cout << '\n';
86 
87  std::cout << "total wheel: "
88  << m_wheel << " " << m_farSide << " " << m_nearSide << '\n';
89  }
90 
91  void Counters::incrementSector( int sector )
92  {
93  m_sector[ sector ] += 1;
94  }
95 }
96 
98 
99  m_wheel = 10;
100  m_sec1 = new int[6];
101  m_sec2 = new int[6];
102  m_orsignals = new RBCInput[6];
103 
104 }
105 //=============================================================================
106 // Destructor
107 //=============================================================================
109 
110  delete [] m_sec1;
111  delete [] m_sec2;
112  delete [] m_orsignals;
113 
114 }
115 
116 //=============================================================================
117 
118 std::istream& operator>>(std::istream &istr , RPCData & rhs)
119 {
120 
121  (istr) >> rhs.m_wheel;
122  for(int k=0; k < 6; ++k)
123  {
124  (istr) >> rhs.m_sec1[k] >> rhs.m_sec2[k];
125  (istr) >> rhs.m_orsignals[k];
126  }
127 
128  return istr;
129 
130 }
131 
132 std::ostream& operator<<(std::ostream& ostr , RPCData & rhs)
133 {
134 
135  ostr << rhs.m_wheel << '\t';
136  for(int k=0; k < 6; ++k)
137  {
138  ostr << rhs.m_sec1[k] << '\t' << rhs.m_sec2[k] << '\n';
139  ostr << rhs.m_orsignals[k];
140  }
141 
142  return ostr;
143 
144 }
RBCInput * m_orsignals
Definition: RPCData.h:55
RPCData()
Standard constructor.
Definition: RPCData.cc:97
virtual ~RPCData()
Destructor.
Definition: RPCData.cc:108
virtual ~Counters()
Definition: RPCData.cc:33
int * m_sec2
Definition: RPCData.h:54
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
std::map< int, int > m_sector
Definition: RPCData.h:42
int m_wheel
Definition: RPCData.h:52
std::istream & operator>>(std::istream &input, CLHEP::HepGenMatrix &matrix)
Definition: matrixSaver.cc:111
void printSummary()
Definition: RPCData.cc:78
tuple cout
Definition: gather_cfg.py:145
void incrementSector(int)
Definition: RPCData.cc:91
void evalCounters()
Definition: RPCData.cc:38
int * m_sec1
Definition: RPCData.h:53