CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
SiStripActionExecutor Class Reference

#include <SiStripActionExecutor.h>

Public Member Functions

void createDummyShiftReport ()
 
void createFaultyModuleMEs (DQMStore *dqm_store)
 
void createOfflineTkMap (const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &map_type, const edm::EventSetup &eSetup)
 
void createShiftReport (DQMStore *dqm_store)
 
void createStatus (DQMStore *dqm_store)
 
void createSummary (DQMStore *dqm_store)
 
void createSummaryOffline (DQMStore *dqm_store)
 
void createTkMap (const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &map_type, const edm::EventSetup &eSetup)
 
void fillDummyStatus ()
 
void fillStatus (DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &fedcabling, const edm::EventSetup &eSetup)
 
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 > > &layout_map, std::ostringstream &str_val)
 
bool readConfiguration ()
 
bool readTkMapConfiguration (const edm::EventSetup &eSetup)
 
void saveMEs (DQMStore *dqm_store, std::string fname)
 
 SiStripActionExecutor (edm::ParameterSet const &ps)
 
virtual ~SiStripActionExecutor ()
 

Private Attributes

SiStripConfigWriterconfigWriter_
 
edm::ParameterSet pSet_
 
SiStripQualityCheckerqualityChecker_
 
SiStripSummaryCreatorsummaryCreator_
 
SiStripTrackerMapCreatortkMapCreator_
 
std::vector< std::string > tkMapMENames
 

Detailed Description

Definition at line 25 of file SiStripActionExecutor.h.

Constructor & Destructor Documentation

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

Definition at line 26 of file SiStripActionExecutor.cc.

References configWriter_, qualityChecker_, summaryCreator_, and tkMapCreator_.

26  :pSet_(ps) {
27  edm::LogInfo("SiStripActionExecutor") <<
28  " Creating SiStripActionExecutor " << "\n" ;
29  summaryCreator_ = 0;
30  tkMapCreator_ = 0;
31  qualityChecker_ = 0;
32  configWriter_ = 0;
33 }
SiStripSummaryCreator * summaryCreator_
SiStripConfigWriter * configWriter_
SiStripTrackerMapCreator * tkMapCreator_
SiStripQualityChecker * qualityChecker_
SiStripActionExecutor::~SiStripActionExecutor ( )
virtual

Definition at line 37 of file SiStripActionExecutor.cc.

References qualityChecker_, summaryCreator_, and tkMapCreator_.

37  {
38  edm::LogInfo("SiStripActionExecutor") <<
39  " Deleting SiStripActionExecutor " << "\n" ;
40  if (summaryCreator_) delete summaryCreator_;
41  if (tkMapCreator_) delete tkMapCreator_;
42  if (qualityChecker_) delete qualityChecker_;
43 }
SiStripSummaryCreator * summaryCreator_
SiStripTrackerMapCreator * tkMapCreator_
SiStripQualityChecker * qualityChecker_

Member Function Documentation

void SiStripActionExecutor::createDummyShiftReport ( )

Definition at line 146 of file SiStripActionExecutor.cc.

References dbtoconf::out.

Referenced by SiStripAnalyser::analyze().

146  {
147  std::ofstream report_file;
148  report_file.open("sistrip_shift_report.txt", std::ios::out);
149  report_file << " Nothing to report!!" << std::endl;
150  report_file.close();
151 }
tuple out
Definition: dbtoconf.py:99
void SiStripActionExecutor::createFaultyModuleMEs ( DQMStore dqm_store)
void SiStripActionExecutor::createOfflineTkMap ( const edm::ParameterSet tkmapPset,
DQMStore dqm_store,
std::string &  map_type,
const edm::EventSetup eSetup 
)

Definition at line 112 of file SiStripActionExecutor.cc.

References SiStripTrackerMapCreator::createForOffline(), and tkMapCreator_.

Referenced by SiStripOfflineDQM::endRun().

