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
TrackingActionExecutor Class Reference

#include <TrackingActionExecutor.h>

Public Member Functions

void createDummyShiftReport ()
 
void createGlobalStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void createLSStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void createShiftReport (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillDummyGlobalStatus ()
 
void fillDummyLSStatus ()
 
void fillGlobalStatus (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void fillStatusAtLumi (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void printReportSummary (MonitorElement *me, std::ostringstream &str_val, std::string name)
 
void printShiftHistoParameters (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::map< std::string, std::vector< std::string > > &layout_map, std::ostringstream &str_val)
 
 TrackingActionExecutor (edm::ParameterSet const &ps)
 
virtual ~TrackingActionExecutor ()
 

Private Attributes

SiStripConfigWriterconfigWriter_
 
edm::ParameterSet pSet_
 
TrackingQualityCheckerqualityChecker_
 
std::vector< std::string > tkMapMENames
 

Detailed Description

Definition at line 26 of file TrackingActionExecutor.h.

Constructor & Destructor Documentation

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

Definition at line 23 of file TrackingActionExecutor.cc.

References configWriter_, NULL, and qualityChecker_.

23  :pSet_(ps) {
24  edm::LogInfo("TrackingActionExecutor") << " Creating TrackingActionExecutor " << "\n" ;
27 }
#define NULL
Definition: scimark2.h:8
TrackingQualityChecker * qualityChecker_
SiStripConfigWriter * configWriter_
TrackingActionExecutor::~TrackingActionExecutor ( )
virtual

Definition at line 31 of file TrackingActionExecutor.cc.

References qualityChecker_.

31  {
32  // std::cout << "[TrackingActionExecutor::~TrackingActionExecutor] .. starting" << std::endl;
33  edm::LogInfo("TrackingActionExecutor") << " Deleting TrackingActionExecutor " << "\n" ;
34  if (qualityChecker_) delete qualityChecker_;
35 }
TrackingQualityChecker * qualityChecker_

Member Function Documentation

void TrackingActionExecutor::createDummyShiftReport ( )

Definition at line 76 of file TrackingActionExecutor.cc.

References dbtoconf::out.

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

76  {
77  // std::cout << "[TrackingActionExecutor::createDummyShiftReport]" << std::endl;
78  std::ofstream report_file;
79  report_file.open("tracking_shift_report.txt", std::ios::out);
80  report_file << " Nothing to report!!" << std::endl;
81  report_file.close();
82 }
tuple out
Definition: dbtoconf.py:99
void TrackingActionExecutor::createGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)
void TrackingActionExecutor::createLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 45 of file TrackingActionExecutor.cc.

References TrackingQualityChecker::bookLSStatus(), pSet_, and qualityChecker_.

Referenced by TrackingOfflineDQM::dqmEndLuminosityBlock().

45  {
47  qualityChecker_->bookLSStatus(ibooker,igetter);
48 }
TrackingQualityChecker * qualityChecker_
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void TrackingActionExecutor::createShiftReport ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 86 of file TrackingActionExecutor.cc.

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

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

86  {
87 
88  // std::cout << "[TrackingActionExecutor::createShiftReport]" << std::endl;
89 
90  // Read layout configuration
91  std::string localPath = std::string("DQM/TrackingMonitorClient/data/tracking_plot_layout.xml");
92  SiStripLayoutParser layout_parser;
93  layout_parser.getDocument(edm::FileInPath(localPath).fullPath());
94 
95  std::map<std::string, std::vector<std::string> > layout_map;
96  if (!layout_parser.getAllLayouts(layout_map)) return;
97 
98 
99  std::ostringstream shift_summary;
100  if (configWriter_) delete configWriter_;
102  configWriter_->init("ShiftReport");
103 
104 
105  // Print Report Summary Content
106  shift_summary << " Report Summary Content :" << std::endl;
107  shift_summary << " =========================" << std::endl;
108  configWriter_->createElement("ReportSummary");
109 
110  shift_summary << std::endl;
111  printShiftHistoParameters(ibooker,igetter, layout_map, shift_summary);
112 
113  std::ofstream report_file;
114  report_file.open("tracking_shift_report.txt", std::ios::out);
115  report_file << shift_summary.str() << std::endl;
116  report_file.close();
117  configWriter_->write("tracking_shift_report.xml");
118  delete configWriter_;
119  configWriter_ = 0;
120 }
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.
void printShiftHistoParameters(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::map< std::string, std::vector< std::string > > &layout_map, std::ostringstream &str_val)
tuple out
Definition: dbtoconf.py:99
SiStripConfigWriter * configWriter_
void write(std::string fname)
bool getAllLayouts(std::map< std::string, std::vector< std::string > > &me_names)
void TrackingActionExecutor::fillDummyGlobalStatus ( )
void TrackingActionExecutor::fillDummyLSStatus ( )
void TrackingActionExecutor::fillGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 64 of file TrackingActionExecutor.cc.

References TrackingQualityChecker::fillGlobalStatus(), and qualityChecker_.

Referenced by TrackingAnalyser::dqmEndJob(), TrackingOfflineDQM::dqmEndJob(), and TrackingAnalyser::dqmEndLuminosityBlock().

64  {
65  qualityChecker_->fillGlobalStatus(ibooker,igetter);
66 }
TrackingQualityChecker * qualityChecker_
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void TrackingActionExecutor::fillStatusAtLumi ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 70 of file TrackingActionExecutor.cc.

References TrackingQualityChecker::fillLSStatus(), and qualityChecker_.

Referenced by TrackingOfflineDQM::dqmEndLuminosityBlock().

70  {
71  qualityChecker_->fillLSStatus(ibooker,igetter);
72 }
TrackingQualityChecker * qualityChecker_
void fillLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
void TrackingActionExecutor::printReportSummary ( MonitorElement me,
std::ostringstream &  str_val,
std::string  name 
)

Definition at line 124 of file TrackingActionExecutor.cc.

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

125  {
126 
127  // std::cout << "[TrackingActionExecutor::printReportSummary]" << std::endl;
128  str_val <<" " << name << " : ";
130  SiStripUtility::getMEValue(me, value);
131  configWriter_->createChildElement("MonitorElement", name, "value", value);
132  float fvalue = atof(value.c_str());
133  if (fvalue == -1.0) str_val <<" Dummy Value "<<std::endl;
134  else str_val << fvalue << std::endl;
135 }
void createChildElement(std::string tag, std::string name)
static void getMEValue(MonitorElement *me, std::string &val)
SiStripConfigWriter * configWriter_
void TrackingActionExecutor::printShiftHistoParameters ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter,
std::map< std::string, std::vector< std::string > > &  layout_map,
std::ostringstream &  str_val 
)

Definition at line 139 of file TrackingActionExecutor.cc.

References configWriter_, SiStripConfigWriter::createChildElement(), SiStripConfigWriter::createElement(), DQMStore::IGetter::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().

139  {
140 
141  // std::cout << "[TrackingActionExecutor::printShiftHistoParameters]" << std::endl;
142  str_val << std::endl;
143  for (std::map<std::string, std::vector< std::string > >::iterator it = layout_map.begin() ; it != layout_map.end(); it++) {
144  std::string set_name = it->first;
145  if (set_name.find("Summary") != std::string::npos) continue;
146  configWriter_->createElement(set_name);
147 
148  str_val << " " << set_name << " : " << std::endl;
149  str_val << " ===================================="<< std::endl;
150 
151  str_val << std::setprecision(2);
152  str_val << setiosflags(std::ios::fixed);
153  for (std::vector<std::string>::iterator im = it->second.begin();
154  im != it->second.end(); im++) {
155  std::string path_name = (*im);
156  if (path_name.size() == 0) continue;
157  MonitorElement* me = igetter.get(path_name);
158  std::ostringstream entry_str, mean_str, rms_str;
159  entry_str << std::setprecision(2);
160  entry_str << setiosflags(std::ios::fixed);
161  mean_str << std::setprecision(2);
162  mean_str << setiosflags(std::ios::fixed);
163  rms_str << std::setprecision(2);
164  rms_str << setiosflags(std::ios::fixed);
165  entry_str << std::setw(7) << me->getEntries();
166  mean_str << std::setw(7) << me->getMean();
167  rms_str << std::setw(7) << me->getRMS();
168  configWriter_->createChildElement("MonitorElement", me->getName(),
169  "entries",entry_str.str(),"mean",mean_str.str(),"rms",rms_str.str());
170 
171  if (me) str_val << " "<< me->getName() <<" : entries = "<< std::setw(7)
172  << me->getEntries() << " mean = "<< me->getMean()
173  <<" : rms = "<< me->getRMS()<< std::endl;
174  }
175  str_val << std::endl;
176  }
177 }
const std::string & getName(void) const
get name of ME
void createChildElement(std::string tag, std::string name)
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:302
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)
double getRMS(int axis=1) const
get RMS of histogram along x, y or z axis (axis=1, 2, 3 respectively)
SiStripConfigWriter * configWriter_

Member Data Documentation

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

Definition at line 55 of file TrackingActionExecutor.h.

Referenced by createGlobalStatus(), and createLSStatus().

TrackingQualityChecker* TrackingActionExecutor::qualityChecker_
private
std::vector<std::string> TrackingActionExecutor::tkMapMENames
private

Definition at line 49 of file TrackingActionExecutor.h.