CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EcalDQMBinningService.cc
Go to the documentation of this file.
3 
9 
14 
15 #include <utility>
16 #include <iomanip>
17 #include <sstream>
18 
19 #include "TMath.h"
20 #include "TObjArray.h"
21 #include "TObjString.h"
22 #include "TString.h"
23 #include "TPRegexp.h"
24 
25 using namespace ecaldqm;
26 
28  cacheId_(0),
29  cacheOtype_(nObjType),
30  cacheBtype_(nBinType),
31  etaBound_(1.479),
32  geometry_(0),
33  initialized_(false),
34  verbosity_(_ps.getUntrackedParameter<int>("verbosity"))
35 {
37 }
38 
40 {
41 }
42 
43 void
45 {
46  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
48  _es.get<EcalMappingRcd>().get(elecMapHandle);
49  setElectronicsMap(elecMapHandle.product());
50 
51  // set up ecaldqm::electronicsMap in EcalDQMCommonUtils
53  _es.get<IdealGeometryRecord>().get(ttMapHandle);
54  setTrigTowerMap(ttMapHandle.product());
55 
57  _es.get<CaloGeometryRecord>().get(geomHndl);
58  geometry_ = geomHndl.product();
59  if(!geometry_)
60  throw cms::Exception("EventSetup") << "CaloGeometry invalid";
61 
62  initialized_ = true;
63 }
64 
65 std::vector<EcalDQMBinningService::AxisSpecs>
66 EcalDQMBinningService::getBinning(ObjectType _otype, BinningType _btype, bool _isMap/* = true*/, unsigned _objOffset/* = 0*/) const
67 {
68  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings))
69  return std::vector<AxisSpecs>(0); // you are on your own
70 
71  switch(_otype){
72  case kEB:
73  return getBinningEB_(_btype, _isMap);
74  case kEBMEM:
75  return getBinningEBMEM_(_btype, _isMap);
76  case kEE:
77  return getBinningEE_(_btype, _isMap, 0);
78  case kEEm:
79  return getBinningEE_(_btype, _isMap, -1);
80  case kEEp:
81  return getBinningEE_(_btype, _isMap, 1);
82  case kEEMEM:
83  return getBinningEEMEM_(_btype, _isMap);
84  case kSM:
85  return getBinningSM_(_btype, _isMap, _objOffset);
86  case kSMMEM:
87  return getBinningSMMEM_(_btype, _isMap, _objOffset);
88  case kEcal:
89  return getBinningEcal_(_btype, _isMap);
90  default:
91  return std::vector<AxisSpecs>(0);
92  }
93 }
94 
95 int
97 {
98  switch(_iSM){
99  case kEEm01: case kEEp01: return 15;
100  case kEEm02: case kEEp02: return 0;
101  case kEEm03: case kEEp03: return 0;
102  case kEEm04: case kEEp04: return 5;
103  case kEEm05: case kEEp05: return 30;
104  case kEEm06: case kEEp06: return 55;
105  case kEEm07: case kEEp07: return 60;
106  case kEEm08: case kEEp08: return 55;
107  case kEEm09: case kEEp09: return 45;
108  default: break;
109  }
110 
111  if(_iSM >= kEBmLow && _iSM <= kEBpHigh) return 0;
112 
113  return 0;
114 }
115 
116 int
118 {
119  switch(_iSM){
120  case kEEm01: case kEEp01: case kEEm09: case kEEp09: return 60;
121  case kEEm02: case kEEp02: case kEEm08: case kEEp08: return 50;
122  case kEEm03: case kEEp03: case kEEm07: case kEEp07: return 25;
123  case kEEm04: case kEEp04: case kEEm06: case kEEp06: return 5;
124  case kEEm05: case kEEp05: return 0;
125  default: break;
126  }
127 
128  if(_iSM >= kEBmLow && _iSM <= kEBmHigh) return ((_iSM - kEBmLow) % 18) * 20;
129  if(_iSM >= kEBpLow && _iSM <= kEBpHigh) return (-1 - ((_iSM - kEBpLow) % 18)) * 20;
130 
131  return 0;
132 }
133 
134 const std::vector<int>*
136 {
137  if(unsigned(_okey) >= nPlotType || unsigned(_bkey) >= nPresetBinnings) return 0;
138 
139  if((_okey == kEEm || _okey == kEEp) && _bkey == kProjPhi)
140  _okey = kEE;
141 
142  if(_bkey == kTriggerTower){
143  if(_okey == kEB) _bkey = kSuperCrystal;
144  else if(_okey == kEE || _okey == kEEm || _okey == kEEp) _bkey = kCrystal;
145  }
146 
147  if(binMaps_[_okey][_bkey].size() != 0) return &(binMaps_[_okey][_bkey]);
148 
149  // Map is not defined yet (or is not going to be)
150 
151  const std::vector<int>* binMap(0);
152 
153  switch(_okey){
154  case kEB:
155  binMap = getBinMapEB_(_bkey);
156  break;
157  case kEBMEM:
158  binMap = getBinMapEBMEM_(_bkey);
159  break;
160  case kEE:
161  binMap = getBinMapEE_(_bkey, 0);
162  break;
163  case kEEm:
164  binMap = getBinMapEE_(_bkey, -1);
165  break;
166  case kEEp:
167  binMap = getBinMapEE_(_bkey, 1);
168  break;
169  case kEEMEM:
170  binMap = getBinMapEEMEM_(_bkey);
171  break;
172  case kSM:
173  binMap = getBinMapSM_(_bkey);
174  break;
175  case kSMMEM:
176  binMap = getBinMapSMMEM_(_bkey);
177  break;
178  case kEcal:
179  binMap = getBinMapEcal_(_bkey);
180  break;
181  default:
182  return 0;
183  }
184 
185  if(verbosity_ > 0){
186  std::cout << "EcalDQMBinningService: Booked new binMap for " << int(_okey) << " " << int(_bkey);
187  std::cout << " (Current memory usage: ";
188  int bytes(0);
189  for(unsigned iO(0); iO < nPlotType; iO++)
190  for(unsigned iB(0); iB < nPresetBinnings; iB++)
191  bytes += binMaps_[iO][iB].size() * sizeof(int);
192  std::cout << bytes / 1024. << "kB)" << std::endl;
193  }
194 
195  return binMap;
196 }
197 
198 std::pair<unsigned, std::vector<int> >
200 {
201  using namespace std;
202 
203  if(_otype == cacheOtype_ && _btype == cacheBtype_ && _id == cacheId_) return cache_;
204 
205  pair<unsigned, std::vector<int> > ret(-1, std::vector<int>(0));
206 
207  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return ret;
208 
209  ret.first = findOffset(_otype, _id);
210  if(ret.first == unsigned(-1)) return ret;
211 
212  // bring up the appropriate dictionary
213  ObjectType okey(objectFromOffset(_otype, ret.first));
214  BinningType bkey(_btype);
215 
216  if(okey == nObjType) return ret;
217 
218  const std::vector<int>* binMap(getBinMap(okey, bkey));
219  if(binMap == 0) return ret;
220 
221  switch(bkey){
222  case kCrystal:
223  findBinsCrystal_(_id, okey, *binMap, ret.second);
224  break;
225  case kTriggerTower:
226  findBinsTriggerTower_(_id, okey, *binMap, ret.second);
227  break;
228  case kSuperCrystal:
229  findBinsSuperCrystal_(_id, okey, *binMap, ret.second);
230  break;
231  case kDCC:
232  findBinsDCC_(_id, okey, *binMap, ret.second);
233  break;
234  case kTCC:
235  findBinsTCC_(_id, okey, *binMap, ret.second);
236  break;
237  case kProjEta:
238  findBinsProjEta_(_id, okey, *binMap, ret.second);
239  break;
240  case kProjPhi:
241  findBinsProjPhi_(_id, okey, *binMap, ret.second);
242  default :
243  break;
244  }
245 
246  // binMap value differs from actual bin numbers for SM plots
247  if(_otype == kSM || _otype == kSMMEM){
248  for(vector<int>::iterator binItr(ret.second.begin()); binItr != ret.second.end(); ++binItr)
249  *binItr -= smOffsetBins(_otype, _btype, ret.first);
250  }
251 
252  cacheId_ = _id;
253  cacheOtype_ = _otype;
254  cacheBtype_ = _btype;
255  cache_ = ret;
256 
257  return ret;
258 }
259 
260 std::pair<unsigned, std::vector<int> >
262 {
263  return findBins(_otype, _btype, getElectronicsMap()->getDetId(_id));
264 }
265 
266 std::pair<unsigned, std::vector<int> >
267 EcalDQMBinningService::findBins(ObjectType _otype, BinningType _btype, unsigned _dcctccid) const
268 {
269  using namespace std;
270 
271  if(_otype == cacheOtype_ && _btype == cacheBtype_ && _dcctccid == cacheId_) return cache_;
272 
273  pair<unsigned, std::vector<int> > ret(-1, std::vector<int>(0));
274 
275  if(_btype != kTCC && _btype != kDCC) return ret;
276 
277  ret.first = findOffset(_otype, _btype, _dcctccid);
278 
279  if(ret.first == unsigned(-1)) return ret;
280 
281  // bring up the appropriate dictionary
282  ObjectType okey(objectFromOffset(_otype, ret.first));
283  BinningType bkey(_btype);
284 
285  const std::vector<int>* binMap(getBinMap(okey, bkey));
286  if(binMap == 0) return ret;
287 
288  unsigned index(_dcctccid - 1);
289 
290  if(bkey == kDCC){
291  if(okey == kEB) index -= kEBmLow;
292  else if(okey == kEE && index >= kEEpLow) index -= (kEBpHigh - kEEmHigh);
293  else if(okey == kEEp) index -= kEEpLow;
294  }
295  else{
296  if(okey == kEB) index -= kEBTCCLow;
297  else if(okey == kEE && index >= kEEpLow) index -= (kEBTCCHigh - kEEmTCCHigh);
298  else if(okey == kEEp) index -= kEEpTCCLow;
299  }
300 
301  ret.second.push_back(binMap->at(index));
302 
303  cacheId_ = _dcctccid;
304  cacheOtype_ = _otype;
305  cacheBtype_ = _btype;
306  cache_ = ret;
307 
308  return ret;
309 }
310 
311 std::pair<unsigned, std::vector<int> >
313 {
314  using namespace std;
315 
316  // Not yet implemented to scale to general cases
317  if(!((_otype == kSM && _btype == kSuperCrystal) ||
318  (_otype == kSM && _btype == kTriggerTower) ||
319  (_otype == kEcal2P && _btype == kDCC) ||
320  (_otype == kEcal2P && _btype == kTCC)))
321  throw cms::Exception("NotImplemented") << "1D bin finding only for SM - SC plots or Ecal2P - DCC plots" << std::endl;
322 
323  if(_otype == kEcal2P && (_btype == kDCC || _btype == kTCC))
324  return findBins(_otype, _btype, _id);
325 
326  pair<unsigned, std::vector<int> > ret(-1, std::vector<int>(0));
327 
328  ret.first = findOffset(_otype, _id);
329  if(ret.first == unsigned(-1)) return ret;
330 
331  if(_otype == kSM && _btype == kSuperCrystal)
332  ret.second.push_back(towerId(_id));
333  else if(_otype == kSM && _btype == kTriggerTower){
334  unsigned tccid(tccId(_id));
335  if(tccid >= 37 && tccid <= 72) // EB
336  ret.second.push_back(ttId(_id));
337  else{
338  unsigned bin(ttId(_id));
339  tccid = (tccid - 1) % 36;
340  bool outer(tccid >= 18);
341  tccid = (tccid + 1) % 18; // TCC numbering is shifted wrt DCC numbering by one
342  if(outer) bin += 48;
343  bin += (tccid % 2) * (outer ? 16 : 24);
344  ret.second.push_back(bin);
345  }
346  }
347 
348  return ret;
349 }
350 
351 std::pair<unsigned, std::vector<int> >
353 {
354  return findBinsNoMap(_otype, _btype, getElectronicsMap()->getDetId(_id));
355 }
356 
357 unsigned
359 {
360  if(_otype == cacheOtype_ && _id == cacheId_) return cache_.first;
361 
362  unsigned iSM(dccId(_id) - 1);
363 
364  if(_otype == kEcal3P){
365  if(iSM <= kEEmHigh) return findOffset(kEcal3P, kUser, (unsigned)kEEm + 1);
366  else if(iSM <= kEBpHigh) return findOffset(kEcal3P, kUser, (unsigned)kEB + 1);
367  else return findOffset(kEcal3P, kUser, (unsigned)kEEp + 1);
368  }
369  else if(_otype == kEcal2P){
370  if(iSM <= kEEmHigh) return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
371  else if(iSM <= kEBpHigh) return findOffset(kEcal2P, kUser, (unsigned)kEB + 1);
372  else return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
373  }
374  else if(_otype == kEcal)
375  return 0;
376  else if(_otype == kEcalMEM2P){
377  if(iSM <= kEEmHigh) return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
378  else if(iSM <= kEBpHigh) return findOffset(kEcal2P, kUser, (unsigned)kEB + 1);
379  else return findOffset(kEcal2P, kUser, (unsigned)kEE + 1);
380  }
381 
382  return findOffset(_otype, kDCC, iSM + 1);
383 }
384 
385 unsigned
387 {
388  return findOffset(_otype, getElectronicsMap()->getDetId(_id));
389 }
390 
391 unsigned
392 EcalDQMBinningService::findOffset(ObjectType _otype, BinningType _btype, unsigned _dcctccid) const
393 {
394  unsigned iSM(_dcctccid - 1);
395 
396  switch(_otype){
397  case kEB:
398  if(_btype == kDCC && iSM >= kEBmLow && iSM <= kEBpHigh) return 0;
399  else if(_btype == kTCC && iSM >= kEBTCCLow && iSM <= kEBTCCHigh) return 0;
400  return -1;
401  case kEE:
402  if(_btype == kDCC &&
403  (iSM <= kEEmHigh ||
404  (iSM >= kEEpLow && iSM <= kEEpHigh))) return 0;
405  else if(_btype == kTCC &&
406  (iSM <= kEEmTCCHigh ||
407  (iSM >= kEEpTCCLow && iSM <= kEEpTCCHigh))) return 0;
408  return -1;
409  case kEEm:
410  if(_btype == kDCC && iSM <= kEEmHigh) return 0;
411  else if(_btype == kTCC && iSM <= kEEmTCCHigh) return 0;
412  else return -1;
413  case kEEp:
414  if(_btype == kDCC && (iSM >= kEEpLow && iSM <= kEEpHigh)) return 0;
415  else if(_btype == kTCC && (iSM >= kEEpTCCLow && iSM <= kEEpTCCHigh)) return 0;
416  else return -1;
417  case kSM:
418  if(iSM < nDCC) return iSM;
419  else return -1;
420  case kSMMEM:
421  if(iSM < nDCC && dccNoMEM.find(iSM) == dccNoMEM.end()) return memDCCIndex(_dcctccid);
422  else return -1;
423  case kEcal:
424  if(_btype == kDCC && iSM < nDCC) return 0;
425  else if(_btype == kTCC && iSM < nTCC) return 0;
426  else if(_btype == kUser) return 0;
427  else return -1;
428  case kEcal2P:
429  {
430  int iSubdet(iSM);
431  if(_btype == kDCC){
432  if(iSM <= kEEmHigh) iSubdet = kEE;
433  else if(iSM <= kEBpHigh) iSubdet = kEB;
434  else iSubdet = kEE;
435  }
436  else if(_btype == kTCC){
437  if(iSM <= kEEmTCCHigh) iSubdet = kEE;
438  else if(iSM <= kEBTCCHigh) iSubdet = kEB;
439  else iSubdet = kEE;
440  }
441  if(iSubdet == kEE || iSubdet == kEEm || iSubdet == kEEp) return 0;
442  else if(iSubdet == kEB) return 1;
443  else return -1;
444  }
445  case kEcal3P:
446  {
447  int iSubdet(iSM);
448  if(_btype == kDCC){
449  if(iSM <= kEEmHigh) iSubdet = kEEm;
450  else if(iSM <= kEBpHigh) iSubdet = kEB;
451  else iSubdet = kEEp;
452  }
453  else if(_btype == kTCC){
454  if(iSM <= kEEmTCCHigh) iSubdet = kEEm;
455  else if(iSM <= kEBTCCHigh) iSubdet = kEB;
456  else iSubdet = kEEp;
457  }
458  if(iSubdet == kEEm) return 0;
459  else if(iSubdet == kEB) return 1;
460  else if(iSubdet == kEEp) return 2;
461  else return -1;
462  }
463  case kEcalMEM2P:
464  {
465  int iSubdet(iSM);
466  if(iSubdet == kEE || iSubdet == kEEm || iSubdet == kEEp) return 0;
467  else if(iSubdet == kEB) return 1;
468  else return -1;
469  }
470  default:
471  return -1;
472  }
473 }
474 
477 {
478  if(_otype == kEcal3P) {
479  switch(_offset){
480  case 0: return kEEm;
481  case 1: return kEB;
482  case 2: return kEEp;
483  default: return nObjType;
484  }
485  }
486  else if(_otype == kEcal2P){
487  switch(_offset){
488  case 0: return kEE;
489  case 1: return kEB;
490  default: return nObjType;
491  }
492  }
493  else if(_otype == kEcalMEM2P){
494  switch(_offset){
495  case 0: return kEEMEM;
496  case 1: return kEBMEM;
497  default: return nObjType;
498  }
499  }
500  else
501  return _otype;
502 }
503 
504 int
505 EcalDQMBinningService::smOffsetBins(ObjectType _otype, BinningType _btype, unsigned _offset) const
506 {
507  if(!_offset) return 0;
508 
509  switch(_otype) {
510  case kSM :
511  {
512  int bins(0);
513  int offset(_offset);
514 
515  if(offset > kEEpLow){
516  int ext(0);
517  if(offset > kEEp02) ext += 1;
518  if(offset > kEEp08) ext += 1;
519  int offBins(nEESMBins * (offset - kEEpLow) + (nEESMBinsExt - nEESMBins) * ext);
520  switch(_btype){
521  case kCrystal:
522  case kTriggerTower:
523  bins += offBins; break;
524  case kSuperCrystal:
525  bins += offBins / 25; break;
526  default:
527  break;
528  }
529  offset = kEEpLow;
530  }
531  if(offset > kEBmLow){
532  int offBins(nEBSMBins * (offset - kEBmLow));
533  switch(_btype){
534  case kCrystal:
535  bins += offBins; break;
536  case kTriggerTower:
537  case kSuperCrystal:
538  bins += offBins / 25; break;
539  default:
540  break;
541  }
542  offset = kEBmLow;
543  }
544  if(offset > kEEmLow){
545  int ext(0);
546  if(offset > kEEm02) ext += 1;
547  if(offset > kEEm08) ext += 1;
548  int offBins(nEESMBins * (offset - kEEmLow) + (nEESMBinsExt - nEESMBins) * ext);
549  switch(_btype){
550  case kCrystal:
551  case kTriggerTower:
552  bins += offBins; break;
553  case kSuperCrystal:
554  bins += offBins / 25; break;
555  default:
556  break;
557  }
558  }
559 
560  return bins;
561  }
562  case kSMMEM :
563  {
564  return _offset * 10;
565  }
566  default :
567  break;
568  }
569 
570  return 0;
571 }
572 
573 std::string
574 EcalDQMBinningService::channelName(uint32_t _rawId, BinningType _btype/* = kDCC*/) const
575 {
576  std::stringstream ss;
577 
578  switch(_btype){
579  case kCrystal:
580  {
581  // EB-03 DCC 12 CCU 12 strip 3 xtal 1 (EB ieta -13 iphi 60) (TCC 39 TT 12 pstrip 3 chan 1)
582  EcalElectronicsId eid(_rawId);
583  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId() << " strip " << eid.stripId() << " xtal " << eid.xtalId();
584  if(eid.towerId() >= 69) break;
585 
586  if(eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1){
587  EBDetId ebid(getElectronicsMap()->getDetId(eid));
588  ss << " (EB ieta " << std::showpos << ebid.ieta() << std::noshowpos << " iphi " << ebid.iphi() << ")";
589  }
590  else{
591  EEDetId eeid(getElectronicsMap()->getDetId(eid));
592  ss << " (EE ix " << eeid.ix() << " iy " << eeid.iy() << ")";
593  }
594  EcalTriggerElectronicsId teid(getElectronicsMap()->getTriggerElectronicsId(eid));
595  ss << " (TCC " << teid.tccId() << " TT " << teid.ttId() << " pstrip " << teid.pseudoStripId() << " chan " << teid.channelId() << ")";
596  break;
597  }
598  case kTriggerTower:
599  {
600  // EB-03 DCC 12 TCC 18 TT 3
601  EcalTriggerElectronicsId teid(_rawId);
602  EcalElectronicsId eid(getElectronicsMap()->getElectronicsId(teid));
603  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " TCC " << teid.tccId() << " TT " << teid.ttId();
604  break;
605  }
606  case kSuperCrystal:
607  {
608  // EB-03 DCC 12 CCU 18 (EBTT ieta -13 iphi 60)
609  EcalElectronicsId eid(_rawId);
610  ss << smName(eid.dccId()) << " DCC " << eid.dccId() << " CCU " << eid.towerId();
611  if(eid.dccId() >= kEBmLow + 1 && eid.dccId() <= kEBpHigh + 1){
612  EcalTrigTowerDetId ttid(EBDetId(getElectronicsMap()->getDetId(eid)).tower());
613  ss << " (EBTT ieta " << std::showpos << ttid.ieta() << std::noshowpos << " iphi " << ttid.iphi() << ")";
614  }
615  else{
616  EcalScDetId scid(EEDetId(getElectronicsMap()->getDetId(eid)).sc());
617  ss << " (EESC ix " << scid.ix() << " iy " << scid.iy() << ")";
618  }
619  break;
620  }
621  case kTCC:
622  {
623  // EB-03 TCC 12
624  int tccid(_rawId - nDCC);
625  int dccid(getElectronicsMap()->DCCid(getElectronicsMap()->getTrigTowerDetId(tccid, 1)));
626  ss << smName(dccid) << " TCC " << (_rawId - nDCC);
627  break;
628  }
629  case kDCC:
630  ss << smName(_rawId);
631  break;
632  default:
633  break;
634  }
635 
636  return ss.str();
637 }
638 
639 uint32_t
640 EcalDQMBinningService::idFromName(std::string const& _name) const
641 {
642  TString name(_name);
643  TPRegexp re("(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) ([0-9]+)(?: (?:TT|strip) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
644  // 1 2 3 4 5 6 7 8
645  uint32_t rawId(0);
646 
647  TObjArray* matches(re.MatchS(name));
648  if(matches->GetEntries() == 0) return 0;
649  else if(matches->GetEntries() == 3){
650  TString subdet(static_cast<TObjString*>(matches->At(1))->GetString());
651  if(subdet == "EB"){
652  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
653  unsigned offset(0);
654  if(dccid < 0){
655  dccid *= -1;
656  offset = kEEmLow;
657  }
658  else offset = kEEpLow;
659  rawId = (dccid + 2) % 9 + 1 + offset;
660  }
661  else{
662  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
663  if(dccid < 0) dccid *= -1;
664  else dccid += 18;
665  rawId = kEBmLow + dccid;
666  }
667  }
668  else if(matches->GetEntries() == 4)
669  rawId = static_cast<TObjString*>(matches->At(3))->GetString().Atoi() + nDCC;
670  else{
671  TString subtype(static_cast<TObjString*>(matches->At(5))->GetString());
672  if(subtype == "TCC"){
673  int tccid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
674  int ttid(static_cast<TObjString*>(matches->At(7))->GetString().Atoi());
675  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
676  }
677  else{
678  int dccid(static_cast<TObjString*>(matches->At(4))->GetString().Atoi());
679  int towerid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
680  if(matches->GetEntries() == 7)
681  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
682  else{
683  int stripid(static_cast<TObjString*>(matches->At(7))->GetString().Atoi());
684  int xtalid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
685  rawId = EcalElectronicsId(dccid, towerid, stripid, xtalid).rawId();
686  }
687  }
688  }
689 
690  delete matches;
691 
692  return rawId;
693 }
void watchPostBeginRun(PostBeginRun::slot_type const &iSlot)
std::vector< AxisSpecs > getBinningEBMEM_(BinningType, bool) const
const std::vector< int > * getBinMapSMMEM_(BinningType) const
unsigned memDCCIndex(unsigned)
std::string channelName(uint32_t, BinningType _btype=kDCC) const
std::vector< AxisSpecs > getBinningEcal_(BinningType, bool) const
const EcalElectronicsMapping * getElectronicsMap()
int ix() const
Definition: EEDetId.h:71
void findBinsDCC_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void setTrigTowerMap(const EcalTrigTowerConstituentsMap *)
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
int xtalId() const
get the channel id
const std::vector< int > * getBinMapEcal_(BinningType) const
int stripId() const
get the tower id
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
const std::vector< int > * getBinMap(ObjectType &, BinningType &) const
std::string smName(unsigned _dccId)
std::vector< AxisSpecs > getBinning(ObjectType, BinningType, bool _isMap=true, unsigned _objOffset=0) const
int towerId() const
get the tower id
unsigned dccId(const DetId &)
std::vector< AxisSpecs > getBinningSMMEM_(BinningType, bool, unsigned) const
void findBinsTCC_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
const std::vector< int > * getBinMapEE_(BinningType, int) const
int channelId() const
get the channel id
int ieta() const
get the tower ieta
ObjectType objectFromOffset(ObjectType, unsigned) const
int iphi() const
get the crystal iphi
Definition: EBDetId.h:46
const std::vector< int > * getBinMapEEMEM_(BinningType) const
void findBinsProjPhi_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void findBinsCrystal_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
void setElectronicsMap(const EcalElectronicsMapping *)
unsigned towerId(const DetId &)
void findBinsSuperCrystal_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
std::vector< AxisSpecs > getBinningEE_(BinningType, bool, int) const
int ix() const
Definition: EcalScDetId.h:72
void postBeginRun(const edm::Run &, const edm::EventSetup &)
int ttId() const
get the tower id
std::vector< int > binMaps_[nPlotType][nPresetBinnings]
const std::vector< int > * getBinMapSM_(BinningType) const
unsigned findOffset(ObjectType, const DetId &) const
std::vector< AxisSpecs > getBinningEB_(BinningType, bool) const
int iy() const
Definition: EEDetId.h:77
int ieta() const
get the crystal ieta
Definition: EBDetId.h:44
unsigned int offset(bool)
std::pair< unsigned, std::vector< int > > findBinsNoMap(ObjectType, BinningType, const DetId &) const
int pseudoStripId() const
get the tower id
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
int iy() const
Definition: EcalScDetId.h:78
EcalDQMBinningService(const edm::ParameterSet &, edm::ActivityRegistry &)
uint32_t rawId() const
const std::set< unsigned > dccNoMEM
const std::vector< int > * getBinMapEB_(BinningType) const
Definition: DetId.h:20
int iphi() const
get the tower iphi
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
const std::vector< int > * getBinMapEBMEM_(BinningType) const
unsigned tccId(const DetId &)
unsigned ttId(const DetId &)
uint32_t idFromName(std::string const &) const
std::pair< unsigned, std::vector< int > > findBins(ObjectType, BinningType, const DetId &) const
void findBinsTriggerTower_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
const CaloGeometry * geometry_
tuple cout
Definition: gather_cfg.py:121
std::vector< AxisSpecs > getBinningSM_(BinningType, bool, unsigned) const
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
std::pair< unsigned, std::vector< int > > cache_
tuple size
Write out results.
int smOffsetBins(ObjectType, BinningType, unsigned) const
void findBinsProjEta_(const DetId &, ObjectType, const std::vector< int > &, std::vector< int > &) const
Definition: Run.h:33
std::vector< AxisSpecs > getBinningEEMEM_(BinningType, bool) const