67 unsigned tccid(
tccId(_id));
68 if(tccid <= 36 || tccid >= 73){
70 bool outer((tccid >= 19 && tccid <= 36) || (tccid >= 73 && tccid <= 90));
72 bin += (tccid % 2) * (outer ? 16 : 24);
83 else if(_btype ==
kTCC)
89 return dccId(_id) - 9;
90 else if(_btype ==
kTCC)
91 return tccId(_id) - 36;
97 else if(_btype ==
kTCC)
103 return dccId(_id) - 45;
104 else if(_btype ==
kTCC)
105 return tccId(_id) - 72;
111 if(bin >= 46) bin -= 36;
114 else if(_btype ==
kTCC){
116 if(bin >= 72) bin -= 36;
145 unsigned tccid(
tccId(_id));
146 if(tccid <= 36 || tccid >= 73){
148 bool outer((tccid >= 19 && tccid <= 36) || (tccid >= 73 && tccid <= 90));
150 bin += (tccid % 2) * (outer ? 16 : 24);
161 else if(_btype ==
kTCC)
167 return dccId(_id) - 9;
168 else if(_btype ==
kTCC)
169 return tccId(_id) - 36;
175 else if(_btype ==
kTCC)
181 return dccId(_id) - 45;
182 else if(_btype ==
kTCC)
183 return tccId(_id) - 72;
189 if(bin >= 46) bin -= 36;
192 else if(_btype ==
kTCC){
194 if(bin >= 72) bin -= 36;
211 else if(_otype ==
kEcal && _btype ==
kTCC)
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)
219 else if(_otype ==
kEEm && _btype ==
kTCC)
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;
279 if(_otype !=
kEcal || _btype !=
kDCC)
return 0;
282 unsigned iDCC(_dccid - 1);
284 if(iDCC <= kEEmHigh || iDCC >=
kEEpLow) xbin = (iDCC + 6) % nbinsX + 1;
285 else xbin = iDCC % nbinsX + 1;
286 int ybin(6 - iDCC / nbinsX);
288 return (nbinsX + 2) * ybin + xbin;
303 if(
zside(_id) > 0)
return 2;
315 if(
zside(_id) > 0)
return 1;
320 unsigned iDCC(
dccId(_id) - 1);
344 int iSM(_dcctccid - 1);
373 if(iSM <= kEEmHigh || iSM >=
kEEpLow)
return 0;
376 else if(_btype ==
kTCC){
377 if(iSM <= kEEmTCCHigh || iSM >=
kEEpTCCLow)
return 0;
391 else if(_btype ==
kTCC){
414 if(iSM <= kEEmHigh || iSM >=
kEEpLow)
return 0;
417 else if(_btype ==
kTCC)
return -1;
419 if(iSM ==
kEB)
return 1;
493 if(_otype ==
kEEm || _otype ==
kEEp){
499 else if(_otype ==
kEE){
502 if(ix > 100) ix = (ix - 100) % 101;
507 if(ix > 20) ix = (ix - 20) % 21;
511 else if(_otype ==
kSM || _otype ==
kEESM){
521 int ix(_bin % (nX + 2) +
xlow_(iSM));
522 int iy(_bin / (nX + 2) +
ylow_(iSM));
530 int ix(_bin % (nX + 2) +
xlow_(iSM) / 5);
531 int iy(_bin / (nX + 2) +
ylow_(iSM) / 5);
550 std::stringstream
ss;
564 ss <<
" (EB ieta " << std::showpos << ebid.
ieta() << std::noshowpos <<
" iphi " << ebid.
iphi() <<
")";
568 ss <<
" (EE ix " << eeid.
ix() <<
" iy " << eeid.
iy() <<
")";
590 ss <<
" (EBTT ieta " << std::showpos << ttid.
ieta() << std::noshowpos <<
" iphi " << ttid.
iphi() <<
")";
594 ss <<
" (EESC ix " << scid.
ix() <<
" iy " << scid.
iy() <<
")";
601 int tccid(_rawId -
nDCC);
603 ss <<
smName(dccid) <<
" TCC " << (_rawId -
nDCC);
620 TPRegexp re(
"(EB|EE)([+-][0-9][0-9])(?: TCC ([0-9]+)| DCC ([0-9]+) (CCU|TCC) ([0-9]+)(?: (TT|strip|PN) ([0-9]+)(?: xtal ([0-9]+)|)|)|)");
624 TObjArray*
matches(re.MatchS(name));
626 if(
matches->GetEntries() == 0)
return 0;
627 else if(
matches->GetEntries() == 3){
628 TString subdet(static_cast<TObjString*>(
matches->At(1))->GetString());
630 int dccid(static_cast<TObjString*>(
matches->At(2))->GetString().Atoi());
637 rawId = (dccid + 2) % 9 + 1 + offset;
640 int dccid(static_cast<TObjString*>(
matches->At(2))->GetString().Atoi());
641 if(dccid < 0) dccid *= -1;
646 else if(
matches->GetEntries() == 4)
647 rawId = static_cast<TObjString*>(
matches->At(3))->GetString().Atoi() +
nDCC;
649 TString subtype(static_cast<TObjString*>(
matches->At(5))->GetString());
650 if(subtype ==
"TCC"){
651 int tccid(static_cast<TObjString*>(
matches->At(6))->GetString().Atoi());
652 int ttid(static_cast<TObjString*>(
matches->At(8))->GetString().Atoi());
656 int dccid(static_cast<TObjString*>(
matches->At(4))->GetString().Atoi());
657 int towerid(static_cast<TObjString*>(
matches->At(6))->GetString().Atoi());
661 TString chType(static_cast<TObjString*>(
matches->At(7))->GetString());
662 int stripOrPNid(static_cast<TObjString*>(
matches->At(8))->GetString().Atoi());
665 else if(chType ==
"strip"){
666 int xtalid(static_cast<TObjString*>(
matches->At(9))->GetString().Atoi());
684 int ieta(_bin / 362 - 86);
685 if(ieta >= 0) ++ieta;
686 return EBDetId(ieta, _bin % 362);
689 int ieta(_bin / 74 - 17);
698 else if(_otype ==
kEEm || _otype ==
kEEp){
699 int z(_otype ==
kEEm ? -1 : 1);
705 else if(_otype ==
kEE){
708 int z(ix > 100 ? 1 : -1);
709 if(z > 0) ix = (ix - 100) % 101;
714 int z(ix > 20 ? 1 : -1);
715 if(z > 0) ix = (ix - 20) % 21;
719 else if(_otype ==
kSM || _otype ==
kEBSM || _otype ==
kEESM){
721 if(_otype ==
kEBSM) iSM += 9;
728 int iphi(((iSM - 9) % 18) * 20 + (z < 0 ? _bin / 87 : 21 - _bin / 87));
729 int ieta((_bin % 87) * z);
733 int iphi((((iSM - 9) % 18) * 4 + (z < 0 ? _bin / 19 : 5 - _bin / 19) + 69) % 72 + 1);
762 if(_axisParams.
existsAs<std::vector<double> >(
"edges",
false)){
764 axis.
nbins = vEdges.size() - 1;
765 axis.
edges =
new float[vEdges.size()];
771 bool highSet(_axisParams.
existsAs<
double>(
"high",
false));
772 bool perBinSet(_axisParams.
existsAs<
double>(
"unitsPerBin",
false));
774 if(perBinSet)
edm::LogWarning(
"EcalDQM") <<
"Maximum and bin width both set in an axis; using the former";
783 if(_axisParams.
existsAs<std::vector<std::string> >(
"labels",
false)){
785 if(
int(labels.size()) == axis.
nbins){
787 for(
int iB(0); iB != axis.
nbins; ++iB)
788 axis.
labels[iB] = labels[iB];
811 if(_otypeName ==
"EB")
return kEB;
812 else if(_otypeName ==
"EE")
return kEE;
813 else if(_otypeName ==
"EEm")
return kEEm;
814 else if(_otypeName ==
"EEp")
return kEEp;
815 else if(_otypeName ==
"SM")
return kSM;
816 else if(_otypeName ==
"EBSM")
return kEBSM;
817 else if(_otypeName ==
"EESM")
return kEESM;
818 else if(_otypeName ==
"SMMEM")
return kSMMEM;
819 else if(_otypeName ==
"EBSMMEM")
return kEBSMMEM;
820 else if(_otypeName ==
"EESMMEM")
return kEESMMEM;
821 else if(_otypeName ==
"Ecal")
return kEcal;
822 else if(_otypeName ==
"MEM")
return kMEM;
823 else if(_otypeName ==
"EBMEM")
return kEBMEM;
824 else if(_otypeName ==
"EEMEM")
return kEEMEM;
825 else if(_otypeName ==
"Ecal2P")
return kEcal2P;
826 else if(_otypeName ==
"Ecal3P")
return kEcal3P;
827 else if(_otypeName ==
"EE2P")
return kEE2P;
828 else if(_otypeName ==
"MEM2P")
return kMEM2P;
829 else if(_otypeName ==
"Channel")
return kChannel;
830 else if(_otypeName ==
"None")
return nObjType;
832 throw cms::Exception(
"InvalidConfiguration") <<
"No object type " << _otypeName <<
" defined";
838 if(_btypeName ==
"Crystal")
return kCrystal;
841 else if(_btypeName ==
"PseudoStrip")
return kPseudoStrip;
842 else if(_btypeName ==
"TCC")
return kTCC;
843 else if(_btypeName ==
"DCC")
return kDCC;
844 else if(_btypeName ==
"ProjEta")
return kProjEta;
845 else if(_btypeName ==
"ProjPhi")
return kProjPhi;
846 else if(_btypeName ==
"RCT")
return kRCT;
847 else if(_btypeName ==
"User")
return kUser;
848 else if(_btypeName ==
"Report")
return kReport;
849 else if(_btypeName ==
"Trend")
return kTrend;
851 throw cms::Exception(
"InvalidConfiguration") <<
"No binning type " << _btypeName <<
" defined";
static bool validDetId(int ix, int iy, int iz)
int findBinCrystal_(ObjectType, DetId const &, int=-1)
unsigned memDCCIndex(unsigned)
T getUntrackedParameter(std::string const &, T const &) const
int findBinRCT_(ObjectType, DetId const &)
int findBinTriggerTower_(ObjectType, DetId const &)
bool existsAs(std::string const ¶meterName, bool trackiness=true) const
checks if a parameter exists as a given type
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
int xtalId() const
get the channel id
ParameterDescriptionBase * addUntracked(U const &iLabel, T const &value)
int stripId() const
get the tower id
bool isValidIdBin(ObjectType, BinningType, unsigned, int)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
unsigned getNObjects(ObjectType)
EcalElectronicsMapping const * getElectronicsMap()
unsigned tccId(DetId const &)
int towerId() const
get the tower id
ObjectType getObject(ObjectType, unsigned)
unsigned ttId(DetId const &)
int channelId() const
get the channel id
int ieta() const
get the tower ieta
ObjectType translateObjectType(std::string const &)
int iphi() const
get the crystal iphi
AxisSpecs getBinning(ObjectType, BinningType, bool, int, unsigned)
uint32_t rawId() const
get the raw id
bool isEndcapTTId(DetId const &)
int iPnId() const
get the PnId
int findBinSuperCrystal_(ObjectType, DetId const &, int=-1)
int ttId() const
get the tower id
AxisSpecs getBinningSMMEM_(BinningType, bool, unsigned, int)
ParameterDescriptionNode * addOptionalNode(ParameterDescriptionNode const &node, bool writeToCfi)
AxisSpecs getBinningEB_(BinningType, bool, int)
int ieta() const
get the crystal ieta
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
uint32_t idFromName(std::string const &)
int pseudoStripId() const
get the tower id
AxisSpecs getBinningSM_(BinningType, bool, unsigned, int)
int findBin1D(ObjectType, BinningType, DetId const &)
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
unsigned towerId(DetId const &)
std::string channelName(uint32_t, BinningType _btype=kDCC)
int iphi() const
get the tower iphi
std::string smName(unsigned)
int findBin2D(ObjectType, BinningType, DetId const &)
unsigned findPlotIndex(ObjectType, DetId const &)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
AxisSpecs getBinningEE_(BinningType, bool, int, int)
void fillAxisDescriptions(edm::ParameterSetDescription &)
MonitorElement::Kind translateKind(std::string const &)
int findBinPseudoStrip_(ObjectType, DetId const &)
ParameterDescriptionBase * addOptionalUntracked(U const &iLabel, T const &value)
BinningType translateBinningType(std::string const &)
AxisSpecs formAxis(edm::ParameterSet const &)
AxisSpecs getBinningMEM_(BinningType, bool, int, int)
unsigned dccId(DetId const &)
AxisSpecs getBinningEcal_(BinningType, bool, int)
Ecal trigger electronics identification [32:20] Unused (so far) [19:13] TCC id [12:6] TT id [5:3] pse...
uint32_t idFromBin(ObjectType, BinningType, unsigned, int)