1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
// -*- C++ -*-
//
// Package: HcalDDDSimConstantsESModule
// Class: HcalDDDSimConstantsESModule
//
/**\class HcalDDDSimConstantsESModule Geometry/HcalCommonData/plugins/HcalDDDSimConstantsESModule.cc
Description: <one line class summary>
Implementation:
<Notes on implementation>
*/
//
// Original Author: Sunanda Banerjee
// Created: Tue Dec 24 16:40:29 PDT 2013
//
//
#include <memory>
#include <FWCore/Framework/interface/ModuleFactory.h>
#include <FWCore/Framework/interface/ESProducer.h>
#include <FWCore/MessageLogger/interface/MessageLogger.h>
#include <Geometry/HcalCommonData/interface/HcalDDDSimConstants.h>
#include <Geometry/Records/interface/HcalSimNumberingRecord.h>
//#define EDM_ML_DEBUG
class HcalDDDSimConstantsESModule : public edm::ESProducer {
public:
HcalDDDSimConstantsESModule(const edm::ParameterSet&);
using ReturnType = std::unique_ptr<HcalDDDSimConstants>;
static void fillDescriptions(edm::ConfigurationDescriptions&);
ReturnType produce(const HcalSimNumberingRecord&);
private:
edm::ESGetToken<HcalParameters, HcalParametersRcd> parToken_;
};
HcalDDDSimConstantsESModule::HcalDDDSimConstantsESModule(const edm::ParameterSet&) {
#ifdef EDM_ML_DEBUG
edm::LogVerbatim("HCalGeom") << "constructing HcalDDDSimConstantsESModule";
#endif
auto cc = setWhatProduced(this);
parToken_ = cc.consumesFrom<HcalParameters, HcalParametersRcd>(edm::ESInputTag{});
}
void HcalDDDSimConstantsESModule::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
descriptions.add("hcalDDDSimConstants", desc);
}
// ------------ method called to produce the data ------------
HcalDDDSimConstantsESModule::ReturnType HcalDDDSimConstantsESModule::produce(const HcalSimNumberingRecord& iRecord) {
const auto& par = iRecord.get(parToken_);
return std::make_unique<HcalDDDSimConstants>(&par);
}
//define this as a plug-in
DEFINE_FWK_EVENTSETUP_MODULE(HcalDDDSimConstantsESModule);
|