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 555 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().

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

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

Referenced by ecaldqm::fillMESetDescriptions().

813  {
814  _desc.addUntracked<std::string>("title", "");
815  _desc.addUntracked<int>("nbins", 0);
816  _desc.addUntracked<double>("low", 0.);
817  _desc.addOptionalNode(edm::ParameterDescription<double>("high", 0., false) ^ edm::ParameterDescription<double>("unitsPerBin", 0., false), false);
818  _desc.addOptionalUntracked<std::vector<double> >("edges");
819  _desc.addOptionalUntracked<std::vector<std::string> >("labels");
820  }
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, ecaldqm::nTTInner, ecaldqm::nTTOuter, SurfaceOrientation::outer, ecaldqm::tccId(), ecaldqm::towerId(), and ecaldqm::ttId().

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

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

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

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

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

222  {
223  if(_otype == kEcal && _btype == kDCC)
224  return _dcctccid;
225  else if(_otype == kEcal && _btype == kTCC)
226  return _dcctccid;
227  if(_otype == kEB && _btype == kDCC)
228  return _dcctccid - 9;
229  else if(_otype == kEB && _btype == kTCC)
230  return _dcctccid - 36;
231  else if(_otype == kEEm && _btype == kDCC)
232  return _dcctccid;
233  else if(_otype == kEEm && _btype == kTCC)
234  return _dcctccid;
235  else if(_otype == kEEp && _btype == kDCC)
236  return _dcctccid - 45;
237  else if(_otype == kEEp && _btype == kTCC)
238  return _dcctccid - 72;
239  else if(_otype == kEE && _btype == kDCC)
240  return _dcctccid <= 9 ? _dcctccid : _dcctccid - 36;
241  else if(_otype == kEE && _btype == kTCC)
242  return _dcctccid <= 36 ? _dcctccid : _dcctccid - 36;
243 
244  return 0;
245  }
int ecaldqm::binning::findBin2D ( ObjectType  _otype,
BinningType  _btype,
DetId const &  _id 
)

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

249  {
250  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return 0;
251 
252  switch(_btype){
253  case kCrystal:
254  return findBinCrystal_(_otype, _id);
255  break;
256  case kTriggerTower:
257  return findBinTriggerTower_(_otype, _id);
258  break;
259  case kSuperCrystal:
260  return findBinSuperCrystal_(_otype, _id);
261  break;
262  case kPseudoStrip:
263  return findBinPseudoStrip_(_otype, _id);
264  break;
265  case kRCT:
266  return findBinRCT_(_otype, _id);
267  break;
268  default :
269  return 0;
270  }
271  }
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 274 of file MESetBinningUtils.cc.

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

275  {
276  if(_otype >= nObjType || _btype >= unsigned(nPresetBinnings)) return 0;
277 
278  switch(_btype){
279  case kCrystal:
280  return findBinCrystal_(_otype, _id);
281  break;
282  case kSuperCrystal:
283  return findBinSuperCrystal_(_otype, _id);
284  break;
285  default :
286  return 0;
287  }
288  }
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 291 of file MESetBinningUtils.cc.

References kDCC, kEcal, and ecaldqm::kEEpLow.

292  {
293  if(_otype != kEcal || _btype != kDCC) return 0;
294 
295  int nbinsX(9);
296  unsigned iDCC(_dccid - 1);
297  int xbin(0);
298  if(iDCC <= kEEmHigh || iDCC >= kEEpLow) xbin = (iDCC + 6) % nbinsX + 1;
299  else xbin = iDCC % nbinsX + 1;
300  int ybin(6 - iDCC / nbinsX);
301 
302  return (nbinsX + 2) * ybin + xbin;
303  }
int ecaldqm::binning::findBinCrystal_ ( ObjectType  _otype,
DetId const &  _id,
int  _iSM = -1 
)

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

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

Definition at line 502 of file MESetBinningUtils2.cc.

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

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

Definition at line 570 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D().

