CMS 3D CMS Logo

Classes | Enumerations | Functions
ecaldqm::binning Namespace Reference

Classes

struct  AxisSpecs
 

Enumerations

enum  BinningType {
  kCrystal, kTriggerTower, kSuperCrystal, kPseudoStrip,
  kTCC, kDCC, kProjEta, kProjPhi,
  kRCT, kUser, kReport, kTrend,
  nBinType
}
 
enum  Constants {
  nPresetBinnings = kRCT + 1, nEBSMEta = 85, nEBSMPhi = 20, nEESMX = 40,
  nEESMXRed = 30, nEESMXExt = 45, nEESMY = 40, nEESMYRed = 35,
  nEBEtaBins = 34, nEEEtaBins = 20, nPhiBins = 36
}
 
enum  ObjectType {
  kEB, kEE, kEEm, kEEp,
  kSM, kEBSM, kEESM, kSMMEM,
  kEBSMMEM, kEESMMEM, kEcal, kMEM,
  kEBMEM, kEEMEM, kEcal2P, kEcal3P,
  kEE2P, kMEM2P, kChannel, nObjType
}
 

Functions

std::string channelName (EcalElectronicsMapping const *, uint32_t, BinningType _btype=kDCC)
 
void fillAxisDescriptions (edm::ParameterSetDescription &)
 
int findBin1D (EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &)
 
int findBin1D (EcalElectronicsMapping const *, ObjectType, BinningType, EcalElectronicsId const &)
 
int findBin1D (EcalElectronicsMapping const *, ObjectType, BinningType, int)
 
int findBin2D (EcalElectronicsMapping const *, ObjectType, BinningType, DetId const &)
 
int findBin2D (EcalElectronicsMapping const *, ObjectType, BinningType, EcalElectronicsId const &)
 
int findBin2D (EcalElectronicsMapping const *, ObjectType, BinningType, int)
 
int findBinCrystal_ (EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
 
int findBinCrystal_ (EcalElectronicsMapping const *, ObjectType, EcalElectronicsId const &)
 
int findBinPseudoStrip_ (EcalElectronicsMapping const *, ObjectType, DetId const &)
 
int findBinRCT_ (ObjectType, DetId const &)
 
int findBinSuperCrystal_ (EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
 
int findBinSuperCrystal_ (EcalElectronicsMapping const *, ObjectType, EcalElectronicsId const &)
 
int findBinTriggerTower_ (EcalElectronicsMapping const *, ObjectType, DetId const &)
 
unsigned findPlotIndex (EcalElectronicsMapping const *, ObjectType, DetId const &)
 
unsigned findPlotIndex (EcalElectronicsMapping const *, ObjectType, EcalElectronicsId const &)
 
unsigned findPlotIndex (EcalElectronicsMapping const *, ObjectType, int, BinningType _btype=kDCC)
 
AxisSpecs formAxis (edm::ParameterSet const &)
 
AxisSpecs getBinning (EcalElectronicsMapping const *, ObjectType, BinningType, bool, int, unsigned)
 
AxisSpecs getBinningEB_ (BinningType, bool, int)
 
AxisSpecs getBinningEcal_ (BinningType, bool, int)
 
AxisSpecs getBinningEE_ (BinningType, bool, int, int)
 
AxisSpecs getBinningMEM_ (BinningType, bool, int, int)
 
AxisSpecs getBinningSM_ (BinningType, bool, unsigned, int, EcalElectronicsMapping const *)
 
AxisSpecs getBinningSMMEM_ (BinningType, bool, unsigned, int)
 
unsigned getNObjects (ObjectType)
 
ObjectType getObject (ObjectType, unsigned)
 
uint32_t idFromBin (ObjectType, BinningType, unsigned, int)
 
uint32_t idFromName (std::string const &)
 
bool isValidIdBin (EcalElectronicsMapping const *, ObjectType, BinningType, unsigned, int)
 
BinningType translateBinningType (std::string const &)
 
dqm::legacy::MonitorElement::Kind translateKind (std::string const &)
 
ObjectType translateObjectType (std::string const &)
 
int xlow_ (int)
 
int ylow_ (int)
 

Enumeration Type Documentation

◆ BinningType

◆ Constants

Enumerator
nPresetBinnings 
nEBSMEta 
nEBSMPhi 
nEESMX 
nEESMXRed 
nEESMXExt 
nEESMY 
nEESMYRed 
nEBEtaBins 
nEEEtaBins 
nPhiBins 

Definition at line 57 of file MESetBinningUtils.h.

◆ ObjectType

Enumerator
kEB 
kEE 
kEEm 
kEEp 
kSM 
kEBSM 
kEESM 
kSMMEM 
kEBSMMEM 
kEESMMEM 
kEcal 
kMEM 
kEBMEM 
kEEMEM 
kEcal2P 
kEcal3P 
kEE2P 
kMEM2P 
kChannel 
nObjType 

Definition at line 18 of file MESetBinningUtils.h.

Function Documentation

◆ channelName()

std::string ecaldqm::binning::channelName ( EcalElectronicsMapping const *  electronicsMap,
uint32_t  _rawId,
BinningType  _btype = kDCC 
)

Definition at line 615 of file MESetBinningUtils.cc.

References EcalElectronicsMapping::DCCid(), runTauDisplay::eid, EcalElectronicsMapping::getDetId(), EcalElectronicsMapping::getElectronicsId(), EcalElectronicsMapping::getTriggerElectronicsId(), EcalElectronicsMapping::getTrigTowerDetId(), kCrystal, kDCC, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kSuperCrystal, kTCC, kTriggerTower, ecaldqm::nDCC, ecaldqm::smName(), contentValuesCheck::ss, EcalTriggerElectronicsId::tccId(), l1tHGCalTowerProducer_cfi::tower, and EcalTriggerElectronicsId::ttId().

Referenced by ecaldqm::MESetDet2D::book(), ecaldqm::MESetDet1D::book(), ecaldqm::MESetEcal::generatePaths(), and DTNoiseCalibration::getChannelName().

617  {
618  // assume the following IDs for respective binning types:
619  // Crystal: EcalElectronicsId
620  // TriggerTower: EcalTriggerElectronicsId (pstrip and channel ignored)
621  // SuperCrystal: EcalElectronicsId (strip and crystal ignored)
622  // TCC: TCC ID
623  // DCC: DCC ID
624 
625  std::stringstream ss;
626 
627  switch (_btype) {
628  case kCrystal: {
629  // EB-03 DCC 12 CCU 12 strip 3 xtal 1 (EB ieta -13 iphi 60) (TCC 39 TT 12
630  // pstrip 3 chan 1)
631  EcalElectronicsId eid(_rawId);
632  if (eid.towerId() >= 69)
633  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " PN " << eid.xtalId();
634  else {
635  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " strip "
636  << eid.stripId() << " xtal " << eid.xtalId();
637 
638  if (eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1) {
639  EBDetId ebid(electronicsMap->getDetId(eid));
640  ss << " (EB ieta " << std::showpos << ebid.ieta() << std::noshowpos << " iphi " << ebid.iphi() << ")";
641  } else {
642  EEDetId eeid(electronicsMap->getDetId(eid));
643  ss << " (EE ix " << eeid.ix() << " iy " << eeid.iy() << ")";
644  }
645  EcalTriggerElectronicsId teid(electronicsMap->getTriggerElectronicsId(eid));
646  ss << " (TCC " << teid.tccId() << " TT " << teid.ttId() << " pstrip " << teid.pseudoStripId() << " chan "
647  << teid.channelId() << ")";
648  break;
649  }
650  }
651  [[fallthrough]];
652  case kTriggerTower: {
653  // EB-03 DCC 12 TCC 18 TT 3
654  EcalTriggerElectronicsId teid(_rawId);
655  EcalElectronicsId eid(electronicsMap->getElectronicsId(teid));
656  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " TCC " << teid.tccId() << " TT " << teid.ttId();
657  break;
658  }
659  case kSuperCrystal: {
660  // EB-03 DCC 12 CCU 18 (EBTT ieta -13 iphi 60)
661  EcalElectronicsId eid(_rawId);
662  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId();
663  if (eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1) {
664  EcalTrigTowerDetId ttid(EBDetId(electronicsMap->getDetId(eid)).tower());
665  ss << " (EBTT ieta " << std::showpos << ttid.ieta() << std::noshowpos << " iphi " << ttid.iphi() << ")";
666  } else {
667  EcalScDetId scid(EEDetId(electronicsMap->getDetId(eid)).sc());
668  ss << " (EESC ix " << scid.ix() << " iy " << scid.iy() << ")";
669  }
670  break;
671  }
672  case kTCC: {
673  // EB-03 TCC 12
674  int tccid(_rawId - nDCC);
675  int dccid(electronicsMap->DCCid(electronicsMap->getTrigTowerDetId(tccid, 1)));
676  ss << smName(dccid) << " TCC " << (_rawId - nDCC);
677  break;
678  }
679  case kDCC:
680  ss << smName(_rawId);
681  break;
682  default:
683  break;
684  }
685 
686  return ss.str();
687  }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
std::string smName(unsigned)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...

◆ fillAxisDescriptions()

void ecaldqm::binning::fillAxisDescriptions ( edm::ParameterSetDescription _desc)

Definition at line 866 of file MESetBinningUtils.cc.

References edm::ParameterSetDescription::addOptionalNode(), edm::ParameterSetDescription::addOptionalUntracked(), edm::ParameterSetDescription::addUntracked(), and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by ecaldqm::fillMESetDescriptions().

866  {
867  _desc.addUntracked<std::string>("title", "");
868  _desc.addUntracked<int>("nbins", 0);
869  _desc.addUntracked<double>("low", 0.);
870  _desc.addOptionalNode(edm::ParameterDescription<double>("high", 0., false) ^
871  edm::ParameterDescription<double>("unitsPerBin", 0., false),
872  false);
873  _desc.addOptionalUntracked<std::vector<double>>("edges");
874  _desc.addOptionalUntracked<std::vector<std::string>>("labels");
875  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)

◆ findBin1D() [1/3]

int ecaldqm::binning::findBin1D ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
DetId const &  _id 
)

Definition at line 63 of file MESetBinningUtils.cc.

References newFWLiteAna::bin, ecaldqm::dccId(), EcalPnDiodeDetId::iPnId(), kCrystal, kDCC, kEB, kEBSM, kEBSMMEM, kEcal, kEE, kEEm, kEEp, kEESM, kEESMMEM, kSM, kSMMEM, kSuperCrystal, kTCC, kTriggerTower, ecaldqm::nTTInner, ecaldqm::nTTOuter, SurfaceOrientation::outer, ecaldqm::tccId(), ecaldqm::towerId(), and ecaldqm::ttId().

Referenced by ecaldqm::MESetDet1D::fill(), ecaldqm::MESetDet1D::findBin(), ecaldqm::MESetDet1D::getBinContent(), ecaldqm::MESetDet1D::getBinEntries(), ecaldqm::MESetDet1D::getBinError(), ecaldqm::MESetDet1D::setBinContent(), ecaldqm::MESetDet1D::setBinEntries(), and ecaldqm::MESetDet1D::setBinError().

66  {
67  switch (_otype) {
68  case kSM:
69  case kEBSM:
70  case kEESM:
71  if (_btype == kSuperCrystal)
72  return towerId(_id, electronicsMap);
73  else if (_btype == kTriggerTower) {
74  unsigned tccid(tccId(_id, electronicsMap));
75  if (tccid <= 36 || tccid >= 73) { // EE
76  unsigned bin(ttId(_id, electronicsMap));
77  bool outer((tccid >= 19 && tccid <= 36) || (tccid >= 73 && tccid <= 90));
78  // For the following, the constants nTTInner and nTTOuter are defined in
79  // EcalDQMCommonUtils.h.
80  if (outer)
81  bin += 2 * nTTInner; // For outer TCCs, sets bin number to increment
82  // by twice the number of TTs in inner TCCs, because numbering of bins
83  // is in the order (inner1, inner2, outer1, outer2).
84  // ("inner"" := closer to the beam)
85  bin += (tccid % 2) * (outer ? nTTOuter : nTTInner); // Yields x-axis bin number
86  // in the format above; TTs in even-numbered TCCs are filled in inner1
87  // or outer1, and those in odd-numbered TCC are filled in inner2 and
88  // outer2.
89  return bin;
90  } else
91  return ttId(_id, electronicsMap);
92  } else
93  break;
94  case kEcal:
95  if (_btype == kDCC)
96  return dccId(_id, electronicsMap);
97  else if (_btype == kTCC)
98  return tccId(_id, electronicsMap);
99  else
100  break;
101  case kEB:
102  if (_btype == kDCC)
103  return dccId(_id, electronicsMap) - 9;
104  else if (_btype == kTCC)
105  return tccId(_id, electronicsMap) - 36;
106  else
107  break;
108  case kEEm:
109  if (_btype == kDCC)
110  return dccId(_id, electronicsMap);
111  else if (_btype == kTCC)
112  return tccId(_id, electronicsMap);
113  else
114  break;
115  case kEEp:
116  if (_btype == kDCC)
117  return dccId(_id, electronicsMap) - 45;
118  else if (_btype == kTCC)
119  return tccId(_id, electronicsMap) - 72;
120  else
121  break;
122  case kEE:
123  if (_btype == kDCC) {
124  int bin(dccId(_id, electronicsMap));
125  if (bin >= 46)
126  bin -= 36;
127  return bin;
128  } else if (_btype == kTCC) {
129  int bin(tccId(_id, electronicsMap));
130  if (bin >= 72)
131  bin -= 36;
132  return bin;
133  } else
134  break;
135  case kSMMEM:
136  case kEBSMMEM:
137  case kEESMMEM:
138  if (_btype == kCrystal)
139  return EcalPnDiodeDetId(_id).iPnId();
140  else
141  break;
142  default:
143  break;
144  }
145 
146  return 0;
147  }
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
int iPnId() const
get the PnId

◆ findBin1D() [2/3]

int ecaldqm::binning::findBin1D ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
EcalElectronicsId const &  _id 
)

