CMS 3D CMS Logo

List of all members | Public Member Functions
SiStripCablingDQM Class Reference

#include <SiStripCablingDQM.h>

Inheritance diagram for SiStripCablingDQM:
SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd > SiStripBaseCondObjDQM

Public Member Functions

void fillMEsForDet (const ModMEs &selModME_, uint32_t selDetId_) override
 
void fillMEsForLayer (uint32_t selDetId_) override
 
void fillModMEs (const std::vector< uint32_t > &selectedDetIds) override
 
void fillSummaryMEs (const std::vector< uint32_t > &selectedDetIds) override
 
void getActiveDetIds (const edm::EventSetup &eSetup) override
 
 SiStripCablingDQM (edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo, const TkDetMap *tkDetMap)
 
 ~SiStripCablingDQM () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >
bool checkChanged (const edm::EventSetup &eSetup) override
 
void getConditionObject (const edm::EventSetup &eSetup) override
 
 SiStripBaseCondObjDQMGet (tokentype token, edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
 
 ~SiStripBaseCondObjDQMGet () override
 
- Public Member Functions inherited from SiStripBaseCondObjDQM
void analysis (const edm::EventSetup &eSetup_)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, uint32_t detIdOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, const std::vector< uint32_t > &detIdsOnDemand)
 
void analysisOnDemand (const edm::EventSetup &eSetup_, std::string requestedSubDetector, uint32_t requestedSide, uint32_t requestedLayer)
 
virtual void end ()
 
void selectModules (std::vector< uint32_t > &detIds_)
 
 SiStripBaseCondObjDQM (edm::RunNumber_t iRun, edm::ParameterSet const &hPSet, edm::ParameterSet const &fPSet, const TrackerTopology *tTopo)
 
virtual ~SiStripBaseCondObjDQM ()
 

Additional Inherited Members

- Public Types inherited from SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >
using tokentype = typename edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd >
 
- Public Types inherited from SiStripBaseCondObjDQM
typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 
- Protected Member Functions inherited from SiStripBaseCondObjDQM
void fillTkMap (const uint32_t &detid, const float &value)
 
std::pair< std::string, uint32_t > getLayerNameAndId (const uint32_t &detId_)
 
void getModMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
std::vector< uint32_t > GetSameLayerDetId (const std::vector< uint32_t > &activeDetIds, uint32_t selDetId)
 
std::pair< std::string, uint32_t > getStringNameAndId (const uint32_t &detId_)
 
void getSummaryMEs (ModMEs &CondObj_ME, const uint32_t &detId_)
 
- Protected Attributes inherited from SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >
const SiStripDetCablingcondObj_
 
- Protected Attributes inherited from SiStripBaseCondObjDQM
std::vector< uint32_t > activeDetIds
 
std::vector< uint32_t > all_DetIds
 
std::string CondObj_fillId_
 
std::string CondObj_name_
 
SiStripDetInfo detInfo_
 
edm::ParameterSet fPSet_
 
bool GrandSummary_On_
 
bool HistoMaps_On_
 
edm::ParameterSet hPSet_
 
double maxValue
 
double minValue
 
bool Mod_On_
 
std::map< uint32_t, ModMEsModMEsMap_
 
std::map< uint32_t, ModMEsSummaryMEsMap_
 
bool SummaryOnLayerLevel_On_
 
bool SummaryOnStringLevel_On_
 
std::unique_ptr< TkHistoMapTk_HM_
 
std::unique_ptr< TkHistoMapTk_HM_H
 
std::unique_ptr< TkHistoMapTk_HM_L
 
TrackerMaptkMap
 
std::vector< int > tkMapScaler
 
const TrackerTopologytTopo_
 

Detailed Description

Definition at line 9 of file SiStripCablingDQM.h.

Constructor & Destructor Documentation

◆ 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 at line 6 of file SiStripCablingDQM.cc.

References unpackBuffers-CaloStage2::token.