570  {
571 
572  int xbin(0);
573  int ybin(0);
574  int nbinsX(0);
575  int subdet(_id.subdetId());
576 
577  if((subdet == EcalTriggerTower && !isEndcapTTId(_id)) || subdet == EcalBarrel){
578  return findBinTriggerTower_(_otype, _id);
579  }
580  else if(subdet == EcalEndcap){
581  unsigned tccid(tccId(_id));
582  unsigned iSM(tccid <= 36 ? tccid % 18 / 2 : (tccid - 72) % 18 / 2);
583  return findBinCrystal_(_otype, _id, iSM);
584  }
585 
586  return (nbinsX + 2) * ybin + xbin;
587  }
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 508 of file MESetBinningUtils2.cc.

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

Referenced by findBin2D().

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

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

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

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

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

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

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

307  {
308  if(getNObjects(_otype) == 1) return 0;
309 
310  switch(_otype){
311  case kEcal3P:
312  if(_id.subdetId() == EcalBarrel) return 1;
313  else if(_id.subdetId() == EcalEndcap && zside(_id) > 0) return 2;
314  else if(_id.subdetId() == EcalTriggerTower){
315  if(!isEndcapTTId(_id)) return 1;
316  else{
317  if(zside(_id) > 0) return 2;
318  else return 0;
319  }
320  }
321  else return 0;
322 
323  case kEcal2P:
324  if(_id.subdetId() == EcalBarrel) return 1;
325  else if(_id.subdetId() == EcalTriggerTower && !isEndcapTTId(_id)) return 1;
326  else return 0;
327 
328  case kEE2P:
329  if(zside(_id) > 0) return 1;
330  else return 0;
331 
332  case kMEM2P:
333  if(_id.subdetId() == EcalLaserPnDiode){
334  unsigned iDCC(dccId(_id) - 1);
335  if(iDCC >= kEBmLow && iDCC <= kEBpHigh) return 1;
336  else return 0;
337  }
338  else return -1;
339 
340  default:
341  return findPlotIndex(_otype, dccId(_id));
342  }
343  }
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 346 of file MESetBinningUtils.cc.

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

347  {
348  if(getNObjects(_otype) == 1) return 0;
349 
350  return findPlotIndex(_otype, _id.dccId());
351  }
unsigned getNObjects(ObjectType)
unsigned findPlotIndex(ObjectType, DetId const &)
unsigned ecaldqm::binning::findPlotIndex ( ObjectType  _otype,
int  _dcctccid,
BinningType  _btype = kDCC 
)

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

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

Definition at line 772 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_25ns10e33_v2_cff::labels, ecaldqm::binning::AxisSpecs::low, ecaldqm::binning::AxisSpecs::nbins, AlCaHLTBitMon_QueryRunRegistry::string, and ecaldqm::binning::AxisSpecs::title.

Referenced by ecaldqm::createMESet().

773  {
774  AxisSpecs axis;
775 
776  if(_axisParams.existsAs<std::vector<double> >("edges", false)){
777  std::vector<double> const& vEdges(_axisParams.getUntrackedParameter<std::vector<double> >("edges"));
778  axis.nbins = vEdges.size() - 1;
779  axis.edges = new float[vEdges.size()];
780  std::copy(vEdges.begin(), vEdges.end(), axis.edges);
781  }
782  else{
783  axis.nbins = _axisParams.getUntrackedParameter<int>("nbins");
784  axis.low = _axisParams.getUntrackedParameter<double>("low");
785  bool highSet(_axisParams.existsAs<double>("high", false));
786  bool perBinSet(_axisParams.existsAs<double>("unitsPerBin", false));
787  if(highSet){
788  if(perBinSet) edm::LogWarning("EcalDQM") << "Maximum and bin width both set in an axis; using the former";
789  axis.high = _axisParams.getUntrackedParameter<double>("high");
790  }
791  else if(perBinSet)
792  axis.high = axis.low + _axisParams.getUntrackedParameter<double>("unitsPerBin") * axis.nbins;
793  else
794  axis.high = 0.;
795  }
796 
797  if(_axisParams.existsAs<std::vector<std::string> >("labels", false)){
798  std::vector<std::string> const& labels(_axisParams.getUntrackedParameter<std::vector<std::string> >("labels"));
799  if(int(labels.size()) == axis.nbins){
800  axis.labels = new std::string[axis.nbins];
801  for(int iB(0); iB != axis.nbins; ++iB)
802  axis.labels[iB] = labels[iB];
803  }
804  }
805 
806  axis.title = _axisParams.getUntrackedParameter<std::string>("title");
807 
808  return axis;
809  }
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 305 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().

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

