CMS 3D CMS Logo

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

#include <EcalFedMap.h>

Public Member Functions

 EcalFedMap ()
 
int getFedFromSlice (std::string)
 
std::string getSliceFromFed (int)
 
 ~EcalFedMap ()
 

Private Attributes

std::map< int, std::string > fedToSliceMap_
 
std::map< std::string, int > sliceToFedMap_
 

Detailed Description

Definition at line 7 of file EcalFedMap.h.

Constructor & Destructor Documentation

EcalFedMap::EcalFedMap ( )

Definition at line 8 of file EcalFedMap.cc.

References fedToSliceMap_, and sliceToFedMap_.

8  {
9 
10  // EE-
11  fedToSliceMap_.insert( std::make_pair(601, "EE-07") );
12  fedToSliceMap_.insert( std::make_pair(602, "EE-08") );
13  fedToSliceMap_.insert( std::make_pair(603, "EE-09") );
14  fedToSliceMap_.insert( std::make_pair(604, "EE-01") );
15  fedToSliceMap_.insert( std::make_pair(605, "EE-02") );
16  fedToSliceMap_.insert( std::make_pair(606, "EE-03") );
17  fedToSliceMap_.insert( std::make_pair(607, "EE-04") );
18  fedToSliceMap_.insert( std::make_pair(608, "EE-05") );
19  fedToSliceMap_.insert( std::make_pair(609, "EE-06") );
20 
21  // EB-
22  fedToSliceMap_.insert( std::make_pair(610, "EB-01") );
23  fedToSliceMap_.insert( std::make_pair(611, "EB-02") );
24  fedToSliceMap_.insert( std::make_pair(612, "EB-03") );
25  fedToSliceMap_.insert( std::make_pair(613, "EB-04") );
26  fedToSliceMap_.insert( std::make_pair(614, "EB-05") );
27  fedToSliceMap_.insert( std::make_pair(615, "EB-06") );
28  fedToSliceMap_.insert( std::make_pair(616, "EB-07") );
29  fedToSliceMap_.insert( std::make_pair(617, "EB-08") );
30  fedToSliceMap_.insert( std::make_pair(618, "EB-09") );
31  fedToSliceMap_.insert( std::make_pair(619, "EB-10") );
32  fedToSliceMap_.insert( std::make_pair(620, "EB-11") );
33  fedToSliceMap_.insert( std::make_pair(621, "EB-12") );
34  fedToSliceMap_.insert( std::make_pair(622, "EB-13") );
35  fedToSliceMap_.insert( std::make_pair(623, "EB-14") );
36  fedToSliceMap_.insert( std::make_pair(624, "EB-15") );
37  fedToSliceMap_.insert( std::make_pair(625, "EB-16") );
38  fedToSliceMap_.insert( std::make_pair(626, "EB-17") );
39  fedToSliceMap_.insert( std::make_pair(627, "EB-18") );
40 
41  // EB+
42  fedToSliceMap_.insert( std::make_pair(628, "EB+01") );
43  fedToSliceMap_.insert( std::make_pair(629, "EB+02") );
44  fedToSliceMap_.insert( std::make_pair(630, "EB+03") );
45  fedToSliceMap_.insert( std::make_pair(631, "EB+04") );
46  fedToSliceMap_.insert( std::make_pair(632, "EB+05") );
47  fedToSliceMap_.insert( std::make_pair(633, "EB+06") );
48  fedToSliceMap_.insert( std::make_pair(634, "EB+07") );
49  fedToSliceMap_.insert( std::make_pair(635, "EB+08") );
50  fedToSliceMap_.insert( std::make_pair(636, "EB+09") );
51  fedToSliceMap_.insert( std::make_pair(637, "EB+10") );
52  fedToSliceMap_.insert( std::make_pair(638, "EB+11") );
53  fedToSliceMap_.insert( std::make_pair(639, "EB+12") );
54  fedToSliceMap_.insert( std::make_pair(640, "EB+13") );
55  fedToSliceMap_.insert( std::make_pair(641, "EB+14") );
56  fedToSliceMap_.insert( std::make_pair(642, "EB+15") );
57  fedToSliceMap_.insert( std::make_pair(643, "EB+16") );
58  fedToSliceMap_.insert( std::make_pair(644, "EB+17") );
59  fedToSliceMap_.insert( std::make_pair(645, "EB+18") );
60 
61  // EE+
62  fedToSliceMap_.insert( std::make_pair(646, "EE+07") );
63  fedToSliceMap_.insert( std::make_pair(647, "EE+08") );
64  fedToSliceMap_.insert( std::make_pair(648, "EE+09") );
65  fedToSliceMap_.insert( std::make_pair(649, "EE+01") );
66  fedToSliceMap_.insert( std::make_pair(650, "EE+02") );
67  fedToSliceMap_.insert( std::make_pair(651, "EE+03") );
68  fedToSliceMap_.insert( std::make_pair(652, "EE+04") );
69  fedToSliceMap_.insert( std::make_pair(653, "EE+05") );
70  fedToSliceMap_.insert( std::make_pair(654, "EE+06") );
71 
72 
73  std::map<int, std::string>::iterator it;
74  for (it = fedToSliceMap_.begin();
75  it != fedToSliceMap_.end();
76  it++)
77  {
78  // std::cout<< "fed: "<< (*it).first << " slice: " << (*it).second << std::endl;
79  sliceToFedMap_.insert( std::make_pair( (*it).second, (*it).first) );
80  }
81 
82  // std::map<std::string, int>::iterator ti;
83  // for (ti = sliceToFedMap_.begin();
84  // ti != sliceToFedMap_.end();
85  // ti++)
86  // {
87  // // std::cout<< "slice: "<< (*ti).first << " fed: " << (*ti).second << std::endl;
88  // }
89 
90 }
std::map< int, std::string > fedToSliceMap_
Definition: EcalFedMap.h:22
std::map< std::string, int > sliceToFedMap_
Definition: EcalFedMap.h:23
EcalFedMap::~EcalFedMap ( )

