27 : fedCablingToken_{esConsumes<edm::Transition::BeginRun>()},
28 tTopoToken_{esConsumes<edm::Transition::BeginRun>()},
29 runInfoToken_{esConsumes<edm::Transition::BeginRun>()} {
30 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::Deleting SiStripDaqInfo ";
44 if (!strip_dir.empty())
52 if (!strip_dir.empty())
57 std::vector<std::string> det_types;
58 det_types.push_back(
"TIB");
59 det_types.push_back(
"TOB");
60 det_types.push_back(
"TIDF");
61 det_types.push_back(
"TIDB");
62 det_types.push_back(
"TECF");
63 det_types.push_back(
"TECB");
65 for (
auto const& det : det_types) {
83 pr.second.daqFractionME->Reset();
84 pr.second.daqFractionME->Fill(-1.0);
91 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo:: Begining of Run";
104 edm::LogInfo(
"SiStripDaqInfo") <<
" SiStripDaqInfo::No FEDs Connected!!!";
108 float nFEDConnected = 0.0;
118 auto const& fedsInIds = sumFED->m_fed_in;
119 for (
auto const fedID : fedsInIds) {
120 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
125 if (nFEDConnected > 0) {
144 for (
auto const fed :
feds) {
146 for (
auto const&
conn : fedChannels) {
147 if (!
conn.isConnected())
149 uint32_t detId =
conn.detId();
150 if (detId == 0 || detId == 0xFFFFFFFF)
163 std::vector<int>
const& fed_ids,
173 auto const&
name =
pr.first;
177 iPos->second.connectedFeds = 0;
185 iPos->second.connectedFeds = 0;
186 for (
auto const subdetId : subdetIds) {
187 bool fedid_found =
false;
188 for (
auto const fedId : fed_ids) {
189 if (fedId < siStripFedIdMin || fedId > siStripFedIdMax)
191 if (subdetId ==
fedId) {
193 iPos->second.connectedFeds++;
200 if (
auto nFedSubDet = subdetIds.size(); nFedSubDet > 0) {
201 iPos->second.daqFractionME->Reset();
202 int const nFedsConnected = iPos->second.connectedFeds;
203 iPos->second.daqFractionME->Fill(nFedsConnected * 1.0 / nFedSubDet);
211 unsigned short const fed_id,
223 for (
auto const&
conn : fedChannels) {
224 if (!
conn.isConnected())
226 uint32_t detId =
conn.detId();
227 if (detId == 0 || detId == 0xFFFFFFFF)
235 if (!dqm_store.
dirExists(subdet_folder)) {
236 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(mdir) + mdir.size());
238 bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
241 std::ostringstream detid_str;
243 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())
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
#define DEFINE_FWK_MODULE(type)
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.
std::map< std::string, std::vector< unsigned short > > subDetFedMap_
const std::string subdet_tag("SubDet")
void analyze(edm::Event const &, edm::EventSetup const &) override
bool getData(T &iHolder) const
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
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