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 *dqm_store)
 
void createLSStatus (DQMStore *dqm_store)
 
void createShiftReport (DQMStore *dqm_store)
 
void fillDummyGlobalStatus ()
 
void fillDummyLSStatus ()
 
void fillGlobalStatus (DQMStore *dqm_store)
 
void fillStatusAtLumi (DQMStore *dqm_store)
 
void printReportSummary (MonitorElement *me, std::ostringstream &str_val, std::string name)
 
void printShiftHistoParameters (DQMStore *dqm_store, 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 25 of file TrackingActionExecutor.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file TrackingActionExecutor.cc.

References configWriter_, NULL, and qualityChecker_.

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

Definition at line 32 of file TrackingActionExecutor.cc.

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

Member Function Documentation

void TrackingActionExecutor::createDummyShiftReport ( )

Definition at line 77 of file TrackingActionExecutor.cc.

References dbtoconf::out.

Referenced by TrackingAnalyser::analyze().

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

Definition at line 87 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::analyze().

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

Definition at line 65 of file TrackingActionExecutor.cc.

References TrackingQualityChecker::fillGlobalStatus(), and qualityChecker_.

Referenced by TrackingAnalyser::analyze(), and TrackingOfflineDQM::endRun().

65  {
67 }
void fillGlobalStatus(DQMStore *dqm_store)
TrackingQualityChecker * qualityChecker_
void TrackingActionExecutor::fillStatusAtLumi ( DQMStore dqm_store)
void TrackingActionExecutor::printReportSummary ( MonitorElement me,
std::ostringstream &  str_val,
std::string  name 
)

Definition at line 125 of file TrackingActionExecutor.cc.

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

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

Definition at line 140 of file TrackingActionExecutor.cc.

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

140  {
141 
142  // std::cout << "[TrackingActionExecutor::printShiftHistoParameters]" << std::endl;
143  str_val << std::endl;
144  for (std::map<std::string, std::vector< std::string > >::iterator it = layout_map.begin() ; it != layout_map.end(); it++) {
145  std::string set_name = it->first;
146  if (set_name.find("Summary") != std::string::npos) 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();
155  im != it->second.end(); im++) {
156  std::string path_name = (*im);
157  if (path_name.size() == 0) continue;
158  MonitorElement* me = dqm_store->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();
169  configWriter_->createChildElement("MonitorElement", me->getName(),
170  "entries",entry_str.str(),"mean",mean_str.str(),"rms",rms_str.str());
171 
172  if (me) str_val << " "<< me->getName() <<" : entries = "<< std::setw(7)
173  << me->getEntries() << " mean = "<< me->getMean()
174  <<" : rms = "<< me->getRMS()<< std::endl;
175  }
176  str_val << std::endl;
177  }
178 }
const std::string & getName(void) const
get name of ME
void createChildElement(std::string tag, std::string name)
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)
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1696
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 54 of file TrackingActionExecutor.h.

Referenced by createGlobalStatus(), and createLSStatus().

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

Definition at line 48 of file TrackingActionExecutor.h.