CMS 3D CMS Logo

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