29 :
public edm::one::EDAnalyzer<edm::one::SharedResources, edm::one::WatchRuns, edm::one::WatchLuminosityBlocks> {
77 usesResource(
"DQMStore");
78 consumes<DQMToken, edm::InRun>(
edm::InputTag(
"siStripOfflineAnalyser",
"DQMGenerationSiStripAnalyserRun"));
79 consumes<DQMToken, edm::InLumi>(
edm::InputTag(
"siStripOfflineAnalyser",
"DQMGenerationSiStripAnalyserLumi"));
83 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: Begining of Run";
91 for (
auto const fedID : sumFED->m_fed_in) {
92 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
113 if (!strip_dir.empty())
121 std::string htitle =
"SiStrip Certification for Good Detector Fraction";
128 auto const& det =
pr.first;
135 if (!strip_dir.empty())
183 if (!strip_dir.empty())
193 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::endLuminosityBlock";
202 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: End Run";
216 <<
" SiStripCertificationInfo::fillSiStripCertificationMEs : MEs missing ";
229 uint16_t nDetTot = 0;
230 uint16_t nFaultyTot = 0;
231 uint16_t nSToNTot = 0;
241 std::string bad_module_folder = mechanical_dir +
"/" + subDetME.folder_name +
"/" +
"BadModuleList";
242 std::vector<MonitorElement*> faulty_detMEs = dqm_store.
getContents(bad_module_folder);
244 uint16_t ndet_subdet = 0;
245 uint16_t nfaulty_subdet = 0;
246 int nlayer = subDetME.n_layer;
248 for (
int ilayer = 0; ilayer < nlayer; ilayer++) {
250 ndet_subdet += ndet_layer;
252 uint16_t nfaulty_layer = 0;
253 for (
auto me : faulty_detMEs) {
256 if (
me->getIntValue() == 0)
258 uint32_t
detId = atoi(
me->getName().c_str());
260 if (
abs(det_layer_pair.second) == ilayer + 1)
264 nfaulty_subdet += nfaulty_layer;
265 float fraction_layer = -1.0;
267 fraction_layer = 1 - ((nfaulty_layer * 1.0) / ndet_layer);
275 float fraction_subdet = -1.0;
277 fraction_subdet = 1 - ((nfaulty_subdet * 1.0) / ndet_subdet);
279 std::string full_path = mechanical_dir.substr(0, mechanical_dir.find_last_of(
'/')) +
280 "/EventInfo/reportSummaryContents/SiStrip_SToNFlag_" +
name;
287 me->Fill(fminf(fraction_subdet, ston_flg));
289 me->Fill(fraction_subdet);
290 nDetTot += ndet_subdet;
291 nFaultyTot += nfaulty_subdet;
293 float fraction_global = -1.0;
295 fraction_global = 1.0 - ((nFaultyTot * 1.0) / nDetTot);
296 float ston_frac_global = 1.0;
298 ston_frac_global = sToNTot / nSToNTot;
312 pr.second.det_fractionME->Reset();
324 pr.second.det_fractionME->Reset();
325 pr.second.det_fractionME->Fill(-1.0);
341 <<
" SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi : MEs missing ";
348 if (strip_dir.empty())
349 strip_dir =
"SiStrip";
352 float dcs_flag = 1.0;
353 float dqm_flag = 1.0;
355 full_path = strip_dir +
"/EventInfo/DCSContents/SiStrip_" +
type;
359 full_path = strip_dir +
"/EventInfo/reportSummaryContents/SiStrip_" +
type;
363 subDetME.det_fractionME->Reset();
364 subDetME.det_fractionME->Fill(fminf(dqm_flag, dcs_flag));
368 full_path = strip_dir +
"/EventInfo/reportSummary";
372 full_path = strip_dir +
"/EventInfo/DCSSummary";
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
MonitorElement * SiStripCertification
dqm::harvesting::DQMStore DQMStore
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void setCurrentFolder(std::string const &fullpath) override
std::optional< T > tryToGet() const
Kind kind() const
Get the type of the monitor element.
edm::ESHandle< SiStripDetCabling > detCabling_
std::string pwd() override
Log< level::Error, false > LogError
void fillSiStripCertificationMEsAtLumi(DQMStore &dqm_store)
bool sistripCertificationBooked_
const edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
std::map< std::string, SubDetMEs > SubDetMEsMap
virtual double getFloatValue() const
void resetSiStripCertificationMEs(DQMStore &dqm_store)
SiStripCertificationInfo(const edm::ParameterSet &ps)
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
void fillDummySiStripCertification(DQMStore &dqm_store)
virtual void setBinLabel(int bin, const std::string &label, int axis=1)
set bin label for x, y or z axis (axis=1, 2, 3 respectively)
MonitorElement * det_fractionME
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
dqm::harvesting::MonitorElement MonitorElement
virtual int getNbinsY() const
get # of bins in Y-axis
Log< level::Info, false > LogInfo
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
const edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
void bookSiStripCertificationMEs(DQMStore &dqm_store)
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
MonitorElement * SiStripCertificationSummaryMap
void fillSiStripCertificationMEs(DQMStore &dqm_store, edm::EventSetup const &eSetup)
static bool goToDir(DQMStore &dqm_store, std::string const &name)
virtual int getNbinsX() const
get # of bins in X-axis
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &eSetup) override
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
MonitorElement * SiStripCertificationMap
void analyze(edm::Event const &, edm::EventSetup const &) override
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)