Definition at line 149 of file MESetBinningUtils.cc.

References newFWLiteAna::bin, ecaldqm::dccId(), kDCC, kEB, kEBSM, kEcal, kEE, kEEm, kEEp, kEESM, kSM, kSuperCrystal, kTCC, kTriggerTower, ecaldqm::nTTInner, ecaldqm::nTTOuter, SurfaceOrientation::outer, ecaldqm::tccId(), ecaldqm::towerId(), and ecaldqm::ttId().

152  {
153  switch (_otype) {
154  case kSM:
155  case kEBSM:
156  case kEESM:
157  if (_btype == kSuperCrystal)
158  return towerId(_id);
159  else if (_btype == kTriggerTower) {
160  unsigned tccid(tccId(_id, electronicsMap));
161  if (tccid <= 36 || tccid >= 73) { // EE
162  unsigned bin(ttId(_id, electronicsMap));
163  bool outer((tccid >= 19 && tccid <= 36) || (tccid >= 73 && tccid <= 90));
164  // For the following, the constants nTTInner and nTTOuter are defined in
165  // EcalDQMCommonUtils.h.
166  if (outer)
167  bin += 2 * nTTInner; // For outer TCCs, sets bin number to increment
168  // by twice the number of TTs in inner TCCs, because numbering of bins
169  // is in the order (inner1, inner2, outer1, outer2).
170  // ("inner"" := closer to the beam)
171  bin += (tccid % 2) * (outer ? nTTOuter : nTTInner); // Yields x-axis bin number
172  // in the format above; TTs in even-numbered TCCs are filled in inner1
173  // or outer1, and those in odd-numbered TCC are filled in inner2 and
174  // outer2.
175  return bin;
176  } else
177  return ttId(_id, electronicsMap);
178  } else
179  break;
180  case kEcal:
181  if (_btype == kDCC)
182  return dccId(_id);
183  else if (_btype == kTCC)
184  return tccId(_id, electronicsMap);
185  else
186  break;
187  case kEB:
188  if (_btype == kDCC)
189  return dccId(_id) - 9;
190  else if (_btype == kTCC)
191  return tccId(_id, electronicsMap) - 36;
192  else
193  break;
194  case kEEm:
195  if (_btype == kDCC)
196  return dccId(_id);
197  else if (_btype == kTCC)
198  return tccId(_id, electronicsMap);
199  else
200  break;
201  case kEEp:
202  if (_btype == kDCC)
203  return dccId(_id) - 45;
204  else if (_btype == kTCC)
205  return tccId(_id, electronicsMap) - 72;
206  else
207  break;
208  case kEE:
209  if (_btype == kDCC) {
210  int bin(dccId(_id));
211  if (bin >= 46)
212  bin -= 36;
213  return bin;
214  } else if (_btype == kTCC) {
215  int bin(tccId(_id, electronicsMap));
216  if (bin >= 72)
217  bin -= 36;
218  return bin;
219  } else
220  break;
221  default:
222  break;
223  }
224 
225  return 0;
226  }
unsigned ttId(DetId const &, EcalElectronicsMapping const *)
unsigned towerId(DetId const &, EcalElectronicsMapping const *)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)

◆ findBin1D() [3/3]

int ecaldqm::binning::findBin1D ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
int  _dcctccid 
)

Definition at line 228 of file MESetBinningUtils.cc.

References kDCC, kEB, kEcal, kEE, kEEm, kEEp, and kTCC.

228  {
229  if (_otype == kEcal && _btype == kDCC)
230  return _dcctccid;
231  else if (_otype == kEcal && _btype == kTCC)
232  return _dcctccid;
233  if (_otype == kEB && _btype == kDCC)
234  return _dcctccid - 9;
235  else if (_otype == kEB && _btype == kTCC)
236  return _dcctccid - 36;
237  else if (_otype == kEEm && _btype == kDCC)
238  return _dcctccid;
239  else if (_otype == kEEm && _btype == kTCC)
240  return _dcctccid;
241  else if (_otype == kEEp && _btype == kDCC)
242  return _dcctccid - 45;
243  else if (_otype == kEEp && _btype == kTCC)
244  return _dcctccid - 72;
245  else if (_otype == kEE && _btype == kDCC)
246  return _dcctccid <= 9 ? _dcctccid : _dcctccid - 36;
247  else if (_otype == kEE && _btype == kTCC)
248  return _dcctccid <= 36 ? _dcctccid : _dcctccid - 36;
249 
250  return 0;
251  }

◆ findBin2D() [1/3]

int ecaldqm::binning::findBin2D ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
DetId const &  _id 
)

Definition at line 253 of file MESetBinningUtils.cc.

References findBinCrystal_(), findBinPseudoStrip_(), findBinRCT_(), findBinSuperCrystal_(), findBinTriggerTower_(), kCrystal, kPseudoStrip, kRCT, kSuperCrystal, kTriggerTower, nObjType, and nPresetBinnings.

Referenced by ecaldqm::MESet::const_iterator::const_iterator(), ecaldqm::MESetDet2D::fill(), ecaldqm::MESetDet2D::findBin(), ecaldqm::MESetDet2D::getBinContent(), ecaldqm::MESetDet2D::getBinEntries(), ecaldqm::MESetDet2D::getBinError(), ecaldqm::MESetDet2D::setBinContent(), ecaldqm::MESetDet2D::setBinEntries(), and ecaldqm::MESetDet2D::setBinError().

256  {
257  if (_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
258  return 0;
259 
260  switch (_btype) {
261  case kCrystal:
262  return findBinCrystal_(electronicsMap, _otype, _id);
263  break;
264  case kTriggerTower:
265  return findBinTriggerTower_(electronicsMap, _otype, _id);
266  break;
267  case kSuperCrystal:
268  return findBinSuperCrystal_(electronicsMap, _otype, _id);
269  break;
270  case kPseudoStrip:
271  return findBinPseudoStrip_(electronicsMap, _otype, _id);
272  break;
273  case kRCT:
274  return findBinRCT_(_otype, _id);
275  break;
276  default:
277  return 0;
278  }
279  }
int findBinRCT_(ObjectType, DetId const &)
int findBinPseudoStrip_(EcalElectronicsMapping const *, ObjectType, DetId const &)
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
int findBinTriggerTower_(EcalElectronicsMapping const *, ObjectType, DetId const &)
int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)

◆ findBin2D() [2/3]

int ecaldqm::binning::findBin2D ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
EcalElectronicsId const &  _id 
)

Definition at line 281 of file MESetBinningUtils.cc.

References findBinCrystal_(), findBinSuperCrystal_(), kCrystal, kSuperCrystal, nObjType, and nPresetBinnings.

284  {
285  if (_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
286  return 0;
287 
288  switch (_btype) {
289  case kCrystal:
290  return findBinCrystal_(electronicsMap, _otype, _id);
291  break;
292  case kSuperCrystal:
293  return findBinSuperCrystal_(electronicsMap, _otype, _id);
294  break;
295  default:
296  return 0;
297  }
298  }
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)

◆ findBin2D() [3/3]

int ecaldqm::binning::findBin2D ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
int  _dccid 
)

Definition at line 300 of file MESetBinningUtils.cc.

References kDCC, kEcal, ecaldqm::kEEpLow, and hlt_dqm_clientPB-live_cfg::nbinsX.

