CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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, BinningType, DetId const &)
 
int findBin1D (ObjectType, BinningType, EcalElectronicsId const &)
 
int findBin1D (ObjectType, BinningType, int)
 
int findBin2D (ObjectType, BinningType, DetId const &)
 
int findBin2D (ObjectType, BinningType, EcalElectronicsId const &)
 
int findBin2D (ObjectType, BinningType, int)
 
int findBinCrystal_ (ObjectType, DetId const &, int=-1)
 
int findBinCrystal_ (ObjectType, EcalElectronicsId const &)
 
int findBinPseudoStrip_ (ObjectType, DetId const &)
 
int findBinRCT_ (ObjectType, DetId const &)
 
int findBinSuperCrystal_ (ObjectType, DetId const &, int=-1)
 
int findBinSuperCrystal_ (ObjectType, EcalElectronicsId const &)
 
int findBinTriggerTower_ (ObjectType, DetId const &)
 
unsigned findPlotIndex (ObjectType, DetId const &)
 
unsigned findPlotIndex (ObjectType, EcalElectronicsId const &)
 
unsigned findPlotIndex (ObjectType, int, BinningType _btype=kDCC)
 
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 59 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 20 of file MESetBinningUtils.h.

Function Documentation

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

Definition at line 541 of file MESetBinningUtils.cc.

References EcalTriggerElectronicsId::channelId(), EcalElectronicsId::dccId(), 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(), ecaldqm::smName(), contentValuesCheck::ss, EcalElectronicsId::stripId(), EcalTriggerElectronicsId::tccId(), EcalElectronicsId::towerId(), EcalTriggerElectronicsId::ttId(), and EcalElectronicsId::xtalId().

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

542  {
543  // assume the following IDs for respective binning types:
544  // Crystal: EcalElectronicsId
545  // TriggerTower: EcalTriggerElectronicsId (pstrip and channel ignored)
546  // SuperCrystal: EcalElectronicsId (strip and crystal ignored)
547  // TCC: TCC ID
548  // DCC: DCC ID
549 
550  std::stringstream ss;
551 
552  switch(_btype){
553  case kCrystal:
554  {
555  // EB-03 DCC 12 CCU 12 strip 3 xtal 1 (EB ieta -13 iphi 60) (TCC 39 TT 12 pstrip 3 chan 1)
556  EcalElectronicsId eid(_rawId);
557  if(eid.towerId() >= 69)
558  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " PN " << eid.xtalId();
559  else{
560  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " strip " << eid.stripId() << " xtal " << eid.xtalId();
561 
562  if(eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1){
563  EBDetId ebid(getElectronicsMap()->getDetId(eid));
564  ss << " (EB ieta " << std::showpos << ebid.ieta() << std::noshowpos << " iphi " << ebid.iphi() << ")";
565  }
566  else{
567  EEDetId eeid(getElectronicsMap()->getDetId(eid));
568  ss << " (EE ix " << eeid.ix() << " iy " << eeid.iy() << ")";
569  }
570  EcalTriggerElectronicsId teid(getElectronicsMap()->getTriggerElectronicsId(eid));
571  ss << " (TCC " << teid.tccId() << " TT " << teid.ttId() << " pstrip " << teid.pseudoStripId() << " chan " << teid.channelId() << ")";
572  break;
573  }
574  }
575  case kTriggerTower:
576  {
577  // EB-03 DCC 12 TCC 18 TT 3
578  EcalTriggerElectronicsId teid(_rawId);
579  EcalElectronicsId eid(getElectronicsMap()->getElectronicsId(teid));
580  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " TCC " << teid.tccId() << " TT " << teid.ttId();
581  break;
582  }
583  case kSuperCrystal:
584  {
585  // EB-03 DCC 12 CCU 18 (EBTT ieta -13 iphi 60)
586  EcalElectronicsId eid(_rawId);
587  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId();
588  if(eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1){
589  EcalTrigTowerDetId ttid(EBDetId(getElectronicsMap()->getDetId(eid)).tower());
590  ss << " (EBTT ieta " << std::showpos << ttid.ieta() << std::noshowpos << " iphi " << ttid.iphi() << ")";
591  }
592  else{
593  EcalScDetId scid(EEDetId(getElectronicsMap()->getDetId(eid)).sc());
594  ss << " (EESC ix " << scid.ix() << " iy " << scid.iy() << ")";
595  }
596  break;
597  }
598  case kTCC:
599  {
600  // EB-03 TCC 12
601  int tccid(_rawId - nDCC);
602  int dccid(getElectronicsMap()->DCCid(getElectronicsMap()->getTrigTowerDetId(tccid, 1)));
603  ss << smName(dccid) << " TCC " << (_rawId - nDCC);
604  break;
605  }
606  case kDCC:
607  ss << smName(_rawId);
608  break;
609  default:
610  break;
611  }
612 
613  return ss.str();
614  }
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 798 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::fillMESetDescriptions().

799  {
800  _desc.addUntracked<std::string>("title", "");
801  _desc.addUntracked<int>("nbins", 0);
802  _desc.addUntracked<double>("low", 0.);
803  _desc.addOptionalNode(edm::ParameterDescription<double>("high", 0., false) ^ edm::ParameterDescription<double>("unitsPerBin", 0., false), false);
804  _desc.addOptionalUntracked<std::vector<double> >("edges");
805  _desc.addOptionalUntracked<std::vector<std::string> >("labels");
806  }
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,
DetId const &  _id 
)

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

59  {
60  switch(_otype){
61  case kSM:
62  case kEBSM:
63  case kEESM:
64  if(_btype == kSuperCrystal)
65  return towerId(_id);
66  else if(_btype == kTriggerTower){
67  unsigned tccid(tccId(_id));
68  if(tccid <= 36 || tccid >= 73){ // EE
69  unsigned bin(ttId(_id));
70  bool outer((tccid >= 19 && tccid <= 36) || (tccid >= 73 && tccid <= 90));
71  if(outer) bin += 48;
72  bin += (tccid % 2) * (outer ? 16 : 24);
73  return bin;
74  }
75  else
76  return ttId(_id);
77  }
78  else
79  break;
80  case kEcal:
81  if(_btype == kDCC)
82  return dccId(_id);
83  else if(_btype == kTCC)
84  return tccId(_id);
85  else
86  break;
87  case kEB:
88  if(_btype == kDCC)
89  return dccId(_id) - 9;
90  else if(_btype == kTCC)
91  return tccId(_id) - 36;
92  else
93  break;
94  case kEEm:
95  if(_btype == kDCC)
96  return dccId(_id);
97  else if(_btype == kTCC)
98  return tccId(_id);
99  else
100  break;
101  case kEEp:
102  if(_btype == kDCC)
103  return dccId(_id) - 45;
104  else if(_btype == kTCC)
105  return tccId(_id) - 72;
106  else
107  break;
108  case kEE:
109  if(_btype == kDCC){
110  int bin(dccId(_id));
111  if(bin >= 46) bin -= 36;
112  return bin;
113  }
114  else if(_btype == kTCC){
115  int bin(tccId(_id));
116  if(bin >= 72) bin -= 36;
117  return bin;
118  }
119  else
120  break;
121  case kSMMEM:
122  case kEBSMMEM:
123  case kEESMMEM:
124  if(_btype == kCrystal)
125  return EcalPnDiodeDetId(_id).iPnId();
126  else
127  break;
128  default:
129  break;
130  }
131 
132  return 0;
133  }
unsigned tccId(DetId const &)
unsigned ttId(DetId const &)
int iPnId() const
get the PnId
unsigned towerId(DetId const &)
unsigned dccId(DetId const &)
int ecaldqm::binning::findBin1D ( ObjectType  _otype,
BinningType  _btype,
EcalElectronicsId const &  _id 
)