114  {
115  if (tkMapCreator_) tkMapCreator_->createForOffline(tkmapPset, dqm_store, map_type, eSetup);
116 }
SiStripTrackerMapCreator * tkMapCreator_
void createForOffline(const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &htype, const edm::EventSetup &eSetup)
void SiStripActionExecutor::createShiftReport ( DQMStore dqm_store)

Definition at line 155 of file SiStripActionExecutor.cc.

References configWriter_, SiStripConfigWriter::createElement(), contentValuesFiles::fullPath, DQMStore::get(), SiStripLayoutParser::getAllLayouts(), DQMParserBase::getDocument(), SiStripConfigWriter::init(), dbtoconf::out, printReportSummary(), printShiftHistoParameters(), AlCaHLTBitMon_QueryRunRegistry::string, and SiStripConfigWriter::write().

Referenced by SiStripAnalyser::analyze().

155  {
156 
157  // Read layout configuration
158  std::string localPath = std::string("DQM/SiStripMonitorClient/data/sistrip_plot_layout.xml");
159  SiStripLayoutParser layout_parser;
160  layout_parser.getDocument(edm::FileInPath(localPath).fullPath());
161 
162  std::map<std::string, std::vector<std::string> > layout_map;
163  if (!layout_parser.getAllLayouts(layout_map)) return;
164 
165 
166  std::ostringstream shift_summary;
167  if (configWriter_) delete configWriter_;
169  configWriter_->init("ShiftReport");
170 
171 
172  // Print Report Summary Content
173  shift_summary << " Report Summary Content :" << std::endl;
174  shift_summary << " =========================" << std::endl;
175  configWriter_->createElement("ReportSummary");
176 
177  MonitorElement* me;
178  std::string report_path;
179  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TECB";
180  me = dqm_store->get(report_path);
181  printReportSummary(me, shift_summary, "TECB");
182 
183  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TECF";
184  me = dqm_store->get(report_path);
185  printReportSummary(me, shift_summary, "TECF");
186 
187  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIB";
188  me = dqm_store->get(report_path);
189  printReportSummary(me, shift_summary, "TIB");
190 
191  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIDB";
192  me = dqm_store->get(report_path);
193  printReportSummary(me, shift_summary, "TIDB");
194 
195  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIDF";
196  me = dqm_store->get(report_path);
197  printReportSummary(me, shift_summary, "TIDF");
198 
199  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TOB";
200  me = dqm_store->get(report_path);
201  printReportSummary(me, shift_summary, "TOB");
202 
203  shift_summary << std::endl;
204  printShiftHistoParameters(dqm_store, layout_map, shift_summary);
205 
206  std::ofstream report_file;
207  report_file.open("sistrip_shift_report.txt", std::ios::out);
208  report_file << shift_summary.str() << std::endl;
209  report_file.close();
210  configWriter_->write("sistrip_shift_report.xml");
211  delete configWriter_;
212  configWriter_ = 0;
213 }
void getDocument(std::string configFile, bool UseDB=false)
Methor that parses the xml file configFile.
void createElement(std::string tag)
bool init(std::string main)
Write XML file.
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1760
SiStripConfigWriter * configWriter_
tuple out
Definition: dbtoconf.py:99
void printShiftHistoParameters(DQMStore *dqm_store, std::map< std::string, std::vector< std::string > > &layout_map, std::ostringstream &str_val)
void write(std::string fname)
bool getAllLayouts(std::map< std::string, std::vector< std::string > > &me_names)
void printReportSummary(MonitorElement *me, std::ostringstream &str_val, std::string name)
void SiStripActionExecutor::createStatus ( DQMStore dqm_store)
void SiStripActionExecutor::createSummary ( DQMStore dqm_store)

Definition at line 78 of file SiStripActionExecutor.cc.

References DQMStore::cd(), SiStripSummaryCreator::createSummary(), DQMStore::dirExists(), RefreshWebPage::dname, AlCaHLTBitMon_QueryRunRegistry::string, and summaryCreator_.

Referenced by SiStripAnalyser::endLuminosityBlock().

