41 produces<nanoaod::FlatTable, edm::Transition::BeginRun>(
"HBDetIdList");
42 produces<nanoaod::FlatTable, edm::Transition::BeginRun>(
"HEDetIdList");
43 produces<nanoaod::FlatTable, edm::Transition::BeginRun>(
"HFDetIdList");
44 produces<nanoaod::FlatTable, edm::Transition::BeginRun>(
"HODetIdList");
56 std::map<HcalSubdetector, std::unique_ptr<std::vector<HcalDetId>>> didLists;
57 didLists[
HcalBarrel] = std::make_unique<std::vector<HcalDetId>>();
58 didLists[
HcalEndcap] = std::make_unique<std::vector<HcalDetId>>();
59 didLists[
HcalForward] = std::make_unique<std::vector<HcalDetId>>();
60 didLists[
HcalOuter] = std::make_unique<std::vector<HcalDetId>>();
67 for (
auto it_did = alldids.begin(); it_did != alldids.end(); ++it_did) {
68 if (!it_did->isHcalDetId()) {
79 didLists[did.
subdet()]->push_back(did);
83 for (
auto& it_subdet :
subdets) {
88 std::map<HcalSubdetector, std::string>
subdetNames = {
91 for (
auto& it_subdet :
subdets) {
93 std::make_unique<nanoaod::FlatTable>(didLists[it_subdet]->size(),
subdetNames[it_subdet],
false,
false);
95 std::vector<int> vdids;
96 for (
auto& it_did : *(didLists[it_subdet])) {
97 vdids.push_back(it_did.rawId());
99 didTable->addColumn<
int>(
"did", vdids,
"HcalDetId");
edm::EDPutTokenT< std::vector< HcalDetId > > hbDetIdListToken_
void produce(edm::StreamID, edm::Event &, edm::EventSetup const &) const override
void globalBeginRunProduce(edm::Run &iRun, edm::EventSetup const &iSetup) const override
HcalDetIdTableProducer(const edm::ParameterSet &iConfig)
edm::EDPutTokenT< std::vector< HcalDetId > > heDetIdListToken_
constexpr HcalSubdetector subdet() const
get the subdetector
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
edm::EDPutTokenT< std::vector< HcalDetId > > hfDetIdListToken_
void put(std::unique_ptr< PROD > product)
Put a new product.
edm::ESGetToken< HcalDbService, HcalDbRecord > tokenHcalDbService_
edm::EDPutTokenT< std::vector< HcalDetId > > hoDetIdListToken_
std::vector< HcalGenericDetId > allPrecisionId() const
static const std::string subdets[7]
static const char * subdetNames[]