CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
SiStripDcsInfo Class Reference

#include <SiStripDcsInfo.h>

Inheritance diagram for SiStripDcsInfo:
edm::EDAnalyzer edm::EDConsumerBase

Classes

struct  SubDetMEs
 

Public Types

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

Public Member Functions

 SiStripDcsInfo (const edm::ParameterSet &ps)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > 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
 
bool registeredToConsumeMany (TypeID const &, 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::ESRecordsToProxyIndices 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,
SiStripDetCablingRcd
detCablingToken_
 
edm::ESGetToken
< SiStripDetVOff,
SiStripDetVOffRcd
detVOffToken0_
 
edm::ESGetToken
< SiStripDetVOff,
SiStripDetVOffRcd
detVOffToken1_
 
edm::ESGetToken
< SiStripDetVOff,
SiStripDetVOffRcd
detVOffToken2_
 
edm::ESWatcher
< SiStripFedCablingRcd
fedCablingWatcher_
 
bool IsLumiGoodDcs_ {false}
 
unsigned long long m_cacheIDDcs_ {}
 
int nFEDConnected_ {}
 
int nGoodDcsLumi_ {}
 
int nLumiAnalysed_ {}
 
edm::ESGetToken< RunInfo,
RunInfoRcd
runInfoToken_
 
std::map< std::string, SubDetMEsSubDetMEsMap {}
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken0_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken1_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken2_
 
edm::ESGetToken
< TrackerTopology,
TrackerTopologyRcd
tTopoToken3_
 

Static Private Attributes

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

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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

DQM/SiStripMonitorCluster/interface/SiStripDcsInfo.h

Description: Checks the # of SiStrip FEDs from DAQ Usage: <usage>

Definition at line 50 of file SiStripDcsInfo.h.

Member Typedef Documentation

Definition at line 53 of file SiStripDcsInfo.h.

Definition at line 52 of file SiStripDcsInfo.h.

Constructor & Destructor Documentation

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

Definition at line 22 of file SiStripDcsInfo.cc.

References LogDebug.

23  : tTopoToken0_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
24  tTopoToken1_(esConsumes<edm::Transition::EndLuminosityBlock>()),
25  tTopoToken2_(esConsumes<edm::Transition::EndRun>()),
26  tTopoToken3_(esConsumes<edm::Transition::BeginRun>()),
27  detVOffToken0_(esConsumes<edm::Transition::BeginLuminosityBlock>()),
28  detVOffToken1_(esConsumes<edm::Transition::EndLuminosityBlock>()),
29  detVOffToken2_(esConsumes<edm::Transition::EndRun>()),
30  detCablingToken_(esConsumes<edm::Transition::BeginRun>()),
31  runInfoToken_(esConsumes<edm::Transition::BeginRun>()) {
32  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::Deleting SiStripDcsInfo ";
33 }
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

void SiStripDcsInfo::addBadModules ( DQMStore dqm_store)
private

Definition at line 265 of file SiStripDcsInfo.cc.

References dqm::implementation::IBooker::bookInt(), dqm::implementation::DQMStore::cd(), dqm::impl::MonitorElement::Fill(), dqm::implementation::IGetter::get(), dqm::impl::MonitorElement::getIntValue(), SiStripUtility::goToDir(), MaxAcceptableBadDcsLumi_, hlt_dqm_clientPB-live_cfg::me, dqm::implementation::DQMStore::pwd(), dqm::impl::MonitorElement::Reset(), SiStripUtility::setBadModuleFlag(), dqm::implementation::DQMStore::setCurrentFolder(), AlCaHLTBitMon_QueryRunRegistry::string, SubDetMEsMap, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by endRun().

265  {
266  dqm_store.cd();
267  std::string mdir = "MechanicalView";
268  if (!SiStripUtility::goToDir(dqm_store, mdir)) {
269  dqm_store.setCurrentFolder("SiStrip/" + mdir);
270  }
271  std::string mechanical_dir = dqm_store.pwd();
272  std::string tag = "DCSError";
273 
274  for (auto const& pr : SubDetMEsMap) {
275  auto const& lumiCountBadModules = pr.second.NLumiDetectorIsFaulty;
276  for (auto const [ibad, nBadLumi] : lumiCountBadModules) {
277  if (nBadLumi <= MaxAcceptableBadDcsLumi_)
278  continue;
279  std::string bad_module_folder = mechanical_dir + "/" + pr.second.folder_name +
280  "/"
281  "BadModuleList";
282  dqm_store.setCurrentFolder(bad_module_folder);
283 
284  std::ostringstream detid_str;
285  detid_str << ibad;
286  std::string full_path = bad_module_folder + "/" + detid_str.str();
287  MonitorElement* me = dqm_store.get(full_path);
288  uint16_t flag = 0;
289  if (me) {
290  flag = me->getIntValue();
291  me->Reset();
292  } else
293  me = dqm_store.bookInt(detid_str.str());
295  me->Fill(flag);
296  }
297  }
298  dqm_store.cd();
299 }
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
virtual int64_t getIntValue() const
std::string pwd() override
Definition: DQMStore.h:567
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
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
static constexpr float MaxAcceptableBadDcsLumi_
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:73
static bool goToDir(DQMStore &dqm_store, std::string const &name)
void SiStripDcsInfo::analyze ( edm::Event const &  event,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 75 of file SiStripDcsInfo.cc.

75 {}
void SiStripDcsInfo::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 35 of file SiStripDcsInfo.cc.

References SubDetMEsMap.

35  {
36  // Since SubDetMEs is a struct, using the brace initialization will
37  // zero-initialize all members that are not specified in the call.
38  SubDetMEsMap.emplace("TIB", SubDetMEs{"TIB", nullptr, 0, {}, {}});
39  SubDetMEsMap.emplace("TOB", SubDetMEs{"TOB", nullptr, 0, {}, {}});
40  SubDetMEsMap.emplace("TECB", SubDetMEs{"TEC/MINUS", nullptr, 0, {}, {}});
41  SubDetMEsMap.emplace("TECF", SubDetMEs{"TEC/PLUS", nullptr, 0, {}, {}});
42  SubDetMEsMap.emplace("TIDB", SubDetMEs{"TID/MINUS", nullptr, 0, {}, {}});
43  SubDetMEsMap.emplace("TIDF", SubDetMEs{"TID/PLUS", nullptr, 0, {}, {}});
44 }
std::map< std::string, SubDetMEs > SubDetMEsMap
void SiStripDcsInfo::beginLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 77 of file SiStripDcsInfo.cc.

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

77  {
78  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::beginLuminosityBlock";
79 
80  if (nFEDConnected_ == 0)
81  return;
82 
83  // initialise BadModule list
84  for (auto& subDetME : SubDetMEsMap) {
85  subDetME.second.FaultyDetectors.clear();
86  }
87  readStatus(eSetup, 0);
89 }
std::map< std::string, SubDetMEs > SubDetMEsMap
void readStatus(edm::EventSetup const &, int transition)
#define LogDebug(id)
void SiStripDcsInfo::beginRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 48 of file SiStripDcsInfo.cc.

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

48  {
49  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo:: Begining of Run";
50  nFEDConnected_ = 0;
51  constexpr int siStripFedIdMin{FEDNumbering::MINSiStripFEDID};
52  constexpr int siStripFedIdMax{FEDNumbering::MAXSiStripFEDID};
53 
54  // Count Tracker FEDs from RunInfo
55  //
56  if (eSetup.tryToGet<RunInfoRcd>()) {
57  if (auto sumFED = eSetup.getHandle(runInfoToken_)) {
58  std::vector<int> FedsInIds = sumFED->m_fed_in;
59  for (unsigned int it = 0; it < FedsInIds.size(); ++it) {
60  int fedID = FedsInIds[it];
61  if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
63  }
64  LogDebug("SiStripDcsInfo") << " SiStripDcsInfo :: Connected FEDs " << nFEDConnected_;
65  }
66  }
67 
68  auto& dqm_store = *edm::Service<DQMStore>{};
69  bookStatus(dqm_store);
70  fillDummyStatus(dqm_store);
71  if (nFEDConnected_ > 0)
72  readCabling(eSetup);
73 }
void bookStatus(DQMStore &dqm_store)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
void readCabling(edm::EventSetup const &)
void fillDummyStatus(DQMStore &dqm_store)
#define LogDebug(id)
void SiStripDcsInfo::bookStatus ( DQMStore dqm_store)
private

Definition at line 117 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().

117  {
118  if (bookedStatus_)
119  return;
120 
121  std::string strip_dir = "";
122  SiStripUtility::getTopFolderPath(dqm_store, "SiStrip", strip_dir);
123  if (!strip_dir.empty())
124  dqm_store.setCurrentFolder(strip_dir + "/EventInfo");
125  else
126  dqm_store.setCurrentFolder("SiStrip/EventInfo");
127 
128  auto scope = DQMStore::UseLumiScope(dqm_store);
129 
130  DcsFraction_ = dqm_store.bookFloat("DCSSummary");
131 
132  dqm_store.cd();
133  if (!strip_dir.empty())
134  dqm_store.setCurrentFolder(strip_dir + "/EventInfo/DCSContents");
135  else
136  dqm_store.setCurrentFolder("SiStrip/EventInfo/DCSContents");
137  for (auto& [suffix, subDetME] : SubDetMEsMap) {
138  std::string const me_name{"SiStrip_" + suffix};
139  subDetME.DcsFractionME = dqm_store.bookFloat(me_name);
140  }
141  bookedStatus_ = true;
142  dqm_store.cd();
143 }
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
Definition: DQMStore.h:80
void setCurrentFolder(std::string const &fullpath) override
Definition: DQMStore.h:569
std::map< std::string, SubDetMEs > SubDetMEsMap
UseScope< MonitorElementData::Scope::LUMI > UseLumiScope
Definition: DQMStore.h:463
MonitorElement * DcsFraction_
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
void SiStripDcsInfo::endLuminosityBlock ( edm::LuminosityBlock const &  lumiSeg,
edm::EventSetup const &  iSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file SiStripDcsInfo.cc.

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

91  {
92  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::endLuminosityBlock";
93 
94  if (nFEDConnected_ == 0)
95  return;
96  auto& dqm_store = *edm::Service<DQMStore>{};
97  readStatus(eSetup, 1);
98  fillStatus(dqm_store);
99 }
void fillStatus(DQMStore &dqm_store)
void readStatus(edm::EventSetup const &, int transition)
#define LogDebug(id)
void SiStripDcsInfo::endRun ( edm::Run const &  run,
edm::EventSetup const &  eSetup 
)
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 101 of file SiStripDcsInfo.cc.

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

101  {
102  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::EndRun";
103 
104  if (nFEDConnected_ == 0)
105  return;
106 
107  for (auto& subDetME : SubDetMEsMap) {
108  subDetME.second.FaultyDetectors.clear();
109  }
110  readStatus(eSetup, 2);
111  auto& dqm_store = *edm::Service<DQMStore>{};
112  addBadModules(dqm_store);
113 }
std::map< std::string, SubDetMEs > SubDetMEsMap
void readStatus(edm::EventSetup const &, int transition)
void addBadModules(DQMStore &dqm_store)
#define LogDebug(id)
void SiStripDcsInfo::fillDummyStatus ( DQMStore dqm_store)
private

Definition at line 252 of file SiStripDcsInfo.cc.

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

Referenced by beginRun().

252  {
253  if (!bookedStatus_)
254  bookStatus(dqm_store);
256 
257  for (auto& pr : SubDetMEsMap) {
258  pr.second.DcsFractionME->Reset();
259  pr.second.DcsFractionME->Fill(-1.0);
260  }
261  DcsFraction_->Reset();
262  DcsFraction_->Fill(-1.0);
263 }
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_
void SiStripDcsInfo::fillStatus ( DQMStore dqm_store)
private

Definition at line 209 of file SiStripDcsInfo.cc.

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

Referenced by endLuminosityBlock().

209  {
210  if (!bookedStatus_)
211  bookStatus(dqm_store);
213 
214  float total_det = 0.0;
215  float faulty_det = 0.0;
216  float fraction;
217  for (auto const& [name, subDetMEs] : SubDetMEsMap) {
218  int total_subdet = subDetMEs.TotalDetectors;
219  int faulty_subdet = subDetMEs.FaultyDetectors.size();
220  if (nFEDConnected_ == 0 || total_subdet == 0)
221  fraction = -1;
222  else
223  fraction = 1.0 - faulty_subdet * 1.0 / total_subdet;
224  subDetMEs.DcsFractionME->Reset();
225  subDetMEs.DcsFractionME->Fill(fraction);
226  edm::LogInfo("SiStripDcsInfo") << " SiStripDcsInfo::fillStatus : Sub Detector " << name << " Total Number "
227  << total_subdet << " Faulty ones " << faulty_subdet;
228  total_det += total_subdet;
229  faulty_det += faulty_subdet;
230  }
231  if (nFEDConnected_ == 0 || total_det == 0)
232  fraction = -1.0;
233  else
234  fraction = 1 - faulty_det / total_det;
235  DcsFraction_->Reset();
236  DcsFraction_->Fill(fraction);
238  if (!IsLumiGoodDcs_)
239  return;
240 
241  ++nGoodDcsLumi_;
242  for (auto& pr : SubDetMEsMap) {
243  for (auto const detId_faulty : pr.second.FaultyDetectors) {
244  pr.second.NLumiDetectorIsFaulty[detId_faulty]++;
245  }
246  }
247 }
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_
void SiStripDcsInfo::readCabling ( edm::EventSetup const &  eSetup)
private

Definition at line 145 of file SiStripDcsInfo.cc.

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

Referenced by beginRun().

145  {
146  const auto tTopo = &eSetup.getData(tTopoToken3_);
147 
148  if (fedCablingWatcher_.check(eSetup)) {
149  LogDebug("SiStripDcsInfo") << "SiStripDcsInfo::readCabling : "
150  << " Change in Cache";
151  detCabling_ = &eSetup.getData(detCablingToken_);
152 
153  std::vector<uint32_t> SelectedDetIds;
154  detCabling_->addActiveDetectorsRawIds(SelectedDetIds);
155  LogDebug("SiStripDcsInfo") << " SiStripDcsInfo::readCabling : "
156  << " Total Detectors " << SelectedDetIds.size();
157 
158  // initialise total # of detectors first
159  for (std::map<std::string, SubDetMEs>::iterator it = SubDetMEsMap.begin(); it != SubDetMEsMap.end(); it++) {
160  it->second.TotalDetectors = 0;
161  }
162 
163  for (std::vector<uint32_t>::const_iterator idetid = SelectedDetIds.begin(); idetid != SelectedDetIds.end();
164  ++idetid) {
165  uint32_t detId = *idetid;
166  if (detId == 0 || detId == 0xFFFFFFFF)
167  continue;
169  SiStripUtility::getSubDetectorTag(detId, subdet_tag, tTopo);
170 
171  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(subdet_tag);
172  if (iPos != SubDetMEsMap.end()) {
173  iPos->second.TotalDetectors++;
174  }
175  }
176  }
177 }
void addActiveDetectorsRawIds(std::vector< uint32_t > &) const
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_
#define LogDebug(id)
void SiStripDcsInfo::readStatus ( edm::EventSetup const &  eSetup,
int  transition 
)
private

Definition at line 181 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().

181  {
182  const auto tTopo = &eSetup.getData(transition == 0 ? tTopoToken0_ : (transition == 1 ? tTopoToken1_ : tTopoToken2_));
183  const auto& detVOff =
184  eSetup.getData(transition == 0 ? detVOffToken0_ : (transition == 1 ? detVOffToken1_ : detVOffToken2_));
185  std::vector<uint32_t> FaultyDetIds;
186  detVOff.getDetIds(FaultyDetIds);
187  LogDebug("SiStripDcsInfo") << " SiStripDcsInfo::readStatus : "
188  << " Faulty Detectors " << FaultyDetIds.size();
189  // Read and fille bad modules
190  for (std::vector<uint32_t>::const_iterator ihvoff = FaultyDetIds.begin(); ihvoff != FaultyDetIds.end(); ++ihvoff) {
191  uint32_t detId_hvoff = (*ihvoff);
192  if (!detCabling_->IsConnected(detId_hvoff))
193  continue;
195  SiStripUtility::getSubDetectorTag(detId_hvoff, subdet_tag, tTopo);
196 
197  std::map<std::string, SubDetMEs>::iterator iPos = SubDetMEsMap.find(subdet_tag);
198  if (iPos != SubDetMEsMap.end()) {
199  std::vector<uint32_t>::iterator ibad =
200  std::find(iPos->second.FaultyDetectors.begin(), iPos->second.FaultyDetectors.end(), detId_hvoff);
201  if (ibad == iPos->second.FaultyDetectors.end())
202  iPos->second.FaultyDetectors.push_back(detId_hvoff);
203  }
204  }
205 }
const SiStripDetCabling * detCabling_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken2_
edm::ESGetToken< SiStripDetVOff, SiStripDetVOffRcd > detVOffToken0_
bool IsConnected(const uint32_t &det_id) const
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
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

bool SiStripDcsInfo::bookedStatus_ {false}
private

Definition at line 84 of file SiStripDcsInfo.h.

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

MonitorElement* SiStripDcsInfo::DcsFraction_ {nullptr}
private

Definition at line 72 of file SiStripDcsInfo.h.

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

const SiStripDetCabling* SiStripDcsInfo::detCabling_
private

Definition at line 95 of file SiStripDcsInfo.h.

Referenced by readCabling(), and readStatus().

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

Definition at line 99 of file SiStripDcsInfo.h.

Referenced by readCabling().

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

Definition at line 97 of file SiStripDcsInfo.h.

Referenced by readStatus().

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

Definition at line 97 of file SiStripDcsInfo.h.

Referenced by readStatus().

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

Definition at line 97 of file SiStripDcsInfo.h.

Referenced by readStatus().

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

Definition at line 98 of file SiStripDcsInfo.h.

Referenced by readCabling().

bool SiStripDcsInfo::IsLumiGoodDcs_ {false}
private

Definition at line 90 of file SiStripDcsInfo.h.

Referenced by fillStatus().

unsigned long long SiStripDcsInfo::m_cacheIDDcs_ {}
private

Definition at line 83 of file SiStripDcsInfo.h.

constexpr float SiStripDcsInfo::MaxAcceptableBadDcsLumi_ {2}
staticprivate

Definition at line 93 of file SiStripDcsInfo.h.

Referenced by addBadModules().

constexpr float SiStripDcsInfo::MinAcceptableDcsDetFrac_ {0.90}
staticprivate

Definition at line 92 of file SiStripDcsInfo.h.

Referenced by fillStatus().

int SiStripDcsInfo::nFEDConnected_ {}
private
int SiStripDcsInfo::nGoodDcsLumi_ {}
private

Definition at line 91 of file SiStripDcsInfo.h.

Referenced by fillStatus().

int SiStripDcsInfo::nLumiAnalysed_ {}
private

Definition at line 88 of file SiStripDcsInfo.h.

Referenced by beginLuminosityBlock().

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

Definition at line 100 of file SiStripDcsInfo.h.

Referenced by beginRun().

std::map<std::string, SubDetMEs> SiStripDcsInfo::SubDetMEsMap {}
private
edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> SiStripDcsInfo::tTopoToken0_
private

Definition at line 96 of file SiStripDcsInfo.h.

Referenced by readStatus().

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

Definition at line 96 of file SiStripDcsInfo.h.

Referenced by readStatus().

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

Definition at line 96 of file SiStripDcsInfo.h.

Referenced by readStatus().

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

Definition at line 96 of file SiStripDcsInfo.h.

Referenced by readCabling().