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 (uint32_t, BinningType _btype=kDCC)
 
void fillAxisDescriptions (edm::ParameterSetDescription &)
 
int findBin1D (ObjectType _otype, BinningType _btype, const DetId &_id)
 
int findBin1D (ObjectType, BinningType, DetId const &)
 
int findBin1D (ObjectType, BinningType, EcalElectronicsId const &)
 
int findBin1D (ObjectType, BinningType, int)
 
int findBin1D (ObjectType _otype, BinningType _btype, const EcalElectronicsId &_id)
 
int findBin2D (ObjectType, BinningType, DetId const &)
 
int findBin2D (ObjectType, BinningType, EcalElectronicsId const &)
 
int findBin2D (ObjectType, BinningType, int)
 
int findBin2D (ObjectType _otype, BinningType _btype, const DetId &_id)
 
int findBin2D (ObjectType _otype, BinningType _btype, const EcalElectronicsId &_id)
 
int findBinCrystal_ (ObjectType, DetId const &, int=-1)
 
int findBinCrystal_ (ObjectType, EcalElectronicsId const &)
 
int findBinCrystal_ (ObjectType _otype, const DetId &_id, int _iSM)
 
int findBinPseudoStrip_ (ObjectType, DetId const &)
 
int findBinRCT_ (ObjectType, DetId const &)
 
int findBinSuperCrystal_ (ObjectType, DetId const &, int=-1)
 
int findBinSuperCrystal_ (ObjectType, EcalElectronicsId const &)
 
int findBinSuperCrystal_ (ObjectType _otype, const DetId &_id, int _iSM)
 
int findBinSuperCrystal_ (ObjectType _otype, const EcalElectronicsId &_id)
 
int findBinTriggerTower_ (ObjectType, DetId const &)
 
unsigned findPlotIndex (ObjectType, DetId const &)
 
unsigned findPlotIndex (ObjectType, EcalElectronicsId const &)
 
unsigned findPlotIndex (ObjectType, int, BinningType _btype=kDCC)
 
unsigned findPlotIndex (ObjectType _otype, const DetId &_id)
 
unsigned findPlotIndex (ObjectType _otype, const EcalElectronicsId &_id)
 
AxisSpecs formAxis (edm::ParameterSet const &)
 
AxisSpecs getBinning (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)
 
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 (ObjectType, BinningType, unsigned, int)
 
BinningType translateBinningType (std::string const &)
 
MonitorElement::Kind translateKind (std::string const &)
 
ObjectType translateObjectType (std::string const &)
 
int xlow_ (int)
 
int ylow_ (int)
 

Enumeration Type Documentation

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

Definition at line 56 of file MESetBinningUtils.h.

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

Definition at line 17 of file MESetBinningUtils.h.

Function Documentation

std::string ecaldqm::binning::channelName ( uint32_t  _rawId,
BinningType  _btype = kDCC 
)

Definition at line 590 of file MESetBinningUtils.cc.

References EcalTriggerElectronicsId::channelId(), EcalElectronicsId::dccId(), runTauDisplay::eid, ecaldqm::getElectronicsMap(), EcalTrigTowerDetId::ieta(), EBDetId::ieta(), EBDetId::iphi(), EcalTrigTowerDetId::iphi(), EcalScDetId::ix(), EEDetId::ix(), EcalScDetId::iy(), EEDetId::iy(), kCrystal, kDCC, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kSuperCrystal, kTCC, kTriggerTower, ecaldqm::nDCC, EcalTriggerElectronicsId::pseudoStripId(), SimDataFormats::CaloAnalysis::sc, ecaldqm::smName(), EcalElectronicsId::stripId(), EcalTriggerElectronicsId::tccId(), EcalElectronicsId::towerId(), EcalTriggerElectronicsId::ttId(), and EcalElectronicsId::xtalId().

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

