CMS 3D CMS Logo

TrackingActionExecutor.cc
Go to the documentation of this file.
1 
3 
5 
7 
13 
15 
16 #include <iomanip>
17 //
18 // -- Constructor
19 //
21  edm::LogInfo("TrackingActionExecutor") << " Creating TrackingActionExecutor "
22  << "\n";
23  qualityChecker_ = nullptr;
24  configWriter_ = nullptr;
25 }
26 //
27 // -- Destructor
28 //
30  // std::cout << "[TrackingActionExecutor::~TrackingActionExecutor] .. starting" << std::endl;
31  edm::LogInfo("TrackingActionExecutor") << " Deleting TrackingActionExecutor "
32  << "\n";
33  if (qualityChecker_)
34  delete qualityChecker_;
35 }
36 
37 //
38 // -- Create Status Monitor Elements
39 //
41  if (!qualityChecker_)
43  qualityChecker_->bookGlobalStatus(ibooker, igetter);
44 }
45 
47  if (!qualityChecker_)
49  qualityChecker_->bookLSStatus(ibooker, igetter);
50 }
51 
52 //
53 // -- Fill Dummy Status
54 //
56 
58 
59 //
60 // -- Fill Status
61 //
63  qualityChecker_->fillGlobalStatus(ibooker, igetter);
64 }
65 //
66 // -- Fill Lumi Status
67 //
69  qualityChecker_->fillLSStatus(ibooker, igetter);
70 }
71 //
72 // --
73 //
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 }
81 //
82 // -- Create Shift Report
83 //
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 }
118 //
119 // -- Print Report Summary
120 //
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 }
133 //
134 // -- Print Shift Histogram Properties
135 //
137  DQMStore::IGetter& igetter,
138  std::map<std::string, std::vector<std::string> >& layout_map,
139  std::ostringstream& str_val) {
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 }
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
TrackingActionExecutor::TrackingActionExecutor
TrackingActionExecutor(edm::ParameterSet const &ps)
Definition: TrackingActionExecutor.cc:20
TrackingActionExecutor::createShiftReport
void createShiftReport(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingActionExecutor.cc:84
MessageLogger.h
SiStripFolderOrganizer.h
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
TrackingActionExecutor::fillDummyLSStatus
void fillDummyLSStatus()
Definition: TrackingActionExecutor.cc:57
SiStripConfigWriter::createChildElement
void createChildElement(std::string tag, std::string name)
Definition: SiStripConfigWriter.cc:32
contentValuesFiles.fullPath
fullPath
Definition: contentValuesFiles.py:64
TrackingActionExecutor::createDummyShiftReport
void createDummyShiftReport()
Definition: TrackingActionExecutor.cc:74
TrackingActionExecutor::printReportSummary
void printReportSummary(MonitorElement *me, std::ostringstream &str_val, std::string name)
Definition: TrackingActionExecutor.cc:121
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
TrackingActionExecutor::createGlobalStatus
void createGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingActionExecutor.cc:40
dqm::legacy::MonitorElement
Definition: MonitorElement.h:461
SiStripConfigWriter.h
postprocess-scan-build.report_file
report_file
Definition: postprocess-scan-build.py:19
SiStripUtility.h
edm::FileInPath
Definition: FileInPath.h:64
TrackingActionExecutor::fillDummyGlobalStatus
void fillDummyGlobalStatus()
Definition: TrackingActionExecutor.cc:55
TrackingQualityChecker::bookLSStatus
void bookLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:121
SiStripDetCabling.h
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
TrackingActionExecutor::createLSStatus
void createLSStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingActionExecutor.cc:46
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::fillStatusAtLumi
void fillStatusAtLumi(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingActionExecutor.cc:68
SiStripLayoutParser.h
edm::ParameterSet
Definition: ParameterSet.h:36
TrackingQualityChecker.h
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
TrackingActionExecutor.h
TrackingActionExecutor::fillGlobalStatus
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingActionExecutor.cc:62
dqm::implementation::IGetter
Definition: DQMStore.h:484
TrackingActionExecutor::~TrackingActionExecutor
virtual ~TrackingActionExecutor()
Definition: TrackingActionExecutor.cc:29
TrackingQualityChecker::fillGlobalStatus
void fillGlobalStatus(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Definition: TrackingQualityChecker.cc:249
relativeConstraints.value
value
Definition: relativeConstraints.py:53
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
dqm::implementation::IBooker
Definition: DQMStore.h:43
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:56
StripSubdetector.h
SiStripLayoutParser::getDocument
void getDocument(std::string filepath)
Definition: SiStripLayoutParser.cc:13
TrackingActionExecutor::pSet_
edm::ParameterSet pSet_
Definition: TrackingActionExecutor.h:54