CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
SiStripActionExecutor Class Reference

#include <SiStripActionExecutor.h>

Public Types

typedef dqm::harvesting::DQMStore DQMStore
 
typedef dqm::harvesting::MonitorElement MonitorElement
 

Public Member Functions

void createDummyShiftReport ()
 
void createFaultyModuleMEs (DQMStore &dqm_store)
 
void createOfflineTkMap (const edm::ParameterSet &tkmapPset, DQMStore &dqm_store, std::string &map_type, const SiStripQuality *stripQuality)
 
void createShiftReport (DQMStore &dqm_store)
 
void createStatus (DQMStore &dqm_store)
 
void createSummary (DQMStore &dqm_store)
 
void createSummaryOffline (DQMStore &dqm_store)
 
void createTkInfoFile (std::vector< std::string > tkhmap_names, TTree *tkinfo_tree, DQMStore &dqm_store, const GeometricDet *geomDet)
 
void createTkMap (const edm::ParameterSet &tkmapPset, DQMStore &dqm_store, const std::string &map_type)
 
void fillDummyStatus ()
 
void fillStatus (DQMStore &dqm_store, const SiStripDetCabling *cabling, const TkDetMap *tkDetMap, const TrackerTopology *tTopo)
 
void fillStatusAtLumi (DQMStore &dqm_store)
 
void printFaultyModuleList (DQMStore &dqm_store, std::ostringstream &str_val)
 
void printReportSummary (MonitorElement *me, std::ostringstream &str_val, std::string name)
 
void printShiftHistoParameters (DQMStore &dqm_store, std::map< std::string, std::vector< std::string >> const &layout_map, std::ostringstream &str_val)
 
bool readConfiguration ()
 
bool readTkMapConfiguration (const SiStripDetCabling *detCabling, const TkDetMap *tkDetMap, const TrackerTopology *tTopo)
 
void saveMEs (DQMStore &dqm_store, std::string fname)
 
 SiStripActionExecutor (edm::ParameterSet const &ps)
 
virtual ~SiStripActionExecutor ()
 

Private Attributes

std::unique_ptr< SiStripConfigWriterconfigWriter_ {nullptr}
 
const edm::ParameterSet pSet_
 
std::unique_ptr< SiStripQualityCheckerqualityChecker_ {nullptr}
 
std::unique_ptr< SiStripSummaryCreatorsummaryCreator_ {nullptr}
 
std::unique_ptr< SiStripTrackerMapCreatortkMapCreator_ {nullptr}
 
std::vector< std::string > tkMapMENames {}
 

Detailed Description

Definition at line 22 of file SiStripActionExecutor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 25 of file SiStripActionExecutor.h.

◆ MonitorElement

Definition at line 24 of file SiStripActionExecutor.h.

Constructor & Destructor Documentation

◆ SiStripActionExecutor()

SiStripActionExecutor::SiStripActionExecutor ( edm::ParameterSet const &  ps)

Definition at line 19 of file SiStripActionExecutor.cc.

19  : pSet_{ps} {
20  edm::LogInfo("SiStripActionExecutor") << " Creating SiStripActionExecutor "
21  << "\n";
22 }

◆ ~SiStripActionExecutor()

SiStripActionExecutor::~SiStripActionExecutor ( )
virtual

Definition at line 24 of file SiStripActionExecutor.cc.

24  {
25  edm::LogInfo("SiStripActionExecutor") << " Deleting SiStripActionExecutor "
26  << "\n";
27 }

Member Function Documentation

◆ createDummyShiftReport()

void SiStripActionExecutor::createDummyShiftReport ( )

Definition at line 127 of file SiStripActionExecutor.cc.

127  {
128  std::ofstream report_file;
129  report_file.open("sistrip_shift_report.txt", std::ios::out);
130  report_file << " Nothing to report!!" << std::endl;
131  report_file.close();
132 }

References MillePedeFileConverter_cfg::out, and postprocess-scan-build::report_file.

