996 std::map<std::string, TH1*> m_histo;
999 int nTriggers(0), nTriggers_c(0), nTriggers_gl(0), nModules_c(0), nModules_gl(0);
1002 if (idSummary.second.accepted_o > 0) ++nTriggers;
1003 if (idSummary.second.keepForGL()) ++nTriggers_gl;
1004 if (idSummary.second.keepForC()) ++nTriggers_c;
1007 if (idSummary.second.keepForGL()) ++nModules_gl;
1008 if (idSummary.second.keepForC()) ++nModules_c;
1011 nTriggers =
std::max(1, nTriggers);
1012 nTriggers_gl =
std::max(1, nTriggers_gl);
1013 nTriggers_c =
std::max(1, nTriggers_c);
1014 nModules_c =
std::max(1, nModules_c);
1015 nModules_gl =
std::max(1, nModules_gl);
1019 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events accepted^{OLD}", nTriggers, 0, nTriggers));
1020 name =
"trigger_gained";
1021 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events gained", nTriggers_gl, 0, nTriggers_gl));
1022 name =
"trigger_lost";
1023 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events lost", nTriggers_gl, 0, nTriggers_gl));
1024 name =
"trigger_changed";
1025 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events changed", nTriggers_c, 0, nTriggers_c));
1026 name =
"trigger_gained_frac";
1027 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{gained}{accepted}", nTriggers_gl, 0, nTriggers_gl));
1028 name =
"trigger_lost_frac";
1029 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{lost}{accepted}", nTriggers_gl, 0, nTriggers_gl));
1030 name =
"trigger_changed_frac";
1031 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{changed}{all - accepted}", nTriggers_c, 0, nTriggers_c));
1032 name =
"module_changed";
1033 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events changed", nModules_c, 0, nModules_c));
1034 name =
"module_gained";
1035 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events gained", nModules_gl, 0, nModules_gl));
1036 name =
"module_lost";
1037 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events lost", nModules_gl, 0, nModules_gl));
1040 size_t bin(0), bin_c(0), bin_gl(0);
1041 for (
const auto& idSummary : m_triggerSummary) {
1042 const TriggerSummary&
summary = idSummary.second;
1043 if (summary.accepted_o > 0) {
1046 m_histo.at(
"trigger_accepted")->SetBinContent(
bin, summary.accepted_o);
1048 m_histo.at(
"trigger_accepted")->GetXaxis()->SetBinLabel(
bin, summary.name.c_str());
1050 if (summary.keepForGL()) {
1053 m_histo.at(
"trigger_gained")->SetBinContent(bin_gl, summary.gained().v);
1054 m_histo.at(
"trigger_lost")->SetBinContent(bin_gl, -summary.lost().v);
1055 m_histo.at(
"trigger_gained_frac")->SetBinContent(bin_gl, summary.gained(1).v);
1056 m_histo.at(
"trigger_lost_frac")->SetBinContent(bin_gl, -summary.lost(1).v);
1058 m_histo.at(
"trigger_gained_frac")->SetBinError(bin_gl, summary.gained(1).e);
1059 m_histo.at(
"trigger_lost_frac")->SetBinError(bin_gl, -summary.lost(1).e);
1061 m_histo.at(
"trigger_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1062 m_histo.at(
"trigger_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1063 m_histo.at(
"trigger_gained_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1064 m_histo.at(
"trigger_lost_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1066 if (summary.keepForC()) {
1069 m_histo.at(
"trigger_changed")->SetBinContent(bin_c, summary.changed().v);
1070 m_histo.at(
"trigger_changed_frac")->SetBinContent(bin_c, summary.changed(1).v);
1072 m_histo.at(
"trigger_changed_frac")->SetBinError(bin_c, summary.changed(1).e);
1074 m_histo.at(
"trigger_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1075 m_histo.at(
"trigger_changed_frac")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1083 for (
const auto& idSummary : m_moduleSummary) {
1085 const GenericSummary& summary = idSummary.second;
1086 if (summary.keepForGL()) {
1089 m_histo.at(
"module_gained")->SetBinContent(bin_gl, summary.gained().v);
1090 m_histo.at(
"module_lost")->SetBinContent(bin_gl, -summary.lost().v);
1092 m_histo.at(
"module_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1093 m_histo.at(
"module_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1095 if (summary.keepForC()) {
1098 m_histo.at(
"module_changed")->SetBinContent(bin_c, summary.changed().v);
1100 m_histo.at(
"module_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1105 for (
const auto& nameHisto : m_histo) {
1107 TH1*
histo = nameHisto.second;
1108 if (name.find(
"gained") != std::string::npos || name.find(
"changed") != std::string::npos) {
1109 if (name.find(
"frac") != std::string::npos)
1110 histo->GetYaxis()->SetRangeUser(0.0, 1.0);
1112 if (name.find(
"lost") != std::string::npos) {
1113 if (name.find(
"frac") != std::string::npos)
1114 histo->GetYaxis()->SetRangeUser(-1.0, 0.0);
1120 auto out_file =
new TFile(file_name.c_str(),
"RECREATE");
1122 char savePath[1000];
1123 sprintf(savePath,
"DQMData/Run %d/HLT/Run summary/EventByEvent/", this->
run);
1124 out_file->mkdir(savePath);
1125 gDirectory->cd(savePath);
1126 gDirectory->Write();
1127 for (
const auto& nameHisto : m_histo)
1128 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.