8 unsigned memarr[] = {
kEEm07,
kEEm08,
kEEm02,
kEEm03,
kEBm01,
kEBm02,
kEBm03,
kEBm04,
kEBm05,
kEBm06,
kEBm07,
9 kEBm08,
kEBm09,
kEBm10,
kEBm11,
kEBm12,
kEBm13,
kEBm14,
kEBm15,
kEBm16,
kEBm17,
kEBm18,
10 kEBp01,
kEBp02,
kEBp03,
kEBp04,
kEBp05,
kEBp06,
kEBp07,
kEBp08,
kEBp09,
kEBp10,
kEBp11,
11 kEBp12,
kEBp13,
kEBp14,
kEBp15,
kEBp16,
kEBp17,
kEBp18,
kEEp07,
kEEp08,
kEEp02,
kEEp03};
12 const std::vector<unsigned>
memDCC(memarr, memarr + 44);
33 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::dccId(" << _id.
rawId() <<
")" << std::endl;
43 if (_index >= memDCC.size())
45 return memDCC.at(_index) + 1;
49 std::vector<unsigned>::const_iterator itr(
std::find(memDCC.begin(), memDCC.end(), _dccid - 1));
50 if (itr == memDCC.end())
53 return (itr - memDCC.begin());
72 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::tccId(" << uint32_t(_id) <<
")" << std::endl;
93 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::towerId(" << std::hex << uint32_t(_id) <<
")" 111 throw cms::Exception(
"InvalidDetId") <<
"EcalDQMCommonUtils::ttId(" << std::hex << uint32_t(_id) <<
")" 122 if ((ic - 1) / 20 > 4 && (ic - 1) % 20 < 10)
125 unsigned iDCC(
dccId(_id) - 1);
133 std::pair<unsigned, unsigned>
innerTCCs(
unsigned _dccId) {
134 int iDCC(_dccId - 1);
135 std::pair<unsigned, unsigned>
res;
137 res.first = (iDCC -
kEEmLow) * 2;
140 res.second = (iDCC -
kEEmLow) * 2 + 1;
142 res.first = res.second = _dccId + 27;
144 res.first = (iDCC -
kEEpLow) * 2 + 90;
147 res.second = (iDCC -
kEEpLow) * 2 + 91;
153 std::pair<unsigned, unsigned>
outerTCCs(
unsigned _dccId) {
154 int iDCC(_dccId - 1);
155 std::pair<unsigned, unsigned>
res;
157 res.first = (iDCC -
kEEmLow) * 2 + 18;
160 res.second = (iDCC -
kEEmLow) * 2 + 19;
162 res.first = res.second = _dccId + 27;
164 res.first = (iDCC -
kEEpLow) * 2 + 72;
167 res.second = (iDCC -
kEEpLow) * 2 + 73;
174 std::vector<DetId>
res;
176 int ixbase((_scid.
ix() - 1) * 5);
177 int iybase((_scid.
iy() - 1) * 5);
179 for (
int ix(1); ix <= 5; ++ix) {
180 for (
int iy(1); iy <= 5; ++iy) {
182 res.push_back(
EEDetId(ixbase + ix, iybase + iy, _scid.
zside()));
194 return (((rawId >> 16) & 0
x1) == 1 ? 1 : -1);
196 return (((rawId >> 14) & 0
x1) == 1 ? 1 : -1);
198 return (((rawId >> 15) & 0
x1) == 1 ? 1 : -1);
200 return (((rawId >> 4) & 0x7f) >
kEBpLow ? 1 : -1);
203 <<
"EcalDQMCommonUtils::zside(" << std::hex << uint32_t(_id) <<
")" << std::endl;
216 const double degToRad(0.0174533);
217 return (_ebid.
iphi() - 10.5) * degToRad;
221 const double degToRad(0.0174533);
222 double p(std::atan2(_eeid.
ix() - 50.5, _eeid.
iy() - 50.5));
223 if (
p < -10. * degToRad)
224 p += 360. * degToRad;
229 const double degToRad(0.0174533);
230 double p((_ttid.
iphi() - 0.5) * 5. * degToRad);
231 if (
p > 350. * degToRad)
232 p -= 360. * degToRad;
237 const double degToRad(0.0174533);
238 if (_phi < -10. * degToRad)
239 _phi += 360. * degToRad;
250 return (scid.
ix() - 10) * (scid.
ix() - 10) + (scid.
iy() - 10) * (scid.
iy() - 10) < 25.;
253 return (eeid.
ix() - 50) * (eeid.
ix() - 50) + (eeid.
iy() - 50) * (eeid.
iy() - 50) < 625.;
275 unsigned smNumber(std::atoi(_smName.substr(3).c_str()));
277 if (_smName.find(
"EE-") == 0)
278 return kEEmLow + 1 + ((smNumber + 2) % 9);
279 else if (_smName.find(
"EB-") == 0)
281 else if (_smName.find(
"EB+") == 0)
283 else if (_smName.find(
"EE+") == 0)
284 return kEEpLow + 1 + ((smNumber + 2) % 9);
290 std::stringstream ss;
292 unsigned iSM(_dccId - 1);
295 ss <<
"EE-" << std::setw(2) << std::setfill(
'0') << (((iSM -
kEEmLow + 6) % 9) + 1);
297 ss <<
"EB-" << std::setw(2) << std::setfill(
'0') << (iSM -
kEBmLow + 1);
299 ss <<
"EB+" << std::setw(2) << std::setfill(
'0') << (iSM -
kEBpLow + 1);
301 ss <<
"EE+" << std::setw(2) << std::setfill(
'0') << (((iSM -
kEEpLow + 6) % 9) + 1);
307 unsigned EEPnDCC(
unsigned _dee,
unsigned _ab) {
335 unsigned iSM(_dccId - 1);
370 unsigned iSM(_dccId - 1);
404 if (_towerId == 69 || _towerId == 70)
406 else if ((_dccId == 8 || _dccId == 53) && _towerId >= 18 && _towerId <= 24)
408 else if (_dccId <= kEEmHigh + 1 || _dccId >=
kEEpLow + 1)
411 return _towerId <= 68;
430 std::lock_guard<std::mutex>
lock(mapMutex);
434 throw cms::Exception(
"InvalidCall") <<
"ElectronicsMapping not initialized";
445 std::lock_guard<std::mutex>
lock(mapMutex);
450 std::lock_guard<std::mutex>
lock(mapMutex);
454 throw cms::Exception(
"InvalidCall") <<
"TrigTowerConstituentsMap not initialized";
465 std::lock_guard<std::mutex>
lock(mapMutex);
470 std::lock_guard<std::mutex>
lock(mapMutex);
474 throw cms::Exception(
"InvalidCall") <<
"CaloGeometry not initialized";
485 std::lock_guard<std::mutex>
lock(mapMutex);
490 std::lock_guard<std::mutex>
lock(mapMutex);
494 throw cms::Exception(
"InvalidCall") <<
"CaloTopology not initialized";
505 std::lock_guard<std::mutex>
lock(mapMutex);
std::vector< unsigned > const memDCC
static boost::mutex mutex
unsigned memDCCIndex(unsigned)
int tccId() const
get the DCC (Ecal Local DCC value not global one) id
CaloTopology const * topology(0)
Ecal readout channel identification [32:20] Unused (so far) [19:13] DCC id [12:6] tower [5:3] strip [...
EcalElectronicsMapping const * getElectronicsMap()
constexpr uint32_t rawId() const
get the raw id
unsigned tccId(DetId const &)
bool isForward(DetId const &)
std::pair< unsigned, unsigned > outerTCCs(unsigned)
int towerId() const
get the tower id
int iTT(const EcalTrigTowerDetId &id) const
returns the index of a Trigger Tower within its TCC.
bool ccuExists(unsigned, unsigned)
std::pair< int, int > getDCCandSC(EcalScDetId id) const
CaloGeometry const * geometry(0)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
CaloGeometry const * getGeometry()
unsigned ttId(DetId const &)
unsigned nSuperCrystals(unsigned)
int iphi() const
get the crystal iphi
unsigned EEPnDCC(unsigned _dee, unsigned _ab)
bool isEndcapTTId(DetId const &)
int TCCid(const EBDetId &id) const
returns the TCCid of an EBDetId
EcalElectronicsId getElectronicsId(const DetId &id) const
Get the electronics id for this det id.
unsigned nCrystals(unsigned)
CaloTopology const * getTopology()
bool checkElectronicsMap(bool=true)
EcalTrigTowerConstituentsMap const * getTrigTowerMap()
int ttId() const
get the tower id
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
void setGeometry(CaloGeometry const *)
EcalTriggerElectronicsId getTriggerElectronicsId(const DetId &id) const
Get the trigger electronics id for this det id.
unsigned rtHalf(DetId const &)
static const float crystalUnitToEta
EcalTrigTowerDetId tower() const
get the HCAL/trigger iphi of this crystal
int iDCCId() const
get the DCCId
int dccId() const
get the DCC (Ecal Local DCC value not global one) id
unsigned towerId(DetId const &)
bool isEcalScDetId(DetId const &)
unsigned memDCCId(unsigned)
bool isSingleChannelId(DetId const &)
int iphi() const
get the tower iphi
void setTopology(CaloTopology const *)
std::string smName(unsigned)
bool checkTopology(bool=true)
static bool validDetId(int crystal_ix, int crystal_iy, int iz)
int DCCid(const EBDetId &id) const
returns the DCC of an EBDetId
bool checkTrigTowerMap(bool=true)
bool isCrystalId(DetId const &)
void setElectronicsMap(EcalElectronicsMapping const *)
EcalElectronicsMapping const * electronicsMap(0)
std::pair< unsigned, unsigned > innerTCCs(unsigned)
EcalTrigTowerConstituentsMap const * trigtowerMap(0)
std::vector< DetId > scConstituents(EcalScDetId const &)
void setTrigTowerMap(EcalTrigTowerConstituentsMap const *)
int iTT() const
sequential index within one DCC
bool checkGeometry(bool=true)
unsigned dccId(DetId const &)
double eta(EBDetId const &)
double phi(EBDetId const &)
int zside() const
get the z-side of the crystal (1/-1)
constexpr Detector det() const
get the detector field from this detid