References EcalBarrel, EcalEndcap, ecaldqm::binning::AxisSpecs::high, kCrystal, ecaldqm::binning::AxisSpecs::low, hlt_dqm_clientPB-live_cfg::nbins, ecaldqm::binning::AxisSpecs::nbins, and ecaldqm::binning::AxisSpecs::title.

Referenced by getBinning().

382  {
383  AxisSpecs specs;
384 
385  if(_btype != kCrystal) return specs;
386 
387  int nbins(44);
388  if(_subdet == EcalBarrel) nbins = 36;
389  else if(_subdet == EcalEndcap) nbins = 8;
390 
391  if(_axis == 1){
392  specs.nbins = nbins;
393  specs.low = 0.;
394  specs.high = nbins;
395  }
396  else if(_axis == 2){
397  specs.nbins = 10;
398  specs.low = 0.;
399  specs.high = 10.;
400  specs.title = "iPN";
401  }
402 
403  return specs;
404  }
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::nTTInner, ecaldqm::nTTOuter, 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 : (2*nTTOuter + 2*nTTInner); // For EE: numbering of bins
218  // is in the order (inner1, inner2, outer1, outer2). ("inner"" := closer to the beam)
219  specs.low = 1.;
220  specs.high = specs.nbins + specs.low;
221  specs.title = "tower";
222  break;
223  case kSuperCrystal:
224  specs.nbins = isBarrel ? 68 : nSuperCrystals(iSM + 1);
225  specs.low = 1.;
226  specs.high = specs.nbins + specs.low;
227  specs.title = "tower";
228  break;
229  default:
230  break;
231  }
232  }else{
233  int nEEX(nEESMX);
234  int nEEY(nEESMY);
235  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nEEX = nEESMXExt;
236  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nEEX = nEESMXRed;
237  if(iSM == kEEm03 || iSM == kEEm07 || iSM == kEEp03 || iSM == kEEp07) nEEY = nEESMYRed;
238 
239  switch(_btype){
240  case kCrystal:
241  if(_axis == 1)
242  specs.nbins = isBarrel ? nEBSMEta : nEEX;
243  else if(_axis == 2)
244  specs.nbins = isBarrel ? nEBSMPhi : nEEY;
245  break;
246  case kTriggerTower:
247  case kPseudoStrip:
248  if(_axis == 1)
249  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX;
250  else if(_axis == 2)
251  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY;
252  break;
253  case kSuperCrystal:
254  if(_axis == 1)
255  specs.nbins = isBarrel ? nEBSMEta / 5 : nEEX / 5;
256  else if(_axis == 2)
257  specs.nbins = isBarrel ? nEBSMPhi / 5 : nEEY / 5;
258  break;
259  default:
260  return specs;
261  }
262 
263  if(_axis == 1){
264  specs.low = xlow_(iSM);
265  specs.high = specs.low + (isBarrel ? nEBSMEta : nEEX);
266  specs.title = isBarrel ? (iSM < kEBpLow ? "-ieta" : "ieta") : "ix";
267  }
268  else if(_axis == 2){
269  specs.low = ylow_(iSM);
270  specs.high = specs.low + (isBarrel ? nEBSMPhi : nEEY);
271  specs.title = isBarrel ? "iphi" : "iy";
272  }
273  }
274 
275  return specs;
276  }
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 279 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().

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

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

477  {
478  switch(_otype){
479  case kSM:
480  return nDCC;
481  case kEBSM:
482  return nEBDCC;
483  case kEESM:
484  return nEEDCC;
485  case kSMMEM:
486  return nDCCMEM;
487  case kEBSMMEM:
488  return nEBDCC;
489  case kEESMMEM:
490  return nEEDCCMEM;
491  case kEcal2P:
492  return 2;
493  case kEcal3P:
494  return 3;
495  case kEE2P:
496  return 2;
497  case kMEM2P:
498  return 2;
499  default:
500  return 1;
501  }
502  }
ObjectType ecaldqm::binning::getObject ( ObjectType  _otype,
unsigned  _iObj 
)

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

