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, kTCC,
  kDCC, kProjEta, kProjPhi, kUser,
  kReport, kTrend, nBinType
}
 
enum  Constants {
  nPresetBinnings = kProjPhi + 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 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 57 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 531 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().

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

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

Referenced by ecaldqm::fillMESetDescriptions().

789  {
790  _desc.addUntracked<std::string>("title", "");
791  _desc.addUntracked<int>("nbins", 0);
792  _desc.addUntracked<double>("low", 0.);
793  _desc.addOptionalNode(edm::ParameterDescription<double>("high", 0., false) ^ edm::ParameterDescription<double>("unitsPerBin", 0., false), false);
794  _desc.addOptionalUntracked<std::vector<double> >("edges");
795  _desc.addOptionalUntracked<std::vector<std::string> >("labels");
796  }
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_(), findBinSuperCrystal_(), findBinTriggerTower_(), kCrystal, 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  default :
249  return 0;
250  }
251  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
int findBinTriggerTower_(ObjectType, DetId const &)
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int ecaldqm::binning::findBin2D ( ObjectType  _otype,
BinningType  _btype,
EcalElectronicsId const &  _id 
)

Definition at line 254 of file MESetBinningUtils.cc.

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

255  {
256  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return 0;
257 
258  switch(_btype){
259  case kCrystal:
260  return findBinCrystal_(_otype, _id);
261  break;
262  case kSuperCrystal:
263  return findBinSuperCrystal_(_otype, _id);
264  break;
265  default :
266  return 0;
267  }
268  }
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 271 of file MESetBinningUtils.cc.

References kDCC, kEcal, and ecaldqm::kEEpLow.

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

Definition at line 388 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_(), and findBinTriggerTower_().

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

Definition at line 483 of file MESetBinningUtils2.cc.

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

484  {
485  return findBinCrystal_(_otype, getElectronicsMap()->getDetId(_id));
486  }
int findBinCrystal_(ObjectType, DetId const &, int=-1)
EcalElectronicsMapping const * getElectronicsMap()
int ecaldqm::binning::findBinSuperCrystal_ ( ObjectType  _otype,
DetId const &  _id,
int  _iSM = -1 
)

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

530  {
531  int xbin(0);
532  int ybin(0);
533  int nbinsX(0);
534  int subdet(_id.subdetId());
535 
536  if(subdet == EcalBarrel){
537  EBDetId ebid(_id);
538  int iphi(ebid.iphi());
539  int ieta(ebid.ieta());
540  switch(_otype){
541  case kEB:
542  xbin = (iphi - 1) / 5 + 1;
543  ybin = (ieta < 0 ? ieta + 85 : ieta + 84) / 5 + 1;
544  nbinsX = 72;
545  break;
546  case kSM:
547  case kEBSM:
548  xbin = (ieta < 0 ? -ieta - 1 : ieta - 1) / 5 + 1;
549  ybin = (ieta < 0 ? (iphi - 1) % 20 : 19 - (iphi - 1) % 20) / 5 + 1;
550  nbinsX = nEBSMEta / 5;
551  break;
552  default:
553  break;
554  }
555  }
556  else if(subdet == EcalEndcap){
557  if(isEcalScDetId(_id)){
558  EcalScDetId scid(_id);
559  int ix(scid.ix());
560  int iy(scid.iy());
561  switch(_otype){
562  case kEE:
563  {
564  int zside(scid.zside());
565  xbin = zside < 0 ? ix : ix + 20;
566  ybin = iy;
567  nbinsX = 40;
568  }
569  break;
570  case kEEm:
571  case kEEp:
572  xbin = ix;
573  ybin = iy;
574  nbinsX = 20;
575  break;
576  case kSM:
577  case kEESM:
578  {
579  int iSM(_iSM >= 0 ? _iSM : dccId(_id) - 1);
580  xbin = ix - xlow_(iSM) / 5;
581  ybin = iy - ylow_(iSM) / 5;
582  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
583  nbinsX = nEESMXExt / 5;
584  else if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
585  nbinsX = nEESMXRed / 5;
586  else
587  nbinsX = nEESMX / 5;
588  }
589  break;
590  default:
591  break;
592  }
593  }
594  else{
595  EEDetId eeid(_id);
596  int ix(eeid.ix());
597  int iy(eeid.iy());
598  switch(_otype){
599  case kEE:
600  xbin = (eeid.zside() < 0 ? ix - 1 : ix + 99) / 5 + 1;
601  ybin = (iy - 1) / 5 + 1;
602  nbinsX = 40;
603  break;
604  case kEEm:
605  case kEEp:
606  xbin = (ix - 1) / 5 + 1;
607  ybin = (iy - 1) / 5 + 1;
608  nbinsX = 20;
609  break;
610  case kSM:
611  case kEESM:
612  {
613  int iSM(_iSM >= 0 ? _iSM : dccId(_id) - 1);
614  xbin = (ix - xlow_(iSM) - 1) / 5 + 1;
615  ybin = (iy - ylow_(iSM) - 1) / 5 + 1;
616  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08)
617  nbinsX = nEESMXExt / 5;
618  else if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09)
619  nbinsX = nEESMXRed / 5;
620  else
621  nbinsX = nEESMX / 5;
622  }
623  break;
624  default:
625  break;
626  }
627  }
628  }
629  else if(subdet == EcalTriggerTower && !isEndcapTTId(_id)){
630  EcalTrigTowerDetId ttid(_id);
631  int ieta(ttid.ieta());
632  int iphi((ttid.iphi() + 1) % 72 + 1);
633  switch(_otype){
634  case kEB:
635  xbin = iphi;
636  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
637  nbinsX = 72;
638  break;
639  case kSM:
640  case kEBSM:
641  xbin = ieta < 0 ? -ieta : ieta;
642  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
643  nbinsX = nEBSMEta / 5;
644  break;
645  default:
646  break;
647  }
648  }
649 
650  return (nbinsX + 2) * ybin + xbin;
651  }
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 654 of file MESetBinningUtils2.cc.

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

