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.

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

References configWriter_, and qualityChecker_.

◆ ~TrackingActionExecutor()

TrackingActionExecutor::~TrackingActionExecutor ( )
virtual

Definition at line 29 of file TrackingActionExecutor.cc.

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

References qualityChecker_.

Member Function Documentation

◆ createDummyShiftReport()

void TrackingActionExecutor::createDummyShiftReport ( )

Definition at line 74 of file TrackingActionExecutor.cc.

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 }

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

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

◆ createGlobalStatus()

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

◆ createLSStatus()

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

◆ createShiftReport()

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

Definition at line 84 of file TrackingActionExecutor.cc.

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 }

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

Referenced by TrackingAnalyser::dqmEndLuminosityBlock().

◆ fillDummyGlobalStatus()

void TrackingActionExecutor::fillDummyGlobalStatus ( )

◆ fillDummyLSStatus()

void TrackingActionExecutor::fillDummyLSStatus ( )

◆ fillGlobalStatus()

void TrackingActionExecutor::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.

68  {
69  qualityChecker_->fillLSStatus(ibooker, igetter);
70 }

References TrackingQualityChecker::fillLSStatus(), and qualityChecker_.

Referenced by TrackingOfflineDQM::dqmEndLuminosityBlock().

◆ printReportSummary()

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

Definition at line 121 of file TrackingActionExecutor.cc.

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 }

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

◆ 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.

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 }

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

Referenced by createShiftReport().

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.

alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
TrackingQualityChecker::bookGlobalStatus
void bookGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:72
TrackingActionExecutor::qualityChecker_
TrackingQualityChecker * qualityChecker_
Definition: TrackingActionExecutor.h:50
SiStripConfigWriter
Definition: SiStripConfigWriter.h:25
SiStripConfigWriter::createChildElement
void createChildElement(std::string tag, std::string name)
Definition: SiStripConfigWriter.cc:32
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
TrackingActionExecutor::printShiftHistoParameters
void printShiftHistoParameters(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter, std::map< std::string, std::vector< std::string > > &layout_map, std::ostringstream &str_val)
Definition: TrackingActionExecutor.cc:136
edm::LogInfo
Definition: MessageLogger.h:254
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
postprocess-scan-build.report_file
report_file
Definition: postprocess-scan-build.py:19
edm::FileInPath
Definition: FileInPath.h:64
TrackingQualityChecker::bookLSStatus
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:121
SiStripLayoutParser
Definition: SiStripLayoutParser.h:16
SiStripConfigWriter::createElement
void createElement(std::string tag)
Definition: SiStripConfigWriter.cc:24
TrackingQualityChecker
Definition: TrackingQualityChecker.h:18
TrackingQualityChecker::fillDummyGlobalStatus
void fillDummyGlobalStatus()
Definition: TrackingQualityChecker.cc:166
SiStripUtility::getMEValue
static void getMEValue(MonitorElement const *me, std::string &val)
Definition: SiStripUtility.cc:239
SiStripConfigWriter::write
void write(std::string fname)
Definition: SiStripConfigWriter.cc:63
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackingQualityChecker::fillDummyLSStatus
void fillDummyLSStatus()
Definition: TrackingQualityChecker.cc:187
TrackingActionExecutor::configWriter_
SiStripConfigWriter * configWriter_
Definition: TrackingActionExecutor.h:52
SiStripLayoutParser::getAllLayouts
bool getAllLayouts(std::map< std::string, std::vector< std::string > > &me_names)
Definition: SiStripLayoutParser.cc:20
value
Definition: value.py:1
TrackingQualityChecker::fillLSStatus
void fillLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:263
SiStripConfigWriter::init
bool init(std::string main)
Write XML file.
Definition: SiStripConfigWriter.cc:17
TrackingQualityChecker::fillGlobalStatus
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:249
relativeConstraints.value
value
Definition: relativeConstraints.py:53
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
genParticles_cff.map
map
Definition: genParticles_cff.py:11
hlt_dqm_clientPB-live_cfg.me
me
Definition: hlt_dqm_clientPB-live_cfg.py:61
SiStripLayoutParser::getDocument
void getDocument(std::string filepath)
Definition: SiStripLayoutParser.cc:13
TrackingActionExecutor::pSet_
edm::ParameterSet pSet_
Definition: TrackingActionExecutor.h:54