Referenced by SiStripAnalyser::analyze().

◆ createFaultyModuleMEs()

void SiStripActionExecutor::createFaultyModuleMEs ( DQMStore dqm_store)

◆ createOfflineTkMap()

void SiStripActionExecutor::createOfflineTkMap ( const edm::ParameterSet tkmapPset,
DQMStore dqm_store,
std::string &  map_type,
const SiStripQuality stripQuality 
)

Definition at line 87 of file SiStripActionExecutor.cc.

90  {
91  if (tkMapCreator_)
92  tkMapCreator_->createForOffline(tkmapPset, dqm_store, map_type, stripQuality);
93 }

References tkMapCreator_.

Referenced by SiStripOfflineDQM::endRun().

◆ createShiftReport()

void SiStripActionExecutor::createShiftReport ( DQMStore dqm_store)

Definition at line 134 of file SiStripActionExecutor.cc.

134  {
135  // Read layout configuration
136  std::string const localPath{"DQM/SiStripMonitorClient/data/sistrip_plot_layout.xml"};
137  SiStripLayoutParser layout_parser;
138  layout_parser.getDocument(edm::FileInPath(localPath).fullPath());
139 
140  std::map<std::string, std::vector<std::string>> layout_map;
141  if (!layout_parser.getAllLayouts(layout_map))
142  return;
143 
144  std::ostringstream shift_summary;
145  configWriter_ = std::make_unique<SiStripConfigWriter>();
146  configWriter_->init("ShiftReport");
147 
148  // Print Report Summary Content
149  shift_summary << " Report Summary Content :\n"
150  << " =========================" << std::endl;
151  configWriter_->createElement("ReportSummary");
152 
153  MonitorElement* me{nullptr};
154  std::string report_path;
155  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TECB";
156  me = dqm_store.get(report_path);
157  printReportSummary(me, shift_summary, "TECB");
158 
159  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TECF";
160  me = dqm_store.get(report_path);
161  printReportSummary(me, shift_summary, "TECF");
162 
163  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIB";
164  me = dqm_store.get(report_path);
165  printReportSummary(me, shift_summary, "TIB");
166 
167  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIDB";
168  me = dqm_store.get(report_path);
169  printReportSummary(me, shift_summary, "TIDB");
170 
171  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIDF";
172  me = dqm_store.get(report_path);
173  printReportSummary(me, shift_summary, "TIDF");
174 
175  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TOB";
176  me = dqm_store.get(report_path);
177  printReportSummary(me, shift_summary, "TOB");
178 
179  shift_summary << std::endl;
180  printShiftHistoParameters(dqm_store, layout_map, shift_summary);
181 
182  std::ofstream report_file;
183  report_file.open("sistrip_shift_report.txt", std::ios::out);
184  report_file << shift_summary.str() << std::endl;
185  report_file.close();
186  configWriter_->write("sistrip_shift_report.xml");
187  configWriter_.reset();
188 }

References configWriter_, contentValuesFiles::fullPath, dqm::implementation::IGetter::get(), SiStripLayoutParser::getAllLayouts(), SiStripLayoutParser::getDocument(), hlt_dqm_clientPB-live_cfg::me, MillePedeFileConverter_cfg::out, printReportSummary(), printShiftHistoParameters(), postprocess-scan-build::report_file, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripAnalyser::analyze().

◆ createStatus()

void SiStripActionExecutor::createStatus ( DQMStore dqm_store)

Definition at line 109 of file SiStripActionExecutor.cc.

109  {
110  if (qualityChecker_.get() == nullptr) {
111  qualityChecker_ = std::make_unique<SiStripQualityChecker>(pSet_);
112  }
113  qualityChecker_->bookStatus(dqm_store);
114 }

References pSet_, and qualityChecker_.

Referenced by SiStripAnalyser::beginRun(), SiStripOfflineDQM::beginRun(), and SiStripOfflineDQM::endRun().

