23 consumes<DQMToken, edm::InRun>(
edm::InputTag(
"siStripOfflineAnalyser",
"DQMGenerationSiStripAnalyserRun"));
24 consumes<DQMToken, edm::InLumi>(
edm::InputTag(
"siStripOfflineAnalyser",
"DQMGenerationSiStripAnalyserLumi"));
26 tTopoToken_ = esConsumes<edm::Transition::EndRun>();
31 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: Begining of Run";
39 for (
auto const fedID : sumFED->m_fed_in) {
40 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
61 if (!strip_dir.empty())
69 std::string htitle =
"SiStrip Certification for Good Detector Fraction";
76 auto const& det =
pr.first;
83 if (!strip_dir.empty())
131 if (!strip_dir.empty())
141 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::endLuminosityBlock";
150 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: End Run";
164 <<
" SiStripCertificationInfo::fillSiStripCertificationMEs : MEs missing ";
177 uint16_t nDetTot = 0;
178 uint16_t nFaultyTot = 0;
179 uint16_t nSToNTot = 0;
189 std::string bad_module_folder = mechanical_dir +
"/" + subDetME.folder_name +
"/" +
"BadModuleList";
190 std::vector<MonitorElement*> faulty_detMEs = dqm_store.
getContents(bad_module_folder);
192 uint16_t ndet_subdet = 0;
193 uint16_t nfaulty_subdet = 0;
194 int nlayer = subDetME.n_layer;
196 for (
int ilayer = 0; ilayer < nlayer; ilayer++) {
198 ndet_subdet += ndet_layer;
200 uint16_t nfaulty_layer = 0;
201 for (
auto me : faulty_detMEs) {
204 if (
me->getIntValue() == 0)
206 uint32_t detId = atoi(
me->getName().c_str());
207 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detId, tTopo,
false);
208 if (
abs(det_layer_pair.second) == ilayer + 1)
212 nfaulty_subdet += nfaulty_layer;
213 float fraction_layer = -1.0;
215 fraction_layer = 1 - ((nfaulty_layer * 1.0) / ndet_layer);
219 if (ybin <= SiStripCertificationSummaryMap->getNbinsY()) {
223 float fraction_subdet = -1.0;
225 fraction_subdet = 1 - ((nfaulty_subdet * 1.0) / ndet_subdet);
227 std::string full_path = mechanical_dir.substr(0, mechanical_dir.find_last_of(
'/')) +
228 "/EventInfo/reportSummaryContents/SiStrip_SToNFlag_" +
name;
235 me->Fill(fminf(fraction_subdet, ston_flg));
237 me->Fill(fraction_subdet);
238 nDetTot += ndet_subdet;
239 nFaultyTot += nfaulty_subdet;
241 float fraction_global = -1.0;
243 fraction_global = 1.0 - ((nFaultyTot * 1.0) / nDetTot);
244 float ston_frac_global = 1.0;
246 ston_frac_global = sToNTot / nSToNTot;
260 pr.second.det_fractionME->Reset();
272 pr.second.det_fractionME->Reset();
273 pr.second.det_fractionME->Fill(-1.0);
289 <<
" SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi : MEs missing ";
296 if (strip_dir.empty())
297 strip_dir =
"SiStrip";
300 float dcs_flag = 1.0;
301 float dqm_flag = 1.0;
303 full_path = strip_dir +
"/EventInfo/DCSContents/SiStrip_" +
type;
307 full_path = strip_dir +
"/EventInfo/reportSummaryContents/SiStrip_" +
type;
311 subDetME.det_fractionME->Reset();
312 subDetME.det_fractionME->Fill(fminf(dqm_flag, dcs_flag));
316 full_path = strip_dir +
"/EventInfo/reportSummary";
320 full_path = strip_dir +
"/EventInfo/DCSSummary";
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
MonitorElement * SiStripCertification
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
#define DEFINE_FWK_MODULE(type)
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_
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)
bool getData(T &iHolder) const
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
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
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
void bookSiStripCertificationMEs(DQMStore &dqm_store)
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
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
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)
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)