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 25 of file RPCData.h.

Constructor & Destructor Documentation

l1trigger::Counters::Counters ( )
inline

Definition at line 28 of file RPCData.h.

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

Definition at line 21 of file RPCData.cc.

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

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  }
std::map< int, int > m_sector
Definition: RPCData.h:43
int k[5][pyjets_maxn]
Counters::~Counters ( )
virtual

Definition at line 34 of file RPCData.cc.

References m_sector.

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

Member Function Documentation

void Counters::evalCounters ( )

Definition at line 39 of file RPCData.cc.

References m_farSide, m_nearSide, m_sector, and m_wheel.

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

Definition at line 92 of file RPCData.cc.

References m_sector.

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

Definition at line 79 of file RPCData.cc.

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

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

Member Data Documentation

int l1trigger::Counters::m_farSide

Definition at line 41 of file RPCData.h.

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

int l1trigger::Counters::m_nearSide

Definition at line 40 of file RPCData.h.

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

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

Definition at line 43 of file RPCData.h.

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

int l1trigger::Counters::m_wheel

Definition at line 42 of file RPCData.h.

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

int l1trigger::Counters::m_wheelid

Definition at line 39 of file RPCData.h.

Referenced by Counters(), and printSummary().