36 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo::Deleting SiStripCertificationInfo ";
42 edm::LogInfo(
"SiStripCertificationInfo") <<
"SiStripCertificationInfo::Deleting SiStripCertificationInfo ";
56 edm::LogInfo (
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: Begining of Run";
70 runInfoRec->get(sumFED);
73 std::vector<int> FedsInIds= sumFED->
m_fed_in;
74 for(
unsigned int it = 0; it < FedsInIds.size(); ++it) {
75 int fedID = FedsInIds[it];
76 if(fedID>=siStripFedIdMin && fedID<=siStripFedIdMax) ++
nFEDConnected_;
100 std::string htitle =
"SiStrip Certification for Good Detector Fraction";
105 for (std::map<std::string, SubDetMEs>::const_iterator it =
SubDetMEsMap.begin();
123 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
130 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
137 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
144 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
151 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
158 SubDetMEsMap.insert(std::pair<std::string, SubDetMEs >(tag, local_mes));
176 edm::LogInfo(
"SiStripDaqInfo") <<
"SiStripDaqInfo::endLuminosityBlock";
187 edm::LogInfo (
"SiStripCertificationInfo") <<
"SiStripCertificationInfo:: End Run";
198 edm::LogError(
"SiStripCertificationInfo") <<
" SiStripCertificationInfo::fillSiStripCertificationMEs : MEs missing ";
212 uint16_t nDetTot = 0;
213 uint16_t nFaultyTot = 0;
214 uint16_t nSToNTot = 0;
218 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
225 std::string bad_module_folder = mechanical_dir+
"/"+it->second.folder_name+
"/"+
"BadModuleList";
228 uint16_t ndet_subdet = 0;
229 uint16_t nfaulty_subdet = 0;
230 int nlayer = it->second.n_layer;
232 for (
int ilayer = 0; ilayer < nlayer; ilayer++) {
234 ndet_subdet += ndet_layer;
236 uint16_t nfaulty_layer = 0;
237 for (std::vector<MonitorElement *>::iterator im = faulty_detMEs.begin(); im != faulty_detMEs.end(); im++) {
239 if ((*im)->getIntValue() == 0)
continue;
240 uint32_t detId = atoi((*im)->getName().c_str());
241 std::pair<std::string,int32_t> det_layer_pair = folder_organizer.
GetSubDetAndLayer(detId, tTopo,
false);
242 if (
abs(det_layer_pair.second) == ilayer+1) nfaulty_layer++;
245 nfaulty_subdet += nfaulty_layer;
246 float fraction_layer = -1.0;
247 if ( ndet_layer > 0) fraction_layer = 1 - ((nfaulty_layer*1.0)/ndet_layer);
250 if (ybin <= SiStripCertificationSummaryMap->getNbinsY()) {
253 float fraction_subdet = -1.0;
254 if (ndet_subdet > 0) fraction_subdet = 1 - ((nfaulty_subdet*1.0)/ndet_subdet);
256 std::string full_path = mechanical_dir.substr(0, mechanical_dir.find_last_of(
"/"))
257 +
"/EventInfo/reportSummaryContents/SiStrip_SToNFlag_"+name;
264 me->
Fill(fminf(fraction_subdet,ston_flg));
265 }
else me->
Fill(fraction_subdet);
266 nDetTot += ndet_subdet ;
267 nFaultyTot += nfaulty_subdet;
269 float fraction_global = -1.0;
270 if (nDetTot > 0) fraction_global = 1.0 - ((nFaultyTot*1.0)/nDetTot);
271 float ston_frac_global = 1.0;
272 if (nSToNTot > 0) ston_frac_global = sToNTot/nSToNTot;
282 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
284 it->second.det_fractionME->Reset();
296 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
298 it->second.det_fractionME->Reset();
299 it->second.det_fractionME->Fill(-1.0);
314 edm::LogError(
"SiStripCertificationInfo") <<
" SiStripCertificationInfo::fillSiStripCertificationMEsAtLumi : MEs missing ";
321 if (strip_dir.empty()) strip_dir =
"SiStrip";
324 float dcs_flag = 1.0;
325 float dqm_flag = 1.0;
326 for (std::map<std::string, SubDetMEs>::iterator it =
SubDetMEsMap.begin();
329 full_path = strip_dir +
"/EventInfo/DCSContents/SiStrip_" +
type;
332 full_path = strip_dir +
"/EventInfo/reportSummaryContents/SiStrip_" +
type;
335 it->second.det_fractionME->Reset();
336 it->second.det_fractionME->Fill(fminf(dqm_flag,dcs_flag));
340 full_path = strip_dir +
"/EventInfo/reportSummary";
343 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
std::vector< MonitorElement * > getContents(std::string const &path) const
MonitorElement * SiStripCertification
double getFloatValue() const
void fillSiStripCertificationMEsAtLumi()
#define DEFINE_FWK_MODULE(type)
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup) override
Begin Run.
void beginJob() override
BeginJob.
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)
void fillSiStripCertificationMEs(edm::EventSetup const &eSetup)
uint32_t connectedNumber(const std::string &subDet, const uint16_t layer) const
void fillDummySiStripCertification()
bool sistripCertificationBooked_
MonitorElement * bookFloat(char_string const &name)
Book float.
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")
SiStripCertificationInfo(const edm::ParameterSet &ps)
Constructor.
Abs< T >::type abs(const T &t)
void Reset()
reset ME (ie. contents, errors, etc)
MonitorElement * det_fractionME
~SiStripCertificationInfo() override
Destructor.
void bookSiStripCertificationMEs()
std::string const & pwd() const
void endRun(edm::Run const &run, edm::EventSetup const &eSetup) override
EndRun.
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
End Of Luminosity.
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 resetSiStripCertificationMEs()
int getNbinsX() const
get # of bins in X-axis
edm::ESHandle< SiStripDetCabling > detCabling_
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
static bool goToDir(DQMStore *dqm_store, std::string name)
T const * product() const
Kind kind() const
Get the type of the monitor element.
static void getTopFolderPath(DQMStore *dqm_store, std::string top_dir, std::string &path)
void analyze(edm::Event const &, edm::EventSetup const &) override
Analyze.
unsigned long long m_cacheID_