CMS 3D CMS Logo

MESetBinningUtils.h
Go to the documentation of this file.
1 #ifndef MESetBinningUtils_H
2 #define MESetBinningUtils_H
3 
6 
7 #include <string>
8 
9 class DetId;
10 class EcalElectronicsId;
11 namespace edm {
12  class ParameterSet;
14 } // namespace edm
15 
16 namespace ecaldqm {
17  namespace binning {
18  enum ObjectType {
19  kEB,
20  kEE,
23  kSM,
39  };
40 
41  enum BinningType {
55  };
56 
57  enum Constants {
59 
60  nEBSMEta = 85,
61  nEBSMPhi = 20,
62  nEESMX = 40,
63  nEESMXRed = 30, // for EE+-01&05&09
64  nEESMXExt = 45, // for EE+-02&08
65  nEESMY = 40,
66  nEESMYRed = 35, // for EE+-03&07
67 
68  nEBEtaBins = 34,
69  nEEEtaBins = 20,
70  nPhiBins = 36
71  };
72 
73  struct AxisSpecs {
74  int nbins;
75  float low, high;
76  float *edges;
79  AxisSpecs() : nbins(0), low(0.), high(0.), edges(nullptr), labels(nullptr), title("") {}
80  AxisSpecs(AxisSpecs const &_specs)
81  : nbins(_specs.nbins),
82  low(_specs.low),
83  high(_specs.high),
84  edges(nullptr),
85  labels(nullptr),
86  title(_specs.title) {
87  if (_specs.edges) {
88  edges = new float[nbins + 1];
89  for (int i(0); i <= nbins; i++)
90  edges[i] = _specs.edges[i];
91  }
92  if (_specs.labels) {
93  labels = new std::string[nbins];
94  for (int i(0); i < nbins; i++)
95  labels[i] = _specs.labels[i];
96  }
97  }
98  AxisSpecs &operator=(AxisSpecs const &_rhs) {
99  if (edges) {
100  delete[] edges;
101  edges = nullptr;
102  }
103  if (labels) {
104  delete[] labels;
105  labels = nullptr;
106  }
107  nbins = _rhs.nbins;
108  low = _rhs.low;
109  high = _rhs.high;
110  title = _rhs.title;
111  if (_rhs.edges) {
112  edges = new float[nbins + 1];
113  for (int i(0); i <= nbins; i++)
114  edges[i] = _rhs.edges[i];
115  }
116  if (_rhs.labels) {
117  labels = new std::string[nbins];
118  for (int i(0); i < nbins; i++)
119  labels[i] = _rhs.labels[i];
120  }
121  return *this;
122  }
124  delete[] edges;
125  delete[] labels;
126  }
127  };
128 
129  AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned);
130 
134 
138 
139  unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &);
141  unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, int, BinningType _btype = kDCC);
142 
143  ObjectType getObject(ObjectType, unsigned);
144 
145  unsigned getNObjects(ObjectType);
146 
147  bool isValidIdBin(EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int);
148 
149  std::string channelName(EcalElectronicsMapping const *, uint32_t, BinningType _btype = kDCC);
150 
151  uint32_t idFromName(std::string const &);
152  uint32_t idFromBin(ObjectType, BinningType, unsigned, int);
153 
154  AxisSpecs formAxis(edm::ParameterSet const &);
156 
160 
161  /* Functions used only internally within binning namespace */
162 
163  // used for SM binnings
164  int xlow_(int);
165  int ylow_(int);
166 
167  AxisSpecs getBinningEB_(BinningType, bool, int);
168  AxisSpecs getBinningEE_(BinningType, bool, int, int);
169  AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *);
170  AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int);
171  AxisSpecs getBinningEcal_(BinningType, bool, int);
172  AxisSpecs getBinningMEM_(BinningType, bool, int, int);
173 
174  int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
178  int findBinRCT_(ObjectType, DetId const &);
179  int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
181  } // namespace binning
182 } // namespace ecaldqm
183 
184 #endif
ecaldqm::binning::getBinningEcal_
AxisSpecs getBinningEcal_(BinningType, bool, int)
Definition: MESetBinningUtils2.cc:333
ecaldqm::binning::AxisSpecs::~AxisSpecs
~AxisSpecs()
Definition: MESetBinningUtils.h:123
EcalElectronicsMapping
Definition: EcalElectronicsMapping.h:28
ecaldqm::binning::channelName
std::string channelName(EcalElectronicsMapping const *, uint32_t, BinningType _btype=kDCC)
Definition: MESetBinningUtils.cc:615
mps_fire.i
i
Definition: mps_fire.py:428
ecaldqm
Definition: DQWorker.h:37
ecaldqm::binning::kSuperCrystal
Definition: MESetBinningUtils.h:44
ecaldqm::binning::kEE2P
Definition: MESetBinningUtils.h:35
edm
HLT enums.
Definition: AlignableModifier.h:19
ecaldqm::binning::AxisSpecs::labels
std::string * labels
Definition: MESetBinningUtils.h:77
ecaldqm::binning::kEEp
Definition: MESetBinningUtils.h:22
ecaldqm::binning::kEB
Definition: MESetBinningUtils.h:19
ecaldqm::binning::idFromBin
uint32_t idFromBin(ObjectType, BinningType, unsigned, int)
Definition: MESetBinningUtils.cc:752
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
ecaldqm::binning::AxisSpecs::AxisSpecs
AxisSpecs(AxisSpecs const &_specs)
Definition: MESetBinningUtils.h:80
ecaldqm::binning::findBinRCT_
int findBinRCT_(ObjectType, DetId const &)
Definition: MESetBinningUtils2.cc:527
ecaldqm::binning::kEcal2P
Definition: MESetBinningUtils.h:33
DQMStore.h
ecaldqm::binning::AxisSpecs::edges
float * edges
Definition: MESetBinningUtils.h:76
ecaldqm::binning::kProjEta
Definition: MESetBinningUtils.h:48
ecaldqm::binning::kEBMEM
Definition: MESetBinningUtils.h:31
ecaldqm::binning::nEBSMEta
Definition: MESetBinningUtils.h:60
ecaldqm::binning::kEE
Definition: MESetBinningUtils.h:20
ecaldqm::binning::nEBSMPhi
Definition: MESetBinningUtils.h:61
ecaldqm::binning::kReport
Definition: MESetBinningUtils.h:52
ecaldqm::binning::AxisSpecs::operator=
AxisSpecs & operator=(AxisSpecs const &_rhs)
Definition: MESetBinningUtils.h:98
ecaldqm::binning::kProjPhi
Definition: MESetBinningUtils.h:49
DetId
Definition: DetId.h:17
ecaldqm::binning::findBinPseudoStrip_
int findBinPseudoStrip_(EcalElectronicsMapping const *, ObjectType, DetId const &)
Definition: MESetBinningUtils2.cc:586
ecaldqm::binning::getNObjects
unsigned getNObjects(ObjectType)
Definition: MESetBinningUtils.cc:535
ecaldqm::binning::kCrystal
Definition: MESetBinningUtils.h:42
ecaldqm::binning::getBinningSM_
AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *)
Definition: MESetBinningUtils2.cc:225
ecaldqm::binning::nEESMYRed
Definition: MESetBinningUtils.h:66
ecaldqm::binning::findBin2D
int findBin2D(EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &)
Definition: MESetBinningUtils.cc:253
ecaldqm::binning::findBinCrystal_
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
Definition: MESetBinningUtils2.cc:430
ecaldqm::binning::kEcal3P
Definition: MESetBinningUtils.h:34
ecaldqm::binning::translateObjectType
ObjectType translateObjectType(std::string const &)
Definition: MESetBinningUtils.cc:877
ecaldqm::binning::AxisSpecs::low
float low
Definition: MESetBinningUtils.h:75
ecaldqm::binning::findBinTriggerTower_
int findBinTriggerTower_(EcalElectronicsMapping const *, ObjectType, DetId const &)
Definition: MESetBinningUtils2.cc:543
ecaldqm::binning::AxisSpecs::nbins
int nbins
Definition: MESetBinningUtils.h:74
ecaldqm::binning::nEESMY
Definition: MESetBinningUtils.h:65
ecaldqm::binning::nEESMX
Definition: MESetBinningUtils.h:62
ecaldqm::binning::getObject
ObjectType getObject(ObjectType, unsigned)
Definition: MESetBinningUtils.cc:490
EcalElectronicsId
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
Definition: EcalElectronicsId.h:18
edm::ParameterSet
Definition: ParameterSet.h:47
ecaldqm::binning::Constants
Constants
Definition: MESetBinningUtils.h:57
ecaldqm::binning::AxisSpecs::title
std::string title
Definition: MESetBinningUtils.h:78
ParameterSet
Definition: Functions.h:16
listHistos.binning
binning
Definition: listHistos.py:43
ecaldqm::binning::ObjectType
ObjectType
Definition: MESetBinningUtils.h:18
ecaldqm::binning::getBinningSMMEM_
AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int)
Definition: MESetBinningUtils2.cc:307
MonitorElementData::Kind
Kind
Definition: MonitorElementCollection.h:129
ecaldqm::binning::kEBSM
Definition: MESetBinningUtils.h:24
ecaldqm::binning::kEESM
Definition: MESetBinningUtils.h:25
ecaldqm::binning::translateKind
dqm::legacy::MonitorElement::Kind translateKind(std::string const &)
Definition: MESetBinningUtils.cc:951
ecaldqm::binning::getBinningEB_
AxisSpecs getBinningEB_(BinningType, bool, int)
Definition: MESetBinningUtils2.cc:89
EcalElectronicsMapping.h
ecaldqm::binning::getBinning
AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned)
Definition: MESetBinningUtils.cc:14
ecaldqm::binning::AxisSpecs::AxisSpecs
AxisSpecs()
Definition: MESetBinningUtils.h:79
ecaldqm::binning::AxisSpecs
Definition: MESetBinningUtils.h:73
ecaldqm::binning::idFromName
uint32_t idFromName(std::string const &)
Definition: MESetBinningUtils.cc:689
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ecaldqm::binning::nEESMXExt
Definition: MESetBinningUtils.h:64
ecaldqm::binning::kUser
Definition: MESetBinningUtils.h:51
ecaldqm::binning::translateBinningType
BinningType translateBinningType(std::string const &)
Definition: MESetBinningUtils.cc:922
ecaldqm::binning::nEESMXRed
Definition: MESetBinningUtils.h:63
ecaldqm::binning::formAxis
AxisSpecs formAxis(edm::ParameterSet const &)
Definition: MESetBinningUtils.cc:829
ecaldqm::binning::kPseudoStrip
Definition: MESetBinningUtils.h:45
ecaldqm::binning::kMEM
Definition: MESetBinningUtils.h:30
ecaldqm::binning::nObjType
Definition: MESetBinningUtils.h:38
ecaldqm::binning::nEBEtaBins
Definition: MESetBinningUtils.h:68
ecaldqm::binning::kDCC
Definition: MESetBinningUtils.h:47
ecaldqm::binning::nEEEtaBins
Definition: MESetBinningUtils.h:69
ecaldqm::binning::findBinSuperCrystal_
int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
Definition: MESetBinningUtils2.cc:603
ecaldqm::binning::nBinType
Definition: MESetBinningUtils.h:54
ParameterSetDescription
ecaldqm::binning::findPlotIndex
unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &)
Definition: MESetBinningUtils.cc:316
ecaldqm::binning::kEcal
Definition: MESetBinningUtils.h:29
ecaldqm::binning::getBinningMEM_
AxisSpecs getBinningMEM_(BinningType, bool, int, int)
Definition: MESetBinningUtils2.cc:404
ecaldqm::binning::AxisSpecs::high
float high
Definition: MESetBinningUtils.h:75
ecaldqm::binning::findBin1D
int findBin1D(EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &)
Definition: MESetBinningUtils.cc:63
ecaldqm::binning::kEBSMMEM
Definition: MESetBinningUtils.h:27
ecaldqm::binning::fillAxisDescriptions
void fillAxisDescriptions(edm::ParameterSetDescription &)
Definition: MESetBinningUtils.cc:866
ecaldqm::binning::kTrend
Definition: MESetBinningUtils.h:53
ecaldqm::binning::kMEM2P
Definition: MESetBinningUtils.h:36
ecaldqm::binning::kEEMEM
Definition: MESetBinningUtils.h:32
ecaldqm::binning::nPhiBins
Definition: MESetBinningUtils.h:70
ecaldqm::binning::BinningType
BinningType
Definition: MESetBinningUtils.h:41
ecaldqm::binning::ylow_
int ylow_(int)
Definition: MESetBinningUtils2.cc:52
ecaldqm::binning::getBinningEE_
AxisSpecs getBinningEE_(BinningType, bool, int, int)
Definition: MESetBinningUtils2.cc:154
ecaldqm::binning::kSM
Definition: MESetBinningUtils.h:23
ecaldqm::binning::kSMMEM
Definition: MESetBinningUtils.h:26
ecaldqm::binning::kTriggerTower
Definition: MESetBinningUtils.h:43
ecaldqm::binning::kEEm
Definition: MESetBinningUtils.h:21
ecaldqm::binning::kTCC
Definition: MESetBinningUtils.h:46
ecaldqm::binning::isValidIdBin
bool isValidIdBin(EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int)
Definition: MESetBinningUtils.cc:562
ecaldqm::binning::kRCT
Definition: MESetBinningUtils.h:50
ecaldqm::binning::kEESMMEM
Definition: MESetBinningUtils.h:28
ecaldqm::binning::xlow_
int xlow_(int)
Definition: MESetBinningUtils2.cc:13
ecaldqm::binning::nPresetBinnings
Definition: MESetBinningUtils.h:58
ecaldqm::binning::kChannel
Definition: MESetBinningUtils.h:37