CMS 3D CMS Logo

SiStripCablingTrackerMap.cc
Go to the documentation of this file.
11 
12 #include <sstream>
13 
14 class SiStripCablingTrackerMap : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
15 public:
17  ~SiStripCablingTrackerMap() override = default;
18 
19  void beginRun(const edm::Run& run, const edm::EventSetup& es) override;
20  void endJob() override;
21  void endRun(const edm::Run& run, const edm::EventSetup& es) override{};
22  void analyze(const edm::Event& e, const edm::EventSetup& c) override;
23 
24 private:
26 
27  std::unique_ptr<TrackerMap> tkMap_detCab; //0 for onTrack, 1 for offTrack, 2 for All
28 };
29 
31 
33  tkMap_detCab = std::make_unique<TrackerMap>("DetCabling");
34 }
35 
36 //------------------------------------------------------------------------------------------
38  tkMap_detCab->save(true, 0, 0, "DetCabling.png");
39  tkMap_detCab->print(true, 0, 0, "DetCabling");
40 }
41 //------------------------------------------------------------------------------------------
42 
44  const auto& detCabling = es.getData(detCablingToken_);
45  //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
46  // get list of active detectors from SiStripDetCabling
47  //&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
48  std::vector<uint32_t> vdetId_;
49  detCabling.addActiveDetectorsRawIds(vdetId_);
50  for (std::vector<uint32_t>::const_iterator detid_iter = vdetId_.begin(); detid_iter != vdetId_.end(); detid_iter++) {
51  uint32_t detid = *detid_iter;
52  tkMap_detCab->fill(detid, 1);
53  }
54 }
55 
58 
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void endRun(const edm::Run &run, const edm::EventSetup &es) override
SiStripCablingTrackerMap(const edm::ParameterSet &conf)
std::unique_ptr< TrackerMap > tkMap_detCab
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
~SiStripCablingTrackerMap() override=default
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
void analyze(const edm::Event &e, const edm::EventSetup &c) override
Definition: Run.h:45