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  typedef int Constants;
58  static constexpr int nPresetBinnings = kRCT + 1, nEBSMEta = 85, nEBSMPhi = 20, nEESMX = 40;
59  static constexpr int nEESMXRed = 30; // for EE+-01&05&09
60  static constexpr int nEESMXExt = 45; //for EE+-02&08
61  static constexpr int nEESMY = 40;
62  static constexpr int nEESMYRed = 35; // for EE+-03&07
63  static constexpr int nEBEtaBins = 34, nEEEtaBins = 20, nPhiBins = 36;
64 
65  struct AxisSpecs {
66  int nbins;
67  float low, high;
68  std::vector<float> edges;
69  std::vector<std::string> labels;
71  AxisSpecs() : nbins(0), low(0.), high(0.), edges(0), labels(0), title("") { ; };
72  };
73 
74  AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned);
75 
79 
83 
84  unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &);
86  unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, int, BinningType _btype = kDCC);
87 
88  ObjectType getObject(ObjectType, unsigned);
89 
90  unsigned getNObjects(ObjectType);
91 
92  bool isValidIdBin(EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int);
93 
94  std::string channelName(EcalElectronicsMapping const *, uint32_t, BinningType _btype = kDCC);
95 
96  uint32_t idFromName(std::string const &);
97  uint32_t idFromBin(ObjectType, BinningType, unsigned, int);
98 
99  AxisSpecs formAxis(edm::ParameterSet const &);
101 
105 
106  /* Functions used only internally within binning namespace */
107 
108  // used for SM binnings
109  int xlow_(int);
110  int ylow_(int);
111 
112  AxisSpecs getBinningEB_(BinningType, bool, int);
113  AxisSpecs getBinningEE_(BinningType, bool, int, int);
114  AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *);
115  AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int);
116  AxisSpecs getBinningEcal_(BinningType, bool, int);
117  AxisSpecs getBinningMEM_(BinningType, bool, int, int);
118 
119  int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
123  int findBinRCT_(ObjectType, DetId const &);
124  int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
126  } // namespace binning
127 } // namespace ecaldqm
128 
129 #endif
static constexpr int nEBSMEta
int findBinRCT_(ObjectType, DetId const &)
static constexpr int nEESMXExt
bool isValidIdBin(EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
int findBinPseudoStrip_(EcalElectronicsMapping const *, ObjectType, DetId const &)
unsigned getNObjects(ObjectType)
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
static constexpr int nEESMYRed
std::vector< float > edges
static constexpr int nEBSMPhi
ObjectType getObject(ObjectType, unsigned)
AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *)
static constexpr int nEESMX
ObjectType translateObjectType(std::string const &)
dqm::legacy::MonitorElement::Kind translateKind(std::string const &)
AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int)
static constexpr int nEEEtaBins
AxisSpecs getBinningEB_(BinningType, bool, int)
int findBin2D(EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &)
int findBinTriggerTower_(EcalElectronicsMapping const *, ObjectType, DetId const &)
uint32_t idFromName(std::string const &)
Definition: DetId.h:17
int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &)
static constexpr int nEBEtaBins
AxisSpecs getBinningEE_(BinningType, bool, int, int)
static constexpr int nEESMXRed
AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned)
HLT enums.
static constexpr int nPresetBinnings
void fillAxisDescriptions(edm::ParameterSetDescription &)
static constexpr int nPhiBins
std::string channelName(EcalElectronicsMapping const *, uint32_t, BinningType _btype=kDCC)
BinningType translateBinningType(std::string const &)
AxisSpecs formAxis(edm::ParameterSet const &)
AxisSpecs getBinningMEM_(BinningType, bool, int, int)
int findBin1D(EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &)
AxisSpecs getBinningEcal_(BinningType, bool, int)
std::vector< std::string > labels
static constexpr int nEESMY
uint32_t idFromBin(ObjectType, BinningType, unsigned, int)