CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Public Attributes
l1trigger::Counters Class Reference

#include <RPCData.h>

Public Member Functions

 Counters ()
 
 Counters (int)
 
void evalCounters ()
 
void incrementSector (int)
 
void printSummary ()
 
virtual ~Counters ()
 

Public Attributes

int m_farSide
 
int m_nearSide
 
std::map< int, int > m_sector
 
int m_wheel
 
int m_wheelid
 

Detailed Description

Definition at line 24 of file RPCData.h.

Constructor & Destructor Documentation

l1trigger::Counters::Counters ( )
inline

Definition at line 27 of file RPCData.h.

27 {};
Counters::Counters ( int  wheel)

Definition at line 20 of file RPCData.cc.

References relval_steps::k, m_farSide, m_nearSide, m_sector, m_wheel, and m_wheelid.

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  }
std::map< int, int > m_sector
Definition: RPCData.h:42
Counters::~Counters ( )
virtual

Definition at line 33 of file RPCData.cc.

References m_sector.

34  {
35  m_sector.clear();
36  }
std::map< int, int > m_sector
Definition: RPCData.h:42

Member Function Documentation

void Counters::evalCounters ( )

Definition at line 38 of file RPCData.cc.

References m_farSide, m_nearSide, m_sector, and m_wheel.

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  }
std::map< int, int > m_sector
Definition: RPCData.h:42
void Counters::incrementSector ( int  sector)

Definition at line 91 of file RPCData.cc.

References m_sector.

92  {
93  m_sector[ sector ] += 1;
94  }
std::map< int, int > m_sector
Definition: RPCData.h:42
void Counters::printSummary ( )

Definition at line 78 of file RPCData.cc.

References gather_cfg::cout, m_farSide, m_nearSide, m_sector, m_wheel, and m_wheelid.

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  }
std::map< int, int > m_sector
Definition: RPCData.h:42
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

int l1trigger::Counters::m_farSide

Definition at line 40 of file RPCData.h.

Referenced by Counters(), evalCounters(), and printSummary().

int l1trigger::Counters::m_nearSide

Definition at line 39 of file RPCData.h.

Referenced by Counters(), evalCounters(), and printSummary().

std::map<int,int> l1trigger::Counters::m_sector

Definition at line 42 of file RPCData.h.

Referenced by Counters(), evalCounters(), incrementSector(), printSummary(), and ~Counters().

int l1trigger::Counters::m_wheel

Definition at line 41 of file RPCData.h.

Referenced by Counters(), evalCounters(), and printSummary().

int l1trigger::Counters::m_wheelid

Definition at line 38 of file RPCData.h.

Referenced by Counters(), and printSummary().