CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SiStripConnectivity.cc
Go to the documentation of this file.
8 
9 #include <memory>
10 
12 public:
14  ~SiStripConnectivity() override;
15 
16  std::unique_ptr<SiStripFecCabling> produceFecCabling(const SiStripFecCablingRcd&);
17  std::unique_ptr<SiStripDetCabling> produceDetCabling(const SiStripDetCablingRcd&);
18 
19 private:
20  struct FecTokens {
21  FecTokens(edm::ESConsumesCollector&& cc) : fedCabling(cc.consumes()) {}
23  };
24  struct DetTokens {
25  DetTokens(edm::ESConsumesCollector&& cc) : fedCabling(cc.consumes()), tTopo(cc.consumes()) {}
28  };
31 };
32 
34  : fecTokens_(setWhatProduced(this, &SiStripConnectivity::produceFecCabling)),
35  detTokens_(setWhatProduced(this, &SiStripConnectivity::produceDetCabling)) {}
36 
38  // do anything here that needs to be done at desctruction time
39  // (e.g. close files, deallocate resources etc.)
40 }
41 
42 // ------------ methods called to produce the data ------------
43 
44 std::unique_ptr<SiStripFecCabling> SiStripConnectivity::produceFecCabling(const SiStripFecCablingRcd& iRecord) {
45  //here build an object of type SiStripFecCabling using **ONLY** the information from class SiStripFedCabling,
46  return std::make_unique<SiStripFecCabling>(iRecord.get(fecTokens_.fedCabling));
47 }
48 
49 std::unique_ptr<SiStripDetCabling> SiStripConnectivity::produceDetCabling(const SiStripDetCablingRcd& iRecord) {
50  //here build an object of type SiStripDetCabling using **ONLY** the information from class SiStripFedCabling,
51  return std::make_unique<SiStripDetCabling>(iRecord.get(detTokens_.fedCabling), &iRecord.get(detTokens_.tTopo));
52 }
53 
54 // define this as a plug-in
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopo
const edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCabling
SiStripConnectivity(const edm::ParameterSet &)
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const DetTokens detTokens_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
const FecTokens fecTokens_
std::unique_ptr< SiStripDetCabling > produceDetCabling(const SiStripDetCablingRcd &)
DetTokens(edm::ESConsumesCollector &&cc)
FecTokens(edm::ESConsumesCollector &&cc)
std::unique_ptr< SiStripFecCabling > produceFecCabling(const SiStripFecCablingRcd &)
const edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCabling