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  std::vector<float> edges;
77  std::vector<std::string> labels;
79  AxisSpecs() : nbins(0), low(0.), high(0.), edges(0), labels(0), title("") { ; };
80  };
81 
82  AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned);
83 
87 
91 
92  unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &);
94  unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, int, BinningType _btype = kDCC);
95 
96  ObjectType getObject(ObjectType, unsigned);
97 
98  unsigned getNObjects(ObjectType);
99 
100  bool isValidIdBin(EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int);
101 
102  std::string channelName(EcalElectronicsMapping const *, uint32_t, BinningType _btype = kDCC);
103 
104  uint32_t idFromName(std::string const &);
105  uint32_t idFromBin(ObjectType, BinningType, unsigned, int);
106 
107  AxisSpecs formAxis(edm::ParameterSet const &);
109 
113 
114  /* Functions used only internally within binning namespace */
115 
116  // used for SM binnings
117  int xlow_(int);
118  int ylow_(int);
119 
120  AxisSpecs getBinningEB_(BinningType, bool, int);
121  AxisSpecs getBinningEE_(BinningType, bool, int, int);
122  AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *);
123  AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int);
124  AxisSpecs getBinningEcal_(BinningType, bool, int);
125  AxisSpecs getBinningMEM_(BinningType, bool, int, int);
126 
127  int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
131  int findBinRCT_(ObjectType, DetId const &);
132  int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int = -1);
134  } // namespace binning
135 } // namespace ecaldqm
136 
137 #endif
int findBinRCT_(ObjectType, DetId const &)
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)
std::vector< float > edges
ObjectType getObject(ObjectType, unsigned)
AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *)
ObjectType translateObjectType(std::string const &)
dqm::legacy::MonitorElement::Kind translateKind(std::string const &)
AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int)
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 &)
AxisSpecs getBinningEE_(BinningType, bool, int, int)
AxisSpecs getBinning(EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned)
HLT enums.
void fillAxisDescriptions(edm::ParameterSetDescription &)
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
uint32_t idFromBin(ObjectType, BinningType, unsigned, int)