655  {
656  int xbin(0);
657  int ybin(0);
658  int nbinsX(0);
659  int iDCC(_id.dccId() - 1);
660 
661  if(iDCC >= kEBmLow && iDCC <= kEBpHigh){
662  unsigned towerid(_id.towerId());
663  bool isEBm(iDCC <= kEBmHigh);
664  switch(_otype){
665  case kEB:
666  xbin = 4 * ((iDCC - 9) % 18) + (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
667  ybin = (towerid - 1) / 4 * (isEBm ? -1 : 1) + (isEBm ? 18 : 17);
668  break;
669  case kSM:
670  case kEBSM:
671  xbin = (towerid - 1) / 4 + 1;
672  ybin = (isEBm ? towerid - 1 : 68 - towerid) % 4 + 1;
673  break;
674  default:
675  break;
676  }
677  }
678  else{
679  return findBinSuperCrystal_(_otype, EEDetId(getElectronicsMap()->getDetId(_id)).sc());
680  }
681 
682  return (nbinsX + 2) * ybin + xbin;
683  }
EcalElectronicsMapping const * getElectronicsMap()
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int ecaldqm::binning::findBinTriggerTower_ ( ObjectType  _otype,
DetId const &  _id 
)

Definition at line 489 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D().

490  {
491  int xbin(0);
492  int ybin(0);
493  int nbinsX(0);
494  int subdet(_id.subdetId());
495 
496  if((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel){
497  EcalTrigTowerDetId ttid;
498  if(subdet == EcalBarrel) ttid = EBDetId(_id).tower();
499  else ttid = _id;
500 
501  int ieta(ttid.ieta());
502  int iphi((ttid.iphi() + 1) % 72 + 1);
503  switch(_otype){
504  case kEB:
505  xbin = iphi;
506  ybin = ieta < 0 ? ieta + 18 : ieta + 17;
507  nbinsX = 72;
508  break;
509  case kSM:
510  case kEBSM:
511  xbin = ieta < 0 ? -ieta : ieta;
512  ybin = ieta < 0 ? (iphi - 1) % 4 + 1 : 4 - (iphi - 1) % 4;
513  nbinsX = 17;
514  break;
515  default:
516  break;
517  }
518  }
519  else if(subdet == EcalEndcap){
520  unsigned tccid(tccId(_id));
521  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
522  return findBinCrystal_(_otype, _id, iSM);
523  }
524 
525  return (nbinsX + 2) * ybin + xbin;
526  }
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 286 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().

287  {
288  if(getNObjects(_otype) == 1) return 0;
289 
290  switch(_otype){
291  case kEcal3P:
292  if(_id.subdetId() == EcalBarrel) return 1;
293  else if(_id.subdetId() == EcalEndcap && zside(_id) > 0) return 2;
294  else if(_id.subdetId() == EcalTriggerTower){
295  if(!isEndcapTTId(_id)) return 1;
296  else{
297  if(zside(_id) > 0) return 2;
298  else return 0;
299  }
300  }
301  else return 0;
302 
303  case kEcal2P:
304  if(_id.subdetId() == EcalBarrel) return 1;
305  else if(_id.subdetId() == EcalTriggerTower && !isEndcapTTId(_id)) return 1;
306  else return 0;
307 
308  case kEE2P:
309  if(zside(_id) > 0) return 1;
310  else return 0;
311 
312  case kMEM2P:
313  if(_id.subdetId() == EcalLaserPnDiode){
314  unsigned iDCC(dccId(_id) - 1);
315  if(iDCC >= kEBmLow && iDCC <= kEBpHigh) return 1;
316  else return 0;
317  }
318  else return -1;
319 
320  default:
321  return findPlotIndex(_otype, dccId(_id));
322  }
323  }
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 326 of file MESetBinningUtils.cc.

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

327  {
328  if(getNObjects(_otype) == 1) return 0;
329 
330  return findPlotIndex(_otype, _id.dccId());
331  }
unsigned getNObjects(ObjectType)
unsigned findPlotIndex(ObjectType, DetId const &)
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
int  _dcctccid,
BinningType  _btype = kDCC 
)

Definition at line 334 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, kSM, kSMMEM, kTCC, ecaldqm::memDCCIndex(), ecaldqm::nEBDCC, and ecaldqm::nEEDCCMEM.

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

Definition at line 748 of file MESetBinningUtils.cc.

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

749  {
750  AxisSpecs axis;
751 
752  if(_axisParams.existsAs<std::vector<double> >("edges", false)){
753  std::vector<double> const& vEdges(_axisParams.getUntrackedParameter<std::vector<double> >("edges"));
754  axis.nbins = vEdges.size() - 1;
755  axis.edges = new float[vEdges.size()];
756  std::copy(vEdges.begin(), vEdges.end(), axis.edges);
757  }
758  else{
759  axis.nbins = _axisParams.getUntrackedParameter<int>("nbins");
760  axis.low = _axisParams.getUntrackedParameter<double>("low");
761  bool highSet(_axisParams.existsAs<double>("high", false));
762  bool perBinSet(_axisParams.existsAs<double>("unitsPerBin", false));
763  if(highSet){
764  if(perBinSet) edm::LogWarning("EcalDQM") << "Maximum and bin width both set in an axis; using the former";
765  axis.high = _axisParams.getUntrackedParameter<double>("high");
766  }
767  else if(perBinSet)
768  axis.high = axis.low + _axisParams.getUntrackedParameter<double>("unitsPerBin") * axis.nbins;
769  else
770  axis.high = 0.;
771  }
772 
773  if(_axisParams.existsAs<std::vector<std::string> >("labels", false)){
774  std::vector<std::string> const& labels(_axisParams.getUntrackedParameter<std::vector<std::string> >("labels"));
775  if(int(labels.size()) == axis.nbins){
776  axis.labels = new std::string[axis.nbins];
777  for(int iB(0); iB != axis.nbins; ++iB)
778  axis.labels[iB] = labels[iB];
779  }
780  }
781 
782  axis.title = _axisParams.getUntrackedParameter<std::string>("title");
783 
784  return axis;
785  }
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, 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  if(_axis == 1)
99  specs.nbins = 72;
100  else if(_axis == 2)
101  specs.nbins = 34;
102  break;
103  default:
104  return specs;
105  }
106 
107  if(_axis == 1){
108  specs.low = 0.;
109  specs.high = 360.;
110  specs.title = "iphi";
111  }
112  else if(_axis == 2){
113  specs.low = -85.;
114  specs.high = 85.;
115  specs.title = "ieta";
116  }
117  }
118 
119  return specs;
120  }
const double Pi
double const etaBound
AxisSpecs ecaldqm::binning::getBinningEcal_ ( BinningType  _btype,
bool  _isMap,
int  _axis 
)

