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