38 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::Deleting SiStripDaqInfo ";
46 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::Deleting SiStripDaqInfo ";
74 std::vector<std::string> det_type;
75 det_type.push_back(
"TIB");
76 det_type.push_back(
"TOB");
77 det_type.push_back(
"TIDF");
78 det_type.push_back(
"TIDB");
79 det_type.push_back(
"TECF");
80 det_type.push_back(
"TECB");
82 for ( std::vector<std::string>::iterator it = det_type.begin(); it != det_type.end(); it++) {
87 me_name =
"SiStrip_" + det;
103 it->second.DaqFractionME->Reset();
104 it->second.DaqFractionME->Fill(-1.0);
114 edm::LogInfo (
"SiStripDaqInfo") <<
"SiStripDaqInfo:: Begining of Run";
128 edm::LogInfo (
"SiStripDaqInfo") <<
" SiStripDaqInfo::No FEDs Connected!!!";
132 float nFEDConnected = 0.0;
137 if( eSetup.
find( recordKey ) !=
nullptr) {
143 std::vector<int> FedsInIds= sumFED->
m_fed_in;
144 for(
unsigned int it = 0; it < FedsInIds.size(); ++it) {
145 int fedID = FedsInIds[it];
147 if(fedID>=siStripFedIdMin && fedID<=siStripFedIdMax) ++nFEDConnected;
150 <<
" Connected FEDs " << nFEDConnected;
151 if (nFEDConnected > 0) {
169 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::endLuminosityBlock";
175 edm::LogInfo (
"SiStripDaqInfo") <<
"SiStripDaqInfo::EndRun";
190 for(std::vector<unsigned short>::const_iterator ifed = feds.begin(); ifed != feds.end(); ifed++){
192 for (
auto iconn = fedChannels.begin(); iconn < fedChannels.end(); iconn++){
193 if (!iconn->isConnected())
continue;
194 uint32_t detId = iconn->detId();
195 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
220 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(name);
222 iPos->second.ConnectedFeds = 0;
230 std::vector<unsigned short> subdetIds = it->second;
231 std::map<std::string, SubDetMEs>::iterator iPos =
SubDetMEsMap.find(name);
233 iPos->second.ConnectedFeds = 0;
234 for (std::vector<unsigned short>::iterator iv = subdetIds.begin();
235 iv != subdetIds.end(); iv++) {
236 bool fedid_found =
false;
237 for(
unsigned int it = 0; it < fed_ids.size(); ++it) {
238 unsigned short fedID = fed_ids[it];
239 if(fedID < siStripFedIdMin || fedID > siStripFedIdMax)
continue;
240 if ((*iv) == fedID) {
242 iPos->second.ConnectedFeds++;
248 int nFedsConnected = iPos->second.ConnectedFeds;
249 int nFedSubDet = subdetIds.size();
250 if (nFedSubDet > 0) {
251 iPos->second.DaqFractionME->Reset();
252 iPos->second.DaqFractionME->Fill(nFedsConnected*1.0/nFedSubDet);
270 for (std::vector<FedChannelConnection>::const_iterator iconn = fedChannels.begin();
271 iconn < fedChannels.end(); iconn++){
272 if (!iconn->isConnected())
continue;
273 uint32_t detId = iconn->detId();
274 if (detId == 0 || detId == 0xFFFFFFFF)
continue;
282 subdet_folder = mechanical_dir + subdet_folder.substr(subdet_folder.find(mdir)+mdir.size());
284 bad_module_folder = subdet_folder +
"/" +
"BadModuleList";
287 std::ostringstream detid_str;
289 std::string full_path = bad_module_folder +
"/" + detid_str.str();
static void setBadModuleFlag(std::string &hname, uint16_t &flg)
int64_t getIntValue() const
const std::string & pwd() const
void getSubDetFolder(const uint32_t &detid, const TrackerTopology *tTopo, std::string &folder_name)
void readFedIds(const edm::ESHandle< SiStripFedCabling > &fedcabling, edm::EventSetup const &iSetup)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
Begin Run.
#define DEFINE_FWK_MODULE(type)
static HCTypeTag findType(char const *iTypeName)
find a type based on the types name, if not found will return default HCTypeTag
void findExcludedModule(unsigned short fed_id, const TrackerTopology *tTopo)
MonitorElement * bookFloat(const char *name)
Book float.
const eventsetup::EventSetupRecord * find(const eventsetup::EventSetupRecordKey &) const
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
End Of Luminosity.
edm::ESHandle< SiStripFedCabling > fedCabling_
void beginJob() override
BeginJob.
std::vector< int > m_fed_in
FedsConstIterRange fedIds() const
const std::string subdet_tag("SubDet")
void analyze(edm::Event const &, edm::EventSetup const &) override
Analyze.
SiStripDaqInfo(const edm::ParameterSet &ps)
Constructor.
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
EndRun.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void Reset()
reset ME (ie. contents, errors, etc)
std::map< std::string, SubDetMEs > SubDetMEsMap
~SiStripDaqInfo() override
Destructor.
bool dirExists(const std::string &path) const
true if directory exists
std::map< std::string, std::vector< unsigned short > > subDetFedMap
void cd()
go to top directory (ie. root)
MonitorElement * DaqFractionME
void readSubdetFedFractions(std::vector< int > &fed_ids, edm::EventSetup const &iSetup)
ConnsConstIterRange fedConnections(uint16_t fed_id) const
static void getSubDetectorTag(uint32_t det_id, std::string &subdet_tag, const TrackerTopology *tTopo)
MonitorElement * DaqFraction_
MonitorElement * bookInt(const char *name)
Book int.
unsigned long long m_cacheID_
static bool goToDir(DQMStore *dqm_store, std::string name)
T const * product() const
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
void setCurrentFolder(const std::string &fullpath)