Definition at line 136 of file MESetBinningUtils.cc.

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

137  {
138  switch(_otype){
139  case kSM:
140  case kEBSM:
141  case kEESM:
142  if(_btype == kSuperCrystal)
143  return towerId(_id);
144  else if(_btype == kTriggerTower){
145  unsigned tccid(tccId(_id));
146  if(tccid <= 36 || tccid >= 73){ // EE
147  unsigned bin(ttId(_id));
148  bool outer((tccid >= 19 && tccid <= 36) || (tccid >= 73 && tccid <= 90));
149  if(outer) bin += 48;
150  bin += (tccid % 2) * (outer ? 16 : 24);
151  return bin;
152  }
153  else
154  return ttId(_id);
155  }
156  else
157  break;
158  case kEcal:
159  if(_btype == kDCC)
160  return dccId(_id);
161  else if(_btype == kTCC)
162  return tccId(_id);
163  else
164  break;
165  case kEB:
166  if(_btype == kDCC)
167  return dccId(_id) - 9;
168  else if(_btype == kTCC)
169  return tccId(_id) - 36;
170  else
171  break;
172  case kEEm:
173  if(_btype == kDCC)
174  return dccId(_id);
175  else if(_btype == kTCC)
176  return tccId(_id);
177  else
178  break;
179  case kEEp:
180  if(_btype == kDCC)
181  return dccId(_id) - 45;
182  else if(_btype == kTCC)
183  return tccId(_id) - 72;
184  else
185  break;
186  case kEE:
187  if(_btype == kDCC){
188  int bin(dccId(_id));
189  if(bin >= 46) bin -= 36;
190  return bin;
191  }
192  else if(_btype == kTCC){
193  int bin(tccId(_id));
194  if(bin >= 72) bin -= 36;
195  return bin;
196  }
197  else
198  break;
199  default:
200  break;
201  }
202 
203  return 0;
204  }
unsigned tccId(DetId const &)
unsigned ttId(DetId const &)
unsigned towerId(DetId const &)
unsigned dccId(DetId const &)
int ecaldqm::binning::findBin1D ( ObjectType  _otype,
BinningType  _btype,
int  _dcctccid 
)

Definition at line 207 of file MESetBinningUtils.cc.

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

208  {
209  if(_otype == kEcal && _btype == kDCC)
210  return _dcctccid;
211  else if(_otype == kEcal && _btype == kTCC)
212  return _dcctccid;
213  if(_otype == kEB && _btype == kDCC)
214  return _dcctccid - 9;
215  else if(_otype == kEB && _btype == kTCC)
216  return _dcctccid - 36;
217  else if(_otype == kEEm && _btype == kDCC)
218  return _dcctccid;
219  else if(_otype == kEEm && _btype == kTCC)
220  return _dcctccid;
221  else if(_otype == kEEp && _btype == kDCC)
222  return _dcctccid - 45;
223  else if(_otype == kEEp && _btype == kTCC)
224  return _dcctccid - 72;
225  else if(_otype == kEE && _btype == kDCC)
226  return _dcctccid <= 9 ? _dcctccid : _dcctccid - 36;
227  else if(_otype == kEE && _btype == kTCC)
228  return _dcctccid <= 36 ? _dcctccid : _dcctccid - 36;
229 
230  return 0;
231  }
int ecaldqm::binning::findBin2D ( ObjectType  _otype,
BinningType  _btype,
DetId const &  _id 
)

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

235  {
236  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return 0;
237 
238  switch(_btype){
239  case kCrystal:
240  return findBinCrystal_(_otype, _id);
241  break;
242  case kTriggerTower:
243  return findBinTriggerTower_(_otype, _id);
244  break;
245  case kSuperCrystal:
246  return findBinSuperCrystal_(_otype, _id);
247  break;
248  case kPseudoStrip:
249  return findBinPseudoStrip_(_otype, _id);
250  break;
251  case kRCT:
252  return findBinRCT_(_otype, _id);
253  break;
254  default :
255  return 0;
256  }
257  }
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,
EcalElectronicsId const &  _id 
)

Definition at line 260 of file MESetBinningUtils.cc.

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