300  {
301  if (_otype != kEcal || _btype != kDCC)
302  return 0;
303 
304  int nbinsX(9);
305  unsigned iDCC(_dccid - 1);
306  int xbin(0);
307  if (iDCC <= kEEmHigh || iDCC >= kEEpLow)
308  xbin = (iDCC + 6) % nbinsX + 1;
309  else
310  xbin = iDCC % nbinsX + 1;
311  int ybin(6 - iDCC / nbinsX);
312 
313  return (nbinsX + 2) * ybin + xbin;
314  }

◆ findBinCrystal_() [1/2]

int ecaldqm::binning::findBinCrystal_ ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
DetId const &  _id,
int  _iSM = -1 
)

Definition at line 430 of file MESetBinningUtils2.cc.

References ecaldqm::dccId(), EcalBarrel, EcalEndcap, EcalLaserPnDiode, EBDetId::ieta(), LEDCalibrationChannels::ieta, EBDetId::iphi(), LEDCalibrationChannels::iphi, EcalPnDiodeDetId::iPnId(), EEDetId::ix(), EEDetId::iy(), kEB, kEBMEM, kEBSM, kEBSMMEM, kEE, kEEm, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm05, ecaldqm::kEEm08, ecaldqm::kEEm09, kEEMEM, ecaldqm::kEEmHigh, kEEp, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp05, ecaldqm::kEEp08, ecaldqm::kEEp09, kEESM, kEESMMEM, kMEM, kSM, kSMMEM, ecaldqm::memDCCIndex(), hlt_dqm_clientPB-live_cfg::nbinsX, nEBSMEta, nEESMX, nEESMXExt, nEESMXRed, DetId::subdetId(), xlow_(), ylow_(), and EEDetId::zside().

Referenced by findBin2D(), findBinCrystal_(), findBinPseudoStrip_(), and findBinTriggerTower_().

433  {
434  int xbin(0), ybin(0);
435  int nbinsX(0);
436  int subdet(_id.subdetId());
437 
438  if (subdet == EcalBarrel) {
439  EBDetId ebid(_id);
440  int iphi(ebid.iphi());
441  int ieta(ebid.ieta());
442  switch (_otype) {
443  case kEB:
444  xbin = iphi;
445  ybin = ieta < 0 ? ieta + 86 : ieta + 85;
446  nbinsX = 360;
447  break;
448  case kSM:
449  case kEBSM:
450  xbin = ieta < 0 ? -ieta : ieta;
451  ybin = ieta < 0 ? (iphi - 1) % 20 + 1 : 20 - (iphi - 1) % 20;
452  nbinsX = nEBSMEta;
453  break;
454  default:
455  break;
456  }
457  } else if (subdet == EcalEndcap) {
458  EEDetId eeid(_id);
459  int ix(eeid.ix());
460  int iy(eeid.iy());
461  switch (_otype) {
462  case kEE:
463  xbin = eeid.zside() < 0 ? ix : ix + 100;
464  ybin = iy;
465  nbinsX = 200;
466  break;
467  case kEEm:
468  case kEEp:
469  xbin = ix;
470  ybin = iy;
471  nbinsX = 100;
472  break;
473  case kSM:
474  case kEESM: {
475  int iSM(_iSM >= 0 ? _iSM : dccId(_id, electronicsMap) - 1);
476  xbin = ix - xlow_(iSM);
477  ybin = iy - ylow_(iSM);
478  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
479  nbinsX = nEESMXExt;
480  else if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
481  nbinsX = nEESMXRed;
482  else
483  nbinsX = nEESMX;
484  } break;
485  default:
486  break;
487  }
488  } else if (subdet == EcalLaserPnDiode) {
489  EcalPnDiodeDetId pnid(_id);
490  switch (_otype) {
491  case kSMMEM:
492  case kEBSMMEM:
493  case kEESMMEM:
494  xbin = pnid.iPnId();
495  ybin = 1;
496  nbinsX = 10;
497  break;
498  case kMEM:
499  xbin = memDCCIndex(dccId(_id, electronicsMap)) + 1;
500  ybin = pnid.iPnId();
501  nbinsX = 44;
502  break;
503  case kEBMEM:
504  xbin = memDCCIndex(dccId(_id, electronicsMap)) - 3;
505  ybin = pnid.iPnId();
506  nbinsX = 36;
507  break;
508  case kEEMEM:
509  xbin = memDCCIndex(dccId(_id, electronicsMap)) + 1;
510  if (xbin > kEEmHigh + 1)
511  xbin -= 36;
512  ybin = pnid.iPnId();
513  nbinsX = 8;
514  break;
515  default:
516  break;
517  }
518  }
519 
520  return (nbinsX + 2) * ybin + xbin;
521  }
unsigned memDCCIndex(unsigned)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)

◆ findBinCrystal_() [2/2]

int ecaldqm::binning::findBinCrystal_ ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
EcalElectronicsId const &  _id 
)

Definition at line 523 of file MESetBinningUtils2.cc.

References findBinCrystal_(), and EcalElectronicsMapping::getDetId().

523  {
524  return findBinCrystal_(electronicsMap, _otype, electronicsMap->getDetId(_id));
525  }
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)

◆ findBinPseudoStrip_()

int ecaldqm::binning::findBinPseudoStrip_ ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
DetId const &  _id 
)

Definition at line 586 of file MESetBinningUtils2.cc.

References EcalBarrel, EcalEndcap, EcalTriggerTower, findBinCrystal_(), findBinTriggerTower_(), ecaldqm::isEndcapTTId(), hlt_dqm_clientPB-live_cfg::nbinsX, DetId::subdetId(), and ecaldqm::tccId().

Referenced by findBin2D().

586  {
587  int xbin(0);
588  int ybin(0);
589  int nbinsX(0);
590  int subdet(_id.subdetId());
591 
592  if ((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel) {
593  return findBinTriggerTower_(electronicsMap, _otype, _id);
594  } else if (subdet == EcalEndcap) {
595  unsigned tccid(tccId(_id, electronicsMap));
596  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
597  return findBinCrystal_(electronicsMap, _otype, _id, iSM);
598  }
599 
600  return (nbinsX + 2) * ybin + xbin;
601  }
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
bool isEndcapTTId(DetId const &)
int findBinTriggerTower_(EcalElectronicsMapping const *, ObjectType, DetId const &)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)

◆ findBinRCT_()

int ecaldqm::binning::findBinRCT_ ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 527 of file MESetBinningUtils2.cc.

References EcalTrigTowerDetId::ieta(), LEDCalibrationChannels::ieta, EcalTrigTowerDetId::iphi(), LEDCalibrationChannels::iphi, and hlt_dqm_clientPB-live_cfg::nbinsX.

Referenced by findBin2D().

527  {
528  int xbin(0);
529  int ybin(0);
530  int nbinsX(0);
531 
532  EcalTrigTowerDetId ttid(_id);
533  int ieta(ttid.ieta());
534  int iphi((ttid.iphi() + 1) % 72 + 1);
535 
536  xbin = ieta < 0 ? ieta + 33 : ieta + 32;
537  ybin = iphi;
538  nbinsX = 64;
539 
540  return (nbinsX + 2) * ybin + xbin;
541  }

◆ findBinSuperCrystal_() [1/2]

int ecaldqm::binning::findBinSuperCrystal_ ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
DetId const &  _id,
int  _iSM = -1 
)

Definition at line 603 of file MESetBinningUtils2.cc.

References ecaldqm::dccId(), EcalBarrel, EcalEndcap, EcalTriggerTower, EcalTrigTowerDetId::ieta(), EBDetId::ieta(), LEDCalibrationChannels::ieta, EBDetId::iphi(), EcalTrigTowerDetId::iphi(), LEDCalibrationChannels::iphi, ecaldqm::isEcalScDetId(), ecaldqm::isEndcapTTId(), EcalScDetId::ix(), EEDetId::ix(), EcalScDetId::iy(), EEDetId::iy(), kEB, kEBSM, kEE, kEEm, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm05, ecaldqm::kEEm08, ecaldqm::kEEm09, kEEp, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp05, ecaldqm::kEEp08, ecaldqm::kEEp09, kEESM, kSM, hlt_dqm_clientPB-live_cfg::nbinsX, nEBSMEta, nEESMX, nEESMXExt, nEESMXRed, DetId::subdetId(), xlow_(), ylow_(), EcalScDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

Referenced by findBin2D(), and findBinSuperCrystal_().

606  {
607  int xbin(0);
608  int ybin(0);
609  int nbinsX(0);
610  int subdet(_id.subdetId());
611 
612  if (subdet == EcalBarrel) {
613  EBDetId ebid(_id);
614  int iphi(ebid.iphi());
615  int ieta(ebid.ieta());
616  switch (_otype) {
617  case kEB:
618  xbin = (iphi - 1) / 5 + 1;
619  ybin = (ieta < 0 ? ieta + 85 : ieta + 84) / 5 + 1;
620  nbinsX = 72;
621  break;
622  case kSM:
623  case kEBSM:
624  xbin = (ieta < 0 ? -ieta - 1 : ieta - 1) / 5 + 1;
625  ybin = (ieta < 0 ? (iphi - 1) % 20 : 19 - (iphi - 1) % 20) / 5 + 1;
626  nbinsX = nEBSMEta / 5;
627  break;
628  default:
629  break;
630  }
631  } else if (subdet == EcalEndcap) {
632  if (isEcalScDetId(_id)) {
633  EcalScDetId scid(_id);
634  int ix(scid.ix());
635  int iy(scid.iy());
636  switch (_otype) {
637  case kEE: {
638  int zside(scid.zside());
639  xbin = zside < 0 ? ix : ix + 20;
640  ybin = iy;
641  nbinsX = 40;
642  } break;
643  case kEEm:
644  case kEEp:
645  xbin = ix;
646  ybin = iy;
647  nbinsX = 20;
648  break;
649  case kSM:
650  case kEESM: {
651  int iSM(_iSM >= 0 ? _iSM : dccId(_id, electronicsMap) - 1);
652  xbin = ix - xlow_(iSM) / 5;
653  ybin = iy - ylow_(iSM) / 5;
654  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
655  nbinsX = nEESMXExt / 5;
656  else if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 ||
657  iSM == kEEp09)
658  nbinsX = nEESMXRed / 5;
659  else
660  nbinsX = nEESMX / 5;
661  } break;
662  default:
663  break;
664  }
665  } else {
666  EEDetId eeid(_id);
667  int ix(eeid.ix());
668  int iy(eeid.iy());
669  switch (_otype) {
670  case kEE:
671  xbin = (eeid.zside() < 0 ? ix - 1 : ix + 99) / 5 + 1;
672  ybin = (iy - 1) / 5 + 1;
673  nbinsX = 40;
674  break;
675  case kEEm:
676  case kEEp:
677  xbin = (ix - 1) / 5 + 1;
678  ybin = (iy - 1) / 5 + 1;
679  nbinsX = 20;
680  break;
681  case kSM:
682  case kEESM: {
683  int iSM(_iSM >= 0 ? _iSM : dccId(_id, electronicsMap) - 1);
684  xbin = (ix - xlow_(iSM) - 1) / 5 + 1;
685  ybin = (iy - ylow_(iSM) - 1) / 5 + 1;
686  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
687  nbinsX = nEESMXExt / 5;
688  else if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 ||
689  iSM == kEEp09)
690  nbinsX = nEESMXRed / 5;
691  else
692  nbinsX = nEESMX / 5;
693  } break;
694  default:
695  break;
696  }
697  }
698  } else if (subdet == EcalTriggerTower && !isEndcapTTId(_id)) {
699  EcalTrigTowerDetId ttid(_id);
700  int ieta(ttid.ieta());
701  int iphi((ttid.iphi() + 1) % 72 + 1);
702  switch (_otype) {
703  case kEB:
704  xbin = iphi;
705  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
706  nbinsX = 72;
707  break;
708  case kSM:
709  case kEBSM:
710  xbin = ieta < 0 ? -ieta : ieta;
711  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
712  nbinsX = nEBSMEta / 5;
713  break;
714  default:
715  break;
716  }
717  }
718 
719  return (nbinsX + 2) * ybin + xbin;
720  }
int zside(DetId const &)
bool isEndcapTTId(DetId const &)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
bool isEcalScDetId(DetId const &)