Definition at line 6 of file EcalFedMap.cc.

6 {}

Member Function Documentation

int EcalFedMap::getFedFromSlice ( std::string  slice)

Definition at line 104 of file EcalFedMap.cc.

References newFWLiteAna::found, sliceToFedMap_, and create_public_pileup_plots::transform.

Referenced by EcalDigiDisplay::EcalDigiDisplay(), EcalPedHists::EcalPedHists(), and EcalPnGraphs::EcalPnGraphs().

105 {
106 
107  transform(slice.begin(), slice.end(), slice.begin(), toupper);
108 
109  std::map< std::string , int>::iterator found = sliceToFedMap_.find(slice);
110 
111  if ( found != sliceToFedMap_.end() )
112  return (* found).second;
113  else
114  return -999;
115 }
std::map< std::string, int > sliceToFedMap_
Definition: EcalFedMap.h:23
std::string EcalFedMap::getSliceFromFed ( int  fedNumber)

Definition at line 93 of file EcalFedMap.cc.

References fedToSliceMap_, newFWLiteAna::found, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by EcalPulseShapeGrapher::analyze(), EcalPedHists::endJob(), EcalURecHitHists::endJob(), EcalCosmicsHists::endJob(), EcalURecHitHists::initHists(), EcalMipGraphs::initHists(), EcalDisplaysByEvent::initHists(), EcalCosmicsHists::initHists(), EcalMipGraphs::selectDigi(), and EcalDisplaysByEvent::selectDigi().

94 {
95  //std::cout << "received: " << fedNumber << std::endl;
96  std::map< int, std::string >::iterator found = fedToSliceMap_.find(fedNumber);
97 
98  if ( found != fedToSliceMap_.end() )
99  return (* found).second;
100  else
101  return std::string("invalid Fed");
102 }
std::map< int, std::string > fedToSliceMap_
Definition: EcalFedMap.h:22

Member Data Documentation

std::map<int, std::string> EcalFedMap::fedToSliceMap_
private

Definition at line 22 of file EcalFedMap.h.

Referenced by EcalFedMap(), and getSliceFromFed().

std::map<std::string, int> EcalFedMap::sliceToFedMap_
private

Definition at line 23 of file EcalFedMap.h.

Referenced by EcalFedMap(), and getFedFromSlice().