◆ createSummary()

void SiStripActionExecutor::createSummary ( DQMStore dqm_store)

Definition at line 50 of file SiStripActionExecutor.cc.

50  {
51  if (!summaryCreator_)
52  return;
53 
54  dqm_store.cd();
55  std::string dname = "SiStrip/MechanicalView";
56  if (dqm_store.dirExists(dname)) {
57  dqm_store.cd(dname);
58  summaryCreator_->createSummary(dqm_store);
59  }
60 }

References dqm::implementation::DQMStore::cd(), dqm::implementation::IGetter::dirExists(), RefreshWebPage::dname, AlCaHLTBitMon_QueryRunRegistry::string, and summaryCreator_.

Referenced by SiStripAnalyser::endLuminosityBlock().

◆ createSummaryOffline()

void SiStripActionExecutor::createSummaryOffline ( DQMStore dqm_store)

Definition at line 64 of file SiStripActionExecutor.cc.

64  {
65  if (!summaryCreator_)
66  return;
67 
68  dqm_store.cd();
69  std::string dname = "MechanicalView";
70  if (SiStripUtility::goToDir(dqm_store, dname)) {
71  summaryCreator_->createSummary(dqm_store);
72  }
73  dqm_store.cd();
74 }

References dqm::implementation::DQMStore::cd(), RefreshWebPage::dname, SiStripUtility::goToDir(), AlCaHLTBitMon_QueryRunRegistry::string, and summaryCreator_.

Referenced by SiStripOfflineDQM::endRun().

◆ createTkInfoFile()

void SiStripActionExecutor::createTkInfoFile ( std::vector< std::string >  tkhmap_names,
TTree *  tkinfo_tree,
DQMStore dqm_store,
const GeometricDet geomDet 
)

Definition at line 97 of file SiStripActionExecutor.cc.

100  {
101  if (!tkMapCreator_)
102  return;
103 
104  tkMapCreator_->createInfoFile(map_names, tkinfo_tree, dqm_store, geomDet);
105 }

References tkMapCreator_.

Referenced by SiStripOfflineDQM::endRun().

◆ createTkMap()

void SiStripActionExecutor::createTkMap ( const edm::ParameterSet tkmapPset,
DQMStore dqm_store,
const std::string &  map_type 
)

Definition at line 78 of file SiStripActionExecutor.cc.

80  {
81  if (tkMapCreator_)
82  tkMapCreator_->create(tkmapPset, dqm_store, map_type);
83 }

References tkMapCreator_.

◆ fillDummyStatus()

void SiStripActionExecutor::fillDummyStatus ( )

Definition at line 116 of file SiStripActionExecutor.cc.

116 { qualityChecker_->fillDummyStatus(); }

References qualityChecker_.

Referenced by SiStripAnalyser::analyze(), SiStripAnalyser::endLuminosityBlock(), and SiStripOfflineDQM::endRun().

◆ fillStatus()

void SiStripActionExecutor::fillStatus ( DQMStore dqm_store,
const SiStripDetCabling cabling,
const TkDetMap tkDetMap,
const TrackerTopology tTopo 
)

Definition at line 118 of file SiStripActionExecutor.cc.

121  {
122  qualityChecker_->fillStatus(dqm_store, detcabling, tkDetMap, tTopo);
123 }

References qualityChecker_.

Referenced by SiStripAnalyser::analyze(), SiStripAnalyser::endLuminosityBlock(), and SiStripOfflineDQM::endRun().

◆ fillStatusAtLumi()

void SiStripActionExecutor::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 125 of file SiStripActionExecutor.cc.

125 { qualityChecker_->fillStatusAtLumi(dqm_store); }

References qualityChecker_.

Referenced by SiStripOfflineDQM::endLuminosityBlock().

◆ printFaultyModuleList()

void SiStripActionExecutor::printFaultyModuleList ( DQMStore dqm_store,
std::ostringstream &  str_val 
)