261  {
262  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return 0;
263 
264  switch(_btype){
265  case kCrystal:
266  return findBinCrystal_(_otype, _id);
267  break;
268  case kSuperCrystal:
269  return findBinSuperCrystal_(_otype, _id);
270  break;
271  default :
272  return 0;
273  }
274  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int ecaldqm::binning::findBin2D ( ObjectType  _otype,
BinningType  _btype,
int  _dccid 
)

Definition at line 277 of file MESetBinningUtils.cc.

References kDCC, kEcal, and ecaldqm::kEEpLow.

278  {
279  if(_otype != kEcal || _btype != kDCC) return 0;
280 
281  int nbinsX(9);
282  unsigned iDCC(_dccid - 1);
283  int xbin(0);
284  if(iDCC <= kEEmHigh || iDCC >= kEEpLow) xbin = (iDCC + 6) % nbinsX + 1;
285  else xbin = iDCC % nbinsX + 1;
286  int ybin(6 - iDCC / nbinsX);
287 
288  return (nbinsX + 2) * ybin + xbin;
289  }
int ecaldqm::binning::findBinCrystal_ ( ObjectType  _otype,
DetId const &  _id,
int  _iSM = -1 
)

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

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

407  {
408  int xbin(0), ybin(0);
409  int nbinsX(0);
410  int subdet(_id.subdetId());
411 
412  if(subdet == EcalBarrel){
413  EBDetId ebid(_id);
414  int iphi(ebid.iphi());
415  int ieta(ebid.ieta());
416  switch(_otype){
417  case kEB:
418  xbin = iphi;
419  ybin = ieta < 0 ? ieta + 86 : ieta + 85;
420  nbinsX = 360;
421  break;
422  case kSM:
423  case kEBSM:
424  xbin = ieta < 0 ? -ieta : ieta;
425  ybin = ieta < 0 ? (iphi - 1) % 20 + 1 : 20 - (iphi - 1) % 20;
426  nbinsX = nEBSMEta;
427  break;
428  default:
429  break;
430  }
431  }
432  else if(subdet == EcalEndcap){
433  EEDetId eeid(_id);
434  int ix(eeid.ix());
435  int iy(eeid.iy());
436  switch(_otype){
437  case kEE:
438  xbin = eeid.zside() < 0 ? ix : ix + 100;
439  ybin = iy;
440  nbinsX = 200;
441  break;
442  case kEEm:
443  case kEEp:
444  xbin = ix;
445  ybin = iy;
446  nbinsX = 100;
447  break;
448  case kSM:
449  case kEESM:
450  {
451  int iSM(_iSM >= 0 ? _iSM : dccId(_id) - 1);
452  xbin = ix - xlow_(iSM);
453  ybin = iy - ylow_(iSM);
454  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
455  nbinsX = nEESMXExt;
456  else if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
457  nbinsX = nEESMXRed;
458  else
459  nbinsX = nEESMX;
460  }
461  break;
462  default:
463  break;
464  }
465  }
466  else if(subdet == EcalLaserPnDiode){
467  EcalPnDiodeDetId pnid(_id);
468  switch(_otype){
469  case kSMMEM:
470  case kEBSMMEM:
471  case kEESMMEM:
472  xbin = pnid.iPnId();
473  ybin = 1;
474  nbinsX = 10;
475  break;
476  case kMEM:
477  xbin = memDCCIndex(dccId(_id)) + 1;
478  ybin = pnid.iPnId();
479  nbinsX = 44;
480  break;
481  case kEBMEM:
482  xbin = memDCCIndex(dccId(_id)) - 3;
483  ybin = pnid.iPnId();
484  nbinsX = 36;
485  break;
486  case kEEMEM:
487  xbin = memDCCIndex(dccId(_id)) + 1;
488  if(xbin > kEEmHigh + 1) xbin -= 36;
489  ybin = pnid.iPnId();
490  nbinsX = 8;
491  break;
492  default:
493  break;
494  }
495  }
496 
497  return (nbinsX + 2) * ybin + xbin;
498  }
unsigned memDCCIndex(unsigned)
unsigned dccId(DetId const &)
int ecaldqm::binning::findBinCrystal_ ( ObjectType  _otype,
EcalElectronicsId const &  _id 
)

Definition at line 501 of file MESetBinningUtils2.cc.

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

502  {
503  return findBinCrystal_(_otype, getElectronicsMap()->getDetId(_id));
504  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
EcalElectronicsMapping const * getElectronicsMap()
int ecaldqm::binning::findBinPseudoStrip_ ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 569 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D().

569  {
570 
571  int xbin(0);
572  int ybin(0);
573  int nbinsX(0);
574  int subdet(_id.subdetId());
575 
576  if((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel){
577  return findBinTriggerTower_(_otype, _id);
578  }
579  else if(subdet == EcalEndcap){
580  unsigned tccid(tccId(_id));
581  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
582  return findBinCrystal_(_otype, _id, iSM);
583  }
584 
585  return (nbinsX + 2) * ybin + xbin;
586  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
int findBinTriggerTower_(ObjectType, DetId const &)
unsigned tccId(DetId const &)
bool isEndcapTTId(DetId const &)
int ecaldqm::binning::findBinRCT_ ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 507 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D().

508  {
509  int xbin(0);
510  int ybin(0);
511  int nbinsX(0);
512 
513  EcalTrigTowerDetId ttid(_id);
514  int ieta(ttid.ieta());
515  int iphi((ttid.iphi() + 1) % 72 + 1);
516 
517  xbin = ieta < 0? ieta + 33: ieta + 32;
518  ybin = iphi;
519  nbinsX = 64;
520 
521  return (nbinsX + 2) * ybin + xbin;
522  }
int ecaldqm::binning::findBinSuperCrystal_ ( ObjectType  _otype,
DetId const &  _id,
int  _iSM = -1 
)

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

Referenced by findBin2D(), and findBinSuperCrystal_().

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

Definition at line 714 of file MESetBinningUtils2.cc.

References EcalElectronicsId::dccId(), findBinSuperCrystal_(), ecaldqm::getElectronicsMap(), kEB, ecaldqm::kEBmHigh, ecaldqm::kEBmLow, ecaldqm::kEBpHigh, kEBSM, kSM, 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  break;
729  case kSM:
730  case kEBSM:
731  xbin = (towerid - 1) / 4 + 1;
732  ybin = (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
733  break;
734  default:
735  break;
736  }
737  }
738  else{
739  return findBinSuperCrystal_(_otype, EEDetId(getElectronicsMap()->getDetId(_id)).sc());
740  }
741 
742  return (nbinsX + 2) * ybin + xbin;
743  }
EcalElectronicsMapping const * getElectronicsMap()
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int ecaldqm::binning::findBinTriggerTower_ ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 525 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D(), and findBinPseudoStrip_().

526  {
527  int xbin(0);
528  int ybin(0);
529  int nbinsX(0);
530  int subdet(_id.subdetId());
531 
532  if((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel){
533  EcalTrigTowerDetId ttid;
534  if(subdet == EcalBarrel) ttid = EBDetId(_id).tower();
535  else ttid = _id;
536 
537  int ieta(ttid.ieta());
538  int iphi((ttid.iphi() + 1) % 72 + 1);
539  switch(_otype){
540  case kEB:
541  xbin = iphi;
542  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
543  nbinsX = 72;
544  break;
545  case kSM:
546  case kEBSM:
547  xbin = ieta < 0 ? -ieta : ieta;
548  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
549  nbinsX = 17;
550  break;
551  case kEcal:
552  xbin = ieta < 0? ieta + 33: ieta + 32;
553  ybin = iphi > 70? iphi-70: iphi+2;
554  nbinsX = 64;
555  default:
556  break;
557  }
558  }
559  else if(subdet == EcalEndcap){
560  unsigned tccid(tccId(_id));
561  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
562  return findBinCrystal_(_otype, _id, iSM);
563  }
564 
565  return (nbinsX + 2) * ybin + xbin;
566  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
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:59
int iphi() const
get the tower iphi
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 292 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::MESetProjection::fill(), ecaldqm::MESetDet2D::fill(), ecaldqm::MESetDet0D::fill(), ecaldqm::MESetDet1D::fill(), ecaldqm::MESetTrend::fill(), ecaldqm::MESetEcal::fill(), ecaldqm::MESetTrend::findBin(), ecaldqm::MESetDet2D::findBin(), ecaldqm::MESetEcal::findBin(), ecaldqm::MESetDet1D::findBin(), findPlotIndex(), ecaldqm::MESetProjection::getBinContent(), ecaldqm::MESetDet0D::getBinContent(), ecaldqm::MESetDet2D::getBinContent(), ecaldqm::MESetEcal::getBinContent(), ecaldqm::MESetDet1D::getBinContent(), ecaldqm::MESetProjection::getBinEntries(), ecaldqm::MESetDet2D::getBinEntries(), ecaldqm::MESetEcal::getBinEntries(), ecaldqm::MESetDet1D::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::MESetEcal::setBinEntries(), ecaldqm::MESetDet1D::setBinEntries(), ecaldqm::MESetProjection::setBinError(), ecaldqm::MESetDet2D::setBinError(), ecaldqm::MESetDet1D::setBinError(), and ecaldqm::MESetEcal::setBinError().

293  {
294  if(getNObjects(_otype) == 1) return 0;
295 
296  switch(_otype){
297  case kEcal3P:
298  if(_id.subdetId() == EcalBarrel) return 1;
299  else if(_id.subdetId() == EcalEndcap && zside(_id) > 0) return 2;
300  else if(_id.subdetId() == EcalTriggerTower){
301  if(!isEndcapTTId(_id)) return 1;
302  else{
303  if(zside(_id) > 0) return 2;
304  else return 0;
305  }
306  }
307  else return 0;
308 
309  case kEcal2P:
310  if(_id.subdetId() == EcalBarrel) return 1;
311  else if(_id.subdetId() == EcalTriggerTower && !isEndcapTTId(_id)) return 1;
312  else return 0;
313 
314  case kEE2P:
315  if(zside(_id) > 0) return 1;
316  else return 0;
317 
318  case kMEM2P:
319  if(_id.subdetId() == EcalLaserPnDiode){
320  unsigned iDCC(dccId(_id) - 1);
321  if(iDCC >= kEBmLow && iDCC <= kEBpHigh) return 1;
322  else return 0;
323  }
324  else return -1;
325 
326  default:
327  return findPlotIndex(_otype, dccId(_id));
328  }
329  }
unsigned getNObjects(ObjectType)
int zside(DetId const &)
bool isEndcapTTId(DetId const &)
unsigned findPlotIndex(ObjectType, DetId const &)
unsigned dccId(DetId const &)
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
EcalElectronicsId const &  _id 
)

Definition at line 332 of file MESetBinningUtils.cc.

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

333  {
334  if(getNObjects(_otype) == 1) return 0;
335 
336  return findPlotIndex(_otype, _id.dccId());
337  }
unsigned getNObjects(ObjectType)
unsigned findPlotIndex(ObjectType, DetId const &)
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
int  _dcctccid,
BinningType  _btype = kDCC 
)

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

341  {
342  if(getNObjects(_otype) == 1) return 0;
343 
344  int iSM(_dcctccid - 1);
345 
346  switch(_otype){
347  case kSM:
348  if(_btype == kPseudoStrip){
349  iSM = iSM <= kEEmTCCHigh ? (iSM + 1) % 18 / 2 : iSM >= kEEpTCCLow ? (iSM + 1 - 72) % 18 / 2 + 45: (iSM + 1) - kEEmTCCHigh;
350  return iSM;
351  }
352  else return iSM;
353 
354  case kEBSM:
355  return iSM - 9;
356 
357  case kEESM:
358  if(iSM <= kEEmHigh) return iSM;
359  else return iSM - nEBDCC;
360 
361  case kSMMEM:
362  return memDCCIndex(_dcctccid);
363 
364  case kEBSMMEM:
365  return memDCCIndex(_dcctccid) - nEEDCCMEM / 2;
366 
367  case kEESMMEM:
368  if(iSM <= kEEmHigh) return memDCCIndex(_dcctccid);
369  else return memDCCIndex(_dcctccid) - nEBDCC;
370 
371  case kEcal2P:
372  if(_btype == kDCC){
373  if(iSM <= kEEmHigh || iSM >= kEEpLow) return 0;
374  else return 1;
375  }
376  else if(_btype == kTCC){
377  if(iSM <= kEEmTCCHigh || iSM >= kEEpTCCLow) return 0;
378  else return 1;
379  }
380  else{
381  if(iSM == EcalBarrel - 1) return 1;
382  else return 0;
383  }
384 
385  case kEcal3P:
386  if(_btype == kDCC){
387  if(iSM <= kEEmHigh) return 0;
388  else if(iSM <= kEBpHigh) return 1;
389  else return 2;
390  }
391  else if(_btype == kTCC){
392  if(iSM <= kEEmTCCHigh) return 0;
393  else if(iSM <= kEBTCCHigh) return 1;
394  else return 2;
395  }
396  else{
397  if(iSM == -EcalEndcap - 1) return 0;
398  else if(iSM == EcalBarrel - 1) return 1;
399  else return 2;
400  }
401 
402  case kEE2P:
403  if(_btype == kDCC){
404  if(iSM >= kEEpLow) return 1;
405  else return 0;
406  }
407  else{
408  if(iSM >= kEEpTCCLow) return 1;
409  else return 0;
410  }
411 
412  case kMEM2P:
413  if(_btype == kDCC){
414  if(iSM <= kEEmHigh || iSM >= kEEpLow) return 0;
415  else return 1;
416  }
417  else if(_btype == kTCC) return -1;
418  else{
419  if(iSM == kEB) return 1;
420  else return 0;
421  }
422  default:
423  return -1;
424  }
425  }
unsigned memDCCIndex(unsigned)
unsigned getNObjects(ObjectType)
AxisSpecs ecaldqm::binning::formAxis ( edm::ParameterSet const &  _axisParams)

Definition at line 758 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::createMESet().

759  {
760  AxisSpecs axis;
761 
762  if(_axisParams.existsAs<std::vector<double> >("edges", false)){
763  std::vector<double> const& vEdges(_axisParams.getUntrackedParameter<std::vector<double> >("edges"));
764  axis.nbins = vEdges.size() - 1;
765  axis.edges = new float[vEdges.size()];
766  std::copy(vEdges.begin(), vEdges.end(), axis.edges);
767  }
768  else{
769  axis.nbins = _axisParams.getUntrackedParameter<int>("nbins");
770  axis.low = _axisParams.getUntrackedParameter<double>("low");
771  bool highSet(_axisParams.existsAs<double>("high", false));
772  bool perBinSet(_axisParams.existsAs<double>("unitsPerBin", false));
773  if(highSet){
774  if(perBinSet) edm::LogWarning("EcalDQM") << "Maximum and bin width both set in an axis; using the former";
775  axis.high = _axisParams.getUntrackedParameter<double>("high");
776  }
777  else if(perBinSet)
778  axis.high = axis.low + _axisParams.getUntrackedParameter<double>("unitsPerBin") * axis.nbins;
779  else
780  axis.high = 0.;
781  }
782 
783  if(_axisParams.existsAs<std::vector<std::string> >("labels", false)){
784  std::vector<std::string> const& labels(_axisParams.getUntrackedParameter<std::vector<std::string> >("labels"));
785  if(int(labels.size()) == axis.nbins){
786  axis.labels = new std::string[axis.nbins];
787  for(int iB(0); iB != axis.nbins; ++iB)
788  axis.labels[iB] = labels[iB];
789  }
790  }
791 
792  axis.title = _axisParams.getUntrackedParameter<std::string>("title");
793 
794  return axis;
795  }
AxisSpecs ecaldqm::binning::getBinning ( ObjectType  _otype,
BinningType  _btype,
bool  _isMap,
int  _axis,
unsigned  _iME 
)

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

17  {
18  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
19  return AxisSpecs(); // you are on your own
20 
21  switch(_otype){
22  case kEB:
23  return getBinningEB_(_btype, _isMap, _axis);
24  case kEE:
25  return getBinningEE_(_btype, _isMap, 0, _axis);
26  case kEEm:
27  return getBinningEE_(_btype, _isMap, -1, _axis);
28  case kEEp:
29  return getBinningEE_(_btype, _isMap, 1, _axis);
30  case kSM:
31  return getBinningSM_(_btype, _isMap, _iME, _axis);
32  case kEBSM:
33  return getBinningSM_(_btype, _isMap, _iME + 9, _axis);
34  case kEESM:
35  if(_iME <= kEEmHigh) return getBinningSM_(_btype, _isMap, _iME, _axis);
36  else return getBinningSM_(_btype, _isMap, _iME + nEBDCC, _axis);
37  case kSMMEM:
38  return getBinningSMMEM_(_btype, _isMap, _iME, _axis);
39  case kEBSMMEM:
40  return getBinningSMMEM_(_btype, _isMap, _iME + nEEDCCMEM / 2, _axis);
41  case kEESMMEM:
42  if(_iME <= kEEmHigh) return getBinningSMMEM_(_btype, _isMap, _iME, _axis);
43  else 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 55 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, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning().

56  {
57  AxisSpecs specs;
58 
59  if(!_isMap){
60  switch(_btype){
61  case kTCC:
62  specs.nbins = 36;
63  specs.low = 9.;
64  specs.high = 45.;
65  specs.title = "iTCC";
66  break;
67  case kDCC:
68  specs.nbins = 36;
69  specs.low = 9.;
70  specs.high = 45.;
71  break;
72  case kProjEta:
73  specs.nbins = nEBEtaBins;
74  specs.low = -etaBound;
75  specs.high = etaBound;
76  specs.title = "eta";
77  break;
78  case kProjPhi:
79  specs.nbins = nPhiBins;
80  specs.low = -TMath::Pi() / 18.;
81  specs.high = TMath::Pi() * 35./18.;
82  specs.title = "phi";
83  break;
84  default:
85  break;
86  }
87  }
88  else{
89  switch(_btype){
90  case kCrystal:
91  if(_axis == 1)
92  specs.nbins = 360;
93  else if(_axis == 2)
94  specs.nbins = 170;
95  break;
96  case kSuperCrystal:
97  case kTriggerTower:
98  case kPseudoStrip:
99  if(_axis == 1)
100  specs.nbins = 72;
101  else if(_axis == 2)
102  specs.nbins = 34;
103  break;
104  default:
105  return specs;
106  }
107 
108  if(_axis == 1){
109  specs.low = 0.;
110  specs.high = 360.;
111  specs.title = "iphi";
112  }
113  else if(_axis == 2){
114  specs.low = -85.;
115  specs.high = 85.;
116  specs.title = "ieta";
117  }
118  }
119 
120  return specs;
121  }
const double Pi
double const etaBound
AxisSpecs ecaldqm::binning::getBinningEcal_ ( BinningType  _btype,
bool  _isMap,
int  _axis 
)

Definition at line 304 of file MESetBinningUtils2.cc.

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

Referenced by getBinning().

305  {
306  AxisSpecs specs;
307 
308  if(!_isMap){
309  switch(_btype){
310  case kTCC:
311  specs.nbins = 108;
312  specs.low = 0.;
313  specs.high = 108.;
314  specs.title = "iTCC";
315  break;
316  case kDCC:
317  specs.nbins = 54;
318  specs.low = 0.;
319  specs.high = 54.;
320  specs.title = "iDCC";
321  break;
322  case kProjEta:
323  specs.nbins = nEBEtaBins + 2 * nEEEtaBins;
324  specs.edges = new float[specs.nbins + 1];
325  for(int i(0); i <= nEEEtaBins; i++)
326  specs.edges[i] = -3. + (3. - etaBound) / nEEEtaBins * i;
327  for(int i(1); i <= nEBEtaBins; i++)
328  specs.edges[i + nEEEtaBins] = -etaBound + 2. * etaBound / nEBEtaBins * i;
329  for(int i(1); i <= nEEEtaBins; i++)
330  specs.edges[i + nEEEtaBins + nEBEtaBins] = etaBound + (3. - etaBound) / nEEEtaBins * i;
331  specs.title = "eta";
332  break;
333  case kProjPhi:
334  specs.nbins = nPhiBins;
335  specs.low = -TMath::Pi() / 18.;
336  specs.high = TMath::Pi() * 35./18.;
337  specs.title = "phi";
338  break;
339  default:
340  break;
341  }
342  }
343  else{
344  switch(_btype){
345  case kDCC:
346  if(_axis == 1){
347  specs.nbins = 9;
348  specs.low = 0.;
349  specs.high = 9.;
350  }
351  else if(_axis == 2){
352  specs.nbins = 6;
353  specs.low = 0.;
354  specs.high = 6.;
355  }
356  break;
357  case kRCT:
358  if(_axis == 1){
359  specs.nbins = 64;
360  specs.low = -32.;
361  specs.high = 32.;
362  specs.title = "RCT iEta";
363  }
364  else if(_axis == 2){
365  specs.nbins = 72;
366  specs.low = 0.;
367  specs.high = 72.;
368  specs.title = "RCT Phi";
369  }
370  break;
371  default:
372  break;
373  }
374  }
375 
376  return specs;
377  }
const double Pi
int i
Definition: DBlmapReader.cc:9
double const etaBound
AxisSpecs ecaldqm::binning::getBinningEE_ ( BinningType  _btype,
bool  _isMap,
int  _zside,
int  _axis 
)

Definition at line 124 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, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning().

125  {
126  AxisSpecs specs;
127 
128  if(!_isMap){
129  switch(_btype){
130  case kTCC:
131  specs.nbins = _zside ? 36 : 72;
132  specs.low = 0.;
133  specs.high = _zside ? 36. : 72.;
134  specs.title = "iTCC";
135  break;
136  case kDCC:
137  specs.nbins = _zside ? 9 : 18;
138  specs.low = 0.;
139  specs.high = _zside ? 9. : 18.;
140  break;
141  case kProjEta:
142  if(_zside == 0){
143  specs.nbins = nEEEtaBins / (3. - etaBound) * 6.;
144  specs.low = -3.;
145  specs.high = 3.;
146  }
147  else{
148  specs.nbins = nEEEtaBins;
149  specs.low = _zside < 0 ? -3. : etaBound;
150  specs.high = _zside < 0 ? -etaBound : 3.;
151  }
152  specs.title = "eta";
153  break;
154  case kProjPhi:
155  specs.nbins = nPhiBins;
156  specs.low = -TMath::Pi() / 18.;
157  specs.high = TMath::Pi() * 35./18.;
158  specs.title = "phi";
159  break;
160  default:
161  break;
162  }
163  }else{
164  switch(_btype){
165  case kCrystal:
166  case kTriggerTower:
167  case kPseudoStrip:
168  if(_axis == 1)
169  specs.nbins = _zside ? 100 : 200;
170  if(_axis == 2)
171  specs.nbins = 100;
172  break;
173  case kSuperCrystal:
174  if(_axis == 1)
175  specs.nbins = _zside ? 20 : 40;
176  if(_axis == 2)
177  specs.nbins = 20;
178  break;
179  default:
180  return specs;
181  }
182 
183  if(_axis == 1){
184  specs.low = 0.;
185  specs.high = _zside ? 100. : 200.;
186  specs.title = "ix";
187  }
188  else if(_axis == 2){
189  specs.low = 0.;
190  specs.high = 100.;
191  specs.title = "iy";
192  }
193  }
194 
195  return specs;
196  }
const double Pi
double const etaBound
AxisSpecs ecaldqm::binning::getBinningMEM_ ( BinningType  _btype,
bool  _isMap,
int  _subdet,
int  _axis 
)

Definition at line 380 of file MESetBinningUtils2.cc.

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

Referenced by getBinning().

381  {
382  AxisSpecs specs;
383 
384  if(_btype != kCrystal) return specs;
385 
386  int nbins(44);
387  if(_subdet == EcalBarrel) nbins = 36;
388  else if(_subdet == EcalEndcap) nbins = 8;
389 
390  if(_axis == 1){
391  specs.nbins = nbins;
392  specs.low = 0.;
393  specs.high = nbins;
394  }
395  else if(_axis == 2){
396  specs.nbins = 10;
397  specs.low = 0.;
398  specs.high = 10.;
399  specs.title = "iPN";
400  }
401 
402  return specs;
403  }
AxisSpecs ecaldqm::binning::getBinningSM_ ( BinningType  _btype,
bool  _isMap,
unsigned  _iObj,
int  _axis 
)

Definition at line 199 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::binning::AxisSpecs::title, xlow_(), and ylow_().

Referenced by getBinning().

200  {
201  AxisSpecs specs;
202 
203  unsigned iSM(_iObj);
204 
205  const bool isBarrel(iSM >= kEBmLow && iSM <= kEBpHigh);
206 
207  if(!_isMap){
208  switch(_btype){
209  case kCrystal:
210  specs.nbins = isBarrel ? 1700 : getElectronicsMap()->dccConstituents(iSM + 1).size();
211  specs.low = 0.;
212  specs.high = specs.nbins;
213  specs.title = "crystal";
214  break;
215  case kTriggerTower:
216  case kPseudoStrip:
217  specs.nbins = isBarrel ? 68 : 80;
218  specs.low = 0.;
219  specs.high = specs.nbins;
220  specs.title = "tower";
221  break;
222  case kSuperCrystal:
223  specs.nbins = isBarrel ? 68 : nSuperCrystals(iSM + 1);
224  specs.low = 0.;
225  specs.high = specs.nbins;
226  specs.title = "tower";
227  break;
228  default:
229  break;
230  }
231  }else{
232  int nEEX(nEESMX);
233  int nEEY(nEESMY);
234  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nEEX = nEESMXExt;
235  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nEEX = nEESMXRed;
236  if(iSM == kEEm03 || iSM == kEEm07 || iSM == kEEp03 || iSM == kEEp07) nEEY = nEESMYRed;
237 
238  switch(_btype){
239  case kCrystal:
240  if(_axis == 1)
241  specs.nbins = isBarrel ? nEBSMEta : nEEX;
242  else if(_axis == 2)
243  specs.nbins = isBarrel ? nEBSMPhi : nEEY;
244  break;
245  case kTriggerTower:
246  case kPseudoStrip:
247  if(_axis == 1)
248  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX;
249  else if(_axis == 2)
250  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY;
251  break;
252  case kSuperCrystal:
253  if(_axis == 1)
254  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX / 5;
255  else if(_axis == 2)
256  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY / 5;
257  break;
258  default:
259  return specs;
260  }
261 
262  if(_axis == 1){
263  specs.low = xlow_(iSM);
264  specs.high = specs.low + (isBarrel ? nEBSMEta : nEEX);
265  specs.title = isBarrel ? (iSM < kEBpLow ? "-ieta" : "ieta") : "ix";
266  }
267  else if(_axis == 2){
268  specs.low = ylow_(iSM);
269  specs.high = specs.low + (isBarrel ? nEBSMPhi : nEEY);
270  specs.title = isBarrel ? "iphi" : "iy";
271  }
272  }
273 
274  return specs;
275  }
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 278 of file MESetBinningUtils2.cc.

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

Referenced by getBinning().

279  {
280  AxisSpecs specs;
281 
282  unsigned iSM(memDCCId(_iObj) - 1);
283 
284  if(iSM == unsigned(-1) || _btype != kCrystal) return specs;
285 
286  if(_axis == 1){
287  specs.nbins = 10;
288  specs.low = 0.;
289  specs.high = 10.;
290  if(_isMap) specs.title = "pseudo-strip";
291  else specs.title = "iPN";
292  }
293  else if(_axis == 2){
294  specs.nbins = 1;
295  specs.low = 0.;
296  specs.high = 5.;
297  specs.title = "channel";
298  }
299 
300  return specs;
301  }
unsigned memDCCId(unsigned)
unsigned ecaldqm::binning::getNObjects ( ObjectType  _otype)

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

463  {
464  switch(_otype){
465  case kSM:
466  return nDCC;
467  case kEBSM:
468  return nEBDCC;
469  case kEESM:
470  return nEEDCC;
471  case kSMMEM:
472  return nDCCMEM;
473  case kEBSMMEM:
474  return nEBDCC;
475  case kEESMMEM:
476  return nEEDCCMEM;
477  case kEcal2P:
478  return 2;
479  case kEcal3P:
480  return 3;
481  case kEE2P:
482  return 2;
483  case kMEM2P:
484  return 2;
485  default:
486  return 1;
487  }
488  }
ObjectType ecaldqm::binning::getObject ( ObjectType  _otype,
unsigned  _iObj 
)

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

429  {
430  switch(_otype){
431  case kEcal3P:
432  switch(_iObj){
433  case 0: return kEEm;
434  case 1: return kEB;
435  case 2: return kEEp;
436  default: return nObjType;
437  }
438  case kEcal2P:
439  switch(_iObj){
440  case 0: return kEE;
441  case 1: return kEB;
442  default: return nObjType;
443  }
444  case kEE2P:
445  switch(_iObj){
446  case 0: return kEEm;
447  case 1: return kEEp;
448  default: return nObjType;
449  }
450  case kMEM2P:
451  switch(_iObj){
452  case 0: return kEEMEM;
453  case 1: return kEBMEM;
454  default: return nObjType;
455  }
456  default:
457  return _otype;
458  }
459  }
uint32_t ecaldqm::binning::idFromBin ( ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

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

681  {
682  if(_otype == kEB){
683  if(_btype == kCrystal){
684  int ieta(_bin / 362 - 86);
685  if(ieta >= 0) ++ieta;
686  return EBDetId(ieta, _bin % 362);
687  }
688  else if(_btype == kTriggerTower || _btype == kSuperCrystal){
689  int ieta(_bin / 74 - 17);
690  int z(1);
691  if(ieta <= 0){
692  z = -1;
693  ieta = -ieta + 1;
694  }
695  return EcalTrigTowerDetId(z, EcalBarrel, ieta, (_bin % 74 + 69) % 72 + 1);
696  }
697  }
698  else if(_otype == kEEm || _otype == kEEp){
699  int z(_otype == kEEm ? -1 : 1);
700  if(_btype == kCrystal || _btype == kTriggerTower)
701  return EEDetId(_bin % 102, _bin / 102, z).rawId();
702  else if(_btype == kSuperCrystal)
703  return EcalScDetId(_bin % 22, _bin / 22, z).rawId();
704  }
705  else if(_otype == kEE){
706  if(_btype == kCrystal || _btype == kTriggerTower){
707  int ix(_bin % 202);
708  int z(ix > 100 ? 1 : -1);
709  if(z > 0) ix = (ix - 100) % 101;
710  return EEDetId(ix, _bin / 202, z).rawId();
711  }
712  else if(_btype == kSuperCrystal){
713  int ix(_bin % 42);
714  int z(ix > 20 ? 1 : -1);
715  if(z > 0) ix = (ix - 20) % 21;
716  return EcalScDetId(ix, _bin / 42, z).rawId();
717  }
718  }
719  else if(_otype == kSM || _otype == kEBSM || _otype == kEESM){
720  unsigned iSM(_iME);
721  if(_otype == kEBSM) iSM += 9;
722  else if(_otype == kEESM && iSM > kEEmHigh) iSM += nEBDCC;
723 
724  int z(iSM <= kEBmHigh ? -1 : 1);
725 
726  if((iSM >= kEBmLow && iSM <= kEBmHigh) || (iSM >= kEBpLow && iSM <= kEBpHigh)){
727  if(_btype == kCrystal){
728  int iphi(((iSM - 9) % 18) * 20 + (z < 0 ? _bin / 87 : 21 - _bin / 87));
729  int ieta((_bin % 87) * z);
730  return EBDetId(ieta, iphi).rawId();
731  }
732  else if(_btype == kTriggerTower || _btype == kSuperCrystal){
733  int iphi((((iSM - 9) % 18) * 4 + (z < 0 ? _bin / 19 : 5 - _bin / 19) + 69) % 72 + 1);
734  int ieta(_bin % 19);
735  return EcalTrigTowerDetId(z, EcalBarrel, ieta, iphi).rawId();
736  }
737  }
738  else{
739  if(_btype == kCrystal || _btype == kTriggerTower){
740  int nX(nEESMX);
741  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt;
742  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed;
743  return EEDetId(_bin % (nX + 2) + xlow_(iSM), _bin / (nX + 2) + ylow_(iSM), z).rawId();
744  }
745  else if(_btype == kSuperCrystal){
746  int nX(nEESMX / 5);
747  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt / 5;
748  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed / 5;
749  return EcalScDetId(_bin % (nX + 2) + xlow_(iSM) / 5, _bin / (nX + 2) + ylow_(iSM) / 5, z).rawId();
750  }
751  }
752  }
753 
754  return 0;
755  }
float float float z
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
uint32_t ecaldqm::binning::idFromName ( std::string const &  _name)

Definition at line 617 of file MESetBinningUtils.cc.

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

618  {
619  TString name(_name);
620  TPRegexp re("(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) ([0-9]+)(?: (TT|strip|PN) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
621  // 1 2 3 4 5 6 7 8 9
622  uint32_t rawId(0);
623 
624  TObjArray* matches(re.MatchS(name));
625  matches->SetOwner(true);
626  if(matches->GetEntries() == 0) return 0;
627  else if(matches->GetEntries() == 3){
628  TString subdet(static_cast<TObjString*>(matches->At(1))->GetString());
629  if(subdet == "EB"){
630  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
631  unsigned offset(0);
632  if(dccid < 0){
633  dccid *= -1;
634  offset = kEEmLow;
635  }
636  else offset = kEEpLow;
637  rawId = (dccid + 2) % 9 + 1 + offset;
638  }
639  else{
640  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
641  if(dccid < 0) dccid *= -1;
642  else dccid += 18;
643  rawId = kEBmLow + dccid;
644  }
645  }
646  else if(matches->GetEntries() == 4)
647  rawId = static_cast<TObjString*>(matches->At(3))->GetString().Atoi() + nDCC;
648  else{
649  TString subtype(static_cast<TObjString*>(matches->At(5))->GetString());
650  if(subtype == "TCC"){
651  int tccid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
652  int ttid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
653  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
654  }
655  else{
656  int dccid(static_cast<TObjString*>(matches->At(4))->GetString().Atoi());
657  int towerid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
658  if(matches->GetEntries() == 7)
659  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
660  else{
661  TString chType(static_cast<TObjString*>(matches->At(7))->GetString());
662  int stripOrPNid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
663  if(chType == "PN")
664  rawId = EcalElectronicsId(dccid, towerid, 1, stripOrPNid).rawId();
665  else if(chType == "strip"){
666  int xtalid(static_cast<TObjString*>(matches->At(9))->GetString().Atoi());
667  rawId = EcalElectronicsId(dccid, towerid, stripOrPNid, xtalid).rawId();
668  }
669  // case "TT" is already taken care of
670  }
671  }
672  }
673 
674  delete matches;
675 
676  return rawId;
677  }
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 491 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().

492  {
493  if(_otype == kEEm || _otype == kEEp){
494  if(_btype == kCrystal || _btype == kTriggerTower)
495  return EEDetId::validDetId(_bin % 102, _bin / 102, 1);
496  else if(_btype == kSuperCrystal)
497  return EcalScDetId::validDetId(_bin % 22, _bin / 22, 1);
498  }
499  else if(_otype == kEE){
500  if(_btype == kCrystal || _btype == kTriggerTower){
501  int ix(_bin % 202);
502  if(ix > 100) ix = (ix - 100) % 101;
503  return EEDetId::validDetId(ix, _bin / 202, 1);
504  }
505  else if(_btype == kSuperCrystal){
506  int ix(_bin % 42);
507  if(ix > 20) ix = (ix - 20) % 21;
508  return EcalScDetId::validDetId(ix, _bin / 42, 1);
509  }
510  }
511  else if(_otype == kSM || _otype == kEESM){
512  unsigned iSM(_iME);
513  if(_otype == kEESM && iSM > kEEmHigh) iSM += nEBDCC;
514 
515  if(iSM >= kEBmLow && iSM <= kEBpHigh) return true;
516 
517  if(_btype == kCrystal || _btype == kTriggerTower){
518  int nX(nEESMX);
519  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt;
520  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed;
521  int ix(_bin % (nX + 2) + xlow_(iSM));
522  int iy(_bin / (nX + 2) + ylow_(iSM));
523  int z(iSM <= kEEmHigh ? -1 : 1);
524  return EEDetId::validDetId(ix, iy, 1) && iSM == dccId(EEDetId(ix, iy, z)) - 1;
525  }
526  else if(_btype == kSuperCrystal){
527  int nX(nEESMX / 5);
528  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt / 5;
529  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed / 5;
530  int ix(_bin % (nX + 2) + xlow_(iSM) / 5);
531  int iy(_bin / (nX + 2) + ylow_(iSM) / 5);
532  int z(iSM <= kEEmHigh ? -1 : 1);
533  return EcalScDetId::validDetId(ix, iy, z) && iSM == dccId(EcalScDetId(ix, iy, z)) - 1;
534  }
535  }
536 
537  return true;
538  }
static bool validDetId(int ix, int iy, int iz)
Definition: EcalScDetId.cc:64
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 836 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::createMESet().

837  {
838  if(_btypeName == "Crystal") return kCrystal;
839  else if(_btypeName == "TriggerTower") return kTriggerTower;
840  else if(_btypeName == "SuperCrystal") return kSuperCrystal;
841  else if(_btypeName == "PseudoStrip") return kPseudoStrip;
842  else if(_btypeName == "TCC") return kTCC;
843  else if(_btypeName == "DCC") return kDCC;
844  else if(_btypeName == "ProjEta") return kProjEta;
845  else if(_btypeName == "ProjPhi") return kProjPhi;
846  else if(_btypeName == "RCT") return kRCT;
847  else if(_btypeName == "User") return kUser;
848  else if(_btypeName == "Report") return kReport;
849  else if(_btypeName == "Trend") return kTrend;
850 
851  throw cms::Exception("InvalidConfiguration") << "No binning type " << _btypeName << " defined";
852  }
MonitorElement::Kind ecaldqm::binning::translateKind ( std::string const &  _kindName)
ObjectType ecaldqm::binning::translateObjectType ( std::string const &  _otypeName)

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

810  {
811  if(_otypeName == "EB") return kEB;
812  else if(_otypeName == "EE") return kEE;
813  else if(_otypeName == "EEm") return kEEm;
814  else if(_otypeName == "EEp") return kEEp;
815  else if(_otypeName == "SM") return kSM;
816  else if(_otypeName == "EBSM") return kEBSM;
817  else if(_otypeName == "EESM") return kEESM;
818  else if(_otypeName == "SMMEM") return kSMMEM;
819  else if(_otypeName == "EBSMMEM") return kEBSMMEM;
820  else if(_otypeName == "EESMMEM") return kEESMMEM;
821  else if(_otypeName == "Ecal") return kEcal;
822  else if(_otypeName == "MEM") return kMEM;
823  else if(_otypeName == "EBMEM") return kEBMEM;
824  else if(_otypeName == "EEMEM") return kEEMEM;
825  else if(_otypeName == "Ecal2P") return kEcal2P;
826  else if(_otypeName == "Ecal3P") return kEcal3P;
827  else if(_otypeName == "EE2P") return kEE2P;
828  else if(_otypeName == "MEM2P") return kMEM2P;
829  else if(_otypeName == "Channel") return kChannel;
830  else if(_otypeName == "None") return nObjType;
831 
832  throw cms::Exception("InvalidConfiguration") << "No object type " << _otypeName << " defined";
833  }
int ecaldqm::binning::xlow_ ( int  _iSM)

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

17  {
18  switch(_iSM){
19  case kEEm01: case kEEp01: return 20;
20  case kEEm02: case kEEp02: return 0;
21  case kEEm03: case kEEp03: return 0;
22  case kEEm04: case kEEp04: return 5;
23  case kEEm05: case kEEp05: return 35;
24  case kEEm06: case kEEp06: return 55;
25  case kEEm07: case kEEp07: return 60;
26  case kEEm08: case kEEp08: return 55;
27  case kEEm09: case kEEp09: return 50;
28  default: break;
29  }
30 
31  if(_iSM >= kEBmLow && _iSM <= kEBpHigh) return 0;
32 
33  return 0;
34  }
int ecaldqm::binning::ylow_ ( int  _iSM)

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

38  {
39  switch(_iSM){
40  case kEEm01: case kEEp01: case kEEm09: case kEEp09: return 60;
41  case kEEm02: case kEEp02: case kEEm08: case kEEp08: return 50;
42  case kEEm03: case kEEp03: case kEEm07: case kEEp07: return 25;
43  case kEEm04: case kEEp04: case kEEm06: case kEEp06: return 5;
44  case kEEm05: case kEEp05: return 0;
45  default: break;
46  }
47 
48  if(_iSM >= kEBmLow && _iSM <= kEBmHigh) return ((_iSM - kEBmLow) % 18) * 20;
49  if(_iSM >= kEBpLow && _iSM <= kEBpHigh) return (-1 - ((_iSM - kEBpLow) % 18)) * 20;
50 
51  return 0;
52  }