CMS 3D CMS Logo

SiStripCablingDQM.cc
Go to the documentation of this file.
4 #include "TCanvas.h"
5 
7  edm::RunNumber_t iRun,
8  edm::ParameterSet const &hPSet,
9  edm::ParameterSet const &fPSet,
10  const TrackerTopology *tTopo,
11  const TkDetMap *tkDetMap)
13  if (HistoMaps_On_) {
14  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "Cabling_TkMap", 0.);
15  }
16 }
17 
19 
21  // Get active and total detIds
22  getConditionObject(eSetup);
23  if (!condObj_) {
24  edm::LogError("InvalidCablingHandle") << "Invalid Cabling Handle";
25  return;
26  }
29 
30  // Initialize arrays for counting:
31  int counterTIB[4];
32  for (int i = 0; i < 4; i++)
33  counterTIB[i] = 0;
34  int counterTID[2][3];
35  for (int i = 0; i < 2; i++) {
36  for (int j = 0; j < 3; j++)
37  counterTID[i][j] = 0;
38  }
39  int counterTOB[6];
40  for (int i = 0; i < 6; i++)
41  counterTOB[i] = 0;
42  int counterTEC[2][9];
43  for (int i = 0; i < 2; i++) {
44  for (int j = 0; j < 9; j++)
45  counterTEC[i][j] = 0;
46  }
47 
48  // fill arrays for counting and fill Histo_Map with value for connected :
49  for (const auto detId : activeDetIds) {
50  StripSubdetector subdet(detId);
51 
52  if (HistoMaps_On_) {
53  Tk_HM_->fill(detId, condObj_->nApvPairs(detId) * 2);
54  }
55  if (fPSet_.getParameter<bool>("TkMap_On") || hPSet_.getParameter<bool>("TkMap_On")) {
56  int32_t n_conn = 0;
57  for (uint32_t connDet_i = 0; connDet_i < condObj_->getConnections(detId).size(); connDet_i++) {
58  if (condObj_->getConnections(detId)[connDet_i] != nullptr &&
59  condObj_->getConnections(detId)[connDet_i]->isConnected() != 0)
60  n_conn++;
61  }
62  fillTkMap(detId, n_conn * 2.);
63  }
64  switch (subdet.subdetId()) {
65  case StripSubdetector::TIB: {
66  int i = tTopo_->tibLayer(detId) - 1;
67  counterTIB[i]++;
68  break;
69  }
70  case StripSubdetector::TID: {
71  int j = tTopo_->tidWheel(detId) - 1;
72  int side = tTopo_->tidSide(detId);
73  if (side == 2) {
74  counterTID[0][j]++;
75  } else if (side == 1) {
76  counterTID[1][j]++;
77  }
78  break;
79  }
80  case StripSubdetector::TOB: {
81  int i = tTopo_->tobLayer(detId) - 1;
82  counterTOB[i]++;
83  break;
84  }
85  case StripSubdetector::TEC: {
86  int j = tTopo_->tecWheel(detId) - 1;
87  int side = tTopo_->tecSide(detId);
88  if (side == 2) {
89  counterTEC[0][j]++;
90  } else if (side == 1) {
91  counterTEC[1][j]++;
92  }
93  break;
94  }
95  }
96 
97  } // idet
98 
99  // obtained from tracker.dat and hard-coded
100  int TIBDetIds[4] = {672, 864, 540, 648};
101  int TIDDetIds[2][3] = {{136, 136, 136}, {136, 136, 136}};
102  int TOBDetIds[6] = {1008, 1152, 648, 720, 792, 888};
103  int TECDetIds[2][9] = {{408, 408, 408, 360, 360, 360, 312, 312, 272}, {408, 408, 408, 360, 360, 360, 312, 312, 272}};
104 
105  DQMStore *dqmStore_ = edm::Service<DQMStore>().operator->();
106 
107  std::string FolderName = fPSet_.getParameter<std::string>("FolderName_For_QualityAndCabling_SummaryHistos");
108 
110 
111  // dqmStore_->cd("SiStrip/MechanicalView/");
113  ME = dqmStore_->book2D("SummaryOfCabling", "SummaryOfCabling", 6, 0.5, 6.5, 9, 0.5, 9.5);
114  ME->setAxisTitle("Sub Det", 1);
115  ME->setAxisTitle("Layer", 2);
116 
117  ME->setBinLabel(1, "TIB");
118  ME->setBinLabel(2, "TID F");
119  ME->setBinLabel(3, "TID B");
120  ME->setBinLabel(4, "TOB");
121  ME->setBinLabel(5, "TEC F");
122  ME->setBinLabel(6, "TEC B");
123 
124  for (int i = 0; i < 4; i++) {
125  ME->Fill(1, i + 1, float(counterTIB[i]) / TIBDetIds[i]);
126  }
127 
128  for (int i = 0; i < 2; i++) {
129  for (int j = 0; j < 3; j++) {
130  ME->Fill(i + 2, j + 1, float(counterTID[i][j]) / TIDDetIds[i][j]);
131  }
132  }
133 
134  for (int i = 0; i < 6; i++) {
135  ME->Fill(4, i + 1, float(counterTOB[i]) / TOBDetIds[i]);
136  }
137 
138  for (int i = 0; i < 2; i++) {
139  for (int j = 0; j < 9; j++) {
140  ME->Fill(i + 5, j + 1, float(counterTEC[i][j]) / TECDetIds[i][j]);
141  }
142  }
143 
144  if (fPSet_.getParameter<bool>("OutputSummaryAtLayerLevelAsImage")) {
145  TCanvas c1("c1");
146  ME->getTH1()->Draw("TEXT");
147  ME->getTH1()->SetStats(kFALSE);
148  std::string name(ME->getTitle());
149  name += ".png";
150  c1.Print(name.c_str());
151  }
152 }
SiStripDetCabling::addActiveDetectorsRawIds
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
Definition: SiStripDetCabling.cc:134
edm::RunNumber_t
unsigned int RunNumber_t
Definition: RunLumiEventNumber.h:14
mps_fire.i
i
Definition: mps_fire.py:428
TrackerTopology
Definition: TrackerTopology.h:16
SiStripBaseCondObjDQM::activeDetIds
std::vector< uint32_t > activeDetIds
Definition: SiStripBaseCondObjDQM.h:114
StripSubdetector
Definition: StripSubdetector.h:12
SiStripCablingDQM.h
DQMStore.h
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
SiStripBaseCondObjDQM::HistoMaps_On_
bool HistoMaps_On_
Definition: SiStripBaseCondObjDQM.h:100
SiStripCablingDQM::SiStripCablingDQM
SiStripCablingDQM(edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
Definition: SiStripCablingDQM.cc:6
PixelVTXMonitor_cfi.FolderName
FolderName
Definition: PixelVTXMonitor_cfi.py:5
TrackerTopology::tidWheel
unsigned int tidWheel(const DetId &id) const
Definition: TrackerTopology.h:201
SiStripBaseCondObjDQM::fillTkMap
void fillTkMap(const uint32_t &detid, const float &value)
Definition: SiStripBaseCondObjDQM.cc:1049
dqm::legacy::DQMStore
Definition: DQMStore.h:727
SiStripDetCabling
Definition: SiStripDetCabling.h:21
SiStripBaseCondObjDQM::Tk_HM_
std::unique_ptr< TkHistoMap > Tk_HM_
Definition: SiStripBaseCondObjDQM.h:117
TkDetMap
Definition: TkDetMap.h:175
dqm::implementation::DQMStore::setCurrentFolder
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
SiStripDetCablingRcd
Definition: SiStripDependentRecords.h:19
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripCablingDQM::~SiStripCablingDQM
~SiStripCablingDQM() override
Definition: SiStripCablingDQM.cc:18
SiStripBaseCondObjDQMGet
Definition: SiStripBaseCondObjDQM.h:148
edm::ParameterSet
Definition: ParameterSet.h:47
ME
dqm::harvesting::MonitorElement ME
Definition: TrackingDQMClientHeavyIons.cc:20
SiStripCablingDQM::getActiveDetIds
void getActiveDetIds(const edm::EventSetup &eSetup) override
Definition: SiStripCablingDQM.cc:20
TrackerTopology::tidSide
unsigned int tidSide(const DetId &id) const
Definition: TrackerTopology.h:190
edm::Service
Definition: Service.h:30
alignmentValidation.c1
c1
do drawing
Definition: alignmentValidation.py:1025
edm::EventSetup
Definition: EventSetup.h:58
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd >
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
SiStripBaseCondObjDQM::tTopo_
const TrackerTopology * tTopo_
Definition: SiStripBaseCondObjDQM.h:122
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
SiStripDetCabling::nApvPairs
const uint16_t nApvPairs(uint32_t det_id) const
Definition: SiStripDetCabling.cc:209
ME
Definition: ME.h:11
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
SiStripBaseCondObjDQM::fPSet_
edm::ParameterSet fPSet_
Definition: SiStripBaseCondObjDQM.h:97
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
SiStripBaseCondObjDQM::hPSet_
edm::ParameterSet hPSet_
Definition: SiStripBaseCondObjDQM.h:96
SiStripDetCabling::addAllDetectorsRawIds
void addAllDetectorsRawIds(std::vector< uint32_t > &vector_to_fill_with_detids) const
Definition: SiStripDetCabling.cc:143
SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >::getConditionObject
void getConditionObject(const edm::EventSetup &eSetup) override
Definition: SiStripBaseCondObjDQM.h:159
SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >::condObj_
const SiStripDetCabling * condObj_
Definition: SiStripBaseCondObjDQM.h:163
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripBaseCondObjDQM::dqmStore_
DQMStore * dqmStore_
Definition: SiStripBaseCondObjDQM.h:143
TrackerTopology::tecWheel
unsigned int tecWheel(const DetId &id) const
Definition: TrackerTopology.h:198
StripSubdetector.h
SiStripDetCabling::getConnections
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
Definition: SiStripDetCabling.cc:161
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316
TrackerTopology::tecSide
unsigned int tecSide(const DetId &id) const
Definition: TrackerTopology.h:184