Definition at line 300 of file MESetBinningUtils2.cc.

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

Referenced by getBinning().

301  {
302  AxisSpecs specs;
303 
304  if(!_isMap){
305  switch(_btype){
306  case kTCC:
307  specs.nbins = 108;
308  specs.low = 0.;
309  specs.high = 108.;
310  specs.title = "iTCC";
311  break;
312  case kDCC:
313  specs.nbins = 54;
314  specs.low = 0.;
315  specs.high = 54.;
316  specs.title = "iDCC";
317  break;
318  case kProjEta:
319  specs.nbins = nEBEtaBins + 2 * nEEEtaBins;
320  specs.edges = new float[specs.nbins + 1];
321  for(int i(0); i <= nEEEtaBins; i++)
322  specs.edges[i] = -3. + (3. - etaBound) / nEEEtaBins * i;
323  for(int i(1); i <= nEBEtaBins; i++)
324  specs.edges[i + nEEEtaBins] = -etaBound + 2. * etaBound / nEBEtaBins * i;
325  for(int i(1); i <= nEEEtaBins; i++)
326  specs.edges[i + nEEEtaBins + nEBEtaBins] = etaBound + (3. - etaBound) / nEEEtaBins * i;
327  specs.title = "eta";
328  break;
329  case kProjPhi:
330  specs.nbins = nPhiBins;
331  specs.low = -TMath::Pi() / 18.;
332  specs.high = TMath::Pi() * 35./18.;
333  specs.title = "phi";
334  break;
335  default:
336  break;
337  }
338  }
339  else{
340  switch(_btype){
341  case kDCC:
342  if(_axis == 1){
343  specs.nbins = 9;
344  specs.low = 0.;
345  specs.high = 9.;
346  }
347  else if(_axis == 2){
348  specs.nbins = 6;
349  specs.low = 0.;
350  specs.high = 6.;
351  }
352  break;
353  default:
354  break;
355  }
356  }
357 
358  return specs;
359  }
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 123 of file MESetBinningUtils2.cc.

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