443  {
444  switch(_otype){
445  case kEcal3P:
446  switch(_iObj){
447  case 0: return kEEm;
448  case 1: return kEB;
449  case 2: return kEEp;
450  default: return nObjType;
451  }
452  case kEcal2P:
453  switch(_iObj){
454  case 0: return kEE;
455  case 1: return kEB;
456  default: return nObjType;
457  }
458  case kEE2P:
459  switch(_iObj){
460  case 0: return kEEm;
461  case 1: return kEEp;
462  default: return nObjType;
463  }
464  case kMEM2P:
465  switch(_iObj){
466  case 0: return kEEMEM;
467  case 1: return kEBMEM;
468  default: return nObjType;
469  }
470  default:
471  return _otype;
472  }
473  }
uint32_t ecaldqm::binning::idFromBin ( ObjectType  _otype,
BinningType  _btype,
unsigned  _iME,
int  _bin 
)

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

695  {
696  if(_otype == kEB){
697  if(_btype == kCrystal){
698  int ieta(_bin / 362 - 86);
699  if(ieta >= 0) ++ieta;
700  return EBDetId(ieta, _bin % 362);
701  }
702  else if(_btype == kTriggerTower || _btype == kSuperCrystal){
703  int ieta(_bin / 74 - 17);
704  int z(1);
705  if(ieta <= 0){
706  z = -1;
707  ieta = -ieta + 1;
708  }
709  return EcalTrigTowerDetId(z, EcalBarrel, ieta, (_bin % 74 + 69) % 72 + 1);
710  }
711  }
712  else if(_otype == kEEm || _otype == kEEp){
713  int z(_otype == kEEm ? -1 : 1);
714  if(_btype == kCrystal || _btype == kTriggerTower)
715  return EEDetId(_bin % 102, _bin / 102, z).rawId();
716  else if(_btype == kSuperCrystal)
717  return EcalScDetId(_bin % 22, _bin / 22, z).rawId();
718  }
719  else if(_otype == kEE){
720  if(_btype == kCrystal || _btype == kTriggerTower){
721  int ix(_bin % 202);
722  int z(ix > 100 ? 1 : -1);
723  if(z > 0) ix = (ix - 100) % 101;
724  return EEDetId(ix, _bin / 202, z).rawId();
725  }
726  else if(_btype == kSuperCrystal){
727  int ix(_bin % 42);
728  int z(ix > 20 ? 1 : -1);
729  if(z > 0) ix = (ix - 20) % 21;
730  return EcalScDetId(ix, _bin / 42, z).rawId();
731  }
732  }
733  else if(_otype == kSM || _otype == kEBSM || _otype == kEESM){
734  unsigned iSM(_iME);
735  if(_otype == kEBSM) iSM += 9;
736  else if(_otype == kEESM && iSM > kEEmHigh) iSM += nEBDCC;
737 
738  int z(iSM <= kEBmHigh ? -1 : 1);
739 
740  if((iSM >= kEBmLow && iSM <= kEBmHigh) || (iSM >= kEBpLow && iSM <= kEBpHigh)){
741  if(_btype == kCrystal){
742  int iphi(((iSM - 9) % 18) * 20 + (z < 0 ? _bin / 87 : 21 - _bin / 87));
743  int ieta((_bin % 87) * z);
744  return EBDetId(ieta, iphi).rawId();
745  }
746  else if(_btype == kTriggerTower || _btype == kSuperCrystal){
747  int iphi((((iSM - 9) % 18) * 4 + (z < 0 ? _bin / 19 : 5 - _bin / 19) + 69) % 72 + 1);
748  int ieta(_bin % 19);
749  return EcalTrigTowerDetId(z, EcalBarrel, ieta, iphi).rawId();
750  }
751  }
752  else{
753  if(_btype == kCrystal || _btype == kTriggerTower){
754  int nX(nEESMX);
755  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt;
756  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed;
757  return EEDetId(_bin % (nX + 2) + xlow_(iSM), _bin / (nX + 2) + ylow_(iSM), z).rawId();
758  }
759  else if(_btype == kSuperCrystal){
760  int nX(nEESMX / 5);
761  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt / 5;
762  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed / 5;
763  return EcalScDetId(_bin % (nX + 2) + xlow_(iSM) / 5, _bin / (nX + 2) + ylow_(iSM) / 5, z).rawId();
764  }
765  }
766  }
767 
768  return 0;
769  }
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 631 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().

