CMS 3D CMS Logo

SiPixelPhase1DeadFEDChannels.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: SiPixelPhase1DeadFEDChannels
4 // Class: SiPixelPhase1DeadFEDChannels
5 //
6 
7 // Original Author: F.Fiori
8 
9 // C++ stuff
10 #include <iostream>
11 
12 // CMSSW stuff
22 
23 // DQM Stuff
25 
26 // Input data stuff
30 
31 // PixelDQM Framework
33 
34 namespace {
35 
36  class SiPixelPhase1DeadFEDChannels final : public SiPixelPhase1Base {
37  // List of quantities to be plotted.
38  enum {
39  DEADCHAN,
40  DEADCHANROC
41 
42  };
43 
44  public:
45  explicit SiPixelPhase1DeadFEDChannels(const edm::ParameterSet& conf);
46  void analyze(const edm::Event&, const edm::EventSetup&) override;
47 
48  private:
49  edm::EDGetTokenT<PixelFEDChannelCollection> pixelFEDChannelCollectionToken_;
50 
51  bool firstEvent_;
52  const TrackerGeometry* trackerGeometry_ = nullptr;
53  const SiPixelFedCabling* cablingMap = nullptr;
54  };
55 
56  SiPixelPhase1DeadFEDChannels::SiPixelPhase1DeadFEDChannels(const edm::ParameterSet& iConfig)
57  : SiPixelPhase1Base(iConfig) {
58  pixelFEDChannelCollectionToken_ = consumes<PixelFEDChannelCollection>(edm::InputTag("siPixelDigis"));
59  firstEvent_ = true;
60  };
61 
63  if (!checktrigger(iEvent, iSetup, DCS))
64  return;
65 
66  if (firstEvent_) {
67  edm::ESHandle<TrackerGeometry> tmpTkGeometry;
68  iSetup.get<TrackerDigiGeometryRecord>().get(tmpTkGeometry);
69  trackerGeometry_ = &(*tmpTkGeometry);
70 
72  iSetup.get<SiPixelFedCablingMapRcd>().get(pixelCabling);
73  cablingMap = pixelCabling.product();
74 
75  firstEvent_ = false;
76  }
77 
79 
80  iEvent.getByToken(pixelFEDChannelCollectionToken_, input);
81  if (!input.isValid())
82  return;
83 
84  for (const auto& disabledOnDetId : *input) {
85  for (const auto& ch : disabledOnDetId) {
86  sipixelobjects::CablingPathToDetUnit path = {ch.fed, ch.link, 0};
87 
88  for (path.roc = 1; path.roc <= (ch.roc_last - ch.roc_first) + 1; path.roc++) {
89  const sipixelobjects::PixelROC* roc = cablingMap->findItem(path);
90  assert(roc != nullptr);
91  assert(roc->rawId() == disabledOnDetId.detId());
92 
93  const PixelGeomDetUnit* theGeomDet =
94  dynamic_cast<const PixelGeomDetUnit*>(trackerGeometry_->idToDet(roc->rawId()));
95  PixelTopology const* topology = &(theGeomDet->specificTopology());
97  topology->colsperroc() / 2}; //center of ROC
99  histo[DEADCHANROC].fill(disabledOnDetId.detId(), &iEvent, global.col, global.row);
100  }
101 
102  histo[DEADCHAN].fill(disabledOnDetId.detId(), &iEvent); // global count
103  }
104  }
105 
106  histo[DEADCHAN].executePerEventHarvesting(&iEvent);
107  }
108 } //namespace
109 
110 DEFINE_FWK_MODULE(SiPixelPhase1DeadFEDChannels);
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
input
static const std::string input
Definition: EdmProvDump.cc:48
TrackerGeometry.h
edm::EDGetTokenT
Definition: EDGetToken.h:33
PixelFEDChannel.h
timingPdfMaker.histo
histo
Definition: timingPdfMaker.py:279
cms::cuda::assert
assert(be >=bs)
SiPixelFedCablingMap.h
DQMStore.h
sipixelobjects::GlobalPixel::row
int row
Definition: GlobalPixel.h:7
PixelDigi.h
SiPixelFedCabling
Definition: SiPixelFedCabling.h:10
edm::Handle
Definition: AssociativeIterator.h:50
sipixelobjects::GlobalPixel::col
int col
Definition: GlobalPixel.h:8
sipixelobjects::LocalPixel
identify pixel inside single ROC
Definition: LocalPixel.h:7
SiPixelPhase1Base
Definition: SiPixelPhase1Base.h:46
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
sipixelobjects::GlobalPixel
global coordinates (row and column in DetUnit, as in PixelDigi)
Definition: GlobalPixel.h:6
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
ecaldqm::topology
const CaloTopology * topology(nullptr)
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
sipixelobjects::CablingPathToDetUnit
Definition: CablingPathToDetUnit.h:5
edm::ESHandle< TrackerGeometry >
PixelTopology
Definition: PixelTopology.h:10
SiPixelFedCabling.h
TrackerDigiGeometryRecord.h
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
SiPixelFedCablingMapRcd.h
CertificationClient_cfi.DCS
DCS
Definition: CertificationClient_cfi.py:9
iEvent
int iEvent
Definition: GenABIO.cc:224
analyze
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
edm::EventSetup
Definition: EventSetup.h:57
DetSetVector.h
get
#define get
SiPixelPhase1Base::analyze
void analyze(edm::Event const &e, edm::EventSetup const &) override=0
sipixelobjects::PixelROC
Definition: PixelROC.h:23
SiPixelPhase1Base.h
sipixelobjects::LocalPixel::RocRowCol
row and collumn in ROC representation
Definition: LocalPixel.h:13
PixelGeomDetUnit.h
PixelMapPlotter.roc
roc
Definition: PixelMapPlotter.py:498
castor_dqm_sourceclient_file_cfg.path
path
Definition: castor_dqm_sourceclient_file_cfg.py:37
DTRecHitClients_cfi.local
local
Definition: DTRecHitClients_cfi.py:10
ParameterSet.h
SiPixelFedCablingMapRcd
Definition: SiPixelFedCablingMapRcd.h:5
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
TrackerGeometry
Definition: TrackerGeometry.h:14