37 edm::LogInfo (
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: Begining of Run";
50 runInfoRec->get(sumFED);
53 for (
auto const fedID : sumFED->
m_fed_in) {
54 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
77 if (!strip_dir.empty())
85 std::string htitle =
"SiStrip Certification for Good Detector Fraction";
87 dqm_store.
book2D(hname, htitle, 6, 0.5, 6.5, 9, 0.5, 9.5);
93 auto const& det =
pr.first;
100 if (!strip_dir.empty())
110 SubDetMEsMap.emplace(tag, local_mes);
117 SubDetMEsMap.emplace(tag, local_mes);
124 SubDetMEsMap.emplace(tag, local_mes);
131 SubDetMEsMap.emplace(tag, local_mes);
138 SubDetMEsMap.emplace(tag, local_mes);
145 SubDetMEsMap.emplace(tag, local_mes);
148 if (!strip_dir.empty()) dqm_store.
setCurrentFolder(strip_dir +
"/EventInfo");
162 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::endLuminosityBlock";
174 edm::LogInfo (
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: End Run";
191 edm::LogError(
"SiStripCertificationInfo") <<
" SiStripCertificationInfo::fillSiStripCertificationMEs : MEs missing ";
205 uint16_t nDetTot = 0;
206 uint16_t nFaultyTot = 0;
207 uint16_t nSToNTot = 0;
217 mechanical_dir +
"/" + subDetME.folder_name +
"/" +
"BadModuleList";
218 std::vector<MonitorElement*> faulty_detMEs =
221 uint16_t ndet_subdet = 0;
222 uint16_t nfaulty_subdet = 0;
223 int nlayer = subDetME.n_layer;
225 for (
int ilayer = 0; ilayer < nlayer; ilayer++) {
227 ndet_subdet += ndet_layer;
229 uint16_t nfaulty_layer = 0;
230 for (
auto me : faulty_detMEs) {
233 uint32_t detId = atoi(me->
getName().c_str());
234 std::pair<std::string, int32_t> det_layer_pair =
236 if (
abs(det_layer_pair.second) == ilayer + 1) nfaulty_layer++;
239 nfaulty_subdet += nfaulty_layer;
240 float fraction_layer = -1.0;
242 fraction_layer = 1 - ((nfaulty_layer * 1.0) / ndet_layer);
246 if (ybin <= SiStripCertificationSummaryMap->getNbinsY()) {
251 float fraction_subdet = -1.0;
252 if (ndet_subdet > 0) fraction_subdet = 1 - ((nfaulty_subdet*1.0)/ndet_subdet);
255 mechanical_dir.substr(0, mechanical_dir.find_last_of(
"/")) +
256 "/EventInfo/reportSummaryContents/SiStrip_SToNFlag_" +
name;
263 me->
Fill(fminf(fraction_subdet,ston_flg));
264 }
else me->
Fill(fraction_subdet);
265 nDetTot += ndet_subdet ;
266 nFaultyTot += nfaulty_subdet;
268 float fraction_global = -1.0;
269 if (nDetTot > 0) fraction_global = 1.0 - ((nFaultyTot*1.0)/nDetTot);
270 float ston_frac_global = 1.0;
271 if (nSToNTot > 0) ston_frac_global = sToNTot / nSToNTot;
287 pr.second.det_fractionME->Reset();
301 pr.second.det_fractionME->Reset();
302 pr.second.det_fractionME->Fill(-1.0);
319 edm::LogError(
"SiStripCertificationInfo") <<
" SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi : MEs missing ";
326 if (strip_dir.empty()) strip_dir =
"SiStrip";
329 float dcs_flag = 1.0;
330 float dqm_flag = 1.0;
332 full_path = strip_dir +
"/EventInfo/DCSContents/SiStrip_" +
type;
336 full_path = strip_dir +
"/EventInfo/reportSummaryContents/SiStrip_" +
type;
340 subDetME.det_fractionME->Reset();
341 subDetME.det_fractionME->Fill(fminf(dqm_flag, dcs_flag));
345 full_path = strip_dir +
"/EventInfo/reportSummary";
348 full_path = strip_dir +
"/EventInfo/DCSSummary";
MonitorElement * book2D(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
std::optional< T > tryToGet() const
int64_t getIntValue() const
std::vector< MonitorElement * > getContents(std::string const &path) const
MonitorElement * SiStripCertification
double getFloatValue() const
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
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)
const std::string & getName() const
get name of ME
edm::ESHandle< SiStripDetCabling > detCabling_
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
void fillSiStripCertificationMEsAtLumi(DQMStore &dqm_store)
bool sistripCertificationBooked_
MonitorElement * bookFloat(char_string const &name)
Book float.
#define DEFINE_FWK_MODULE(type)
std::map< std::string, SubDetMEs > SubDetMEsMap
std::vector< int > m_fed_in
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
void resetSiStripCertificationMEs(DQMStore &dqm_store)
SiStripCertificationInfo(const edm::ParameterSet &ps)
Abs< T >::type abs(const T &t)
void Reset()
reset ME (ie. contents, errors, etc)
void fillDummySiStripCertification(DQMStore &dqm_store)
MonitorElement * det_fractionME
std::string const & pwd() const
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
void setCurrentFolder(std::string const &fullpath)
void cd()
go to top directory (ie. root)
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &iSetup) override
void bookSiStripCertificationMEs(DQMStore &dqm_store)
int getNbinsY() const
get # of bins in Y-axis
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)
int getNbinsX() const
get # of bins in X-axis
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
T const * product() const
Kind kind() const
Get the type of the monitor element.
static void getTopFolderPath(DQMStore &dqm_store, std::string const &top_dir, std::string &path)
void analyze(edm::Event const &, edm::EventSetup const &) override
unsigned long long m_cacheID_