78  {
79  if (summaryCreator_) {
80  dqm_store->cd();
81  std::string dname = "SiStrip/MechanicalView";
82  if (dqm_store->dirExists(dname)) {
83  dqm_store->cd(dname);
84  summaryCreator_->createSummary(dqm_store);
85  }
86  }
87 }
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:696
SiStripSummaryCreator * summaryCreator_
void createSummary(DQMStore *dqm_store)
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:784
void SiStripActionExecutor::createSummaryOffline ( DQMStore dqm_store)

Definition at line 91 of file SiStripActionExecutor.cc.

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

Referenced by SiStripOfflineDQM::endRun().

91  {
92  if (summaryCreator_) {
93  dqm_store->cd();
94  std::string dname = "MechanicalView";
95  if (SiStripUtility::goToDir(dqm_store, dname)) {
96  summaryCreator_->createSummary(dqm_store);
97  }
98  dqm_store->cd();
99  }
100 }
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:696
SiStripSummaryCreator * summaryCreator_
void createSummary(DQMStore *dqm_store)
static bool goToDir(DQMStore *dqm_store, std::string name)
void SiStripActionExecutor::createTkMap ( const edm::ParameterSet tkmapPset,
DQMStore dqm_store,
std::string &  map_type,
const edm::EventSetup eSetup 
)

Definition at line 104 of file SiStripActionExecutor.cc.

References SiStripTrackerMapCreator::create(), and tkMapCreator_.

106  {
107  if (tkMapCreator_) tkMapCreator_->create(tkmapPset, dqm_store, map_type, eSetup);
108 }
SiStripTrackerMapCreator * tkMapCreator_
void create(const edm::ParameterSet &tkmapPset, DQMStore *dqm_store, std::string &htype, const edm::EventSetup &eSetup)
void SiStripActionExecutor::fillDummyStatus ( )
void SiStripActionExecutor::fillStatus ( DQMStore dqm_store,
const edm::ESHandle< SiStripDetCabling > &  fedcabling,
const edm::EventSetup eSetup 
)

Definition at line 134 of file SiStripActionExecutor.cc.

References SiStripQualityChecker::fillStatus(), and qualityChecker_.

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

134  {
135  qualityChecker_->fillStatus(dqm_store, detcabling, eSetup);
136 }
void fillStatus(DQMStore *dqm_store, const edm::ESHandle< SiStripDetCabling > &cabling, const edm::EventSetup &eSetup)
SiStripQualityChecker * qualityChecker_
void SiStripActionExecutor::fillStatusAtLumi ( DQMStore dqm_store)

Definition at line 140 of file SiStripActionExecutor.cc.

References SiStripQualityChecker::fillStatusAtLumi(), and qualityChecker_.

Referenced by SiStripOfflineDQM::endLuminosityBlock().

140  {
141  qualityChecker_->fillStatusAtLumi(dqm_store);
142 }
void fillStatusAtLumi(DQMStore *dqm_store)
SiStripQualityChecker * qualityChecker_
void SiStripActionExecutor::printFaultyModuleList ( DQMStore dqm_store,
std::ostringstream &  str_val 
)

Definition at line 271 of file SiStripActionExecutor.cc.

References DQMStore::cd(), DQMStore::dirExists(), RefreshWebPage::dname, archive::flag, SiStripUtility::getBadModuleStatus(), DQMStore::getContents(), SiStripUtility::getModuleFolderList(), SiStripUtility::goToDir(), python.rootplot.argparse::message, DQMStore::pwd(), and AlCaHLTBitMon_QueryRunRegistry::string.

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

