CMS 3D CMS Logo

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) { cc.setConsumes(fedCabling); }
23  };
24  struct DetTokens {
25  DetTokens(edm::ESConsumesCollector&& cc) { cc.setConsumes(fedCabling).setConsumes(tTopo); }
28  };
31 };
32 
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
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
SiStripConnectivity(const edm::ParameterSet &)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopo
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
const DetTokens detTokens_
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCabling
const FecTokens fecTokens_
std::unique_ptr< SiStripDetCabling > produceDetCabling(const SiStripDetCablingRcd &)
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCabling
DetTokens(edm::ESConsumesCollector &&cc)
FecTokens(edm::ESConsumesCollector &&cc)
std::unique_ptr< SiStripFecCabling > produceFecCabling(const SiStripFecCablingRcd &)