590  {
591  // assume the following IDs for respective binning types:
592  // Crystal: EcalElectronicsId
593  // TriggerTower: EcalTriggerElectronicsId (pstrip and channel ignored)
594  // SuperCrystal: EcalElectronicsId (strip and crystal ignored)
595  // TCC: TCC ID
596  // DCC: DCC ID
597 
598  std::stringstream ss;
599 
600  switch (_btype) {
601  case kCrystal: {
602  // EB-03 DCC 12 CCU 12 strip 3 xtal 1 (EB ieta -13 iphi 60) (TCC 39 TT 12
603  // pstrip 3 chan 1)
604  EcalElectronicsId eid(_rawId);
605  if (eid.towerId() >= 69)
606  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " PN " << eid.xtalId();
607  else {
608  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " strip "
609  << eid.stripId() << " xtal " << eid.xtalId();
610 
611  if (eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1) {
612  EBDetId ebid(getElectronicsMap()->getDetId(eid));
613  ss << " (EB ieta " << std::showpos << ebid.ieta() << std::noshowpos << " iphi " << ebid.iphi() << ")";
614  } else {
615  EEDetId eeid(getElectronicsMap()->getDetId(eid));
616  ss << " (EE ix " << eeid.ix() << " iy " << eeid.iy() << ")";
617  }
618  EcalTriggerElectronicsId teid(getElectronicsMap()->getTriggerElectronicsId(eid));
619  ss << " (TCC " << teid.tccId() << " TT " << teid.ttId() << " pstrip " << teid.pseudoStripId() << " chan "
620  << teid.channelId() << ")";
621  break;
622  }
623  }
624  case kTriggerTower: {
625  // EB-03 DCC 12 TCC 18 TT 3
626  EcalTriggerElectronicsId teid(_rawId);
627  EcalElectronicsId eid(getElectronicsMap()->getElectronicsId(teid));
628  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " TCC " << teid.tccId() << " TT " << teid.ttId();
629  break;
630  }
631  case kSuperCrystal: {
632  // EB-03 DCC 12 CCU 18 (EBTT ieta -13 iphi 60)
633  EcalElectronicsId eid(_rawId);
634  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId();
635  if (eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1) {
636  EcalTrigTowerDetId ttid(EBDetId(getElectronicsMap()->getDetId(eid)).tower());
637  ss << " (EBTT ieta " << std::showpos << ttid.ieta() << std::noshowpos << " iphi " << ttid.iphi() << ")";
638  } else {
639  EcalScDetId scid(EEDetId(getElectronicsMap()->getDetId(eid)).sc());
640  ss << " (EESC ix " << scid.ix() << " iy " << scid.iy() << ")";
641  }
642  break;
643  }
644  case kTCC: {
645  // EB-03 TCC 12
646  int tccid(_rawId - nDCC);
647  int dccid(getElectronicsMap()->DCCid(getElectronicsMap()->getTrigTowerDetId(tccid, 1)));
648  ss << smName(dccid) << " TCC " << (_rawId - nDCC);
649  break;
650  }
651  case kDCC:
652  ss << smName(_rawId);
653  break;
654  default:
655  break;
656  }
657 
658  return ss.str();
659  }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
EcalElectronicsMapping const * getElectronicsMap()
std::string smName(unsigned)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
void ecaldqm::binning::fillAxisDescriptions ( edm::ParameterSetDescription _desc)

Definition at line 838 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::fillMESetDescriptions(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

838  {
839  _desc.addUntracked<std::string>("title", "");
840  _desc.addUntracked<int>("nbins", 0);
841  _desc.addUntracked<double>("low", 0.);
842  _desc.addOptionalNode(edm::ParameterDescription<double>("high", 0., false) ^
843  edm::ParameterDescription<double>("unitsPerBin", 0., false),
844  false);
845  _desc.addOptionalUntracked<std::vector<double>>("edges");
846  _desc.addOptionalUntracked<std::vector<std::string>>("labels");
847  }
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
int ecaldqm::binning::findBin1D ( ObjectType  _otype,
BinningType  _btype,
const DetId _id 
)

Definition at line 57 of file MESetBinningUtils.cc.

References stringResolutionProvider_cfi::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().

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

Definition at line 216 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::binning::AxisSpecs::~AxisSpecs().

216  {
217  if (_otype == kEcal && _btype == kDCC)
218  return _dcctccid;
219  else if (_otype == kEcal && _btype == kTCC)
220  return _dcctccid;
221  if (_otype == kEB && _btype == kDCC)
222  return _dcctccid - 9;
223  else if (_otype == kEB && _btype == kTCC)
224  return _dcctccid - 36;
225  else if (_otype == kEEm && _btype == kDCC)
226  return _dcctccid;
227  else if (_otype == kEEm && _btype == kTCC)
228  return _dcctccid;
229  else if (_otype == kEEp && _btype == kDCC)
230  return _dcctccid - 45;
231  else if (_otype == kEEp && _btype == kTCC)
232  return _dcctccid - 72;
233  else if (_otype == kEE && _btype == kDCC)
234  return _dcctccid <= 9 ? _dcctccid : _dcctccid - 36;
235  else if (_otype == kEE && _btype == kTCC)
236  return _dcctccid <= 36 ? _dcctccid : _dcctccid - 36;
237 
238  return 0;
239  }
int ecaldqm::binning::findBin1D ( ObjectType  _otype,
BinningType  _btype,
const EcalElectronicsId _id 
)

Definition at line 140 of file MESetBinningUtils.cc.

References stringResolutionProvider_cfi::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().

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

Definition at line 282 of file MESetBinningUtils.cc.

References kDCC, kEcal, and ecaldqm::kEEpLow.

Referenced by ecaldqm::binning::AxisSpecs::~AxisSpecs().

282  {
283  if (_otype != kEcal || _btype != kDCC)
284  return 0;
285 
286  int nbinsX(9);
287  unsigned iDCC(_dccid - 1);
288  int xbin(0);
289  if (iDCC <= kEEmHigh || iDCC >= kEEpLow)
290  xbin = (iDCC + 6) % nbinsX + 1;
291  else
292  xbin = iDCC % nbinsX + 1;
293  int ybin(6 - iDCC / nbinsX);
294 
295  return (nbinsX + 2) * ybin + xbin;
296  }
int ecaldqm::binning::findBin2D ( ObjectType  _otype,
BinningType  _btype,
const DetId _id 
)

Definition at line 241 of file MESetBinningUtils.cc.

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

241  {
242  if (_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
243  return 0;
244 
245  switch (_btype) {
246  case kCrystal:
247  return findBinCrystal_(_otype, _id);
248  break;
249  case kTriggerTower:
250  return findBinTriggerTower_(_otype, _id);
251  break;
252  case kSuperCrystal:
253  return findBinSuperCrystal_(_otype, _id);
254  break;
255  case kPseudoStrip:
256  return findBinPseudoStrip_(_otype, _id);
257  break;
258  case kRCT:
259  return findBinRCT_(_otype, _id);
260  break;
261  default:
262  return 0;
263  }
264  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
int findBinRCT_(ObjectType, DetId const &)
int findBinTriggerTower_(ObjectType, DetId const &)
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int findBinPseudoStrip_(ObjectType, DetId const &)
int ecaldqm::binning::findBin2D ( ObjectType  _otype,
BinningType  _btype,
const EcalElectronicsId _id 
)

Definition at line 266 of file MESetBinningUtils.cc.

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

266  {
267  if (_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
268  return 0;
269 
270  switch (_btype) {
271  case kCrystal:
272  return findBinCrystal_(_otype, _id);
273  break;
274  case kSuperCrystal:
275  return findBinSuperCrystal_(_otype, _id);
276  break;
277  default:
278  return 0;
279  }
280  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int ecaldqm::binning::findBinCrystal_ ( ObjectType  ,
DetId const &  ,
int  = -1 
)
int ecaldqm::binning::findBinCrystal_ ( ObjectType  _otype,
EcalElectronicsId const &  _id 
)

Definition at line 519 of file MESetBinningUtils2.cc.

References findBinCrystal_(), and ecaldqm::getElectronicsMap().

Referenced by ecaldqm::binning::AxisSpecs::~AxisSpecs().

519  {
520  return findBinCrystal_(_otype, getElectronicsMap()->getDetId(_id));
521  }
EcalElectronicsMapping const * getElectronicsMap()
int findBinCrystal_(ObjectType _otype, const DetId &_id, int _iSM)
int ecaldqm::binning::findBinCrystal_ ( ObjectType  _otype,
const DetId _id,
int  _iSM 
)

Definition at line 429 of file MESetBinningUtils2.cc.

References ecaldqm::dccId(), EcalBarrel, EcalEndcap, EcalLaserPnDiode, EBDetId::ieta(), EBDetId::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(), nEBSMEta, nEESMX, nEESMXExt, nEESMXRed, DetId::subdetId(), xlow_(), ylow_(), and EEDetId::zside().

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

Definition at line 582 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 523 of file MESetBinningUtils2.cc.

References EcalTrigTowerDetId::ieta(), and EcalTrigTowerDetId::iphi().

Referenced by findBin2D(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

523  {
524  int xbin(0);
525  int ybin(0);
526  int nbinsX(0);
527 
528  EcalTrigTowerDetId ttid(_id);
529  int ieta(ttid.ieta());
530  int iphi((ttid.iphi() + 1) % 72 + 1);
531 
532  xbin = ieta < 0 ? ieta + 33 : ieta + 32;
533  ybin = iphi;
534  nbinsX = 64;
535 
536  return (nbinsX + 2) * ybin + xbin;
537  }
int ecaldqm::binning::findBinSuperCrystal_ ( ObjectType  ,
DetId const &  ,
int  = -1 
)

Referenced by findBin2D(), and findBinSuperCrystal_().

int ecaldqm::binning::findBinSuperCrystal_ ( ObjectType  ,
EcalElectronicsId const &   
)
int ecaldqm::binning::findBinSuperCrystal_ ( ObjectType  _otype,
const DetId _id,
int  _iSM 
)

Definition at line 599 of file MESetBinningUtils2.cc.

References ecaldqm::dccId(), EcalBarrel, EcalEndcap, EcalTriggerTower, EcalTrigTowerDetId::ieta(), EBDetId::ieta(), EBDetId::iphi(), EcalTrigTowerDetId::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, nEBSMEta, nEESMX, nEESMXExt, nEESMXRed, DetId::subdetId(), xlow_(), ylow_(), EcalScDetId::zside(), EEDetId::zside(), and ecaldqm::zside().

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

Definition at line 715 of file MESetBinningUtils2.cc.

References EcalElectronicsId::dccId(), findBinSuperCrystal_(), ecaldqm::getElectronicsMap(), kEB, ecaldqm::kEBmHigh, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEBSM, kSM, SimDataFormats::CaloAnalysis::sc, and EcalElectronicsId::towerId().

715  {
716  int xbin(0);
717  int ybin(0);
718  int nbinsX(0);
719  int iDCC(_id.dccId() - 1);
720 
721  if (iDCC >= kEBmLow && iDCC <= kEBpHigh) {
722  unsigned towerid(_id.towerId());
723  bool isEBm(iDCC <= kEBmHigh);
724  switch (_otype) {
725  case kEB:
726  xbin = 4 * ((iDCC - 9) % 18) + (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
727  ybin = (towerid - 1) / 4 * (isEBm ? -1 : 1) + (isEBm ? 18 : 17);
728  nbinsX = 72;
729  break;
730  case kSM:
731  case kEBSM:
732  xbin = (towerid - 1) / 4 + 1;
733  ybin = (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
734  nbinsX = 17;
735  break;
736  default:
737  break;
738  }
739  } else {
740  return findBinSuperCrystal_(_otype, EEDetId(getElectronicsMap()->getDetId(_id)).sc());
741  }
742 
743  return (nbinsX + 2) * ybin + xbin;
744  }
EcalElectronicsMapping const * getElectronicsMap()
int towerId() const
get the tower id
int findBinSuperCrystal_(ObjectType _otype, const EcalElectronicsId &_id)
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
int ecaldqm::binning::findBinTriggerTower_ ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 539 of file MESetBinningUtils2.cc.

References photons_cff::_id, EcalBarrel, EcalEndcap, EcalTriggerTower, findBinCrystal_(), EcalTrigTowerDetId::ieta(), EcalTrigTowerDetId::iphi(), ecaldqm::isEndcapTTId(), kEB, kEBSM, kEcal, kSM, DetId::subdetId(), ecaldqm::tccId(), and EBDetId::tower().

Referenced by findBin2D(), findBinPseudoStrip_(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 356 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.

Referenced by ecaldqm::binning::AxisSpecs::~AxisSpecs().

356  {
357  if (getNObjects(_otype) == 1)
358  return 0;
359 
360  int iSM(_dcctccid - 1);
361 
362  switch (_otype) {
363  case kSM:
364  if (_btype == kPseudoStrip) {
365  iSM = iSM <= kEEmTCCHigh ? (iSM + 1) % 18 / 2
366  : iSM >= kEEpTCCLow ? (iSM + 1 - 72) % 18 / 2 + 45 : (iSM + 1) - kEEmTCCHigh;
367  return iSM;
368  } else
369  return iSM;
370 
371  case kEBSM:
372  return iSM - 9;
373 
374  case kEESM:
375  if (iSM <= kEEmHigh)
376  return iSM;
377  else
378  return iSM - nEBDCC;
379 
380  case kSMMEM:
381  return memDCCIndex(_dcctccid);
382 
383  case kEBSMMEM:
384  return memDCCIndex(_dcctccid) - nEEDCCMEM / 2;
385 
386  case kEESMMEM:
387  if (iSM <= kEEmHigh)
388  return memDCCIndex(_dcctccid);
389  else
390  return memDCCIndex(_dcctccid) - nEBDCC;
391 
392  case kEcal2P:
393  if (_btype == kDCC) {
394  if (iSM <= kEEmHigh || iSM >= kEEpLow)
395  return 0;
396  else
397  return 1;
398  } else if (_btype == kTCC) {
399  if (iSM <= kEEmTCCHigh || iSM >= kEEpTCCLow)
400  return 0;
401  else
402  return 1;
403  } else {
404  if (iSM == EcalBarrel - 1)
405  return 1;
406  else
407  return 0;
408  }
409 
410  case kEcal3P:
411  if (_btype == kDCC) {
412  if (iSM <= kEEmHigh)
413  return 0;
414  else if (iSM <= kEBpHigh)
415  return 1;
416  else
417  return 2;
418  } else if (_btype == kTCC) {
419  if (iSM <= kEEmTCCHigh)
420  return 0;
421  else if (iSM <= kEBTCCHigh)
422  return 1;
423  else
424  return 2;
425  } else {
426  if (iSM == -EcalEndcap - 1)
427  return 0;
428  else if (iSM == EcalBarrel - 1)
429  return 1;
430  else
431  return 2;
432  }
433 
434  case kEE2P:
435  if (_btype == kDCC) {
436  if (iSM >= kEEpLow)
437  return 1;
438  else
439  return 0;
440  } else {
441  if (iSM >= kEEpTCCLow)
442  return 1;
443  else
444  return 0;
445  }
446 
447  case kMEM2P:
448  if (_btype == kDCC) {
449  if (iSM <= kEEmHigh || iSM >= kEEpLow)
450  return 0;
451  else
452  return 1;
453  } else if (_btype == kTCC)
454  return -1;
455  else {
456  if (iSM == kEB)
457  return 1;
458  else
459  return 0;
460  }
461  default:
462  return -1;
463  }
464  }
unsigned memDCCIndex(unsigned)
unsigned getNObjects(ObjectType)
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
const DetId _id 
)

Definition at line 298 of file MESetBinningUtils.cc.

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

298  {
299  if (getNObjects(_otype) == 1)
300  return 0;
301 
302  switch (_otype) {
303  case kEcal3P:
304  if (_id.subdetId() == EcalBarrel)
305  return 1;
306  else if (_id.subdetId() == EcalEndcap && zside(_id) > 0)
307  return 2;
308  else if (_id.subdetId() == EcalTriggerTower) {
309  if (!isEndcapTTId(_id))
310  return 1;
311  else {
312  if (zside(_id) > 0)
313  return 2;
314  else
315  return 0;
316  }
317  } else
318  return 0;
319 
320  case kEcal2P:
321  if (_id.subdetId() == EcalBarrel)
322  return 1;
323  else if (_id.subdetId() == EcalTriggerTower && !isEndcapTTId(_id))
324  return 1;
325  else
326  return 0;
327 
328  case kEE2P:
329  if (zside(_id) > 0)
330  return 1;
331  else
332  return 0;
333 
334  case kMEM2P:
335  if (_id.subdetId() == EcalLaserPnDiode) {
336  unsigned iDCC(dccId(_id) - 1);
337  if (iDCC >= kEBmLow && iDCC <= kEBpHigh)
338  return 1;
339  else
340  return 0;
341  } else
342  return -1;
343 
344  default:
345  return findPlotIndex(_otype, dccId(_id));
346  }
347  }
unsigned getNObjects(ObjectType)
int zside(DetId const &)
bool isEndcapTTId(DetId const &)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41
unsigned dccId(DetId const &)
unsigned findPlotIndex(ObjectType _otype, const EcalElectronicsId &_id)
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
const EcalElectronicsId _id 
)

Definition at line 349 of file MESetBinningUtils.cc.

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

349  {
350  if (getNObjects(_otype) == 1)
351  return 0;
352 
353  return findPlotIndex(_otype, _id.dccId());
354  }
unsigned getNObjects(ObjectType)
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
unsigned findPlotIndex(ObjectType _otype, const EcalElectronicsId &_id)
AxisSpecs ecaldqm::binning::formAxis ( edm::ParameterSet const &  _axisParams)

Definition at line 801 of file MESetBinningUtils.cc.

References popcon2dropbox::copy(), ecaldqm::binning::AxisSpecs::edges, edm::ParameterSet::existsAs(), edm::ParameterSet::getUntrackedParameter(), ecaldqm::binning::AxisSpecs::high, tablePrinter::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(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

801  {
802  AxisSpecs axis;
803 
804  if (_axisParams.existsAs<std::vector<double>>("edges", false)) {
805  std::vector<double> const &vEdges(_axisParams.getUntrackedParameter<std::vector<double>>("edges"));
806  axis.nbins = vEdges.size() - 1;
807  axis.edges = new float[vEdges.size()];
808  std::copy(vEdges.begin(), vEdges.end(), axis.edges);
809  } else {
810  axis.nbins = _axisParams.getUntrackedParameter<int>("nbins");
811  axis.low = _axisParams.getUntrackedParameter<double>("low");
812  bool highSet(_axisParams.existsAs<double>("high", false));
813  bool perBinSet(_axisParams.existsAs<double>("unitsPerBin", false));
814  if (highSet) {
815  if (perBinSet)
816  edm::LogWarning("EcalDQM") << "Maximum and bin width both set in an axis; using the former";
817  axis.high = _axisParams.getUntrackedParameter<double>("high");
818  } else if (perBinSet)
819  axis.high = axis.low + _axisParams.getUntrackedParameter<double>("unitsPerBin") * axis.nbins;
820  else
821  axis.high = 0.;
822  }
823 
824  if (_axisParams.existsAs<std::vector<std::string>>("labels", false)) {
825  std::vector<std::string> const &labels(_axisParams.getUntrackedParameter<std::vector<std::string>>("labels"));
826  if (int(labels.size()) == axis.nbins) {
827  axis.labels = new std::string[axis.nbins];
828  for (int iB(0); iB != axis.nbins; ++iB)
829  axis.labels[iB] = labels[iB];
830  }
831  }
832 
833  axis.title = _axisParams.getUntrackedParameter<std::string>("title");
834 
835  return axis;
836  }
def copy(args, dbName)
AxisSpecs ecaldqm::binning::getBinning ( ObjectType  _otype,
BinningType  _btype,
bool  _isMap,
int  _axis,
unsigned  _iME 
)

Definition at line 13 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(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 89 of file MESetBinningUtils2.cc.

References ecaldqm::etaBound, ecaldqm::binning::AxisSpecs::high, kCrystal, kDCC, kProjEta, kProjPhi, kPseudoStrip, kSuperCrystal, kTCC, kTriggerTower, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, nEBEtaBins, nPhiBins, Pi, SiPixelPhase1DigisV_cfi::specs, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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
AxisSpecs ecaldqm::binning::getBinningEcal_ ( BinningType  _btype,
bool  _isMap,
int  _axis 
)

Definition at line 332 of file MESetBinningUtils2.cc.

References ecaldqm::binning::AxisSpecs::edges, ecaldqm::etaBound, ecaldqm::binning::AxisSpecs::high, mps_fire::i, kDCC, kProjEta, kProjPhi, kRCT, kTCC, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, nEBEtaBins, nEEEtaBins, nPhiBins, Pi, SiPixelPhase1DigisV_cfi::specs, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 154 of file MESetBinningUtils2.cc.

References ecaldqm::etaBound, ecaldqm::binning::AxisSpecs::high, kCrystal, kDCC, kProjEta, kProjPhi, kPseudoStrip, kSuperCrystal, kTCC, kTriggerTower, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, nEEEtaBins, nPhiBins, Pi, SiPixelPhase1DigisV_cfi::specs, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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
AxisSpecs ecaldqm::binning::getBinningMEM_ ( BinningType  _btype,
bool  _isMap,
int  _subdet,
int  _axis 
)

Definition at line 403 of file MESetBinningUtils2.cc.

References EcalBarrel, EcalEndcap, ecaldqm::binning::AxisSpecs::high, kCrystal, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, pileupCalc::nbins, SiPixelPhase1DigisV_cfi::specs, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 225 of file MESetBinningUtils2.cc.

References EcalElectronicsMapping::dccConstituents(), ecaldqm::getElectronicsMap(), ecaldqm::binning::AxisSpecs::high, GeomDetEnumerators::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, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, nEBSMEta, nEBSMPhi, nEESMX, nEESMXExt, nEESMXRed, nEESMY, nEESMYRed, ecaldqm::nSuperCrystals(), ecaldqm::nTTInner, ecaldqm::nTTOuter, SiPixelPhase1DigisV_cfi::specs, ecaldqm::binning::AxisSpecs::title, xlow_(), and ylow_().

Referenced by getBinning(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 306 of file MESetBinningUtils2.cc.

References ecaldqm::binning::AxisSpecs::high, kCrystal, ecaldqm::binning::AxisSpecs::low, ecaldqm::memDCCId(), ecaldqm::binning::AxisSpecs::nbins, SiPixelPhase1DigisV_cfi::specs, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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

Definition at line 511 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(), ecaldqm::MESetDet1D::reset(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

511  {
512  switch (_otype) {
513  case kSM:
514  return nDCC;
515  case kEBSM:
516  return nEBDCC;
517  case kEESM:
518  return nEEDCC;
519  case kSMMEM:
520  return nDCCMEM;
521  case kEBSMMEM:
522  return nEBDCC;
523  case kEESMMEM:
524  return nEEDCCMEM;
525  case kEcal2P:
526  return 2;
527  case kEcal3P:
528  return 3;
529  case kEE2P:
530  return 2;
531  case kMEM2P:
532  return 2;
533  default:
534  return 1;
535  }
536  }
ObjectType ecaldqm::binning::getObject ( ObjectType  _otype,
unsigned  _iObj 
)

Definition at line 466 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().

466  {
467  switch (_otype) {
468  case kEcal3P:
469  switch (_iObj) {
470  case 0:
471  return kEEm;
472  case 1:
473  return kEB;
474  case 2:
475  return kEEp;
476  default:
477  return nObjType;
478  }
479  case kEcal2P:
480  switch (_iObj) {
481  case 0:
482  return kEE;
483  case 1:
484  return kEB;
485  default:
486  return nObjType;
487  }
488  case kEE2P:
489  switch (_iObj) {
490  case 0:
491  return kEEm;
492  case 1:
493  return kEEp;
494  default:
495  return nObjType;
496  }
497  case kMEM2P:
498  switch (_iObj) {
499  case 0:
500  return kEEMEM;
501  case 1:
502  return kEBMEM;
503  default:
504  return nObjType;
505  }
506  default:
507  return _otype;
508  }
509  }
uint32_t ecaldqm::binning::idFromBin ( ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

Definition at line 724 of file MESetBinningUtils.cc.

References EcalBarrel, 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(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

724  {
725  if (_otype == kEB) {
726  if (_btype == kCrystal) {
727  int ieta(_bin / 362 - 86);
728  if (ieta >= 0)
729  ++ieta;
730  return EBDetId(ieta, _bin % 362);
731  } else if (_btype == kTriggerTower || _btype == kSuperCrystal) {
732  int ieta(_bin / 74 - 17);
733  int z(1);
734  if (ieta <= 0) {
735  z = -1;
736  ieta = -ieta + 1;
737  }
738  return EcalTrigTowerDetId(z, EcalBarrel, ieta, (_bin % 74 + 69) % 72 + 1);
739  }
740  } else if (_otype == kEEm || _otype == kEEp) {
741  int z(_otype == kEEm ? -1 : 1);
742  if (_btype == kCrystal || _btype == kTriggerTower)
743  return EEDetId(_bin % 102, _bin / 102, z).rawId();
744  else if (_btype == kSuperCrystal)
745  return EcalScDetId(_bin % 22, _bin / 22, z).rawId();
746  } else if (_otype == kEE) {
747  if (_btype == kCrystal || _btype == kTriggerTower) {
748  int ix(_bin % 202);
749  int z(ix > 100 ? 1 : -1);
750  if (z > 0)
751  ix = (ix - 100) % 101;
752  return EEDetId(ix, _bin / 202, z).rawId();
753  } else if (_btype == kSuperCrystal) {
754  int ix(_bin % 42);
755  int z(ix > 20 ? 1 : -1);
756  if (z > 0)
757  ix = (ix - 20) % 21;
758  return EcalScDetId(ix, _bin / 42, z).rawId();
759  }
760  } else if (_otype == kSM || _otype == kEBSM || _otype == kEESM) {
761  unsigned iSM(_iME);
762  if (_otype == kEBSM)
763  iSM += 9;
764  else if (_otype == kEESM && iSM > kEEmHigh)
765  iSM += nEBDCC;
766 
767  int z(iSM <= kEBmHigh ? -1 : 1);
768 
769  if ((iSM >= kEBmLow && iSM <= kEBmHigh) || (iSM >= kEBpLow && iSM <= kEBpHigh)) {
770  if (_btype == kCrystal) {
771  int iphi(((iSM - 9) % 18) * 20 + (z < 0 ? _bin / 87 : 21 - _bin / 87));
772  int ieta((_bin % 87) * z);
773  return EBDetId(ieta, iphi).rawId();
774  } else if (_btype == kTriggerTower || _btype == kSuperCrystal) {
775  int iphi((((iSM - 9) % 18) * 4 + (z < 0 ? _bin / 19 : 5 - _bin / 19) + 69) % 72 + 1);
776  int ieta(_bin % 19);
777  return EcalTrigTowerDetId(z, EcalBarrel, ieta, iphi).rawId();
778  }
779  } else {
780  if (_btype == kCrystal || _btype == kTriggerTower) {
781  int nX(nEESMX);
782  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
783  nX = nEESMXExt;
784  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
785  nX = nEESMXRed;
786  return EEDetId(_bin % (nX + 2) + xlow_(iSM), _bin / (nX + 2) + ylow_(iSM), z).rawId();
787  } else if (_btype == kSuperCrystal) {
788  int nX(nEESMX / 5);
789  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
790  nX = nEESMXExt / 5;
791  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
792  nX = nEESMXRed / 5;
793  return EcalScDetId(_bin % (nX + 2) + xlow_(iSM) / 5, _bin / (nX + 2) + ylow_(iSM) / 5, z).rawId();
794  }
795  }
796  }
797 
798  return 0;
799  }
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:50
float float float z
uint32_t ecaldqm::binning::idFromName ( std::string const &  _name)

Definition at line 661 of file MESetBinningUtils.cc.

References ecaldqm::kEBmLow, ecaldqm::kEEmLow, ecaldqm::kEEpLow, patRefSel_triggerMatching_cfi::matches, dataset::name, ecaldqm::nDCC, PFRecoTauDiscriminationByIsolation_cfi::offset, EcalTriggerElectronicsId::rawId(), and EcalElectronicsId::rawId().

Referenced by ecaldqm::binning::AxisSpecs::~AxisSpecs().

661  {
662  TString name(_name);
663  TPRegexp re(
664  "(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) "
665  "([0-9]+)(?: (TT|strip|PN) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
666  // 1 2 3 4 5 6 7 8 9
667  uint32_t rawId(0);
668 
669  TObjArray *matches(re.MatchS(name));
670  matches->SetOwner(true);
671  if (matches->GetEntries() == 0)
672  return 0;
673  else if (matches->GetEntries() == 3) {
674  TString subdet(static_cast<TObjString *>(matches->At(1))->GetString());
675  if (subdet == "EB") {
676  int dccid(static_cast<TObjString *>(matches->At(2))->GetString().Atoi());
677  unsigned offset(0);
678  if (dccid < 0) {
679  dccid *= -1;
680  offset = kEEmLow;
681  } else
682  offset = kEEpLow;
683  rawId = (dccid + 2) % 9 + 1 + offset;
684  } else {
685  int dccid(static_cast<TObjString *>(matches->At(2))->GetString().Atoi());
686  if (dccid < 0)
687  dccid *= -1;
688  else
689  dccid += 18;
690  rawId = kEBmLow + dccid;
691  }
692  } else if (matches->GetEntries() == 4)
693  rawId = static_cast<TObjString *>(matches->At(3))->GetString().Atoi() + nDCC;
694  else {
695  TString subtype(static_cast<TObjString *>(matches->At(5))->GetString());
696  if (subtype == "TCC") {
697  int tccid(static_cast<TObjString *>(matches->At(6))->GetString().Atoi());
698  int ttid(static_cast<TObjString *>(matches->At(8))->GetString().Atoi());
699  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
700  } else {
701  int dccid(static_cast<TObjString *>(matches->At(4))->GetString().Atoi());
702  int towerid(static_cast<TObjString *>(matches->At(6))->GetString().Atoi());
703  if (matches->GetEntries() == 7)
704  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
705  else {
706  TString chType(static_cast<TObjString *>(matches->At(7))->GetString());
707  int stripOrPNid(static_cast<TObjString *>(matches->At(8))->GetString().Atoi());
708  if (chType == "PN")
709  rawId = EcalElectronicsId(dccid, towerid, 1, stripOrPNid).rawId();
710  else if (chType == "strip") {
711  int xtalid(static_cast<TObjString *>(matches->At(9))->GetString().Atoi());
712  rawId = EcalElectronicsId(dccid, towerid, stripOrPNid, xtalid).rawId();
713  }
714  // case "TT" is already taken care of
715  }
716  }
717  }
718 
719  delete matches;
720 
721  return rawId;
722  }
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...
bool ecaldqm::binning::isValidIdBin ( ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

Definition at line 538 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(), ecaldqm::MESetDet2D::reset(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

538  {
539  if (_otype == kEEm || _otype == kEEp) {
540  if (_btype == kCrystal || _btype == kTriggerTower)
541  return EEDetId::validDetId(_bin % 102, _bin / 102, 1);
542  else if (_btype == kSuperCrystal)
543  return EcalScDetId::validDetId(_bin % 22, _bin / 22, 1);
544  } else if (_otype == kEE) {
545  if (_btype == kCrystal || _btype == kTriggerTower) {
546  int ix(_bin % 202);
547  if (ix > 100)
548  ix = (ix - 100) % 101;
549  return EEDetId::validDetId(ix, _bin / 202, 1);
550  } else if (_btype == kSuperCrystal) {
551  int ix(_bin % 42);
552  if (ix > 20)
553  ix = (ix - 20) % 21;
554  return EcalScDetId::validDetId(ix, _bin / 42, 1);
555  }
556  } else if (_otype == kSM || _otype == kEESM) {
557  unsigned iSM(_iME);
558  if (_otype == kEESM && iSM > kEEmHigh)
559  iSM += nEBDCC;
560 
561  if (iSM >= kEBmLow && iSM <= kEBpHigh)
562  return true;
563 
564  if (_btype == kCrystal || _btype == kTriggerTower) {
565  int nX(nEESMX);
566  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
567  nX = nEESMXExt;
568  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
569  nX = nEESMXRed;
570  int ix(_bin % (nX + 2) + xlow_(iSM));
571  int iy(_bin / (nX + 2) + ylow_(iSM));
572  int z(iSM <= kEEmHigh ? -1 : 1);
573  return EEDetId::validDetId(ix, iy, 1) && iSM == dccId(EEDetId(ix, iy, z)) - 1;
574  } else if (_btype == kSuperCrystal) {
575  int nX(nEESMX / 5);
576  if (iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
577  nX = nEESMXExt / 5;
578  if (iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
579  nX = nEESMXRed / 5;
580  int ix(_bin % (nX + 2) + xlow_(iSM) / 5);
581  int iy(_bin / (nX + 2) + ylow_(iSM) / 5);
582  int z(iSM <= kEEmHigh ? -1 : 1);
583  return EcalScDetId::validDetId(ix, iy, z) && iSM == dccId(EcalScDetId(ix, iy, z)) - 1;
584  }
585  }
586 
587  return true;
588  }
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:59
float float float z
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
Definition: EEDetId.h:248
unsigned dccId(DetId const &)
BinningType ecaldqm::binning::translateBinningType ( std::string const &  _btypeName)

Definition at line 894 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::createMESet(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

894  {
895  if (_btypeName == "Crystal")
896  return kCrystal;
897  else if (_btypeName == "TriggerTower")
898  return kTriggerTower;
899  else if (_btypeName == "SuperCrystal")
900  return kSuperCrystal;
901  else if (_btypeName == "PseudoStrip")
902  return kPseudoStrip;
903  else if (_btypeName == "TCC")
904  return kTCC;
905  else if (_btypeName == "DCC")
906  return kDCC;
907  else if (_btypeName == "ProjEta")
908  return kProjEta;
909  else if (_btypeName == "ProjPhi")
910  return kProjPhi;
911  else if (_btypeName == "RCT")
912  return kRCT;
913  else if (_btypeName == "User")
914  return kUser;
915  else if (_btypeName == "Report")
916  return kReport;
917  else if (_btypeName == "Trend")
918  return kTrend;
919 
920  throw cms::Exception("InvalidConfiguration") << "No binning type " << _btypeName << " defined";
921  }
MonitorElement::Kind ecaldqm::binning::translateKind ( std::string const &  _kindName)
ObjectType ecaldqm::binning::translateObjectType ( std::string const &  _otypeName)

Definition at line 849 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(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

849  {
850  if (_otypeName == "EB")
851  return kEB;
852  else if (_otypeName == "EE")
853  return kEE;
854  else if (_otypeName == "EEm")
855  return kEEm;
856  else if (_otypeName == "EEp")
857  return kEEp;
858  else if (_otypeName == "SM")
859  return kSM;
860  else if (_otypeName == "EBSM")
861  return kEBSM;
862  else if (_otypeName == "EESM")
863  return kEESM;
864  else if (_otypeName == "SMMEM")
865  return kSMMEM;
866  else if (_otypeName == "EBSMMEM")
867  return kEBSMMEM;
868  else if (_otypeName == "EESMMEM")
869  return kEESMMEM;
870  else if (_otypeName == "Ecal")
871  return kEcal;
872  else if (_otypeName == "MEM")
873  return kMEM;
874  else if (_otypeName == "EBMEM")
875  return kEBMEM;
876  else if (_otypeName == "EEMEM")
877  return kEEMEM;
878  else if (_otypeName == "Ecal2P")
879  return kEcal2P;
880  else if (_otypeName == "Ecal3P")
881  return kEcal3P;
882  else if (_otypeName == "EE2P")
883  return kEE2P;
884  else if (_otypeName == "MEM2P")
885  return kMEM2P;
886  else if (_otypeName == "Channel")
887  return kChannel;
888  else if (_otypeName == "None")
889  return nObjType;
890 
891  throw cms::Exception("InvalidConfiguration") << "No object type " << _otypeName << " defined";
892  }
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(), isValidIdBin(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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  }
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(), isValidIdBin(), and ecaldqm::binning::AxisSpecs::~AxisSpecs().

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  }