33 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: Begining of Run";
45 runInfoRec->get(sumFED);
48 for (
auto const fedID : sumFED->
m_fed_in) {
49 if (fedID >= siStripFedIdMin && fedID <= siStripFedIdMax)
70 if (!strip_dir.empty())
78 std::string htitle =
"SiStrip Certification for Good Detector Fraction";
85 auto const& det =
pr.first;
92 if (!strip_dir.empty())
102 SubDetMEsMap.emplace(tag, local_mes);
109 SubDetMEsMap.emplace(tag, local_mes);
116 SubDetMEsMap.emplace(tag, local_mes);
123 SubDetMEsMap.emplace(tag, local_mes);
130 SubDetMEsMap.emplace(tag, local_mes);
137 SubDetMEsMap.emplace(tag, local_mes);
140 if (!strip_dir.empty())
150 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::endLuminosityBlock";
159 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: End Run";
173 <<
" SiStripCertificationInfo::fillSiStripCertificationMEs : MEs missing ";
188 uint16_t nDetTot = 0;
189 uint16_t nFaultyTot = 0;
190 uint16_t nSToNTot = 0;
200 std::string bad_module_folder = mechanical_dir +
"/" + subDetME.folder_name +
"/" +
"BadModuleList";
201 std::vector<MonitorElement*> faulty_detMEs = dqm_store.
getContents(bad_module_folder);
203 uint16_t ndet_subdet = 0;
204 uint16_t nfaulty_subdet = 0;
205 int nlayer = subDetME.n_layer;
207 for (
int ilayer = 0; ilayer < nlayer; ilayer++) {
209 ndet_subdet += ndet_layer;
211 uint16_t nfaulty_layer = 0;
212 for (
auto me : faulty_detMEs) {
217 uint32_t detId = atoi(me->
getName().c_str());
218 std::pair<std::string, int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detId, tTopo,
false);
219 if (
abs(det_layer_pair.second) == ilayer + 1)
223 nfaulty_subdet += nfaulty_layer;
224 float fraction_layer = -1.0;
226 fraction_layer = 1 - ((nfaulty_layer * 1.0) / ndet_layer);
230 if (ybin <= SiStripCertificationSummaryMap->getNbinsY()) {
234 float fraction_subdet = -1.0;
236 fraction_subdet = 1 - ((nfaulty_subdet * 1.0) / ndet_subdet);
238 std::string full_path = mechanical_dir.substr(0, mechanical_dir.find_last_of(
"/")) +
239 "/EventInfo/reportSummaryContents/SiStrip_SToNFlag_" +
name;
246 me->
Fill(fminf(fraction_subdet, ston_flg));
248 me->
Fill(fraction_subdet);
249 nDetTot += ndet_subdet;
250 nFaultyTot += nfaulty_subdet;
252 float fraction_global = -1.0;
254 fraction_global = 1.0 - ((nFaultyTot * 1.0) / nDetTot);
255 float ston_frac_global = 1.0;
257 ston_frac_global = sToNTot / nSToNTot;
271 pr.second.det_fractionME->Reset();
283 pr.second.det_fractionME->Reset();
284 pr.second.det_fractionME->Fill(-1.0);
300 <<
" SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi : MEs missing ";
307 if (strip_dir.empty())
308 strip_dir =
"SiStrip";
311 float dcs_flag = 1.0;
312 float dqm_flag = 1.0;
314 full_path = strip_dir +
"/EventInfo/DCSContents/SiStrip_" +
type;
318 full_path = strip_dir +
"/EventInfo/reportSummaryContents/SiStrip_" +
type;
322 subDetME.det_fractionME->Reset();
323 subDetME.det_fractionME->Fill(fminf(dqm_flag, dcs_flag));
327 full_path = strip_dir +
"/EventInfo/reportSummary";
331 full_path = strip_dir +
"/EventInfo/DCSSummary";
std::optional< T > tryToGet() const
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.
virtual int getNbinsY() const
get # of bins in Y-axis
MonitorElement * SiStripCertification
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
std::vector< MonitorElement * > getContents(std::string const &path) const
virtual int64_t getIntValue() const
Kind kind() const
Get the type of the monitor element.
const std::string & getName() const
get name of ME
std::string const & pwd() const
edm::ESHandle< SiStripDetCabling > detCabling_
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
void cd()
go to top directory (ie. root)
void fillSiStripCertificationMEsAtLumi(DQMStore &dqm_store)
bool sistripCertificationBooked_
virtual void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
#define DEFINE_FWK_MODULE(type)
virtual int getNbinsX() const
get # of bins in X-axis
std::map< std::string, SubDetMEs > SubDetMEsMap
std::vector< int > m_fed_in
void resetSiStripCertificationMEs(DQMStore &dqm_store)
SiStripCertificationInfo(const edm::ParameterSet &ps)
Abs< T >::type abs(const T &t)
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
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)
std::pair< std::string, int32_t > GetSubDetAndLayer(const uint32_t &detid, const TrackerTopology *tTopo, bool ring_flag=false)
void setCurrentFolder(std::string const &fullpath)
MonitorElement * SiStripCertificationSummaryMap
virtual double getFloatValue() const
void fillSiStripCertificationMEs(DQMStore &dqm_store, edm::EventSetup const &eSetup)
static bool goToDir(DQMStore &dqm_store, std::string const &name)
MonitorElement * bookFloat(char_string const &name)
Book float.
T const * product() const
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_
virtual void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)