995 std::map<std::string, TH1*> m_histo;
998 int nTriggers(0), nTriggers_c(0), nTriggers_gl(0), nModules_c(0), nModules_gl(0);
1001 if (idSummary.second.accepted_o > 0) ++nTriggers;
1002 if (idSummary.second.keepForGL()) ++nTriggers_gl;
1003 if (idSummary.second.keepForC()) ++nTriggers_c;
1006 if (idSummary.second.keepForGL()) ++nModules_gl;
1007 if (idSummary.second.keepForC()) ++nModules_c;
1010 nTriggers =
std::max(1, nTriggers);
1011 nTriggers_gl =
std::max(1, nTriggers_gl);
1012 nTriggers_c =
std::max(1, nTriggers_c);
1013 nModules_c =
std::max(1, nModules_c);
1014 nModules_gl =
std::max(1, nModules_gl);
1018 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events accepted^{OLD}", nTriggers, 0, nTriggers));
1019 name =
"trigger_gained";
1020 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events gained", nTriggers_gl, 0, nTriggers_gl));
1021 name =
"trigger_lost";
1022 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events lost", nTriggers_gl, 0, nTriggers_gl));
1023 name =
"trigger_changed";
1024 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events changed", nTriggers_c, 0, nTriggers_c));
1025 name =
"trigger_gained_frac";
1026 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{gained}{accepted}", nTriggers_gl, 0, nTriggers_gl));
1027 name =
"trigger_lost_frac";
1028 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{lost}{accepted}", nTriggers_gl, 0, nTriggers_gl));
1029 name =
"trigger_changed_frac";
1030 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{changed}{all - accepted}", nTriggers_c, 0, nTriggers_c));
1031 name =
"module_changed";
1032 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events changed", nModules_c, 0, nModules_c));
1033 name =
"module_gained";
1034 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events gained", nModules_gl, 0, nModules_gl));
1035 name =
"module_lost";
1036 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events lost", nModules_gl, 0, nModules_gl));
1039 size_t bin(0), bin_c(0), bin_gl(0);
1040 for (
const auto& idSummary : m_triggerSummary) {
1041 const TriggerSummary&
summary = idSummary.second;
1042 if (summary.accepted_o > 0) {
1045 m_histo.at(
"trigger_accepted")->SetBinContent(
bin, summary.accepted_o);
1047 m_histo.at(
"trigger_accepted")->GetXaxis()->SetBinLabel(
bin, summary.name.c_str());
1049 if (summary.keepForGL()) {
1052 m_histo.at(
"trigger_gained")->SetBinContent(bin_gl, summary.gained().v);
1053 m_histo.at(
"trigger_lost")->SetBinContent(bin_gl, -summary.lost().v);
1054 m_histo.at(
"trigger_gained_frac")->SetBinContent(bin_gl, summary.gained(1).v);
1055 m_histo.at(
"trigger_lost_frac")->SetBinContent(bin_gl, -summary.lost(1).v);
1057 m_histo.at(
"trigger_gained_frac")->SetBinError(bin_gl, summary.gained(1).e);
1058 m_histo.at(
"trigger_lost_frac")->SetBinError(bin_gl, -summary.lost(1).e);
1060 m_histo.at(
"trigger_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1061 m_histo.at(
"trigger_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1062 m_histo.at(
"trigger_gained_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1063 m_histo.at(
"trigger_lost_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1065 if (summary.keepForC()) {
1068 m_histo.at(
"trigger_changed")->SetBinContent(bin_c, summary.changed().v);
1069 m_histo.at(
"trigger_changed_frac")->SetBinContent(bin_c, summary.changed(1).v);
1071 m_histo.at(
"trigger_changed_frac")->SetBinError(bin_c, summary.changed(1).e);
1073 m_histo.at(
"trigger_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1074 m_histo.at(
"trigger_changed_frac")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1082 for (
const auto& idSummary : m_moduleSummary) {
1084 const GenericSummary& summary = idSummary.second;
1085 if (summary.keepForGL()) {
1088 m_histo.at(
"module_gained")->SetBinContent(bin_gl, summary.gained().v);
1089 m_histo.at(
"module_lost")->SetBinContent(bin_gl, -summary.lost().v);
1091 m_histo.at(
"module_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1092 m_histo.at(
"module_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1094 if (summary.keepForC()) {
1097 m_histo.at(
"module_changed")->SetBinContent(bin_c, summary.changed().v);
1099 m_histo.at(
"module_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1104 for (
const auto& nameHisto : m_histo) {
1106 TH1*
histo = nameHisto.second;
1107 if (name.find(
"gained") != std::string::npos || name.find(
"changed") != std::string::npos) {
1108 if (name.find(
"frac") != std::string::npos)
1109 histo->GetYaxis()->SetRangeUser(0.0, 1.0);
1111 if (name.find(
"lost") != std::string::npos) {
1112 if (name.find(
"frac") != std::string::npos)
1113 histo->GetYaxis()->SetRangeUser(-1.0, 0.0);
1119 auto out_file =
new TFile(file_name.c_str(),
"RECREATE");
1121 char savePath[1000];
1122 sprintf(savePath,
"DQMData/Run %d/HLT/Run summary/EventByEvent/", this->
run);
1123 out_file->mkdir(savePath);
1124 gDirectory->cd(savePath);
1125 gDirectory->Write();
1126 for (
const auto& nameHisto : m_histo)
1127 nameHisto.second->Write(nameHisto.first.c_str());
const JsonOutputProducer & json
std::map< int, GenericSummary > m_moduleSummary
std::string output_filename_base(int _run) const
std::map< int, TriggerSummary > m_triggerSummary
bin
set the eta bin as selection string.