271  {
272  dqm_store->cd();
273 
274  std::string mdir = "MechanicalView";
275  if (!SiStripUtility::goToDir(dqm_store, mdir)) return;
276  std::string mechanicalview_dir = dqm_store->pwd();
277 
278  std::vector<std::string> subdet_folder;
279  subdet_folder.push_back("TIB");
280  subdet_folder.push_back("TOB");
281  subdet_folder.push_back("TEC/MINUS");
282  subdet_folder.push_back("TEC/PLUS");
283  subdet_folder.push_back("TID/MINUS");
284  subdet_folder.push_back("TID/PLUS");
285 
286  int nDetsTotal = 0;
287  int nDetsWithErrorTotal = 0;
288  for (std::vector<std::string>::const_iterator im = subdet_folder.begin(); im != subdet_folder.end(); im++) {
289  std::string dname = mechanicalview_dir + "/" + (*im);
290  if (!dqm_store->dirExists(dname)) continue;
291  str_val << "============"<< std::endl;
292  str_val << (*im) << std::endl;
293  str_val << "============"<< std::endl;
294  str_val << std::endl;
295 
296  dqm_store->cd(dname);
297  std::vector<std::string> module_folders;
298  SiStripUtility::getModuleFolderList(dqm_store, module_folders);
299  int nDets = module_folders.size();
300  dqm_store->cd();
301 
302  int nDetsWithError = 0;
303  std::string bad_module_folder = dname + "/" + "BadModuleList";
304  if (dqm_store->dirExists(bad_module_folder)) {
305  std::vector<MonitorElement *> meVec = dqm_store->getContents(bad_module_folder);
306  for (std::vector<MonitorElement *>::const_iterator it = meVec.begin();
307  it != meVec.end(); it++) {
308  nDetsWithError++;
309  uint16_t flag = (*it)->getIntValue();
311  SiStripUtility::getBadModuleStatus(flag, message);
312  str_val << (*it)->getName() << " flag : " << (*it)->getIntValue() << " " << message << std::endl;
313  }
314  }
315  str_val << "--------------------------------------------------------------------"<< std::endl;
316  str_val << " Detectors : Total "<< nDets
317  << " with Error " << nDetsWithError<< std::endl;
318  str_val << "--------------------------------------------------------------------"<< std::endl;
319  nDetsTotal += nDets;
320  nDetsWithErrorTotal += nDetsWithError;
321  }
322  dqm_store->cd();
323  str_val << "--------------------------------------------------------------------"<< std::endl;
324  str_val << " Total Number of Connected Detectors : " << nDetsTotal << std::endl;
325  str_val << " Total Number of Detectors with Error : " << nDetsWithErrorTotal << std::endl;
326  str_val << "--------------------------------------------------------------------"<< std::endl;
327 
328 }
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:696
static void getBadModuleStatus(uint16_t flag, std::string &message)
std::vector< MonitorElement * > getContents(const std::string &path) const
Definition: DQMStore.cc:1789
bool dirExists(const std::string &path) const
true if directory exists
Definition: DQMStore.cc:784
static void getModuleFolderList(DQMStore *dqm_store, std::vector< std::string > &m_ids)
static bool goToDir(DQMStore *dqm_store, std::string name)
const std::string & pwd(void) const
Definition: DQMStore.cc:691
void SiStripActionExecutor::printReportSummary ( MonitorElement me,
std::ostringstream &  str_val,
std::string  name 
)

Definition at line 217 of file SiStripActionExecutor.cc.

References configWriter_, SiStripConfigWriter::createChildElement(), SiStripUtility::getMEValue(), AlCaHLTBitMon_QueryRunRegistry::string, and relativeConstraints::value.

Referenced by createShiftReport().

218  {
219  str_val <<" " << name << " : ";
221  SiStripUtility::getMEValue(me, value);
222  configWriter_->createChildElement("MonitorElement", name, "value", value);
223  float fvalue = atof(value.c_str());
224  if (fvalue == -1.0) str_val <<" Dummy Value "<<std::endl;
225  else str_val << fvalue << std::endl;
226 }
void createChildElement(std::string tag, std::string name)
static void getMEValue(MonitorElement *me, std::string &val)
SiStripConfigWriter * configWriter_
void SiStripActionExecutor::printShiftHistoParameters ( DQMStore dqm_store,
std::map< std::string, std::vector< std::string > > &  layout_map,
std::ostringstream &  str_val 
)

Definition at line 230 of file SiStripActionExecutor.cc.

References configWriter_, SiStripConfigWriter::createChildElement(), SiStripConfigWriter::createElement(), DQMStore::get(), MonitorElement::getEntries(), MonitorElement::getMean(), MonitorElement::getName(), MonitorElement::getRMS(), python.multivaluedict::map(), create_public_lumi_plots::path_name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by createShiftReport().