◆ findBinSuperCrystal_() [2/2]

int ecaldqm::binning::findBinSuperCrystal_ ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
EcalElectronicsId const &  _id 
)

Definition at line 722 of file MESetBinningUtils2.cc.

References EcalElectronicsId::dccId(), findBinSuperCrystal_(), EcalElectronicsMapping::getDetId(), kEB, ecaldqm::kEBmHigh, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEBSM, kSM, hlt_dqm_clientPB-live_cfg::nbinsX, and EcalElectronicsId::towerId().

724  {
725  int xbin(0);
726  int ybin(0);
727  int nbinsX(0);
728  int iDCC(_id.dccId() - 1);
729 
730  if (iDCC >= kEBmLow && iDCC <= kEBpHigh) {
731  unsigned towerid(_id.towerId());
732  bool isEBm(iDCC <= kEBmHigh);
733  switch (_otype) {
734  case kEB:
735  xbin = 4 * ((iDCC - 9) % 18) + (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
736  ybin = (towerid - 1) / 4 * (isEBm ? -1 : 1) + (isEBm ? 18 : 17);
737  nbinsX = 72;
738  break;
739  case kSM:
740  case kEBSM:
741  xbin = (towerid - 1) / 4 + 1;
742  //In by SM plots, using towerid, the ybinning always increases from 1 to 4,
743  //whereas using iphi it flips for EB- and EB+
744  ybin = (towerid - 1) % 4 + 1;
745  nbinsX = 17;
746  break;
747  default:
748  break;
749  }
750  } else {
751  return findBinSuperCrystal_(electronicsMap, _otype, EEDetId(electronicsMap->getDetId(_id)).sc());
752  }
753 
754  return (nbinsX + 2) * ybin + xbin;
755  }
int findBinSuperCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)

◆ findBinTriggerTower_()

int ecaldqm::binning::findBinTriggerTower_ ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
DetId const &  _id 
)

Definition at line 543 of file MESetBinningUtils2.cc.

References EcalBarrel, EcalEndcap, EcalTriggerTower, findBinCrystal_(), EcalTrigTowerDetId::ieta(), LEDCalibrationChannels::ieta, EcalTrigTowerDetId::iphi(), LEDCalibrationChannels::iphi, ecaldqm::isEndcapTTId(), kEB, kEBSM, kEcal, kSM, hlt_dqm_clientPB-live_cfg::nbinsX, DetId::subdetId(), ecaldqm::tccId(), and EBDetId::tower().

Referenced by findBin2D(), and findBinPseudoStrip_().

543  {
544  int xbin(0);
545  int ybin(0);
546  int nbinsX(0);
547  int subdet(_id.subdetId());
548 
549  if ((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel) {
550  EcalTrigTowerDetId ttid;
551  if (subdet == EcalBarrel)
552  ttid = EBDetId(_id).tower();
553  else
554  ttid = _id;
555 
556  int ieta(ttid.ieta());
557  int iphi((ttid.iphi() + 1) % 72 + 1);
558  switch (_otype) {
559  case kEB:
560  xbin = iphi;
561  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
562  nbinsX = 72;
563  break;
564  case kSM:
565  case kEBSM:
566  xbin = ieta < 0 ? -ieta : ieta;
567  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
568  nbinsX = 17;
569  break;
570  case kEcal:
571  xbin = ieta < 0 ? ieta + 33 : ieta + 32;
572  ybin = iphi > 70 ? iphi - 70 : iphi + 2;
573  nbinsX = 64;
574  default:
575  break;
576  }
577  } else if (subdet == EcalEndcap) {
578  unsigned tccid(tccId(_id, electronicsMap));
579  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
580  return findBinCrystal_(electronicsMap, _otype, _id, iSM);
581  }
582 
583  return (nbinsX + 2) * ybin + xbin;
584  }
int ieta() const
get the tower ieta
int findBinCrystal_(EcalElectronicsMapping const *, ObjectType, DetId const &, int=-1)
bool isEndcapTTId(DetId const &)
unsigned tccId(DetId const &, EcalElectronicsMapping const *)
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
Definition: EBDetId.h:57
int iphi() const
get the tower iphi

◆ findPlotIndex() [1/3]

unsigned ecaldqm::binning::findPlotIndex ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
DetId const &  _id 
)

Definition at line 316 of file MESetBinningUtils.cc.

References ecaldqm::dccId(), EcalBarrel, EcalEndcap, EcalLaserPnDiode, EcalTriggerTower, getNObjects(), ecaldqm::isEndcapTTId(), ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEcal2P, kEcal3P, kEE2P, kMEM2P, DetId::subdetId(), and ecaldqm::zside().

Referenced by ecaldqm::MESet::const_iterator::const_iterator(), ecaldqm::MESetDet0D::fill(), ecaldqm::MESetProjection::fill(), ecaldqm::MESetDet2D::fill(), ecaldqm::MESetDet1D::fill(), ecaldqm::MESetTrend::fill(), ecaldqm::MESetEcal::fill(), ecaldqm::MESetTrend::findBin(), ecaldqm::MESetDet2D::findBin(), ecaldqm::MESetDet1D::findBin(), ecaldqm::MESetEcal::findBin(), findPlotIndex(), ecaldqm::MESetDet0D::getBinContent(), ecaldqm::MESetProjection::getBinContent(), ecaldqm::MESetDet2D::getBinContent(), ecaldqm::MESetEcal::getBinContent(), ecaldqm::MESetDet1D::getBinContent(), ecaldqm::MESetProjection::getBinEntries(), ecaldqm::MESetDet2D::getBinEntries(), ecaldqm::MESetDet1D::getBinEntries(), ecaldqm::MESetEcal::getBinEntries(), ecaldqm::MESetProjection::getBinError(), ecaldqm::MESetDet2D::getBinError(), ecaldqm::MESetEcal::getBinError(), ecaldqm::MESetDet1D::getBinError(), ecaldqm::MESetProjection::setBinContent(), ecaldqm::MESetDet2D::setBinContent(), ecaldqm::MESetDet1D::setBinContent(), ecaldqm::MESetEcal::setBinContent(), ecaldqm::MESetProjection::setBinEntries(), ecaldqm::MESetDet2D::setBinEntries(), ecaldqm::MESetDet1D::setBinEntries(), ecaldqm::MESetEcal::setBinEntries(), ecaldqm::MESetProjection::setBinError(), ecaldqm::MESetDet2D::setBinError(), ecaldqm::MESetDet1D::setBinError(), and ecaldqm::MESetEcal::setBinError().

316  {
317  if (getNObjects(_otype) == 1)
318  return 0;
319 
320  switch (_otype) {
321  case kEcal3P:
322  if (_id.subdetId() == EcalBarrel)
323  return 1;
324  else if (_id.subdetId() == EcalEndcap && zside(_id) > 0)
325  return 2;
326  else if (_id.subdetId() == EcalTriggerTower) {
327  if (!isEndcapTTId(_id))
328  return 1;
329  else {
330  if (zside(_id) > 0)
331  return 2;
332  else
333  return 0;
334  }
335  } else
336  return 0;
337 
338  case kEcal2P:
339  if (_id.subdetId() == EcalBarrel)
340  return 1;
341  else if (_id.subdetId() == EcalTriggerTower && !isEndcapTTId(_id))
342  return 1;
343  else
344  return 0;
345 
346  case kEE2P:
347  if (zside(_id) > 0)
348  return 1;
349  else
350  return 0;
351 
352  case kMEM2P:
353  if (_id.subdetId() == EcalLaserPnDiode) {
354  unsigned iDCC(dccId(_id, electronicsMap) - 1);
355  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
356  return 1;
357  else
358  return 0;
359  } else
360  return -1;
361 
362  default:
363  return findPlotIndex(electronicsMap, _otype, dccId(_id, electronicsMap));
364  }
365  }
unsigned getNObjects(ObjectType)
int zside(DetId const &)
bool isEndcapTTId(DetId const &)
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &)

◆ findPlotIndex() [2/3]

unsigned ecaldqm::binning::findPlotIndex ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
EcalElectronicsId const &  _id 
)

Definition at line 367 of file MESetBinningUtils.cc.

References EcalElectronicsId::dccId(), findPlotIndex(), and getNObjects().

369  {
370  if (getNObjects(_otype) == 1)
371  return 0;
372 
373  return findPlotIndex(electronicsMap, _otype, _id.dccId());
374  }
unsigned getNObjects(ObjectType)
unsigned findPlotIndex(EcalElectronicsMapping const *, ObjectType, DetId const &)

◆ findPlotIndex() [3/3]

unsigned ecaldqm::binning::findPlotIndex ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
int  _dcctccid,
BinningType  _btype = kDCC 
)

Definition at line 376 of file MESetBinningUtils.cc.

References EcalBarrel, EcalEndcap, getNObjects(), kDCC, kEB, ecaldqm::kEBpHigh, kEBSM, kEBSMMEM, ecaldqm::kEBTCCHigh, kEcal2P, kEcal3P, kEE2P, ecaldqm::kEEmHigh, ecaldqm::kEEmTCCHigh, ecaldqm::kEEpLow, ecaldqm::kEEpTCCLow, kEESM, kEESMMEM, kMEM2P, kPseudoStrip, kSM, kSMMEM, kTCC, ecaldqm::memDCCIndex(), ecaldqm::nEBDCC, and ecaldqm::nEEDCCMEM.