Referenced by getBinning().

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

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

363  {
364  AxisSpecs specs;
365 
366  if(_btype != kCrystal) return specs;
367 
368  int nbins(44);
369  if(_subdet == EcalBarrel) nbins = 36;
370  else if(_subdet == EcalEndcap) nbins = 8;
371 
372  if(_axis == 1){
373  specs.nbins = nbins;
374  specs.low = 0.;
375  specs.high = nbins;
376  }
377  else if(_axis == 2){
378  specs.nbins = 10;
379  specs.low = 0.;
380  specs.high = 10.;
381  specs.title = "iPN";
382  }
383 
384  return specs;
385  }
AxisSpecs ecaldqm::binning::getBinningSM_ ( BinningType  _btype,
bool  _isMap,
unsigned  _iObj,
int  _axis 
)

Definition at line 197 of file MESetBinningUtils2.cc.

References EcalElectronicsMapping::dccConstituents(), ecaldqm::getElectronicsMap(), ecaldqm::binning::AxisSpecs::high, 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, 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().

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

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

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

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

453  {
454  switch(_otype){
455  case kSM:
456  return nDCC;
457  case kEBSM:
458  return nEBDCC;
459  case kEESM:
460  return nEEDCC;
461  case kSMMEM:
462  return nDCCMEM;
463  case kEBSMMEM:
464  return nEBDCC;
465  case kEESMMEM:
466  return nEEDCCMEM;
467  case kEcal2P:
468  return 2;
469  case kEcal3P:
470  return 3;
471  case kEE2P:
472  return 2;
473  case kMEM2P:
474  return 2;
475  default:
476  return 1;
477  }
478  }
ObjectType ecaldqm::binning::getObject ( ObjectType  _otype,
unsigned  _iObj 
)

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