632  {
633  TString name(_name);
634  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]+)|)|)|)");
635  // 1 2 3 4 5 6 7 8 9
636  uint32_t rawId(0);
637 
638  TObjArray* matches(re.MatchS(name));
639  matches->SetOwner(true);
640  if(matches->GetEntries() == 0) return 0;
641  else if(matches->GetEntries() == 3){
642  TString subdet(static_cast<TObjString*>(matches->At(1))->GetString());
643  if(subdet == "EB"){
644  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
645  unsigned offset(0);
646  if(dccid < 0){
647  dccid *= -1;
648  offset = kEEmLow;
649  }
650  else offset = kEEpLow;
651  rawId = (dccid + 2) % 9 + 1 + offset;
652  }
653  else{
654  int dccid(static_cast<TObjString*>(matches->At(2))->GetString().Atoi());
655  if(dccid < 0) dccid *= -1;
656  else dccid += 18;
657  rawId = kEBmLow + dccid;
658  }
659  }
660  else if(matches->GetEntries() == 4)
661  rawId = static_cast<TObjString*>(matches->At(3))->GetString().Atoi() + nDCC;
662  else{
663  TString subtype(static_cast<TObjString*>(matches->At(5))->GetString());
664  if(subtype == "TCC"){
665  int tccid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
666  int ttid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
667  rawId = EcalTriggerElectronicsId(tccid, ttid, 1, 1).rawId();
668  }
669  else{
670  int dccid(static_cast<TObjString*>(matches->At(4))->GetString().Atoi());
671  int towerid(static_cast<TObjString*>(matches->At(6))->GetString().Atoi());
672  if(matches->GetEntries() == 7)
673  rawId = EcalElectronicsId(dccid, towerid, 1, 1).rawId();
674  else{
675  TString chType(static_cast<TObjString*>(matches->At(7))->GetString());
676  int stripOrPNid(static_cast<TObjString*>(matches->At(8))->GetString().Atoi());
677  if(chType == "PN")
678  rawId = EcalElectronicsId(dccid, towerid, 1, stripOrPNid).rawId();
679  else if(chType == "strip"){
680  int xtalid(static_cast<TObjString*>(matches->At(9))->GetString().Atoi());
681  rawId = EcalElectronicsId(dccid, towerid, stripOrPNid, xtalid).rawId();
682  }
683  // case "TT" is already taken care of
684  }
685  }
686  }
687 
688  delete matches;
689 
690  return rawId;
691  }
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 505 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().