379  {
380  if (getNObjects(_otype) == 1)
381  return 0;
382 
383  int iSM(_dcctccid - 1);
384 
385  switch (_otype) {
386  case kSM:
387  if (_btype == kPseudoStrip) {
388  iSM = iSM <= kEEmTCCHigh ? (iSM + 1) % 18 / 2
389  : iSM >= kEEpTCCLow ? (iSM + 1 - 72) % 18 / 2 + 45
390  : (iSM + 1) - kEEmTCCHigh;
391  return iSM;
392  } else
393  return iSM;
394 
395  case kEBSM:
396  return iSM - 9;
397 
398  case kEESM:
399  if (iSM <= kEEmHigh)
400  return iSM;
401  else
402  return iSM - nEBDCC;
403 
404  case kSMMEM:
405  return memDCCIndex(_dcctccid);
406 
407  case kEBSMMEM:
408  return memDCCIndex(_dcctccid) - nEEDCCMEM / 2;
409 
410  case kEESMMEM:
411  if (iSM <= kEEmHigh)
412  return memDCCIndex(_dcctccid);
413  else
414  return memDCCIndex(_dcctccid) - nEBDCC;
415 
416  case kEcal2P:
417  if (_btype == kDCC) {
418  if (iSM <= kEEmHigh || iSM >= kEEpLow)
419  return 0;
420  else
421  return 1;
422  } else if (_btype == kTCC) {
423  if (iSM <= kEEmTCCHigh || iSM >= kEEpTCCLow)
424  return 0;
425  else
426  return 1;
427  } else {
428  if (iSM == EcalBarrel - 1)
429  return 1;
430  else
431  return 0;
432  }
433 
434  case kEcal3P:
435  if (_btype == kDCC) {
436  if (iSM <= kEEmHigh)
437  return 0;
438  else if (iSM <= kEBpHigh)
439  return 1;
440  else
441  return 2;
442  } else if (_btype == kTCC) {
443  if (iSM <= kEEmTCCHigh)
444  return 0;
445  else if (iSM <= kEBTCCHigh)
446  return 1;
447  else
448  return 2;
449  } else {
450  if (iSM == -EcalEndcap - 1)
451  return 0;
452  else if (iSM == EcalBarrel - 1)
453  return 1;
454  else
455  return 2;
456  }
457 
458  case kEE2P:
459  if (_btype == kDCC) {
460  if (iSM >= kEEpLow)
461  return 1;
462  else
463  return 0;
464  } else {
465  if (iSM >= kEEpTCCLow)
466  return 1;
467  else
468  return 0;
469  }
470 
471  case kMEM2P:
472  if (_btype == kDCC) {
473  if (iSM <= kEEmHigh || iSM >= kEEpLow)
474  return 0;
475  else
476  return 1;
477  } else if (_btype == kTCC)
478  return -1;
479  else {
480  if (iSM == kEB)
481  return 1;
482  else
483  return 0;
484  }
485  default:
486  return -1;
487  }
488  }
unsigned memDCCIndex(unsigned)
unsigned getNObjects(ObjectType)

◆ formAxis()

AxisSpecs ecaldqm::binning::formAxis ( edm::ParameterSet const &  _axisParams)

Definition at line 829 of file MESetBinningUtils.cc.

References filterCSVwithJSON::copy, ecaldqm::binning::AxisSpecs::edges, edm::ParameterSet::existsAs(), edm::ParameterSet::getUntrackedParameter(), ecaldqm::binning::AxisSpecs::high, SummaryClient_cfi::labels, ecaldqm::binning::AxisSpecs::labels, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::binning::AxisSpecs::title.

Referenced by ecaldqm::createMESet().

829  {
830  AxisSpecs axis;
831 
832  if (_axisParams.existsAs<std::vector<double>>("edges", false)) {
833  std::vector<double> const &vEdges(_axisParams.getUntrackedParameter<std::vector<double>>("edges"));
834  axis.nbins = vEdges.size() - 1;
835  axis.edges = new float[vEdges.size()];
836  std::copy(vEdges.begin(), vEdges.end(), axis.edges);
837  } else {
838  axis.nbins = _axisParams.getUntrackedParameter<int>("nbins");
839  axis.low = _axisParams.getUntrackedParameter<double>("low");
840  bool highSet(_axisParams.existsAs<double>("high", false));
841  bool perBinSet(_axisParams.existsAs<double>("unitsPerBin", false));
842  if (highSet) {
843  if (perBinSet)
844  edm::LogWarning("EcalDQM") << "Maximum and bin width both set in an axis; using the former";
845  axis.high = _axisParams.getUntrackedParameter<double>("high");
846  } else if (perBinSet)
847  axis.high = axis.low + _axisParams.getUntrackedParameter<double>("unitsPerBin") * axis.nbins;
848  else
849  axis.high = 0.;
850  }
851 
852  if (_axisParams.existsAs<std::vector<std::string>>("labels", false)) {
853  std::vector<std::string> const &labels(_axisParams.getUntrackedParameter<std::vector<std::string>>("labels"));
854  if (int(labels.size()) == axis.nbins) {
855  axis.labels = new std::string[axis.nbins];
856  for (int iB(0); iB != axis.nbins; ++iB)
857  axis.labels[iB] = labels[iB];
858  }
859  }
860 
861  axis.title = _axisParams.getUntrackedParameter<std::string>("title");
862 
863  return axis;
864  }
Log< level::Warning, false > LogWarning

◆ getBinning()

AxisSpecs ecaldqm::binning::getBinning ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
bool  _isMap,
int  _axis,
unsigned  _iME 
)

Definition at line 14 of file MESetBinningUtils.cc.

References EcalBarrel, EcalEndcap, getBinningEB_(), getBinningEcal_(), getBinningEE_(), getBinningMEM_(), getBinningSM_(), getBinningSMMEM_(), kEB, kEBMEM, kEBSM, kEBSMMEM, kEcal, kEE, kEEm, kEEMEM, ecaldqm::kEEmHigh, kEEp, kEESM, kEESMMEM, kMEM, kSM, kSMMEM, ecaldqm::nEBDCC, ecaldqm::nEEDCCMEM, nObjType, and nPresetBinnings.

Referenced by ecaldqm::MESetEcal::book().

19  {
20  if (_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
21  return AxisSpecs(); // you are on your own
22 
23  switch (_otype) {
24  case kEB:
25  return getBinningEB_(_btype, _isMap, _axis);
26  case kEE:
27  return getBinningEE_(_btype, _isMap, 0, _axis);
28  case kEEm:
29  return getBinningEE_(_btype, _isMap, -1, _axis);
30  case kEEp:
31  return getBinningEE_(_btype, _isMap, 1, _axis);
32  case kSM:
33  return getBinningSM_(_btype, _isMap, _iME, _axis, electronicsMap);
34  case kEBSM:
35  return getBinningSM_(_btype, _isMap, _iME + 9, _axis, electronicsMap);
36  case kEESM:
37  if (_iME <= kEEmHigh)
38  return getBinningSM_(_btype, _isMap, _iME, _axis, electronicsMap);
39  else
40  return getBinningSM_(_btype, _isMap, _iME + nEBDCC, _axis, electronicsMap);
41  case kSMMEM:
42  return getBinningSMMEM_(_btype, _isMap, _iME, _axis);
43  case kEBSMMEM:
44  return getBinningSMMEM_(_btype, _isMap, _iME + nEEDCCMEM / 2, _axis);
45  case kEESMMEM:
46  if (_iME <= kEEmHigh)
47  return getBinningSMMEM_(_btype, _isMap, _iME, _axis);
48  else
49  return getBinningSMMEM_(_btype, _isMap, _iME + nEBDCC, _axis);
50  case kEcal:
51  return getBinningEcal_(_btype, _isMap, _axis);
52  case kMEM:
53  return getBinningMEM_(_btype, _isMap, -1, _axis);
54  case kEBMEM:
55  return getBinningMEM_(_btype, _isMap, EcalBarrel, _axis);
56  case kEEMEM:
57  return getBinningMEM_(_btype, _isMap, EcalEndcap, _axis);
58  default:
59  return AxisSpecs();
60  }
61  }
AxisSpecs getBinningSM_(BinningType, bool, unsigned, int, EcalElectronicsMapping const *)
AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int)
AxisSpecs getBinningEB_(BinningType, bool, int)
AxisSpecs getBinningEE_(BinningType, bool, int, int)
AxisSpecs getBinningMEM_(BinningType, bool, int, int)
AxisSpecs getBinningEcal_(BinningType, bool, int)

◆ getBinningEB_()

AxisSpecs ecaldqm::binning::getBinningEB_ ( BinningType  _btype,
bool  _isMap,
int  _axis 
)

Definition at line 89 of file MESetBinningUtils2.cc.

References ecaldqm::etaBound, kCrystal, kDCC, kProjEta, kProjPhi, kPseudoStrip, kSuperCrystal, kTCC, kTriggerTower, nEBEtaBins, nPhiBins, Pi, and HistogramManager_cfi::specs.

Referenced by getBinning().

89  {
90  AxisSpecs specs;
91 
92  if (!_isMap) {
93  switch (_btype) {
94  case kTCC:
95  specs.nbins = 36;
96  specs.low = 9.;
97  specs.high = 45.;
98  specs.title = "iTCC";
99  break;
100  case kDCC:
101  specs.nbins = 36;
102  specs.low = 9.;
103  specs.high = 45.;
104  break;
105  case kProjEta:
106  specs.nbins = nEBEtaBins;
107  specs.low = -etaBound;
108  specs.high = etaBound;
109  specs.title = "eta";
110  break;
111  case kProjPhi:
112  specs.nbins = nPhiBins;
113  specs.low = -TMath::Pi() / 18.;
114  specs.high = TMath::Pi() * 35. / 18.;
115  specs.title = "phi";
116  break;
117  default:
118  break;
119  }
120  } else {
121  switch (_btype) {
122  case kCrystal:
123  if (_axis == 1)
124  specs.nbins = 360;
125  else if (_axis == 2)
126  specs.nbins = 170;
127  break;
128  case kSuperCrystal:
129  case kTriggerTower:
130  case kPseudoStrip:
131  if (_axis == 1)
132  specs.nbins = 72;
133  else if (_axis == 2)
134  specs.nbins = 34;
135  break;
136  default:
137  return specs;
138  }
139 
140  if (_axis == 1) {
141  specs.low = 0.;
142  specs.high = 360.;
143  specs.title = "iphi";
144  } else if (_axis == 2) {
145  specs.low = -85.;
146  specs.high = 85.;
147  specs.title = "ieta";
148  }
149  }
150 
151  return specs;
152  }
const double Pi
double const etaBound

◆ getBinningEcal_()

AxisSpecs ecaldqm::binning::getBinningEcal_ ( BinningType  _btype,
bool  _isMap,
int  _axis 
)