419  {
420  switch(_otype){
421  case kEcal3P:
422  switch(_iObj){
423  case 0: return kEEm;
424  case 1: return kEB;
425  case 2: return kEEp;
426  default: return nObjType;
427  }
428  case kEcal2P:
429  switch(_iObj){
430  case 0: return kEE;
431  case 1: return kEB;
432  default: return nObjType;
433  }
434  case kEE2P:
435  switch(_iObj){
436  case 0: return kEEm;
437  case 1: return kEEp;
438  default: return nObjType;
439  }
440  case kMEM2P:
441  switch(_iObj){
442  case 0: return kEEMEM;
443  case 1: return kEBMEM;
444  default: return nObjType;
445  }
446  default:
447  return _otype;
448  }
449  }
uint32_t ecaldqm::binning::idFromBin ( ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

Definition at line 670 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_(), ylow_(), and detailsBasic3DVector::z.

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

671  {
672  if(_otype == kEB){
673  if(_btype == kCrystal){
674  int ieta(_bin / 362 - 86);
675  if(ieta >= 0) ++ieta;
676  return EBDetId(ieta, _bin % 362);
677  }
678  else if(_btype == kTriggerTower || _btype == kSuperCrystal){
679  int ieta(_bin / 74 - 17);
680  int z(1);
681  if(ieta <= 0){
682  z = -1;
683  ieta = -ieta + 1;
684  }
685  return EcalTrigTowerDetId(z, EcalBarrel, ieta, (_bin % 74 + 69) % 72 + 1);
686  }
687  }
688  else if(_otype == kEEm || _otype == kEEp){
689  int z(_otype == kEEm ? -1 : 1);
690  if(_btype == kCrystal || _btype == kTriggerTower)
691  return EEDetId(_bin % 102, _bin / 102, z).rawId();
692  else if(_btype == kSuperCrystal)
693  return EcalScDetId(_bin % 22, _bin / 22, z).rawId();
694  }
695  else if(_otype == kEE){
696  if(_btype == kCrystal || _btype == kTriggerTower){
697  int ix(_bin % 202);
698  int z(ix > 100 ? 1 : -1);
699  if(z > 0) ix = (ix - 100) % 101;
700  return EEDetId(ix, _bin / 202, z).rawId();
701  }
702  else if(_btype == kSuperCrystal){
703  int ix(_bin % 42);
704  int z(ix > 20 ? 1 : -1);
705  if(z > 0) ix = (ix - 20) % 21;
706  return EcalScDetId(ix, _bin / 42, z).rawId();
707  }
708  }
709  else if(_otype == kSM || _otype == kEBSM || _otype == kEESM){
710  unsigned iSM(_iME);
711  if(_otype == kEBSM) iSM += 9;
712  else if(_otype == kEESM && iSM > kEEmHigh) iSM += nEBDCC;
713 
714  int z(iSM <= kEBmHigh ? -1 : 1);
715 
716  if((iSM >= kEBmLow && iSM <= kEBmHigh) || (iSM >= kEBpLow && iSM <= kEBpHigh)){
717  if(_btype == kCrystal){
718  int iphi(((iSM - 9) % 18) * 20 + (z < 0 ? _bin / 87 : 21 - _bin / 87));
719  int ieta((_bin % 87) * z);
720  return EBDetId(ieta, iphi).rawId();
721  }
722  else if(_btype == kTriggerTower || _btype == kSuperCrystal){
723  int iphi((((iSM - 9) % 18) * 4 + (z < 0 ? _bin / 19 : 5 - _bin / 19) + 69) % 72 + 1);
724  int ieta(_bin % 19);
725  return EcalTrigTowerDetId(z, EcalBarrel, ieta, iphi).rawId();
726  }
727  }
728  else{
729  if(_btype == kCrystal || _btype == kTriggerTower){
730  int nX(nEESMX);
731  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt;
732  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed;
733  return EEDetId(_bin % (nX + 2) + xlow_(iSM), _bin / (nX + 2) + ylow_(iSM), z).rawId();
734  }
735  else if(_btype == kSuperCrystal){
736  int nX(nEESMX / 5);
737  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt / 5;
738  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed / 5;
739  return EcalScDetId(_bin % (nX + 2) + xlow_(iSM) / 5, _bin / (nX + 2) + ylow_(iSM) / 5, z).rawId();
740  }
741  }
742  }
743 
744  return 0;
745  }
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 607 of file MESetBinningUtils.cc.

References ecaldqm::kEBmLow, ecaldqm::kEEmLow, ecaldqm::kEEpLow, mergeVDriftHistosByStation::name, ecaldqm::nDCC, evf::evtn::offset(), EcalElectronicsId::rawId(), and EcalTriggerElectronicsId::rawId().

608  {
609  TString name(_name);
610  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]+)|)|)|)");
611  // 1 2 3 4 5 6 7 8 9
612  uint32_t rawId(0);
613 
614  TObjArray* matches(re.MatchS(name));
615  matches->SetOwner(true);
616  if(matches->GetEntries() == 0) return 0;
617  else if(matches->GetEntries() == 3){
618  TString subdet(static_cast<TObjString*>(matches->At(1))->GetString());
619  if(subdet == "EB"){
620  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
621  unsigned offset(0);
622  if(dccid < 0){
623  dccid *= -1;
624  offset = kEEmLow;
625  }
626  else offset = kEEpLow;
627  rawId = (dccid + 2) % 9 + 1 + offset;
628  }
629  else{
630  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
631  if(dccid < 0) dccid *= -1;
632  else dccid += 18;
633  rawId = kEBmLow + dccid;
634  }
635  }
636  else if(matches->GetEntries() == 4)
637  rawId = static_cast<TObjString*>(matches->At(3))->GetString().Atoi() + nDCC;
638  else{
639  TString subtype(static_cast<TObjString*>(matches->At(5))->GetString());
640  if(subtype == "TCC"){
641  int tccid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
642  int ttid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
643  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
644  }
645  else{
646  int dccid(static_cast<TObjString*>(matches->At(4))->GetString().Atoi());
647  int towerid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
648  if(matches->GetEntries() == 7)
649  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
650  else{
651  TString chType(static_cast<TObjString*>(matches->At(7))->GetString());
652  int stripOrPNid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
653  if(chType == "PN")
654  rawId = EcalElectronicsId(dccid, towerid, 1, stripOrPNid).rawId();
655  else if(chType == "strip"){
656  int xtalid(static_cast<TObjString*>(matches->At(9))->GetString().Atoi());
657  rawId = EcalElectronicsId(dccid, towerid, stripOrPNid, xtalid).rawId();
658  }
659  // case "TT" is already taken care of
660  }
661  }
662  }
663 
664  delete matches;
665 
666  return rawId;
667  }
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
unsigned int offset(bool)
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 481 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_(), ylow_(), and detailsBasic3DVector::z.

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

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

