73 : fedCablingToken_{esConsumes<edm::Transition::BeginRun>()},
74 tTopoToken_{esConsumes<edm::Transition::BeginRun>()},
75 runInfoToken_{esConsumes<edm::Transition::BeginRun>()} {
76 usesResource(
"DQMStore");
77 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::Deleting SiStripDaqInfo ";
91 if (!strip_dir.empty())
99 if (!strip_dir.empty())
104 std::vector<std::string> det_types;
105 det_types.push_back(
"TIB");
106 det_types.push_back(
"TOB");
107 det_types.push_back(
"TIDF");
108 det_types.push_back(
"TIDB");
109 det_types.push_back(
"TECF");
110 det_types.push_back(
"TECB");
112 for (
auto const& det : det_types) {
130 pr.second.daqFractionME->Reset();
131 pr.second.daqFractionME->Fill(-1.0);
138 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo:: Begining of Run";
151 edm::LogInfo(
"SiStripDaqInfo") <<
" SiStripDaqInfo::No FEDs Connected!!!";
155 float nFEDConnected = 0.0;
165 auto const& fedsInIds = sumFED->m_fed_in;
166 for (
auto const fedID : fedsInIds) {
167 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
172 if (nFEDConnected > 0) {
191 for (
auto const fed :
feds) {
193 for (
auto const&
conn : fedChannels) {
194 if (!
conn.isConnected())
196 uint32_t detId =
conn.detId();
197 if (detId == 0 || detId == 0xFFFFFFFF)
210 std::vector<int>
const& fed_ids,
220 auto const&
name =
pr.first;
224 iPos->second.connectedFeds = 0;
232 iPos->second.connectedFeds = 0;
233 for (
auto const subdetId : subdetIds) {
234 bool fedid_found =
false;
235 for (
auto const fedId : fed_ids) {
236 if (fedId < siStripFedIdMin || fedId > siStripFedIdMax)
238 if (subdetId ==
fedId) {
240 iPos->second.connectedFeds++;
247 if (
auto nFedSubDet = subdetIds.size(); nFedSubDet > 0) {
248 iPos->second.daqFractionME->Reset();
249 int const nFedsConnected = iPos->second.connectedFeds;
250 iPos->second.daqFractionME->Fill(nFedsConnected * 1.0 / nFedSubDet);
258 unsigned short const fed_id,
270 for (
auto const&
conn : fedChannels) {
271 if (!
conn.isConnected())
273 uint32_t detId =
conn.detId();
274 if (detId == 0 || detId == 0xFFFFFFFF)
282 if (!dqm_store.
dirExists(subdet_folder)) {
283 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(mdir) + mdir.size());
285 bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
288 std::ostringstream detid_str;
290 std::string full_path = bad_module_folder +
"/" + detid_str.str();
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
void findExcludedModule(DQMStore &dqm_store, unsigned short fed_id, TrackerTopology const *tTopo)
void readSubdetFedFractions(DQMStore &dqm_store, std::vector< int > const &fed_ids, edm::EventSetup const &iSetup)
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
edm::ESGetToken< SiStripFedCabling, SiStripFedCablingRcd > fedCablingToken_
void setCurrentFolder(std::string const &fullpath) override
std::optional< T > tryToGet() const
virtual bool dirExists(std::string const &path) const
void bookStatus(DQMStore &dqm_store)
std::string pwd() override
void readFedIds(const SiStripFedCabling *fedcabling, edm::EventSetup const &iSetup)
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
MonitorElement * daqFractionME
std::map< std::string, std::vector< unsigned short > > subDetFedMap_
dqm::harvesting::MonitorElement MonitorElement
const std::string subdet_tag("SubDet")
void analyze(edm::Event const &, edm::EventSetup const &) override
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
#define DEFINE_FWK_MODULE(type)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
dqm::harvesting::DQMStore DQMStore
SiStripDaqInfo(edm::ParameterSet const &ps)
Log< level::Info, false > LogInfo
MonitorElement * bookInt(TString const &name, FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
edm::ESWatcher< SiStripFedCablingRcd > fedCablingWatcher_
std::map< std::string, SubDetMEs > subDetMEsMap_
Contains cabling info at the device level, including DetId, APV pair numbers, hardware addresses...
bool check(const edm::EventSetup &iSetup)
const SiStripFedCabling * fedCabling_
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
static bool goToDir(DQMStore &dqm_store, std::string const &name)
MonitorElement * daqFraction_
void fillDummyStatus(DQMStore &dqm_store)
FedsConstIterRange fedIds() const
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
ConnsConstIterRange fedConnections(uint16_t fed_id) const