Definition at line 333 of file MESetBinningUtils2.cc.

References ecaldqm::etaBound, cms::cuda::for(), mps_fire::i, kDCC, kProjEta, kProjPhi, kRCT, kTCC, nEBEtaBins, nEEEtaBins, nPhiBins, Pi, and HistogramManager_cfi::specs.

Referenced by getBinning().

333  {
334  AxisSpecs specs;
335 
336  if (!_isMap) {
337  switch (_btype) {
338  case kTCC:
339  specs.nbins = 108;
340  specs.low = 0.;
341  specs.high = 108.;
342  specs.title = "iTCC";
343  break;
344  case kDCC:
345  specs.nbins = 54;
346  specs.low = 0.;
347  specs.high = 54.;
348  specs.title = "iDCC";
349  break;
350  case kProjEta:
351  specs.nbins = nEBEtaBins + 2 * nEEEtaBins;
352  specs.edges = new float[specs.nbins + 1];
353  for (int i(0); i <= nEEEtaBins; i++)
354  specs.edges[i] = -3. + (3. - etaBound) / nEEEtaBins * i;
355  for (int i(1); i <= nEBEtaBins; i++)
356  specs.edges[i + nEEEtaBins] = -etaBound + 2. * etaBound / nEBEtaBins * i;
357  for (int i(1); i <= nEEEtaBins; i++)
358  specs.edges[i + nEEEtaBins + nEBEtaBins] = etaBound + (3. - etaBound) / nEEEtaBins * i;
359  specs.title = "eta";
360  break;
361  case kProjPhi:
362  specs.nbins = nPhiBins;
363  specs.low = -TMath::Pi() / 18.;
364  specs.high = TMath::Pi() * 35. / 18.;
365  specs.title = "phi";
366  break;
367  default:
368  break;
369  }
370  } else {
371  switch (_btype) {
372  case kDCC:
373  if (_axis == 1) {
374  specs.nbins = 9;
375  specs.low = 0.;
376  specs.high = 9.;
377  } else if (_axis == 2) {
378  specs.nbins = 6;
379  specs.low = 0.;
380  specs.high = 6.;
381  }
382  break;
383  case kRCT:
384  if (_axis == 1) {
385  specs.nbins = 64;
386  specs.low = -32.;
387  specs.high = 32.;
388  specs.title = "RCT iEta";
389  } else if (_axis == 2) {
390  specs.nbins = 72;
391  specs.low = 0.;
392  specs.high = 72.;
393  specs.title = "RCT Phi";
394  }
395  break;
396  default:
397  break;
398  }
399  }
400 
401  return specs;
402  }
const double Pi
for(int i=first, nt=offsets[nh];i< nt;i+=gridDim.x *blockDim.x)
double const etaBound

◆ getBinningEE_()

AxisSpecs ecaldqm::binning::getBinningEE_ ( BinningType  _btype,
bool  _isMap,
int  _zside,
int  _axis 
)

Definition at line 154 of file MESetBinningUtils2.cc.

References ecaldqm::etaBound, kCrystal, kDCC, kProjEta, kProjPhi, kPseudoStrip, kSuperCrystal, kTCC, kTriggerTower, nEEEtaBins, nPhiBins, Pi, and HistogramManager_cfi::specs.

Referenced by getBinning().

154  {
155  AxisSpecs specs;
156 
157  if (!_isMap) {
158  switch (_btype) {
159  case kTCC:
160  specs.nbins = _zside ? 36 : 72;
161  specs.low = 0.;
162  specs.high = _zside ? 36. : 72.;
163  specs.title = "iTCC";
164  break;
165  case kDCC:
166  specs.nbins = _zside ? 9 : 18;
167  specs.low = 0.;
168  specs.high = _zside ? 9. : 18.;
169  break;
170  case kProjEta:
171  if (_zside == 0) {
172  specs.nbins = nEEEtaBins / (3. - etaBound) * 6.;
173  specs.low = -3.;
174  specs.high = 3.;
175  } else {
176  specs.nbins = nEEEtaBins;
177  specs.low = _zside < 0 ? -3. : etaBound;
178  specs.high = _zside < 0 ? -etaBound : 3.;
179  }
180  specs.title = "eta";
181  break;
182  case kProjPhi:
183  specs.nbins = nPhiBins;
184  specs.low = -TMath::Pi() / 18.;
185  specs.high = TMath::Pi() * 35. / 18.;
186  specs.title = "phi";
187  break;
188  default:
189  break;
190  }
191  } else {
192  switch (_btype) {
193  case kCrystal:
194  case kTriggerTower:
195  case kPseudoStrip:
196  if (_axis == 1)
197  specs.nbins = _zside ? 100 : 200;
198  if (_axis == 2)
199  specs.nbins = 100;
200  break;
201  case kSuperCrystal:
202  if (_axis == 1)
203  specs.nbins = _zside ? 20 : 40;
204  if (_axis == 2)
205  specs.nbins = 20;
206  break;
207  default:
208  return specs;
209  }
210 
211  if (_axis == 1) {
212  specs.low = 0.;
213  specs.high = _zside ? 100. : 200.;
214  specs.title = "ix";
215  } else if (_axis == 2) {
216  specs.low = 0.;
217  specs.high = 100.;
218  specs.title = "iy";
219  }
220  }
221 
222  return specs;
223  }
const double Pi
double const etaBound

◆ getBinningMEM_()

AxisSpecs ecaldqm::binning::getBinningMEM_ ( BinningType  _btype,
bool  _isMap,
int  _subdet,
int  _axis 
)

Definition at line 404 of file MESetBinningUtils2.cc.

References EcalBarrel, EcalEndcap, kCrystal, LaserClient_cfi::nbins, and HistogramManager_cfi::specs.

Referenced by getBinning().

404  {
405  AxisSpecs specs;
406 
407  if (_btype != kCrystal)
408  return specs;
409 
410  int nbins(44);
411  if (_subdet == EcalBarrel)
412  nbins = 36;
413  else if (_subdet == EcalEndcap)
414  nbins = 8;
415 
416  if (_axis == 1) {
417  specs.nbins = nbins;
418  specs.low = 0.;
419  specs.high = nbins;
420  } else if (_axis == 2) {
421  specs.nbins = 10;
422  specs.low = 0.;
423  specs.high = 10.;
424  specs.title = "iPN";
425  }
426 
427  return specs;
428  }

◆ getBinningSM_()

AxisSpecs ecaldqm::binning::getBinningSM_ ( BinningType  _btype,
bool  _isMap,
unsigned  _iObj,
int  _axis,
EcalElectronicsMapping const *  electronicsMap 
)

Definition at line 225 of file MESetBinningUtils2.cc.

References EcalElectronicsMapping::dccConstituents(), PixelPluginsPhase0_cfi::isBarrel, kCrystal, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEBpLow, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm03, ecaldqm::kEEm05, ecaldqm::kEEm07, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp03, ecaldqm::kEEp05, ecaldqm::kEEp07, ecaldqm::kEEp08, ecaldqm::kEEp09, kPseudoStrip, kSuperCrystal, kTriggerTower, nEBSMEta, nEBSMPhi, nEESMX, nEESMXExt, nEESMXRed, nEESMY, nEESMYRed, ecaldqm::nSuperCrystals(), ecaldqm::nTTInner, ecaldqm::nTTOuter, HistogramManager_cfi::specs, xlow_(), and ylow_().

Referenced by getBinning().

226  {
227  AxisSpecs specs;
228 
229  unsigned iSM(_iObj);
230 
231  const bool isBarrel(iSM >= kEBmLow && iSM <= kEBpHigh);
232 
233  if (!_isMap) {
234  switch (_btype) {
235  case kCrystal:
236  specs.nbins = isBarrel ? 1700 : electronicsMap->dccConstituents(iSM + 1).size();
237  specs.low = 0.;
238  specs.high = specs.nbins;
239  specs.title = "crystal";
240  break;
241  case kTriggerTower:
242  case kPseudoStrip:
243  specs.nbins = isBarrel ? 68 : (2 * nTTOuter + 2 * nTTInner); // For EE: numbering of bins
244  // is in the order (inner1, inner2, outer1, outer2). ("inner"" := closer
245  // to the beam)
246  specs.low = 1.;
247  specs.high = specs.nbins + specs.low;
248  specs.title = "tower";
249  break;
250  case kSuperCrystal:
251  specs.nbins = isBarrel ? 68 : nSuperCrystals(iSM + 1);
252  specs.low = 1.;
253  specs.high = specs.nbins + specs.low;
254  specs.title = "tower";
255  break;
256  default:
257  break;
258  }
259  } else {
260  int nEEX(nEESMX);
261  int nEEY(nEESMY);
262  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
263  nEEX = nEESMXExt;
264  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
265  nEEX = nEESMXRed;
266  if (iSM == kEEm03 || iSM == kEEm07 || iSM == kEEp03 || iSM == kEEp07)
267  nEEY = nEESMYRed;
268 
269  switch (_btype) {
270  case kCrystal:
271  if (_axis == 1)
272  specs.nbins = isBarrel ? nEBSMEta : nEEX;
273  else if (_axis == 2)
274  specs.nbins = isBarrel ? nEBSMPhi : nEEY;
275  break;
276  case kTriggerTower:
277  case kPseudoStrip:
278  if (_axis == 1)
279  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX;
280  else if (_axis == 2)
281  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY;
282  break;
283  case kSuperCrystal:
284  if (_axis == 1)
285  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX / 5;
286  else if (_axis == 2)
287  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY / 5;
288  break;
289  default:
290  return specs;
291  }
292 
293  if (_axis == 1) {
294  specs.low = xlow_(iSM);
295  specs.high = specs.low + (isBarrel ? nEBSMEta : nEEX);
296  specs.title = isBarrel ? (iSM < kEBpLow ? "-ieta" : "ieta") : "ix";
297  } else if (_axis == 2) {
298  specs.low = ylow_(iSM);
299  specs.high = specs.low + (isBarrel ? nEBSMPhi : nEEY);
300  specs.title = isBarrel ? "iphi" : "iy";
301  }
302  }
303 
304  return specs;
305  }
unsigned nSuperCrystals(unsigned)

◆ getBinningSMMEM_()

AxisSpecs ecaldqm::binning::getBinningSMMEM_ ( BinningType  _btype,
bool  _isMap,
unsigned  _iObj,
int  _axis 
)

Definition at line 307 of file MESetBinningUtils2.cc.

References kCrystal, ecaldqm::memDCCId(), and HistogramManager_cfi::specs.

Referenced by getBinning().