References edm::hlt::Exception, kCrystal, kDCC, kProjEta, kProjPhi, kReport, kSuperCrystal, kTCC, kTrend, kTriggerTower, and kUser.

Referenced by ecaldqm::createMESet().

827  {
828  if(_btypeName == "Crystal") return kCrystal;
829  else if(_btypeName == "TriggerTower") return kTriggerTower;
830  else if(_btypeName == "SuperCrystal") return kSuperCrystal;
831  else if(_btypeName == "TCC") return kTCC;
832  else if(_btypeName == "DCC") return kDCC;
833  else if(_btypeName == "ProjEta") return kProjEta;
834  else if(_btypeName == "ProjPhi") return kProjPhi;
835  else if(_btypeName == "User") return kUser;
836  else if(_btypeName == "Report") return kReport;
837  else if(_btypeName == "Trend") return kTrend;
838 
839  throw cms::Exception("InvalidConfiguration") << "No binning type " << _btypeName << " defined";
840  }
MonitorElement::Kind ecaldqm::binning::translateKind ( std::string const &  _kindName)
ObjectType ecaldqm::binning::translateObjectType ( std::string const &  _otypeName)

Definition at line 799 of file MESetBinningUtils.cc.

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

800  {
801  if(_otypeName == "EB") return kEB;
802  else if(_otypeName == "EE") return kEE;
803  else if(_otypeName == "EEm") return kEEm;
804  else if(_otypeName == "EEp") return kEEp;
805  else if(_otypeName == "SM") return kSM;
806  else if(_otypeName == "EBSM") return kEBSM;
807  else if(_otypeName == "EESM") return kEESM;
808  else if(_otypeName == "SMMEM") return kSMMEM;
809  else if(_otypeName == "EBSMMEM") return kEBSMMEM;
810  else if(_otypeName == "EESMMEM") return kEESMMEM;
811  else if(_otypeName == "Ecal") return kEcal;
812  else if(_otypeName == "MEM") return kMEM;
813  else if(_otypeName == "EBMEM") return kEBMEM;
814  else if(_otypeName == "EEMEM") return kEEMEM;
815  else if(_otypeName == "Ecal2P") return kEcal2P;
816  else if(_otypeName == "Ecal3P") return kEcal3P;
817  else if(_otypeName == "EE2P") return kEE2P;
818  else if(_otypeName == "MEM2P") return kMEM2P;
819  else if(_otypeName == "Channel") return kChannel;
820  else if(_otypeName == "None") return nObjType;
821 
822  throw cms::Exception("InvalidConfiguration") << "No object type " << _otypeName << " defined";
823  }
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  }