506  {
507  if(_otype == kEEm || _otype == kEEp){
508  if(_btype == kCrystal || _btype == kTriggerTower)
509  return EEDetId::validDetId(_bin % 102, _bin / 102, 1);
510  else if(_btype == kSuperCrystal)
511  return EcalScDetId::validDetId(_bin % 22, _bin / 22, 1);
512  }
513  else if(_otype == kEE){
514  if(_btype == kCrystal || _btype == kTriggerTower){
515  int ix(_bin % 202);
516  if(ix > 100) ix = (ix - 100) % 101;
517  return EEDetId::validDetId(ix, _bin / 202, 1);
518  }
519  else if(_btype == kSuperCrystal){
520  int ix(_bin % 42);
521  if(ix > 20) ix = (ix - 20) % 21;
522  return EcalScDetId::validDetId(ix, _bin / 42, 1);
523  }
524  }
525  else if(_otype == kSM || _otype == kEESM){
526  unsigned iSM(_iME);
527  if(_otype == kEESM && iSM > kEEmHigh) iSM += nEBDCC;
528 
529  if(iSM >= kEBmLow && iSM <= kEBpHigh) return true;
530 
531  if(_btype == kCrystal || _btype == kTriggerTower){
532  int nX(nEESMX);
533  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt;
534  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed;
535  int ix(_bin % (nX + 2) + xlow_(iSM));
536  int iy(_bin / (nX + 2) + ylow_(iSM));
537  int z(iSM <= kEEmHigh ? -1 : 1);
538  return EEDetId::validDetId(ix, iy, 1) && iSM == dccId(EEDetId(ix, iy, z)) - 1;
539  }
540  else if(_btype == kSuperCrystal){
541  int nX(nEESMX / 5);
542  if(iSM == kEEm02 || iSM == kEEm08 || iSM == kEEp02 || iSM == kEEp08) nX = nEESMXExt / 5;
543  if(iSM == kEEm01 || iSM == kEEm05 || iSM == kEEm09 || iSM == kEEp01 || iSM == kEEp05 || iSM == kEEp09) nX = nEESMXRed / 5;
544  int ix(_bin % (nX + 2) + xlow_(iSM) / 5);
545  int iy(_bin / (nX + 2) + ylow_(iSM) / 5);
546  int z(iSM <= kEEmHigh ? -1 : 1);
547  return EcalScDetId::validDetId(ix, iy, z) && iSM == dccId(EcalScDetId(ix, iy, z)) - 1;
548  }
549  }
550 
551  return true;
552  }
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 850 of file MESetBinningUtils.cc.

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

Referenced by ecaldqm::createMESet().

851  {
852  if(_btypeName == "Crystal") return kCrystal;
853  else if(_btypeName == "TriggerTower") return kTriggerTower;
854  else if(_btypeName == "SuperCrystal") return kSuperCrystal;
855  else if(_btypeName == "PseudoStrip") return kPseudoStrip;
856  else if(_btypeName == "TCC") return kTCC;
857  else if(_btypeName == "DCC") return kDCC;
858  else if(_btypeName == "ProjEta") return kProjEta;
859  else if(_btypeName == "ProjPhi") return kProjPhi;
860  else if(_btypeName == "RCT") return kRCT;
861  else if(_btypeName == "User") return kUser;
862  else if(_btypeName == "Report") return kReport;
863  else if(_btypeName == "Trend") return kTrend;
864 
865  throw cms::Exception("InvalidConfiguration") << "No binning type " << _btypeName << " defined";
866  }
MonitorElement::Kind ecaldqm::binning::translateKind ( std::string const &  _kindName)
ObjectType ecaldqm::binning::translateObjectType ( std::string const &  _otypeName)

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

824  {
825  if(_otypeName == "EB") return kEB;
826  else if(_otypeName == "EE") return kEE;
827  else if(_otypeName == "EEm") return kEEm;
828  else if(_otypeName == "EEp") return kEEp;
829  else if(_otypeName == "SM") return kSM;
830  else if(_otypeName == "EBSM") return kEBSM;
831  else if(_otypeName == "EESM") return kEESM;
832  else if(_otypeName == "SMMEM") return kSMMEM;
833  else if(_otypeName == "EBSMMEM") return kEBSMMEM;
834  else if(_otypeName == "EESMMEM") return kEESMMEM;
835  else if(_otypeName == "Ecal") return kEcal;
836  else if(_otypeName == "MEM") return kMEM;
837  else if(_otypeName == "EBMEM") return kEBMEM;
838  else if(_otypeName == "EEMEM") return kEEMEM;
839  else if(_otypeName == "Ecal2P") return kEcal2P;
840  else if(_otypeName == "Ecal3P") return kEcal3P;
841  else if(_otypeName == "EE2P") return kEE2P;
842  else if(_otypeName == "MEM2P") return kMEM2P;
843  else if(_otypeName == "Channel") return kChannel;
844  else if(_otypeName == "None") return nObjType;
845 
846  throw cms::Exception("InvalidConfiguration") << "No object type " << _otypeName << " defined";
847  }
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  }