Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-04-10 02:35:40

0001 #include "CalibCalorimetry/EcalTPGTools/interface/EcalReadoutTools.h"
0002 
0003 EcalReadoutTools::EcalReadoutTools(const edm::Event&, const edm::EventSetup& iSetup, const ESGetTokens& esGetTokens) {
0004   triggerTowerMap_ = &iSetup.getData(esGetTokens.ecalTrigTowerConstituentsMapToken);
0005   elecMap_ = &iSetup.getData(esGetTokens.ecalElectronicsMappingToken);
0006 }
0007 
0008 EcalTrigTowerDetId EcalReadoutTools::readOutUnitOf(const EBDetId& xtalId) const {
0009   return triggerTowerMap_->towerOf(xtalId);
0010 }
0011 
0012 EcalScDetId EcalReadoutTools::readOutUnitOf(const EEDetId& xtalId) const {
0013   const EcalElectronicsId& EcalElecId = elecMap_->getElectronicsId(xtalId);
0014   int iDCC = EcalElecId.dccId();
0015   int iDccChan = EcalElecId.towerId();
0016   const bool ignoreSingle = true;
0017   const std::vector<EcalScDetId> id = elecMap_->getEcalScDetId(iDCC, iDccChan, ignoreSingle);
0018   return !id.empty() ? id[0] : EcalScDetId();
0019 }