307  {
308  AxisSpecs specs;
309 
310  unsigned iSM(memDCCId(_iObj) - 1);
311 
312  if (iSM == unsigned(-1) || _btype != kCrystal)
313  return specs;
314 
315  if (_axis == 1) {
316  specs.nbins = 10;
317  specs.low = 0.;
318  specs.high = 10.;
319  if (_isMap)
320  specs.title = "pseudo-strip";
321  else
322  specs.title = "iPN";
323  } else if (_axis == 2) {
324  specs.nbins = 1;
325  specs.low = 0.;
326  specs.high = 5.;
327  specs.title = "channel";
328  }
329 
330  return specs;
331  }
unsigned memDCCId(unsigned)

◆ getNObjects()

unsigned ecaldqm::binning::getNObjects ( ObjectType  _otype)

Definition at line 535 of file MESetBinningUtils.cc.

References kEBSM, kEBSMMEM, kEcal2P, kEcal3P, kEE2P, kEESM, kEESMMEM, kMEM2P, kSM, kSMMEM, ecaldqm::nDCC, ecaldqm::nDCCMEM, ecaldqm::nEBDCC, ecaldqm::nEEDCC, and ecaldqm::nEEDCCMEM.

Referenced by findPlotIndex(), ecaldqm::MESetEcal::generatePaths(), ecaldqm::MESetDet2D::reset(), and ecaldqm::MESetDet1D::reset().

535  {
536  switch (_otype) {
537  case kSM:
538  return nDCC;
539  case kEBSM:
540  return nEBDCC;
541  case kEESM:
542  return nEEDCC;
543  case kSMMEM:
544  return nDCCMEM;
545  case kEBSMMEM:
546  return nEBDCC;
547  case kEESMMEM:
548  return nEEDCCMEM;
549  case kEcal2P:
550  return 2;
551  case kEcal3P:
552  return 3;
553  case kEE2P:
554  return 2;
555  case kMEM2P:
556  return 2;
557  default:
558  return 1;
559  }
560  }

◆ getObject()

ObjectType ecaldqm::binning::getObject ( ObjectType  _otype,
unsigned  _iObj 
)

Definition at line 490 of file MESetBinningUtils.cc.

References kEB, kEBMEM, kEcal2P, kEcal3P, kEE, kEE2P, kEEm, kEEMEM, kEEp, kMEM2P, and nObjType.

Referenced by ecaldqm::MESetDet2D::book(), ecaldqm::MESetDet1D::book(), ecaldqm::MESetEcal::book(), ecaldqm::MESet::ConstBin::ConstBin(), ecaldqm::MESetDet2D::fill(), ecaldqm::MESetDet1D::fill(), ecaldqm::MESetDet2D::findBin(), ecaldqm::MESetDet1D::findBin(), ecaldqm::MESetEcal::generatePaths(), ecaldqm::MESetDet2D::getBinContent(), ecaldqm::MESetDet1D::getBinContent(), ecaldqm::MESetDet2D::getBinEntries(), ecaldqm::MESetDet1D::getBinEntries(), ecaldqm::MESetDet2D::getBinError(), ecaldqm::MESetDet1D::getBinError(), ecaldqm::MESet::const_iterator::operator++(), ecaldqm::MESetDet2D::reset(), ecaldqm::MESetDet2D::setBinContent(), ecaldqm::MESetDet1D::setBinContent(), ecaldqm::MESetDet2D::setBinEntries(), ecaldqm::MESetDet1D::setBinEntries(), ecaldqm::MESetDet2D::setBinError(), and ecaldqm::MESetDet1D::setBinError().

490  {
491  switch (_otype) {
492  case kEcal3P:
493  switch (_iObj) {
494  case 0:
495  return kEEm;
496  case 1:
497  return kEB;
498  case 2:
499  return kEEp;
500  default:
501  return nObjType;
502  }
503  case kEcal2P:
504  switch (_iObj) {
505  case 0:
506  return kEE;
507  case 1:
508  return kEB;
509  default:
510  return nObjType;
511  }
512  case kEE2P:
513  switch (_iObj) {
514  case 0:
515  return kEEm;
516  case 1:
517  return kEEp;
518  default:
519  return nObjType;
520  }
521  case kMEM2P:
522  switch (_iObj) {
523  case 0:
524  return kEEMEM;
525  case 1:
526  return kEBMEM;
527  default:
528  return nObjType;
529  }
530  default:
531  return _otype;
532  }
533  }

◆ idFromBin()