Definition at line 244 of file SiStripActionExecutor.cc.

244  {
245  dqm_store.cd();
246 
247  std::string mdir = "MechanicalView";
248  if (!SiStripUtility::goToDir(dqm_store, mdir))
249  return;
250  std::string mechanicalview_dir = dqm_store.pwd();
251 
252  std::vector<std::string> subdet_folder;
253  subdet_folder.push_back("TIB");
254  subdet_folder.push_back("TOB");
255  subdet_folder.push_back("TEC/MINUS");
256  subdet_folder.push_back("TEC/PLUS");
257  subdet_folder.push_back("TID/MINUS");
258  subdet_folder.push_back("TID/PLUS");
259 
260  int nDetsTotal = 0;
261  int nDetsWithErrorTotal = 0;
262  for (auto const& sd : subdet_folder) {
263  std::string dname = mechanicalview_dir + "/" + sd;
264  if (!dqm_store.dirExists(dname))
265  continue;
266  str_val << "============\n" << sd << '\n' << "============\n" << std::endl;
267 
268  dqm_store.cd(dname);
269  std::vector<std::string> module_folders;
270  SiStripUtility::getModuleFolderList(dqm_store, module_folders);
271  int nDets = module_folders.size();
272  dqm_store.cd();
273 
274  int nDetsWithError = 0;
275  std::string bad_module_folder = dname + "/" + "BadModuleList";
276  if (dqm_store.dirExists(bad_module_folder)) {
277  auto const meVec = dqm_store.getContents(bad_module_folder);
278  for (auto me : meVec) {
279  nDetsWithError++;
280  uint16_t flag = me->getIntValue();
281  std::string message;
283  str_val << me->getName() << " flag : " << me->getIntValue() << " " << message << std::endl;
284  }
285  }
286  str_val << "---------------------------------------------------------------"
287  "-----\n"
288  << " Detectors : Total " << nDets << " with Error " << nDetsWithError << '\n'
289  << "---------------------------------------------------------------"
290  "-----\n";
291  nDetsTotal += nDets;
292  nDetsWithErrorTotal += nDetsWithError;
293  }
294  dqm_store.cd();
295  str_val << "--------------------------------------------------------------------\n"
296  << " Total Number of Connected Detectors : " << nDetsTotal << '\n'
297  << " Total Number of Detectors with Error : " << nDetsWithErrorTotal << '\n'
298  << "--------------------------------------------------------------------" << std::endl;
299 }

References dqm::implementation::DQMStore::cd(), dqm::implementation::IGetter::dirExists(), RefreshWebPage::dname, RemoveAddSevLevel::flag, SiStripUtility::getBadModuleStatus(), dqm::implementation::IGetter::getContents(), SiStripUtility::getModuleFolderList(), SiStripUtility::goToDir(), hlt_dqm_clientPB-live_cfg::me, dqm::implementation::DQMStore::pwd(), sd, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by SiStripAnalyser::endJob(), and SiStripOfflineDQM::endJob().

◆ printReportSummary()

void SiStripActionExecutor::printReportSummary ( MonitorElement me,
std::ostringstream &  str_val,
std::string  name 
)

Definition at line 190 of file SiStripActionExecutor.cc.

190  {
191  str_val << " " << name << " : ";
194  configWriter_->createChildElement("MonitorElement", name, "value", value);
195  float fvalue = atof(value.c_str());
196  if (fvalue == -1.0)
197  str_val << " Dummy Value " << std::endl;
198  else
199  str_val << fvalue << std::endl;
200 }

References configWriter_, SiStripUtility::getMEValue(), hlt_dqm_clientPB-live_cfg::me, Skims_PA_cff::name, AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by createShiftReport().

◆ printShiftHistoParameters()

void SiStripActionExecutor::printShiftHistoParameters ( DQMStore dqm_store,
std::map< std::string, std::vector< std::string >> const &  layout_map,
std::ostringstream &  str_val 
)

