test
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 24 of file SiStripActionExecutor.cc.

References configWriter_, qualityChecker_, summaryCreator_, and tkMapCreator_.

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

Definition at line 35 of file SiStripActionExecutor.cc.

References qualityChecker_, summaryCreator_, and tkMapCreator_.

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

Member Function Documentation

void SiStripActionExecutor::createDummyShiftReport ( )

Definition at line 144 of file SiStripActionExecutor.cc.

References dbtoconf::out.

Referenced by SiStripAnalyser::analyze().

144  {
145  std::ofstream report_file;
146  report_file.open("sistrip_shift_report.txt", std::ios::out);
147  report_file << " Nothing to report!!" << std::endl;
148  report_file.close();
149 }
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 110 of file SiStripActionExecutor.cc.

References SiStripTrackerMapCreator::createForOffline(), and tkMapCreator_.

Referenced by SiStripOfflineDQM::endRun().

112  {
113  if (tkMapCreator_) tkMapCreator_->createForOffline(tkmapPset, dqm_store, map_type, eSetup);
114 }
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 153 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().

153  {
154 
155  // Read layout configuration
156  std::string localPath = std::string("DQM/SiStripMonitorClient/data/sistrip_plot_layout.xml");
157  SiStripLayoutParser layout_parser;
158  layout_parser.getDocument(edm::FileInPath(localPath).fullPath());
159 
160  std::map<std::string, std::vector<std::string> > layout_map;
161  if (!layout_parser.getAllLayouts(layout_map)) return;
162 
163 
164  std::ostringstream shift_summary;
165  if (configWriter_) delete configWriter_;
167  configWriter_->init("ShiftReport");
168 
169 
170  // Print Report Summary Content
171  shift_summary << " Report Summary Content :" << std::endl;
172  shift_summary << " =========================" << std::endl;
173  configWriter_->createElement("ReportSummary");
174 
175  MonitorElement* me;
176  std::string report_path;
177  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TECB";
178  me = dqm_store->get(report_path);
179  printReportSummary(me, shift_summary, "TECB");
180 
181  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TECF";
182  me = dqm_store->get(report_path);
183  printReportSummary(me, shift_summary, "TECF");
184 
185  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIB";
186  me = dqm_store->get(report_path);
187  printReportSummary(me, shift_summary, "TIB");
188 
189  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIDB";
190  me = dqm_store->get(report_path);
191  printReportSummary(me, shift_summary, "TIDB");
192 
193  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TIDF";
194  me = dqm_store->get(report_path);
195  printReportSummary(me, shift_summary, "TIDF");
196 
197  report_path = "SiStrip/EventInfo/reportSummaryContents/SiStrip_DetFraction_TOB";
198  me = dqm_store->get(report_path);
199  printReportSummary(me, shift_summary, "TOB");
200 
201  shift_summary << std::endl;
202  printShiftHistoParameters(dqm_store, layout_map, shift_summary);
203 
204  std::ofstream report_file;
205  report_file.open("sistrip_shift_report.txt", std::ios::out);
206  report_file << shift_summary.str() << std::endl;
207  report_file.close();
208  configWriter_->write("sistrip_shift_report.xml");
209  delete configWriter_;
210  configWriter_ = 0;
211 }
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:1748
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 76 of file SiStripActionExecutor.cc.

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

Referenced by SiStripAnalyser::endLuminosityBlock().

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

Definition at line 89 of file SiStripActionExecutor.cc.

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

Referenced by SiStripOfflineDQM::endRun().

89  {
90  if (summaryCreator_) {
91  dqm_store->cd();
92  std::string dname = "MechanicalView";
93  if (SiStripUtility::goToDir(dqm_store, dname)) {
94  summaryCreator_->createSummary(dqm_store);
95  }
96  dqm_store->cd();
97  }
98 }
void cd(void)
go to top directory (ie. root)
Definition: DQMStore.cc:684
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 102 of file SiStripActionExecutor.cc.

References SiStripTrackerMapCreator::create(), and tkMapCreator_.

104  {
105  if (tkMapCreator_) tkMapCreator_->create(tkmapPset, dqm_store, map_type, eSetup);
106 }
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 132 of file SiStripActionExecutor.cc.

References SiStripQualityChecker::fillStatus(), and qualityChecker_.

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

132  {
133  qualityChecker_->fillStatus(dqm_store, detcabling, eSetup);
134 }
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 138 of file SiStripActionExecutor.cc.

References SiStripQualityChecker::fillStatusAtLumi(), and qualityChecker_.

Referenced by SiStripOfflineDQM::endLuminosityBlock().

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

Definition at line 269 of file SiStripActionExecutor.cc.

References DQMStore::cd(), DQMStore::dirExists(), RefreshWebPage::dname, 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().

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

Definition at line 215 of file SiStripActionExecutor.cc.

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

Referenced by createShiftReport().

216  {
217  str_val <<" " << name << " : ";
219  SiStripUtility::getMEValue(me, value);
220  configWriter_->createChildElement("MonitorElement", name, "value", value);
221  float fvalue = atof(value.c_str());
222  if (fvalue == -1.0) str_val <<" Dummy Value "<<std::endl;
223  else str_val << fvalue << std::endl;
224 }
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 228 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().

228  {
229 
230  str_val << std::endl;
231  for (std::map<std::string, std::vector< std::string > >::iterator it = layout_map.begin() ; it != layout_map.end(); it++) {
232  std::string set_name = it->first;
233  if (set_name.find("Summary") != std::string::npos) continue;
234  configWriter_->createElement(set_name);
235 
236  str_val << " " << set_name << " : " << std::endl;
237  str_val << " ===================================="<< std::endl;
238 
239  str_val << std::setprecision(2);
240  str_val << setiosflags(std::ios::fixed);
241  for (std::vector<std::string>::iterator im = it->second.begin();
242  im != it->second.end(); im++) {
243  std::string path_name = (*im);
244  if (path_name.size() == 0) continue;
245  MonitorElement* me = dqm_store->get(path_name);
246  std::ostringstream entry_str, mean_str, rms_str;
247  entry_str << std::setprecision(2);
248  entry_str << setiosflags(std::ios::fixed);
249  mean_str << std::setprecision(2);
250  mean_str << setiosflags(std::ios::fixed);
251  rms_str << std::setprecision(2);
252  rms_str << setiosflags(std::ios::fixed);
253  entry_str << std::setw(7) << me->getEntries();
254  mean_str << std::setw(7) << me->getMean();
255  rms_str << std::setw(7) << me->getRMS();
256  configWriter_->createChildElement("MonitorElement", me->getName(),
257  "entries",entry_str.str(),"mean",mean_str.str(),"rms",rms_str.str());
258 
259  if (me) str_val << " "<< me->getName() <<" : entries = "<< std::setw(7)
260  << me->getEntries() << " mean = "<< me->getMean()
261  <<" : rms = "<< me->getRMS()<< std::endl;
262  }
263  str_val << std::endl;
264  }
265 }
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:1748
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 45 of file SiStripActionExecutor.cc.

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

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

45  {
46 
47  if (!summaryCreator_) {
49  }
50  std::string fpath = pSet_.getUntrackedParameter<std::string>("SummaryConfigPath","DQM/SiStripMonitorClient/data/sistrip_monitorelement_config.xml");
51  if (summaryCreator_->readConfiguration(fpath)) return true;
52  else return false;
53 }
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 66 of file SiStripActionExecutor.cc.

References tkMapCreator_.

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

66  {
67 
68  if (tkMapCreator_) delete tkMapCreator_;
70  if (tkMapCreator_) return true;
71  else return false;
72 }
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.