|
|
Go to the documentation of this file.
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";
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
MonitorElement * bookFloat(TString const &name, FUNC onbooking=NOOP())
void resetSiStripCertificationMEs(DQMStore &dqm_store)
Log< level::Info, false > LogInfo
void fillSiStripCertificationMEsAtLumi(DQMStore &dqm_store)
SiStripCertificationInfo(const edm::ParameterSet &ps)
Kind kind() const
Get the type of the monitor element.
edm::ESHandle< SiStripDetCabling > detCabling_
edm::ESGetToken< SiStripDetCabling, SiStripDetCablingRcd > detCablingToken_
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
std::optional< T > tryToGet() const
#define DEFINE_FWK_MODULE(type)
virtual void Reset()
Remove all data from the ME, keept the empty histogram with all its settings.
void setCurrentFolder(std::string const &fullpath) override
bool sistripCertificationBooked_
virtual double getFloatValue() const
std::string pwd() override
void fillDummySiStripCertification(DQMStore &dqm_store)
virtual int getNbinsY() const
get # of bins in Y-axis
static bool goToDir(DQMStore &dqm_store, std::string const &name)
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
edm::ESGetToken< RunInfo, RunInfoRcd > runInfoToken_
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)
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
std::map< std::string, SubDetMEs > SubDetMEsMap
Log< level::Error, false > LogError
void bookSiStripCertificationMEs(DQMStore &dqm_store)
bool getData(T &iHolder) const
MonitorElement * det_fractionME
MonitorElement * SiStripCertificationSummaryMap
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual int getNbinsX() const
get # of bins in X-axis
void fillSiStripCertificationMEs(DQMStore &dqm_store, edm::EventSetup const &eSetup)
virtual MonitorElement * get(std::string const &fullpath) const
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoToken_
MonitorElement * SiStripCertification
Abs< T >::type abs(const T &t)
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
void analyze(edm::Event const &, edm::EventSetup const &) override