Definition at line 202 of file SiStripActionExecutor.cc.

204  {
205  str_val << std::endl;
206  for (auto const& [set_name, path_names] : layout_map) {
207  if (set_name.find("Summary") != std::string::npos)
208  continue;
209  configWriter_->createElement(set_name);
210 
211  str_val << " " << set_name << " : " << std::endl;
212  str_val << " ====================================" << std::endl;
213 
214  str_val << std::setprecision(2);
215  str_val << setiosflags(std::ios::fixed);
216  for (auto const& path_name : path_names) {
217  if (path_name.empty())
218  continue;
219  MonitorElement* me = dqm_store.get(path_name);
220  std::ostringstream entry_str, mean_str, rms_str;
221  entry_str << std::setprecision(2);
222  entry_str << setiosflags(std::ios::fixed);
223  mean_str << std::setprecision(2);
224  mean_str << setiosflags(std::ios::fixed);
225  rms_str << std::setprecision(2);
226  rms_str << setiosflags(std::ios::fixed);
227  entry_str << std::setw(7) << me->getEntries();
228  mean_str << std::setw(7) << me->getMean();
229  rms_str << std::setw(7) << me->getRMS();
230  configWriter_->createChildElement(
231  "MonitorElement", me->getName(), "entries", entry_str.str(), "mean", mean_str.str(), "rms", rms_str.str());
232 
233  if (me)
234  str_val << " " << me->getName() << " : entries = " << std::setw(7) << me->getEntries()
235  << " mean = " << me->getMean() << " : rms = " << me->getRMS() << '\n';
236  }
237  str_val << std::endl;
238  }
239 }

References configWriter_, alignBH_cfg::fixed, dqm::implementation::IGetter::get(), and hlt_dqm_clientPB-live_cfg::me.

Referenced by createShiftReport().

◆ readConfiguration()

bool SiStripActionExecutor::readConfiguration ( )

Definition at line 29 of file SiStripActionExecutor.cc.

29  {
30  if (!summaryCreator_) {
31  summaryCreator_ = std::make_unique<SiStripSummaryCreator>();
32  }
33  auto const fpath = pSet_.getUntrackedParameter<std::string>(
34  "SummaryConfigPath", "DQM/SiStripMonitorClient/data/sistrip_monitorelement_config.xml");
35  return summaryCreator_->readConfiguration(fpath);
36 }

References edm::ParameterSet::getUntrackedParameter(), pSet_, AlCaHLTBitMon_QueryRunRegistry::string, and summaryCreator_.

Referenced by SiStripAnalyser::beginJob(), and SiStripOfflineDQM::beginJob().

◆ readTkMapConfiguration()

bool SiStripActionExecutor::readTkMapConfiguration ( const SiStripDetCabling detCabling,
const TkDetMap tkDetMap,
const TrackerTopology tTopo 
)

Definition at line 41 of file SiStripActionExecutor.cc.

43  {
44  tkMapCreator_ = std::make_unique<SiStripTrackerMapCreator>(detCabling, tkDetMap, tTopo);
45  return tkMapCreator_.get() != nullptr;
46 }

References tkMapCreator_.

Referenced by SiStripAnalyser::beginRun(), and SiStripOfflineDQM::endRun().

◆ saveMEs()

void SiStripActionExecutor::saveMEs ( DQMStore dqm_store,
std::string  fname 
)

Member Data Documentation

◆ configWriter_

std::unique_ptr<SiStripConfigWriter> SiStripActionExecutor::configWriter_ {nullptr}
private

◆ pSet_

const edm::ParameterSet SiStripActionExecutor::pSet_
private

Definition at line 73 of file SiStripActionExecutor.h.

Referenced by createStatus(), and readConfiguration().

◆ qualityChecker_

std::unique_ptr<SiStripQualityChecker> SiStripActionExecutor::qualityChecker_ {nullptr}
private

