35 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::Deleting SiStripDaqInfo ";
51 if (!strip_dir.empty())
59 if (!strip_dir.empty())
64 std::vector<std::string> det_types;
65 det_types.push_back(
"TIB");
66 det_types.push_back(
"TOB");
67 det_types.push_back(
"TIDF");
68 det_types.push_back(
"TIDB");
69 det_types.push_back(
"TECF");
70 det_types.push_back(
"TECB");
72 for (
auto const& det : det_types) {
92 pr.second.daqFractionME->Reset();
93 pr.second.daqFractionME->Fill(-1.0);
102 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo:: Begining of Run";
119 edm::LogInfo (
"SiStripDaqInfo") <<
" SiStripDaqInfo::No FEDs Connected!!!";
123 float nFEDConnected = 0.0;
128 if (!runInfoRec)
return;
131 runInfoRec->get(sumFED);
135 auto const& fedsInIds = sumFED->
m_fed_in;
136 for (
auto const fedID : fedsInIds) {
137 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax) ++nFEDConnected;
140 <<
" SiStripDaqInfo::Total # of FEDs " <<
nFedTotal_ <<
" Connected FEDs " 142 if (nFEDConnected > 0) {
167 for (
auto const fed : feds) {
169 for (
auto const& conn : fedChannels) {
170 if (!conn.isConnected())
continue;
171 uint32_t detId = conn.detId();
172 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
185 std::vector<int>
const& fed_ids,
198 auto const&
name =
pr.first;
201 iPos->second.connectedFeds = 0;
205 for (
auto const& [
name, subdetIds] : subDetFedMap_) {
208 iPos->second.connectedFeds = 0;
209 for (
auto const subdetId : subdetIds) {
210 bool fedid_found =
false;
211 for (
auto const fedId : fed_ids) {
212 if (fedId < siStripFedIdMin || fedId > siStripFedIdMax)
continue;
213 if (subdetId ==
fedId) {
215 iPos->second.connectedFeds++;
221 if (
auto nFedSubDet = subdetIds.size(); nFedSubDet > 0) {
222 iPos->second.daqFractionME->Reset();
223 int const nFedsConnected = iPos->second.connectedFeds;
224 iPos->second.daqFractionME->Fill(nFedsConnected * 1.0 / nFedSubDet);
233 unsigned short const fed_id,
246 for (
auto const& conn : fedChannels) {
247 if (!conn.isConnected())
continue;
248 uint32_t detId = conn.detId();
249 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
256 if (!dqm_store.
dirExists(subdet_folder)) {
259 subdet_folder.substr(subdet_folder.find(mdir) + mdir.size());
261 bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
264 std::ostringstream detid_str;
266 std::string full_path = bad_module_folder +
"/" + detid_str.str();
273 me = dqm_store.
bookInt(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)
std::optional< T > tryToGet() const
int64_t getIntValue() const
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void bookStatus(DQMStore &dqm_store)
MonitorElement * bookInt(char_string const &name)
Book int.
MonitorElement * bookFloat(char_string const &name)
Book float.
std::map< std::string, std::vector< unsigned short > > subDetFedMap_
#define DEFINE_FWK_MODULE(type)
bool dirExists(std::string const &path) const
true if directory exists
std::vector< int > m_fed_in
FedsConstIterRange fedIds() const
void readFedIds(edm::ESHandle< SiStripFedCabling > const &fedcabling, edm::EventSetup const &iSetup)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
const std::string subdet_tag("SubDet")
void analyze(edm::Event const &, edm::EventSetup const &) override
void Reset()
reset ME (ie. contents, errors, etc)
SiStripDaqInfo(edm::ParameterSet const &ps)
std::string const & pwd() const
void setCurrentFolder(std::string const &fullpath)
void cd()
go to top directory (ie. root)
ConnsConstIterRange fedConnections(uint16_t fed_id) const
std::map< std::string, SubDetMEs > subDetMEsMap_
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)
unsigned long long m_cacheID_
T const * product() const
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
edm::ESHandle< SiStripFedCabling > fedCabling_