CMS 3D CMS Logo

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

Definition at line 6 of file EcalFedMap.cc.

6 {}

Member Function Documentation

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

Definition at line 96 of file EcalFedMap.cc.

References newFWLiteAna::found, sliceToFedMap_, and HcalDetIdTransform::transform().

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

96  {
97  transform(slice.begin(), slice.end(), slice.begin(), toupper);
98 
99  std::map<std::string, int>::iterator found = sliceToFedMap_.find(slice);
100 
101  if (found != sliceToFedMap_.end())
102  return (*found).second;
103  else
104  return -999;
105 }
std::map< std::string, int > sliceToFedMap_
Definition: EcalFedMap.h:21
unsigned transform(const HcalDetId &id, unsigned transformCode)
std::string EcalFedMap::getSliceFromFed ( int  fedNumber)

Definition at line 86 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().

86  {
87  //std::cout << "received: " << fedNumber << std::endl;
88  std::map<int, std::string>::iterator found = fedToSliceMap_.find(fedNumber);
89 
90  if (found != fedToSliceMap_.end())
91  return (*found).second;
92  else
93  return std::string("invalid Fed");
94 }
std::map< int, std::string > fedToSliceMap_
Definition: EcalFedMap.h:20

Member Data Documentation

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

Definition at line 20 of file EcalFedMap.h.

Referenced by EcalFedMap(), and getSliceFromFed().

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

Definition at line 21 of file EcalFedMap.h.

Referenced by EcalFedMap(), and getFedFromSlice().