uint32_t ecaldqm::binning::idFromBin ( ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

Definition at line 752 of file MESetBinningUtils.cc.

References EcalBarrel, LEDCalibrationChannels::ieta, LEDCalibrationChannels::iphi, kCrystal, kEB, ecaldqm::kEBmHigh, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEBpLow, kEBSM, kEE, kEEm, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm05, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEmHigh, kEEp, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp05, ecaldqm::kEEp08, ecaldqm::kEEp09, kEESM, kSM, kSuperCrystal, kTriggerTower, ecaldqm::nEBDCC, nEESMX, nEESMXExt, nEESMXRed, DetId::rawId(), xlow_(), and ylow_().

Referenced by ecaldqm::MESet::ConstBin::getId().

752  {
753  if (_otype == kEB) {
754  if (_btype == kCrystal) {
755  int ieta(_bin / 362 - 86);
756  if (ieta >= 0)
757  ++ieta;
758  return EBDetId(ieta, _bin % 362);
759  } else if (_btype == kTriggerTower || _btype == kSuperCrystal) {
760  int ieta(_bin / 74 - 17);
761  int z(1);
762  if (ieta <= 0) {
763  z = -1;
764  ieta = -ieta + 1;
765  }
766  return EcalTrigTowerDetId(z, EcalBarrel, ieta, (_bin % 74 + 69) % 72 + 1);
767  }
768  } else if (_otype == kEEm || _otype == kEEp) {
769  int z(_otype == kEEm ? -1 : 1);
770  if (_btype == kCrystal || _btype == kTriggerTower)
771  return EEDetId(_bin % 102, _bin / 102, z).rawId();
772  else if (_btype == kSuperCrystal)
773  return EcalScDetId(_bin % 22, _bin / 22, z).rawId();
774  } else if (_otype == kEE) {
775  if (_btype == kCrystal || _btype == kTriggerTower) {
776  int ix(_bin % 202);
777  int z(ix > 100 ? 1 : -1);
778  if (z > 0)
779  ix = (ix - 100) % 101;
780  return EEDetId(ix, _bin / 202, z).rawId();
781  } else if (_btype == kSuperCrystal) {
782  int ix(_bin % 42);
783  int z(ix > 20 ? 1 : -1);
784  if (z > 0)
785  ix = (ix - 20) % 21;
786  return EcalScDetId(ix, _bin / 42, z).rawId();
787  }
788  } else if (_otype == kSM || _otype == kEBSM || _otype == kEESM) {
789  unsigned iSM(_iME);
790  if (_otype == kEBSM)
791  iSM += 9;
792  else if (_otype == kEESM && iSM > kEEmHigh)
793  iSM += nEBDCC;
794 
795  int z(iSM <= kEBmHigh ? -1 : 1);
796 
797  if ((iSM >= kEBmLow && iSM <= kEBmHigh) || (iSM >= kEBpLow && iSM <= kEBpHigh)) {
798  if (_btype == kCrystal) {
799  int iphi(((iSM - 9) % 18) * 20 + (z < 0 ? _bin / 87 : 21 - _bin / 87));
800  int ieta((_bin % 87) * z);
801  return EBDetId(ieta, iphi).rawId();
802  } else if (_btype == kTriggerTower || _btype == kSuperCrystal) {
803  int iphi((((iSM - 9) % 18) * 4 + (z < 0 ? _bin / 19 : 5 - _bin / 19) + 69) % 72 + 1);
804  int ieta(_bin % 19);
806  }
807  } else {
808  if (_btype == kCrystal || _btype == kTriggerTower) {
809  int nX(nEESMX);
810  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
811  nX = nEESMXExt;
812  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
813  nX = nEESMXRed;
814  return EEDetId(_bin % (nX + 2) + xlow_(iSM), _bin / (nX + 2) + ylow_(iSM), z).rawId();
815  } else if (_btype == kSuperCrystal) {
816  int nX(nEESMX / 5);
817  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
818  nX = nEESMXExt / 5;
819  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
820  nX = nEESMXRed / 5;
821  return EcalScDetId(_bin % (nX + 2) + xlow_(iSM) / 5, _bin / (nX + 2) + ylow_(iSM) / 5, z).rawId();
822  }
823  }
824  }
825 
826  return 0;
827  }
float float float z
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57

◆ idFromName()

uint32_t ecaldqm::binning::idFromName ( std::string const &  _name)

Definition at line 689 of file MESetBinningUtils.cc.

References ecaldqm::kEBmLow, ecaldqm::kEEmLow, ecaldqm::kEEpLow, oniaPATMuonsWithTrigger_cff::matches, Skims_PA_cff::name, ecaldqm::nDCC, hltrates_dqm_sourceclient-live_cfg::offset, EcalTriggerElectronicsId::rawId(), and EcalElectronicsId::rawId().

689  {
690  TString name(_name);
691  TPRegexp re(
692  "(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) "
693  "([0-9]+)(?: (TT|strip|PN) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
694  // 1 2 3 4 5 6 7 8 9
695  uint32_t rawId(0);
696 
697  TObjArray *matches(re.MatchS(name));
698  matches->SetOwner(true);
699  if (matches->GetEntries() == 0)
700  return 0;
701  else if (matches->GetEntries() == 3) {
702  TString subdet(static_cast<TObjString *>(matches->At(1))->GetString());
703  if (subdet == "EB") {
704  int dccid(static_cast<TObjString *>(matches->At(2))->GetString().Atoi());
705  unsigned offset(0);
706  if (dccid < 0) {
707  dccid *= -1;
708  offset = kEEmLow;
709  } else
710  offset = kEEpLow;
711  rawId = (dccid + 2) % 9 + 1 + offset;
712  } else {
713  int dccid(static_cast<TObjString *>(matches->At(2))->GetString().Atoi());
714  if (dccid < 0)
715  dccid *= -1;
716  else
717  dccid += 18;
718  rawId = kEBmLow + dccid;
719  }
720  } else if (matches->GetEntries() == 4)
721  rawId = static_cast<TObjString *>(matches->At(3))->GetString().Atoi() + nDCC;
722  else {
723  TString subtype(static_cast<TObjString *>(matches->At(5))->GetString());
724  if (subtype == "TCC") {
725  int tccid(static_cast<TObjString *>(matches->At(6))->GetString().Atoi());
726  int ttid(static_cast<TObjString *>(matches->At(8))->GetString().Atoi());
727  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
728  } else {
729  int dccid(static_cast<TObjString *>(matches->At(4))->GetString().Atoi());
730  int towerid(static_cast<TObjString *>(matches->At(6))->GetString().Atoi());
731  if (matches->GetEntries() == 7)
732  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
733  else {
734  TString chType(static_cast<TObjString *>(matches->At(7))->GetString());
735  int stripOrPNid(static_cast<TObjString *>(matches->At(8))->GetString().Atoi());
736  if (chType == "PN")
737  rawId = EcalElectronicsId(dccid, towerid, 1, stripOrPNid).rawId();
738  else if (chType == "strip") {
739  int xtalid(static_cast<TObjString *>(matches->At(9))->GetString().Atoi());
740  rawId = EcalElectronicsId(dccid, towerid, stripOrPNid, xtalid).rawId();
741  }
742  // case "TT" is already taken care of
743  }
744  }
745  }
746 
747  delete matches;
748 
749  return rawId;
750  }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
uint32_t rawId() const
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...

◆ isValidIdBin()

bool ecaldqm::binning::isValidIdBin ( EcalElectronicsMapping const *  electronicsMap,
ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

Definition at line 562 of file MESetBinningUtils.cc.

References ecaldqm::dccId(), kCrystal, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEE, kEEm, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm05, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEmHigh, kEEp, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp05, ecaldqm::kEEp08, ecaldqm::kEEp09, kEESM, kSM, kSuperCrystal, kTriggerTower, ecaldqm::nEBDCC, nEESMX, nEESMXExt, nEESMXRed, EcalScDetId::validDetId(), EEDetId::validDetId(), xlow_(), and ylow_().

Referenced by ecaldqm::MESet::ConstBin::isChannel(), and ecaldqm::MESetDet2D::reset().

563  {
564  if (_otype == kEEm || _otype == kEEp) {
565  if (_btype == kCrystal || _btype == kTriggerTower)
566  return EEDetId::validDetId(_bin % 102, _bin / 102, 1);
567  else if (_btype == kSuperCrystal)
568  return EcalScDetId::validDetId(_bin % 22, _bin / 22, 1);
569  } else if (_otype == kEE) {
570  if (_btype == kCrystal || _btype == kTriggerTower) {
571  int ix(_bin % 202);
572  if (ix > 100)
573  ix = (ix - 100) % 101;
574  return EEDetId::validDetId(ix, _bin / 202, 1);
575  } else if (_btype == kSuperCrystal) {
576  int ix(_bin % 42);
577  if (ix > 20)
578  ix = (ix - 20) % 21;
579  return EcalScDetId::validDetId(ix, _bin / 42, 1);
580  }
581  } else if (_otype == kSM || _otype == kEESM) {
582  unsigned iSM(_iME);
583  if (_otype == kEESM && iSM > kEEmHigh)
584  iSM += nEBDCC;
585 
586  if (iSM >= kEBmLow && iSM <= kEBpHigh)
587  return true;
588 
589  if (_btype == kCrystal || _btype == kTriggerTower) {
590  int nX(nEESMX);
591  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
592  nX = nEESMXExt;
593  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
594  nX = nEESMXRed;
595  int ix(_bin % (nX + 2) + xlow_(iSM));
596  int iy(_bin / (nX + 2) + ylow_(iSM));
597  int z(iSM <= kEEmHigh ? -1 : 1);
598  return EEDetId::validDetId(ix, iy, 1) && iSM == dccId(EEDetId(ix, iy, z), electronicsMap) - 1;
599  } else if (_btype == kSuperCrystal) {
600  int nX(nEESMX / 5);
601  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
602  nX = nEESMXExt / 5;
603  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
604  nX = nEESMXRed / 5;
605  int ix(_bin % (nX + 2) + xlow_(iSM) / 5);
606  int iy(_bin / (nX + 2) + ylow_(iSM) / 5);
607  int z(iSM <= kEEmHigh ? -1 : 1);
608  return EcalScDetId::validDetId(ix, iy, z) && iSM == dccId(EcalScDetId(ix, iy, z), electronicsMap) - 1;
609  }
610  }
611 
612  return true;
613  }
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:59
float float float z
unsigned dccId(DetId const &, EcalElectronicsMapping const *)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248

◆ translateBinningType()

BinningType ecaldqm::binning::translateBinningType ( std::string const &  _btypeName)

Definition at line 922 of file MESetBinningUtils.cc.

References Exception, kCrystal, kDCC, kProjEta, kProjPhi, kPseudoStrip, kRCT, kReport, kSuperCrystal, kTCC, kTrend, kTriggerTower, and kUser.

Referenced by ecaldqm::createMESet().

922  {
923  if (_btypeName == "Crystal")
924  return kCrystal;
925  else if (_btypeName == "TriggerTower")
926  return kTriggerTower;
927  else if (_btypeName == "SuperCrystal")
928  return kSuperCrystal;
929  else if (_btypeName == "PseudoStrip")
930  return kPseudoStrip;
931  else if (_btypeName == "TCC")
932  return kTCC;
933  else if (_btypeName == "DCC")
934  return kDCC;
935  else if (_btypeName == "ProjEta")
936  return kProjEta;
937  else if (_btypeName == "ProjPhi")
938  return kProjPhi;
939  else if (_btypeName == "RCT")
940  return kRCT;
941  else if (_btypeName == "User")
942  return kUser;
943  else if (_btypeName == "Report")
944  return kReport;
945  else if (_btypeName == "Trend")
946  return kTrend;
947 
948  throw cms::Exception("InvalidConfiguration") << "No binning type " << _btypeName << " defined";
949  }

◆ translateKind()

dqm::reco::MonitorElement::Kind ecaldqm::binning::translateKind ( std::string const &  _kindName)

◆ translateObjectType()

ObjectType ecaldqm::binning::translateObjectType ( std::string const &  _otypeName)

Definition at line 877 of file MESetBinningUtils.cc.

References Exception, kChannel, kEB, kEBMEM, kEBSM, kEBSMMEM, kEcal, kEcal2P, kEcal3P, kEE, kEE2P, kEEm, kEEMEM, kEEp, kEESM, kEESMMEM, kMEM, kMEM2P, kSM, kSMMEM, and nObjType.

Referenced by ecaldqm::createMESet().

877  {
878  if (_otypeName == "EB")
879  return kEB;
880  else if (_otypeName == "EE")
881  return kEE;
882  else if (_otypeName == "EEm")
883  return kEEm;
884  else if (_otypeName == "EEp")
885  return kEEp;
886  else if (_otypeName == "SM")
887  return kSM;
888  else if (_otypeName == "EBSM")
889  return kEBSM;
890  else if (_otypeName == "EESM")
891  return kEESM;
892  else if (_otypeName == "SMMEM")
893  return kSMMEM;
894  else if (_otypeName == "EBSMMEM")
895  return kEBSMMEM;
896  else if (_otypeName == "EESMMEM")
897  return kEESMMEM;
898  else if (_otypeName == "Ecal")
899  return kEcal;
900  else if (_otypeName == "MEM")
901  return kMEM;
902  else if (_otypeName == "EBMEM")
903  return kEBMEM;
904  else if (_otypeName == "EEMEM")
905  return kEEMEM;
906  else if (_otypeName == "Ecal2P")
907  return kEcal2P;
908  else if (_otypeName == "Ecal3P")
909  return kEcal3P;
910  else if (_otypeName == "EE2P")
911  return kEE2P;
912  else if (_otypeName == "MEM2P")
913  return kMEM2P;
914  else if (_otypeName == "Channel")
915  return kChannel;
916  else if (_otypeName == "None")
917  return nObjType;
918 
919  throw cms::Exception("InvalidConfiguration") << "No object type " << _otypeName << " defined";
920  }

◆ xlow_()

int ecaldqm::binning::xlow_ ( int  _iSM)

Definition at line 13 of file MESetBinningUtils2.cc.

References ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm03, ecaldqm::kEEm04, ecaldqm::kEEm05, ecaldqm::kEEm06, ecaldqm::kEEm07, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp03, ecaldqm::kEEp04, ecaldqm::kEEp05, ecaldqm::kEEp06, ecaldqm::kEEp07, ecaldqm::kEEp08, and ecaldqm::kEEp09.

Referenced by findBinCrystal_(), findBinSuperCrystal_(), getBinningSM_(), idFromBin(), and isValidIdBin().

13  {
14  switch (_iSM) {
15  case kEEm01:
16  case kEEp01:
17  return 20;
18  case kEEm02:
19  case kEEp02:
20  return 0;
21  case kEEm03:
22  case kEEp03:
23  return 0;
24  case kEEm04:
25  case kEEp04:
26  return 5;
27  case kEEm05:
28  case kEEp05:
29  return 35;
30  case kEEm06:
31  case kEEp06:
32  return 55;
33  case kEEm07:
34  case kEEp07:
35  return 60;
36  case kEEm08:
37  case kEEp08:
38  return 55;
39  case kEEm09:
40  case kEEp09:
41  return 50;
42  default:
43  break;
44  }
45 
46  if (_iSM >= kEBmLow && _iSM <= kEBpHigh)
47  return 0;
48 
49  return 0;
50  }

◆ ylow_()

int ecaldqm::binning::ylow_ ( int  _iSM)

Definition at line 52 of file MESetBinningUtils2.cc.

References ecaldqm::kEBmHigh, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, ecaldqm::kEBpLow, ecaldqm::kEEm01, ecaldqm::kEEm02, ecaldqm::kEEm03, ecaldqm::kEEm04, ecaldqm::kEEm05, ecaldqm::kEEm06, ecaldqm::kEEm07, ecaldqm::kEEm08, ecaldqm::kEEm09, ecaldqm::kEEp01, ecaldqm::kEEp02, ecaldqm::kEEp03, ecaldqm::kEEp04, ecaldqm::kEEp05, ecaldqm::kEEp06, ecaldqm::kEEp07, ecaldqm::kEEp08, and ecaldqm::kEEp09.

Referenced by findBinCrystal_(), findBinSuperCrystal_(), getBinningSM_(), idFromBin(), and isValidIdBin().

52  {
53  switch (_iSM) {
54  case kEEm01:
55  case kEEp01:
56  case kEEm09:
57  case kEEp09:
58  return 60;
59  case kEEm02:
60  case kEEp02:
61  case kEEm08:
62  case kEEp08:
63  return 50;
64  case kEEm03:
65  case kEEp03:
66  case kEEm07:
67  case kEEp07:
68  return 25;
69  case kEEm04:
70  case kEEp04:
71  case kEEm06:
72  case kEEp06:
73  return 5;
74  case kEEm05:
75  case kEEp05:
76  return 0;
77  default:
78  break;
79  }
80 
81  if (_iSM >= kEBmLow && _iSM <= kEBmHigh)
82  return ((_iSM - kEBmLow) % 18) * 20;
83  if (_iSM >= kEBpLow && _iSM <= kEBpHigh)
84  return (-1 - ((_iSM - kEBpLow) % 18)) * 20;
85 
86  return 0;
87  }