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 // $Id: RPCData.cc,v 1.4 2013/03/20 15:45:25 wdd Exp $
2 // Include files
3 
4 
5 
6 // local
8 
9 //-----------------------------------------------------------------------------
10 // Implementation file for class : RPCData
11 //
12 // 2008-11-18 : Andres Osorio
13 //-----------------------------------------------------------------------------
14 
15 //=============================================================================
16 // Standard constructor, initializes variables
17 //=============================================================================
18 
19 namespace l1trigger {
20 
21  Counters::Counters(int wheel)
22  {
23  m_wheelid = wheel;
24  int maxsectors=12;
25 
26  for(int k=1; k <= maxsectors; ++k)
27  m_sector[k] = 0;
28  m_nearSide = 0;
29  m_farSide = 0;
30  m_wheel=0;
31 
32  }
33 
35  {
36  m_sector.clear();
37  }
38 
40  {
41 
42  std::map<int,int>::iterator itr;
43  for(itr = m_sector.begin(); itr != m_sector.end(); ++itr)
44  m_wheel += (*itr).second;
45 
46  std::vector<int> far;
47  std::vector<int> near;
48 
49  far.push_back(3);
50  far.push_back(4);
51  far.push_back(5);
52  far.push_back(6);
53  far.push_back(7);
54  far.push_back(8);
55 
56  near.push_back(1);
57  near.push_back(2);
58  near.push_back(12);
59  near.push_back(11);
60  near.push_back(10);
61  near.push_back(9);
62 
63  std::vector<int>::iterator sec;
64  for( sec = far.begin(); sec != far.end(); ++sec) {
65  std::map<int, int>::iterator sector;
66  sector = m_sector.find( (*sec) );
67  m_farSide += (*sector).second;
68  }
69 
70  for( sec = near.begin(); sec != near.end(); ++sec) {
71  std::map<int, int>::iterator sector;
72  sector = m_sector.find( (*sec) );
73  m_nearSide += (*sector).second;
74  }
75 
76 
77  }
78 
80  {
81 
82  std::cout << m_wheelid << std::endl;
83  std::map<int,int>::iterator itr;
84  for(itr = m_sector.begin(); itr != m_sector.end(); ++itr)
85  std::cout << (*itr).first << ": " << (*itr).second << '\t';
86  std::cout << '\n';
87 
88  std::cout << "total wheel: "
89  << m_wheel << " " << m_farSide << " " << m_nearSide << '\n';
90  }
91 
92  void Counters::incrementSector( int sector )
93  {
94  m_sector[ sector ] += 1;
95  }
96 }
97 
99 
100  m_wheel = 10;
101  m_sec1 = new int[6];
102  m_sec2 = new int[6];
103  m_orsignals = new RBCInput[6];
104 
105 }
106 //=============================================================================
107 // Destructor
108 //=============================================================================
110 
111  delete [] m_sec1;
112  delete [] m_sec2;
113  delete [] m_orsignals;
114 
115 }
116 
117 //=============================================================================
118 
119 std::istream& operator>>(std::istream &istr , RPCData & rhs)
120 {
121 
122  (istr) >> rhs.m_wheel;
123  for(int k=0; k < 6; ++k)
124  {
125  (istr) >> rhs.m_sec1[k] >> rhs.m_sec2[k];
126  (istr) >> rhs.m_orsignals[k];
127  }
128 
129  return istr;
130 
131 }
132 
133 std::ostream& operator<<(std::ostream& ostr , RPCData & rhs)
134 {
135 
136  ostr << rhs.m_wheel << '\t';
137  for(int k=0; k < 6; ++k)
138  {
139  ostr << rhs.m_sec1[k] << '\t' << rhs.m_sec2[k] << '\n';
140  ostr << rhs.m_orsignals[k];
141  }
142 
143  return ostr;
144 
145 }
RBCInput * m_orsignals
Definition: RPCData.h:56
RPCData()
Standard constructor.
Definition: RPCData.cc:98
virtual ~RPCData()
Destructor.
Definition: RPCData.cc:109
virtual ~Counters()
Definition: RPCData.cc:34
int * m_sec2
Definition: RPCData.h:55
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
std::map< int, int > m_sector
Definition: RPCData.h:43
int m_wheel
Definition: RPCData.h:53
int k[5][pyjets_maxn]
std::istream & operator>>(std::istream &input, CLHEP::HepGenMatrix &matrix)
Definition: matrixSaver.cc:111
void printSummary()
Definition: RPCData.cc:79
tuple cout
Definition: gather_cfg.py:121
void incrementSector(int)
Definition: RPCData.cc:92
void evalCounters()
Definition: RPCData.cc:39
int * m_sec1
Definition: RPCData.h:54