CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SiStripDcsInfo Class Reference
Inheritance diagram for SiStripDcsInfo:
edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks > edm::one::EDAnalyzerBase edm::EDConsumerBase

Classes

struct  SubDetMEs
 

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 
- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

 SiStripDcsInfo (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void addBadModules (DQMStore &dqm_store)
 
void analyze (edm::Event const &, edm::EventSetup const &) override
 
void beginJob () override
 
void beginLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
 
void beginRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void bookStatus (DQMStore &dqm_store)
 
void endLuminosityBlock (edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
 
void endRun (edm::Run const &run, edm::EventSetup const &eSetup) override
 
void fillDummyStatus (DQMStore &dqm_store)
 
void fillStatus (DQMStore &dqm_store)
 
void readCabling (edm::EventSetup const &)
 
void readStatus (edm::EventSetup const &, int transition)
 

Private Attributes

bool bookedStatus_ {false}
 
MonitorElementDcsFraction_ {nullptr}
 
const SiStripDetCablingdetCabling_
 
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcddetCablingToken_
 
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcddetVOffToken0_
 
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcddetVOffToken1_
 
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcddetVOffToken2_
 
edm::ESWatcher< SiStripFedCablingRcdfedCablingWatcher_
 
bool IsLumiGoodDcs_ {false}
 
unsigned long long m_cacheIDDcs_ {}
 
int nFEDConnected_ {}
 
int nGoodDcsLumi_ {}
 
int nLumiAnalysed_ {}
 
edm::ESGetToken< RunInfo, RunInfoRcdrunInfoToken_
 
std::map< std::string, SubDetMEsSubDetMEsMap {}
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken0_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken1_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken2_
 
edm::ESGetToken< TrackerTopology, TrackerTopologyRcdtTopoToken3_
 

Static Private Attributes

static constexpr float MaxAcceptableBadDcsLumi_ {2}
 
static constexpr float MinAcceptableDcsDetFrac_ {0.90}
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 35 of file SiStripDcsInfo.cc.

Member Typedef Documentation

◆ DQMStore

Definition at line 39 of file SiStripDcsInfo.cc.

◆ MonitorElement

Definition at line 38 of file SiStripDcsInfo.cc.

Constructor & Destructor Documentation

◆ SiStripDcsInfo()

SiStripDcsInfo::SiStripDcsInfo ( const edm::ParameterSet ps)

Definition at line 92 of file SiStripDcsInfo.cc.

References LogDebug.

93  : tTopoToken0_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
94  tTopoToken1_(esConsumes<edm::Transition::EndLuminosityBlock>()),
95  tTopoToken2_(esConsumes<edm::Transition::EndRun>()),
96  tTopoToken3_(esConsumes<edm::Transition::BeginRun>()),
97  detVOffToken0_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
98  detVOffToken1_(esConsumes<edm::Transition::EndLuminosityBlock>()),
99  detVOffToken2_(esConsumes<edm::Transition::EndRun>()),
100  detCablingToken_(esConsumes<edm::Transition::BeginRun>()),
101  runInfoToken_(esConsumes<edm::Transition::BeginRun>()) {
102  usesResource("DQMStore");
103  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::Deleting SiStripDcsInfo ";
104 }
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken2_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken0_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken2_
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken3_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken1_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken1_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken0_
#define LogDebug(id)

Member Function Documentation

◆ addBadModules()

void SiStripDcsInfo::addBadModules ( DQMStore dqm_store)
private

Definition at line 336 of file SiStripDcsInfo.cc.

References dqm::implementation::IBooker::bookInt(), dqm::implementation::DQMStore::cd(), RemoveAddSevLevel::flag, dqm::implementation::IGetter::get(), SiStripUtility::goToDir(), MaxAcceptableBadDcsLumi_, hlt_dqm_clientPB-live_cfg::me, dqm::implementation::DQMStore::pwd(), SiStripUtility::setBadModuleFlag(), dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, and makeGlobalPositionRcd_cfg::tag.

Referenced by endRun().

336  {
337  dqm_store.cd();
338  std::string mdir = "MechanicalView";
339  if (!SiStripUtility::goToDir(dqm_store, mdir)) {
340  dqm_store.setCurrentFolder("SiStrip/" + mdir);
341  }
342  std::string mechanical_dir = dqm_store.pwd();
343  std::string tag = "DCSError";
344 
345  for (auto const& pr : SubDetMEsMap) {
346  auto const& lumiCountBadModules = pr.second.NLumiDetectorIsFaulty;
347  for (auto const [ibad, nBadLumi] : lumiCountBadModules) {
348  if (nBadLumi <= MaxAcceptableBadDcsLumi_)
349  continue;
350  std::string bad_module_folder = mechanical_dir + "/" + pr.second.folder_name +
351  "/"
352  "BadModuleList";
353  dqm_store.setCurrentFolder(bad_module_folder);
354 
355  std::ostringstream detid_str;
356  detid_str << ibad;
357  std::string full_path = bad_module_folder + "/" + detid_str.str();
358  MonitorElement* me = dqm_store.get(full_path);
359  uint16_t flag = 0;
360  if (me) {
361  flag = me->getIntValue();
362  me->Reset();
363  } else
364  me = dqm_store.bookInt(detid_str.str());
366  me->Fill(flag);
367  }
368  }
369  dqm_store.cd();
370 }
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:647
std::string pwd() override
Definition: DQMStore.h:645
std::map< std::string, SubDetMEs > SubDetMEsMap
static constexpr float MaxAcceptableBadDcsLumi_
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:712
static bool goToDir(DQMStore &dqm_store, std::string const &name)

◆ analyze()

void SiStripDcsInfo::analyze ( edm::Event const &  event,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 146 of file SiStripDcsInfo.cc.

146 {}

◆ beginJob()

void SiStripDcsInfo::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 106 of file SiStripDcsInfo.cc.

References SubDetMEsMap.

106  {
107  // Since SubDetMEs is a struct, using the brace initialization will
108  // zero-initialize all members that are not specified in the call.
109  SubDetMEsMap.emplace("TIB", SubDetMEs{"TIB", nullptr, 0, {}, {}});
110  SubDetMEsMap.emplace("TOB", SubDetMEs{"TOB", nullptr, 0, {}, {}});
111  SubDetMEsMap.emplace("TECB", SubDetMEs{"TEC/MINUS", nullptr, 0, {}, {}});
112  SubDetMEsMap.emplace("TECF", SubDetMEs{"TEC/PLUS", nullptr, 0, {}, {}});
113  SubDetMEsMap.emplace("TIDB", SubDetMEs{"TID/MINUS", nullptr, 0, {}, {}});
114  SubDetMEsMap.emplace("TIDF", SubDetMEs{"TID/PLUS", nullptr, 0, {}, {}});
115 }
std::map< std::string, SubDetMEs > SubDetMEsMap

◆ beginLuminosityBlock()

void SiStripDcsInfo::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprivate

Definition at line 148 of file SiStripDcsInfo.cc.

References LogDebug, nFEDConnected_, nLumiAnalysed_, readStatus(), and SubDetMEsMap.

148  {
149  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::beginLuminosityBlock";
150 
151  if (nFEDConnected_ == 0)
152  return;
153 
154  // initialise BadModule list
155  for (auto& subDetME : SubDetMEsMap) {
156  subDetME.second.FaultyDetectors.clear();
157  }
158  readStatus(eSetup, 0);
159  nLumiAnalysed_++;
160 }
std::map< std::string, SubDetMEs > SubDetMEsMap
void readStatus(edm::EventSetup const &, int transition)
#define LogDebug(id)

◆ beginRun()

void SiStripDcsInfo::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivate

Definition at line 119 of file SiStripDcsInfo.cc.

References bookStatus(), ALPAKA_ACCELERATOR_NAMESPACE::brokenline::constexpr(), fillDummyStatus(), edm::EventSetup::getHandle(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogDebug, FEDNumbering::MAXSiStripFEDID, FEDNumbering::MINSiStripFEDID, nFEDConnected_, readCabling(), runInfoToken_, and edm::EventSetup::tryToGet().

119  {
120  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo:: Begining of Run";
121  nFEDConnected_ = 0;
122  constexpr int siStripFedIdMin{FEDNumbering::MINSiStripFEDID};
123  constexpr int siStripFedIdMax{FEDNumbering::MAXSiStripFEDID};
124 
125  // Count Tracker FEDs from RunInfo
126  //
127  if (eSetup.tryToGet<RunInfoRcd>()) {
128  if (auto sumFED = eSetup.getHandle(runInfoToken_)) {
129  std::vector<int> FedsInIds = sumFED->m_fed_in;
130  for (unsigned int it = 0; it < FedsInIds.size(); ++it) {
131  int fedID = FedsInIds[it];
132  if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
133  ++nFEDConnected_;
134  }
135  LogDebug("SiStripDcsInfo") << " SiStripDcsInfo :: Connected FEDs " << nFEDConnected_;
136  }
137  }
138 
139  auto& dqm_store = *edm::Service<DQMStore>{};
140  bookStatus(dqm_store);
141  fillDummyStatus(dqm_store);
142  if (nFEDConnected_ > 0)
143  readCabling(eSetup);
144 }
void bookStatus(DQMStore &dqm_store)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
void readCabling(edm::EventSetup const &)
void fillDummyStatus(DQMStore &dqm_store)
#define LogDebug(id)

◆ bookStatus()

void SiStripDcsInfo::bookStatus ( DQMStore dqm_store)
private

Definition at line 188 of file SiStripDcsInfo.cc.

References bookedStatus_, dqm::implementation::IBooker::bookFloat(), dqm::implementation::DQMStore::cd(), DcsFraction_, SiStripUtility::getTopFolderPath(), dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, and makePlotsFromDump::suffix.

Referenced by beginRun(), fillDummyStatus(), and fillStatus().

188  {
189  if (bookedStatus_)
190  return;
191 
192  std::string strip_dir = "";
193  SiStripUtility::getTopFolderPath(dqm_store, "SiStrip", strip_dir);
194  if (!strip_dir.empty())
195  dqm_store.setCurrentFolder(strip_dir + "/EventInfo");
196  else
197  dqm_store.setCurrentFolder("SiStrip/EventInfo");
198 
199  auto scope = DQMStore::UseLumiScope(dqm_store);
200 
201  DcsFraction_ = dqm_store.bookFloat("DCSSummary");
202 
203  dqm_store.cd();
204  if (!strip_dir.empty())
205  dqm_store.setCurrentFolder(strip_dir + "/EventInfo/DCSContents");
206  else
207  dqm_store.setCurrentFolder("SiStrip/EventInfo/DCSContents");
208  for (auto& [suffix, subDetME] : SubDetMEsMap) {
209  std::string const me_name{"SiStrip_" + suffix};
210  subDetME.DcsFractionME = dqm_store.bookFloat(me_name);
211  }
212  bookedStatus_ = true;
213  dqm_store.cd();
214 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:647
std::map< std::string, SubDetMEs > SubDetMEsMap
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:540
MonitorElement * DcsFraction_
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)

◆ endLuminosityBlock()

void SiStripDcsInfo::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
overrideprivate

Definition at line 162 of file SiStripDcsInfo.cc.

References fillStatus(), LogDebug, nFEDConnected_, and readStatus().

162  {
163  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::endLuminosityBlock";
164 
165  if (nFEDConnected_ == 0)
166  return;
167  auto& dqm_store = *edm::Service<DQMStore>{};
168  readStatus(eSetup, 1);
169  fillStatus(dqm_store);
170 }
void fillStatus(DQMStore &dqm_store)
void readStatus(edm::EventSetup const &, int transition)
#define LogDebug(id)

◆ endRun()

void SiStripDcsInfo::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivate

Definition at line 172 of file SiStripDcsInfo.cc.

References addBadModules(), LogDebug, nFEDConnected_, readStatus(), and SubDetMEsMap.

172  {
173  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::EndRun";
174 
175  if (nFEDConnected_ == 0)
176  return;
177 
178  for (auto& subDetME : SubDetMEsMap) {
179  subDetME.second.FaultyDetectors.clear();
180  }
181  readStatus(eSetup, 2);
182  auto& dqm_store = *edm::Service<DQMStore>{};
183  addBadModules(dqm_store);
184 }
std::map< std::string, SubDetMEs > SubDetMEsMap
void readStatus(edm::EventSetup const &, int transition)
void addBadModules(DQMStore &dqm_store)
#define LogDebug(id)

◆ fillDummyStatus()

void SiStripDcsInfo::fillDummyStatus ( DQMStore dqm_store)
private

Definition at line 323 of file SiStripDcsInfo.cc.

References cms::cuda::assert(), bookedStatus_, bookStatus(), DcsFraction_, dqm::impl::MonitorElement::Fill(), dqm::impl::MonitorElement::Reset(), and SubDetMEsMap.

Referenced by beginRun().

323  {
324  if (!bookedStatus_)
325  bookStatus(dqm_store);
327 
328  for (auto& pr : SubDetMEsMap) {
329  pr.second.DcsFractionME->Reset();
330  pr.second.DcsFractionME->Fill(-1.0);
331  }
332  DcsFraction_->Reset();
333  DcsFraction_->Fill(-1.0);
334 }
void bookStatus(DQMStore &dqm_store)
assert(be >=bs)
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
std::map< std::string, SubDetMEs > SubDetMEsMap
MonitorElement * DcsFraction_

◆ fillStatus()

void SiStripDcsInfo::fillStatus ( DQMStore dqm_store)
private

Definition at line 280 of file SiStripDcsInfo.cc.

References cms::cuda::assert(), bookedStatus_, bookStatus(), DcsFraction_, dqm::impl::MonitorElement::Fill(), HLT_2024v12_cff::fraction, IsLumiGoodDcs_, MinAcceptableDcsDetFrac_, Skims_PA_cff::name, nFEDConnected_, nGoodDcsLumi_, dqm::impl::MonitorElement::Reset(), and SubDetMEsMap.

Referenced by endLuminosityBlock().

280  {
281  if (!bookedStatus_)
282  bookStatus(dqm_store);
284 
285  float total_det = 0.0;
286  float faulty_det = 0.0;
287  float fraction;
288  for (auto const& [name, subDetMEs] : SubDetMEsMap) {
289  int total_subdet = subDetMEs.TotalDetectors;
290  int faulty_subdet = subDetMEs.FaultyDetectors.size();
291  if (nFEDConnected_ == 0 || total_subdet == 0)
292  fraction = -1;
293  else
294  fraction = 1.0 - faulty_subdet * 1.0 / total_subdet;
295  subDetMEs.DcsFractionME->Reset();
296  subDetMEs.DcsFractionME->Fill(fraction);
297  edm::LogInfo("SiStripDcsInfo") << " SiStripDcsInfo::fillStatus : Sub Detector " << name << " Total Number "
298  << total_subdet << " Faulty ones " << faulty_subdet;
299  total_det += total_subdet;
300  faulty_det += faulty_subdet;
301  }
302  if (nFEDConnected_ == 0 || total_det == 0)
303  fraction = -1.0;
304  else
305  fraction = 1 - faulty_det / total_det;
306  DcsFraction_->Reset();
309  if (!IsLumiGoodDcs_)
310  return;
311 
312  ++nGoodDcsLumi_;
313  for (auto& pr : SubDetMEsMap) {
314  for (auto const detId_faulty : pr.second.FaultyDetectors) {
315  pr.second.NLumiDetectorIsFaulty[detId_faulty]++;
316  }
317  }
318 }
void bookStatus(DQMStore &dqm_store)
assert(be >=bs)
void Fill(long long x)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
std::map< std::string, SubDetMEs > SubDetMEsMap
Log< level::Info, false > LogInfo
MonitorElement * DcsFraction_
static constexpr float MinAcceptableDcsDetFrac_

◆ readCabling()

void SiStripDcsInfo::readCabling ( edm::EventSetup const &  eSetup)
private

Definition at line 216 of file SiStripDcsInfo.cc.

References SiStripDetCabling::addActiveDetectorsRawIds(), edm::ESWatcher< T >::check(), detCabling_, detCablingToken_, hcalRecHitTable_cff::detId, fedCablingWatcher_, edm::EventSetup::getData(), SiStripUtility::getSubDetectorTag(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, LogDebug, AlCaHLTBitMon_QueryRunRegistry::string, xuti::subdet_tag(), SubDetMEsMap, and tTopoToken3_.

Referenced by beginRun().

216  {
217  const auto tTopo = &eSetup.getData(tTopoToken3_);
218 
219  if (fedCablingWatcher_.check(eSetup)) {
220  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::readCabling : "
221  << " Change in Cache";
222  detCabling_ = &eSetup.getData(detCablingToken_);
223 
224  std::vector<uint32_t> SelectedDetIds;
225  detCabling_->addActiveDetectorsRawIds(SelectedDetIds);
226  LogDebug("SiStripDcsInfo") << " SiStripDcsInfo::readCabling : "
227  << " Total Detectors " << SelectedDetIds.size();
228 
229  // initialise total # of detectors first
230  for (std::map<std::string, SubDetMEs>::iterator it = SubDetMEsMap.begin(); it != SubDetMEsMap.end(); it++) {
231  it->second.TotalDetectors = 0;
232  }
233 
234  for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(); idetid != SelectedDetIds.end();
235  ++idetid) {
236  uint32_t detId = *idetid;
237  if (detId == 0 || detId == 0xFFFFFFFF)
238  continue;
241 
242  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(subdet_tag);
243  if (iPos != SubDetMEsMap.end()) {
244  iPos->second.TotalDetectors++;
245  }
246  }
247  }
248 }
const SiStripDetCabling * detCabling_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
std::map< std::string, SubDetMEs > SubDetMEsMap
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
const std::string subdet_tag("SubDet")
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken3_
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
#define LogDebug(id)

◆ readStatus()

void SiStripDcsInfo::readStatus ( edm::EventSetup const &  eSetup,
int  transition 
)
private

Definition at line 252 of file SiStripDcsInfo.cc.

References detCabling_, detVOffToken0_, detVOffToken1_, detVOffToken2_, spr::find(), edm::EventSetup::getData(), SiStripUtility::getSubDetectorTag(), SiStripDetCabling::IsConnected(), LogDebug, AlCaHLTBitMon_QueryRunRegistry::string, xuti::subdet_tag(), SubDetMEsMap, tTopoToken0_, tTopoToken1_, and tTopoToken2_.

Referenced by beginLuminosityBlock(), endLuminosityBlock(), and endRun().

252  {
253  const auto tTopo = &eSetup.getData(transition == 0 ? tTopoToken0_ : (transition == 1 ? tTopoToken1_ : tTopoToken2_));
254  const auto& detVOff =
255  eSetup.getData(transition == 0 ? detVOffToken0_ : (transition == 1 ? detVOffToken1_ : detVOffToken2_));
256  std::vector<uint32_t> FaultyDetIds;
257  detVOff.getDetIds(FaultyDetIds);
258  LogDebug("SiStripDcsInfo") << " SiStripDcsInfo::readStatus : "
259  << " Faulty Detectors " << FaultyDetIds.size();
260  // Read and fille bad modules
261  for (std::vector<uint32_t>::const_iterator ihvoff = FaultyDetIds.begin(); ihvoff != FaultyDetIds.end(); ++ihvoff) {
262  uint32_t detId_hvoff = (*ihvoff);
263  if (!detCabling_->IsConnected(detId_hvoff))
264  continue;
266  SiStripUtility::getSubDetectorTag(detId_hvoff, subdet_tag, tTopo);
267 
268  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(subdet_tag);
269  if (iPos != SubDetMEsMap.end()) {
270  std::vector<uint32_t>::iterator ibad =
271  std::find(iPos->second.FaultyDetectors.begin(), iPos->second.FaultyDetectors.end(), detId_hvoff);
272  if (ibad == iPos->second.FaultyDetectors.end())
273  iPos->second.FaultyDetectors.push_back(detId_hvoff);
274  }
275  }
276 }
const SiStripDetCabling * detCabling_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken2_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken0_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken2_
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
bool IsConnected(const uint32_t &det_id) const
std::map< std::string, SubDetMEs > SubDetMEsMap
const std::string subdet_tag("SubDet")
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken1_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken1_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken0_
#define LogDebug(id)

Member Data Documentation

◆ bookedStatus_

bool SiStripDcsInfo::bookedStatus_ {false}
private

Definition at line 70 of file SiStripDcsInfo.cc.

Referenced by bookStatus(), fillDummyStatus(), and fillStatus().

◆ DcsFraction_

MonitorElement* SiStripDcsInfo::DcsFraction_ {nullptr}
private

Definition at line 58 of file SiStripDcsInfo.cc.

Referenced by bookStatus(), fillDummyStatus(), and fillStatus().

◆ detCabling_

const SiStripDetCabling* SiStripDcsInfo::detCabling_
private

Definition at line 81 of file SiStripDcsInfo.cc.

Referenced by readCabling(), and readStatus().

◆ detCablingToken_

edm::ESGetToken<SiStripDetCabling, SiStripDetCablingRcd> SiStripDcsInfo::detCablingToken_
private

Definition at line 85 of file SiStripDcsInfo.cc.

Referenced by readCabling().

◆ detVOffToken0_

edm::ESGetToken<SiStripDetVOff, SiStripDetVOffRcd> SiStripDcsInfo::detVOffToken0_
private

Definition at line 83 of file SiStripDcsInfo.cc.

Referenced by readStatus().

◆ detVOffToken1_

edm::ESGetToken<SiStripDetVOff, SiStripDetVOffRcd> SiStripDcsInfo::detVOffToken1_
private

Definition at line 83 of file SiStripDcsInfo.cc.

Referenced by readStatus().

◆ detVOffToken2_

edm::ESGetToken<SiStripDetVOff, SiStripDetVOffRcd> SiStripDcsInfo::detVOffToken2_
private

Definition at line 83 of file SiStripDcsInfo.cc.

Referenced by readStatus().

◆ fedCablingWatcher_

edm::ESWatcher<SiStripFedCablingRcd> SiStripDcsInfo::fedCablingWatcher_
private

Definition at line 84 of file SiStripDcsInfo.cc.

Referenced by readCabling().

◆ IsLumiGoodDcs_

bool SiStripDcsInfo::IsLumiGoodDcs_ {false}
private

Definition at line 76 of file SiStripDcsInfo.cc.

Referenced by fillStatus().

◆ m_cacheIDDcs_

unsigned long long SiStripDcsInfo::m_cacheIDDcs_ {}
private

Definition at line 69 of file SiStripDcsInfo.cc.

◆ MaxAcceptableBadDcsLumi_

constexpr float SiStripDcsInfo::MaxAcceptableBadDcsLumi_ {2}
staticprivate

Definition at line 79 of file SiStripDcsInfo.cc.

Referenced by addBadModules().

◆ MinAcceptableDcsDetFrac_

constexpr float SiStripDcsInfo::MinAcceptableDcsDetFrac_ {0.90}
staticprivate

Definition at line 78 of file SiStripDcsInfo.cc.

Referenced by fillStatus().

◆ nFEDConnected_

int SiStripDcsInfo::nFEDConnected_ {}
private

◆ nGoodDcsLumi_

int SiStripDcsInfo::nGoodDcsLumi_ {}
private

Definition at line 77 of file SiStripDcsInfo.cc.

Referenced by fillStatus().

◆ nLumiAnalysed_

int SiStripDcsInfo::nLumiAnalysed_ {}
private

Definition at line 74 of file SiStripDcsInfo.cc.

Referenced by beginLuminosityBlock().

◆ runInfoToken_

edm::ESGetToken<RunInfo, RunInfoRcd> SiStripDcsInfo::runInfoToken_
private

Definition at line 86 of file SiStripDcsInfo.cc.

Referenced by beginRun().

◆ SubDetMEsMap

std::map<std::string, SubDetMEs> SiStripDcsInfo::SubDetMEsMap {}
private

◆ tTopoToken0_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripDcsInfo::tTopoToken0_
private

Definition at line 82 of file SiStripDcsInfo.cc.

Referenced by readStatus().

◆ tTopoToken1_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripDcsInfo::tTopoToken1_
private

Definition at line 82 of file SiStripDcsInfo.cc.

Referenced by readStatus().

◆ tTopoToken2_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripDcsInfo::tTopoToken2_
private

Definition at line 82 of file SiStripDcsInfo.cc.

Referenced by readStatus().

◆ tTopoToken3_

edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripDcsInfo::tTopoToken3_
private

Definition at line 82 of file SiStripDcsInfo.cc.

Referenced by readCabling().