◆ summaryCreator_

std::unique_ptr<SiStripSummaryCreator> SiStripActionExecutor::summaryCreator_ {nullptr}
private

Definition at line 68 of file SiStripActionExecutor.h.

Referenced by createSummary(), createSummaryOffline(), and readConfiguration().

◆ tkMapCreator_

std::unique_ptr<SiStripTrackerMapCreator> SiStripActionExecutor::tkMapCreator_ {nullptr}
private

◆ tkMapMENames

std::vector<std::string> SiStripActionExecutor::tkMapMENames {}
private

Definition at line 66 of file SiStripActionExecutor.h.

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
dqm::implementation::IGetter::getContents
virtual std::vector< dqm::harvesting::MonitorElement * > getContents(std::string const &path) const
Definition: DQMStore.cc:593
SiStripUtility::getModuleFolderList
static void getModuleFolderList(DQMStore &dqm_store, std::vector< std::string > &m_ids)
Definition: SiStripUtility.cc:187
SiStripActionExecutor::summaryCreator_
std::unique_ptr< SiStripSummaryCreator > summaryCreator_
Definition: SiStripActionExecutor.h:68
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
SiStripActionExecutor::printReportSummary
void printReportSummary(MonitorElement *me, std::ostringstream &str_val, std::string name)
Definition: SiStripActionExecutor.cc:190
postprocess-scan-build.report_file
report_file
Definition: postprocess-scan-build.py:32
edm::FileInPath
Definition: FileInPath.h:61
SiStripLayoutParser
Definition: SiStripLayoutParser.h:16
SiStripUtility::getBadModuleStatus
static void getBadModuleStatus(uint16_t flag, std::string &message)
Definition: SiStripUtility.cc:343
SiStripUtility::getMEValue
static void getMEValue(MonitorElement const *me, std::string &val)
Definition: SiStripUtility.cc:239
dqm::implementation::DQMStore::pwd
std::string pwd() override
Definition: DQMStore.h:567
SiStripActionExecutor::configWriter_
std::unique_ptr< SiStripConfigWriter > configWriter_
Definition: SiStripActionExecutor.h:71
SiStripActionExecutor::printShiftHistoParameters
void printShiftHistoParameters(DQMStore &dqm_store, std::map< std::string, std::vector< std::string >> const &layout_map, std::ostringstream &str_val)
Definition: SiStripActionExecutor.cc:202
SiStripUtility::goToDir
static bool goToDir(DQMStore &dqm_store, std::string const &name)
Definition: SiStripUtility.cc:252
SiStripLayoutParser::getAllLayouts
bool getAllLayouts(std::map< std::string, std::vector< std::string > > &me_names)
Definition: SiStripLayoutParser.cc:20
value
Definition: value.py:1
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
SiStripActionExecutor::tkMapCreator_
std::unique_ptr< SiStripTrackerMapCreator > tkMapCreator_
Definition: SiStripActionExecutor.h:69
SiStripActionExecutor::pSet_
const edm::ParameterSet pSet_
Definition: SiStripActionExecutor.h:73
relativeConstraints.value
value
Definition: relativeConstraints.py:53
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:673
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
RefreshWebPage.dname
dname
Definition: RefreshWebPage.py:56
sd
double sd
Definition: CascadeWrapper.h:113
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
dqm::implementation::IGetter::dirExists
virtual bool dirExists(std::string const &path) const
Definition: DQMStore.cc:730
dqm::implementation::DQMStore::cd
void cd() override
Definition: DQMStore.h:564
RemoveAddSevLevel.flag
flag
Definition: RemoveAddSevLevel.py:117
SiStripLayoutParser::getDocument
void getDocument(std::string filepath)
Definition: SiStripLayoutParser.cc:13
SiStripActionExecutor::qualityChecker_
std::unique_ptr< SiStripQualityChecker > qualityChecker_
Definition: SiStripActionExecutor.h:70