CMS 3D CMS Logo

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

#include <TrackingActionExecutor.h>

Public Types

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

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 24 of file TrackingActionExecutor.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 26 of file TrackingActionExecutor.h.

◆ MonitorElement

Definition at line 27 of file TrackingActionExecutor.h.

Constructor & Destructor Documentation

◆ TrackingActionExecutor()

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

Definition at line 20 of file TrackingActionExecutor.cc.

References configWriter_, and qualityChecker_.

20  : pSet_(ps) {
21  edm::LogInfo("TrackingActionExecutor") << " Creating TrackingActionExecutor "
22  << "\n";
23  qualityChecker_ = nullptr;
24  configWriter_ = nullptr;
25 }
TrackingQualityChecker * qualityChecker_
Log< level::Info, false > LogInfo
SiStripConfigWriter * configWriter_

◆ ~TrackingActionExecutor()

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 "
32  << "\n";
33  if (qualityChecker_)
34  delete qualityChecker_;
35 }
TrackingQualityChecker * qualityChecker_
Log< level::Info, false > LogInfo

Member Function Documentation

◆ createDummyShiftReport()

void TrackingActionExecutor::createDummyShiftReport ( )

Definition at line 74 of file TrackingActionExecutor.cc.

References MillePedeFileConverter_cfg::out.

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 }

◆ createGlobalStatus()

void TrackingActionExecutor::createGlobalStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

◆ createLSStatus()

void TrackingActionExecutor::createLSStatus ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 46 of file TrackingActionExecutor.cc.

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

Referenced by TrackingOfflineDQM::dqmEndLuminosityBlock().

46  {
47  if (!qualityChecker_)
49  qualityChecker_->bookLSStatus(ibooker, igetter);
50 }
TrackingQualityChecker * qualityChecker_
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)

◆ createShiftReport()

void TrackingActionExecutor::createShiftReport ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 84 of file TrackingActionExecutor.cc.

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

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

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

◆ fillDummyGlobalStatus()

void TrackingActionExecutor::fillDummyGlobalStatus ( )

◆ fillDummyLSStatus()

void TrackingActionExecutor::fillDummyLSStatus ( )

◆ fillGlobalStatus()

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)

◆ fillStatusAtLumi()

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)

◆ printReportSummary()

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

Definition at line 121 of file TrackingActionExecutor.cc.

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

121  {
122  // std::cout << "[TrackingActionExecutor::printReportSummary]" << std::endl;
123  str_val << " " << name << " : ";
126  configWriter_->createChildElement("MonitorElement", name, "value", value);
127  float fvalue = atof(value.c_str());
128  if (fvalue == -1.0)
129  str_val << " Dummy Value " << std::endl;
130  else
131  str_val << fvalue << std::endl;
132 }
void createChildElement(std::string tag, std::string name)
static void getMEValue(MonitorElement const *me, std::string &val)
Definition: value.py:1
SiStripConfigWriter * configWriter_

◆ printShiftHistoParameters()

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

References configWriter_, SiStripConfigWriter::createChildElement(), SiStripConfigWriter::createElement(), alignBH_cfg::fixed, dqm::implementation::IGetter::get(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, genParticles_cff::map, hlt_dqm_clientPB-live_cfg::me, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by createShiftReport().

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

Member Data Documentation

◆ configWriter_

SiStripConfigWriter* TrackingActionExecutor::configWriter_
private

◆ pSet_

edm::ParameterSet TrackingActionExecutor::pSet_
private

Definition at line 54 of file TrackingActionExecutor.h.

Referenced by createGlobalStatus(), and createLSStatus().

◆ qualityChecker_

TrackingQualityChecker* TrackingActionExecutor::qualityChecker_
private

◆ tkMapMENames

std::vector<std::string> TrackingActionExecutor::tkMapMENames
private

Definition at line 48 of file TrackingActionExecutor.h.