CMS 3D CMS Logo

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 21 of file TrackingActionExecutor.cc.

References configWriter_, and qualityChecker_.

21  :pSet_(ps) {
22  edm::LogInfo("TrackingActionExecutor") << " Creating TrackingActionExecutor " << "\n" ;
23  qualityChecker_ = nullptr;
24  configWriter_ = nullptr;
25 }
TrackingQualityChecker * qualityChecker_
SiStripConfigWriter * configWriter_
TrackingActionExecutor::~TrackingActionExecutor ( )
virtual

Definition at line 29 of file TrackingActionExecutor.cc.

References qualityChecker_.

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

Member Function Documentation

void TrackingActionExecutor::createDummyShiftReport ( )

Definition at line 74 of file TrackingActionExecutor.cc.

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

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

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

Definition at line 43 of file TrackingActionExecutor.cc.

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

Referenced by TrackingOfflineDQM::dqmEndLuminosityBlock().

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

Definition at line 84 of file TrackingActionExecutor.cc.

References configWriter_, SiStripConfigWriter::createElement(), SiStripLayoutParser::getAllLayouts(), DQMParserBase::getDocument(), SiStripConfigWriter::init(), MillePedeFileConverter_cfg::out, printShiftHistoParameters(), postprocess-scan-build::report_file, AlCaHLTBitMon_QueryRunRegistry::string, and SiStripConfigWriter::write().

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

84  {
85 
86  // std::cout << "[TrackingActionExecutor::createShiftReport]" << std::endl;
87 
88  // Read layout configuration
89  std::string localPath = std::string("DQM/TrackingMonitorClient/data/tracking_plot_layout.xml");
90  SiStripLayoutParser layout_parser;
91  layout_parser.getDocument(edm::FileInPath(localPath).fullPath());
92 
93  std::map<std::string, std::vector<std::string> > layout_map;
94  if (!layout_parser.getAllLayouts(layout_map)) return;
95 
96 
97  std::ostringstream shift_summary;
98  if (configWriter_) delete configWriter_;
100  configWriter_->init("ShiftReport");
101 
102 
103  // Print Report Summary Content
104  shift_summary << " Report Summary Content :" << std::endl;
105  shift_summary << " =========================" << std::endl;
106  configWriter_->createElement("ReportSummary");
107 
108  shift_summary << std::endl;
109  printShiftHistoParameters(ibooker,igetter, layout_map, shift_summary);
110 
111  std::ofstream report_file;
112  report_file.open("tracking_shift_report.txt", std::ios::out);
113  report_file << shift_summary.str() << std::endl;
114  report_file.close();
115  configWriter_->write("tracking_shift_report.xml");
116  delete configWriter_;
117  configWriter_ = nullptr;
118 }
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)
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 62 of file TrackingActionExecutor.cc.

References TrackingQualityChecker::fillGlobalStatus(), and qualityChecker_.

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

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

Definition at line 68 of file TrackingActionExecutor.cc.

References TrackingQualityChecker::fillLSStatus(), and qualityChecker_.

Referenced by TrackingOfflineDQM::dqmEndLuminosityBlock().

68  {
69  qualityChecker_->fillLSStatus(ibooker,igetter);
70 }
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 122 of file TrackingActionExecutor.cc.

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

123  {
124 
125  // std::cout << "[TrackingActionExecutor::printReportSummary]" << std::endl;
126  str_val <<" " << name << " : ";
128  SiStripUtility::getMEValue(me, value);
129  configWriter_->createChildElement("MonitorElement", name, "value", value);
130  float fvalue = atof(value.c_str());
131  if (fvalue == -1.0) str_val <<" Dummy Value "<<std::endl;
132  else str_val << fvalue << std::endl;
133 }
void createChildElement(std::string tag, std::string name)
static void getMEValue(MonitorElement const *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 137 of file TrackingActionExecutor.cc.

References configWriter_, SiStripConfigWriter::createChildElement(), SiStripConfigWriter::createElement(), alignBH_cfg::fixed, DQMStore::IGetter::get(), MonitorElement::getEntries(), MonitorElement::getMean(), MonitorElement::getName(), MonitorElement::getRMS(), genParticles_cff::map, create_public_lumi_plots::path_name, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by createShiftReport().

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