230  {
231 
232  str_val << std::endl;
233  for (std::map<std::string, std::vector< std::string > >::iterator it = layout_map.begin() ; it != layout_map.end(); it++) {
234  std::string set_name = it->first;
235  if (set_name.find("Summary") != std::string::npos) continue;
236  configWriter_->createElement(set_name);
237 
238  str_val << " " << set_name << " : " << std::endl;
239  str_val << " ===================================="<< std::endl;
240 
241  str_val << std::setprecision(2);
242  str_val << setiosflags(std::ios::fixed);
243  for (std::vector<std::string>::iterator im = it->second.begin();
244  im != it->second.end(); im++) {
245  std::string path_name = (*im);
246  if (path_name.size() == 0) continue;
247  MonitorElement* me = dqm_store->get(path_name);
248  std::ostringstream entry_str, mean_str, rms_str;
249  entry_str << std::setprecision(2);
250  entry_str << setiosflags(std::ios::fixed);
251  mean_str << std::setprecision(2);
252  mean_str << setiosflags(std::ios::fixed);
253  rms_str << std::setprecision(2);
254  rms_str << setiosflags(std::ios::fixed);
255  entry_str << std::setw(7) << me->getEntries();
256  mean_str << std::setw(7) << me->getMean();
257  rms_str << std::setw(7) << me->getRMS();
258  configWriter_->createChildElement("MonitorElement", me->getName(),
259  "entries",entry_str.str(),"mean",mean_str.str(),"rms",rms_str.str());
260 
261  if (me) str_val << " "<< me->getName() <<" : entries = "<< std::setw(7)
262  << me->getEntries() << " mean = "<< me->getMean()
263  <<" : rms = "<< me->getRMS()<< std::endl;
264  }
265  str_val << std::endl;
266  }
267 }
const std::string & getName(void) const
get name of ME
void createChildElement(std::string tag, std::string name)
double getEntries(void) const
get # of entries
double getMean(int axis=1) const
get mean value of histogram along x, y or z axis (axis=1, 2, 3 respectively)
void createElement(std::string tag)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1760
SiStripConfigWriter * configWriter_
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
bool SiStripActionExecutor::readConfiguration ( )

Definition at line 47 of file SiStripActionExecutor.cc.

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

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

47  {
48 
49  if (!summaryCreator_) {
51  }
52  std::string fpath = pSet_.getUntrackedParameter<std::string>("SummaryConfigPath","DQM/SiStripMonitorClient/data/sistrip_monitorelement_config.xml");
53  if (summaryCreator_->readConfiguration(fpath)) return true;
54  else return false;
55 }
T getUntrackedParameter(std::string const &, T const &) const
SiStripSummaryCreator * summaryCreator_
bool readConfiguration(std::string &file_path)
bool SiStripActionExecutor::readTkMapConfiguration ( const edm::EventSetup eSetup)

Definition at line 68 of file SiStripActionExecutor.cc.

References tkMapCreator_.

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

68  {
69 
70  if (tkMapCreator_) delete tkMapCreator_;
72  if (tkMapCreator_) return true;
73  else return false;
74 }
SiStripTrackerMapCreator * tkMapCreator_
void SiStripActionExecutor::saveMEs ( DQMStore dqm_store,
std::string  fname 
)

Member Data Documentation

SiStripConfigWriter* SiStripActionExecutor::configWriter_
private
edm::ParameterSet SiStripActionExecutor::pSet_
private

Definition at line 68 of file SiStripActionExecutor.h.

Referenced by createStatus(), and readConfiguration().

SiStripQualityChecker* SiStripActionExecutor::qualityChecker_
private
SiStripSummaryCreator* SiStripActionExecutor::summaryCreator_
private
SiStripTrackerMapCreator* SiStripActionExecutor::tkMapCreator_
private
std::vector<std::string> SiStripActionExecutor::tkMapMENames
private

Definition at line 60 of file SiStripActionExecutor.h.