File indexing completed on 2024-04-06 12:00:07
0001 #include "CaloOnlineTools/HcalOnlineDb/interface/HcalLutGenerator.h"
0002
0003 #include "FWCore/Framework/interface/ESHandle.h"
0004 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
0005 #include "CondFormats/HcalObjects/interface/HcalElectronicsMap.h"
0006 #include "CaloOnlineTools/HcalOnlineDb/interface/HcalLutManager.h"
0007
0008 #include "CaloOnlineTools/HcalOnlineDb/interface/LMap.h"
0009
0010 #include <iostream>
0011
0012 HcalLutGenerator::HcalLutGenerator(const edm::ParameterSet& iConfig) {
0013 _tag = iConfig.getParameter<std::string>("tag");
0014 _lin_file = iConfig.getParameter<std::string>("HO_master_file");
0015 _status_word_to_mask = iConfig.getParameter<uint32_t>("status_word_to_mask");
0016 tok_inCoder_ = esConsumes<HcalTPGCoder, HcalTPGRecord>();
0017 tok_dbservice_ = esConsumes<HcalDbService, HcalDbRecord>();
0018 tok_hcalChStatus_ = esConsumes<HcalChannelQuality, HcalChannelQualityRcd>(edm::ESInputTag("", "withTopo"));
0019 tok_hcalCoder_ = esConsumes<CaloTPGTranscoder, CaloTPGRecord>();
0020 }
0021
0022 void HcalLutGenerator::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) {
0023 const HcalTPGCoder* inputCoder = &iSetup.getData(tok_inCoder_);
0024 const HcalDbService* hcalcond = &iSetup.getData(tok_dbservice_);
0025 const HcalChannelQuality* _cq = &iSetup.getData(tok_hcalChStatus_);
0026
0027 edm::ESHandle<CaloTPGTranscoder> outTranscoder = iSetup.getHandle(tok_hcalCoder_);
0028 edm::ESHandle<CaloTPGTranscoderULUT> transcoder;
0029 transcoder.swap(outTranscoder);
0030
0031 HcalLutManager manager(hcalcond, _cq, _status_word_to_mask);
0032 bool split_by_crate = true;
0033
0034 manager.createLutXmlFiles_HBEFFromCoder_HOFromAscii_ZDC(_tag, *inputCoder, *transcoder, _lin_file, split_by_crate);
0035 }