13  if (HistoMaps_On_) {
14  Tk_HM_ = std::make_unique<TkHistoMap>(tkDetMap, "SiStrip/Histo_Map", "Cabling_TkMap", 0.);
15  }
16 }
std::unique_ptr< TkHistoMap > Tk_HM_

◆ ~SiStripCablingDQM()

SiStripCablingDQM::~SiStripCablingDQM ( )
override

Definition at line 18 of file SiStripCablingDQM.cc.

18 {}

Member Function Documentation

◆ fillMEsForDet()

void SiStripCablingDQM::fillMEsForDet ( const ModMEs selModME_,
uint32_t  selDetId_ 
)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 23 of file SiStripCablingDQM.h.

23 { ; }

◆ fillMEsForLayer()

void SiStripCablingDQM::fillMEsForLayer ( uint32_t  selDetId_)
inlineoverridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 24 of file SiStripCablingDQM.h.

25  {
26  ;
27  }

◆ fillModMEs()

void SiStripCablingDQM::fillModMEs ( const std::vector< uint32_t > &  selectedDetIds)
inlineoverridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 20 of file SiStripCablingDQM.h.

20 { ; }

◆ fillSummaryMEs()

void SiStripCablingDQM::fillSummaryMEs ( const std::vector< uint32_t > &  selectedDetIds)
inlineoverridevirtual

Reimplemented from SiStripBaseCondObjDQM.

Definition at line 21 of file SiStripCablingDQM.h.

21 { ; }

◆ getActiveDetIds()

void SiStripCablingDQM::getActiveDetIds ( const edm::EventSetup eSetup)
overridevirtual

Implements SiStripBaseCondObjDQM.

Definition at line 20 of file SiStripCablingDQM.cc.

References SiStripBaseCondObjDQM::activeDetIds, SiStripDetCabling::addActiveDetectorsRawIds(), SiStripDetCabling::addAllDetectorsRawIds(), dqm::implementation::IBooker::book2D(), alignmentValidation::c1, SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >::condObj_, hcalRecHitTable_cff::detId, SiStripBaseCondObjDQM::dqmStore_, SiStripBaseCondObjDQM::fillTkMap(), PixelVTXMonitor_cfi::FolderName, SiStripBaseCondObjDQM::fPSet_, SiStripBaseCondObjDQMGet< SiStripDetCabling, SiStripDetCablingRcd >::getConditionObject(), SiStripDetCabling::getConnections(), edm::ParameterSet::getParameter(), SiStripBaseCondObjDQM::HistoMaps_On_, SiStripBaseCondObjDQM::hPSet_, mps_fire::i, dqmiolumiharvest::j, Skims_PA_cff::name, SiStripDetCabling::nApvPairs(), Utilities::operator, dqm::implementation::DQMStore::setCurrentFolder(), ALPAKA_ACCELERATOR_NAMESPACE::ecal::reconstruction::internal::barrel::side(), AlCaHLTBitMon_QueryRunRegistry::string, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecSide(), TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidSide(), TrackerTopology::tidWheel(), SiStripBaseCondObjDQM::Tk_HM_, StripSubdetector::TOB, TrackerTopology::tobLayer(), and SiStripBaseCondObjDQM::tTopo_.

20  {
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 
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 }
static constexpr auto TEC
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
unsigned int tobLayer(const DetId &id) const
const TrackerTopology * tTopo_
const std::vector< const FedChannelConnection * > & getConnections(uint32_t det_id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:647
Log< level::Error, false > LogError
void fillTkMap(const uint32_t &detid, const float &value)
Definition: ME.h:11
unsigned int tecSide(const DetId &id) const
static constexpr auto TOB
static constexpr auto TIB
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:212
void addAllDetectorsRawIds(std::vector< uint32_t > &vector_to_fill_with_detids) const
dqm::harvesting::MonitorElement ME
std::vector< uint32_t > activeDetIds
unsigned int tibLayer(const DetId &id) const
static constexpr auto TID
const uint16_t nApvPairs(uint32_t det_id) const
std::unique_ptr< TkHistoMap > Tk_HM_
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const