966 std::map<std::string, TH1*> m_histo;
969 int nTriggers(0), nTriggers_c(0), nTriggers_gl(0), nModules_c(0), nModules_gl(0);
972 if (idSummary.second.accepted_o > 0) ++nTriggers;
973 if (idSummary.second.keepForGL()) ++nTriggers_gl;
974 if (idSummary.second.keepForC()) ++nTriggers_c;
977 if (idSummary.second.keepForGL()) ++nModules_gl;
978 if (idSummary.second.keepForC()) ++nModules_c;
983 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events accepted^{OLD}", nTriggers, 0, nTriggers));
984 name =
"trigger_gained";
985 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events gained", nTriggers_gl, 0, nTriggers_gl));
986 name =
"trigger_lost";
987 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events lost", nTriggers_gl, 0, nTriggers_gl));
988 name =
"trigger_changed";
989 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events changed", nTriggers_c, 0, nTriggers_c));
990 name =
"trigger_gained_frac";
991 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{gained}{accepted}", nTriggers_gl, 0, nTriggers_gl));
992 name =
"trigger_lost_frac";
993 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{lost}{accepted}", nTriggers_gl, 0, nTriggers_gl));
994 name =
"trigger_changed_frac";
995 m_histo.emplace(name,
new TH1F(name.c_str(),
";;#frac{changed}{all - accepted}", nTriggers_c, 0, nTriggers_c));
996 name =
"module_changed";
997 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events changed", nModules_c, 0, nModules_c));
998 name =
"module_gained";
999 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events gained", nModules_gl, 0, nModules_gl));
1000 name =
"module_lost";
1001 m_histo.emplace(name,
new TH1F(name.c_str(),
";;Events lost", nModules_gl, 0, nModules_gl));
1004 size_t bin(0), bin_c(0), bin_gl(0);
1005 for (
const auto& idSummary : m_triggerSummary) {
1006 const TriggerSummary&
summary = idSummary.second;
1007 if (summary.accepted_o > 0) {
1010 m_histo.at(
"trigger_accepted")->SetBinContent(
bin, summary.accepted_o);
1012 m_histo.at(
"trigger_accepted")->GetXaxis()->SetBinLabel(
bin, summary.name.c_str());
1014 if (summary.keepForGL()) {
1017 m_histo.at(
"trigger_gained")->SetBinContent(bin_gl, summary.gained().v);
1018 m_histo.at(
"trigger_lost")->SetBinContent(bin_gl, -summary.lost().v);
1019 m_histo.at(
"trigger_gained_frac")->SetBinContent(bin_gl, summary.gained(1).v);
1020 m_histo.at(
"trigger_lost_frac")->SetBinContent(bin_gl, -summary.lost(1).v);
1022 m_histo.at(
"trigger_gained_frac")->SetBinError(bin_gl, summary.gained(1).e);
1023 m_histo.at(
"trigger_lost_frac")->SetBinError(bin_gl, -summary.lost(1).e);
1025 m_histo.at(
"trigger_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1026 m_histo.at(
"trigger_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1027 m_histo.at(
"trigger_gained_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1028 m_histo.at(
"trigger_lost_frac")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1030 if (summary.keepForC()) {
1033 m_histo.at(
"trigger_changed")->SetBinContent(bin_c, summary.changed().v);
1034 m_histo.at(
"trigger_changed_frac")->SetBinContent(bin_c, summary.changed(1).v);
1036 m_histo.at(
"trigger_changed_frac")->SetBinError(bin_c, summary.changed(1).e);
1038 m_histo.at(
"trigger_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1039 m_histo.at(
"trigger_changed_frac")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1047 for (
const auto& idSummary : m_moduleSummary) {
1049 const GenericSummary& summary = idSummary.second;
1050 if (summary.keepForGL()) {
1053 m_histo.at(
"module_gained")->SetBinContent(bin_gl, summary.gained().v);
1054 m_histo.at(
"module_lost")->SetBinContent(bin_gl, -summary.lost().v);
1056 m_histo.at(
"module_gained")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1057 m_histo.at(
"module_lost")->GetXaxis()->SetBinLabel(bin_gl, summary.name.c_str());
1059 if (summary.keepForC()) {
1062 m_histo.at(
"module_changed")->SetBinContent(bin_c, summary.changed().v);
1064 m_histo.at(
"module_changed")->GetXaxis()->SetBinLabel(bin_c, summary.name.c_str());
1069 for (
const auto& nameHisto : m_histo) {
1071 TH1*
histo = nameHisto.second;
1072 if (name.find(
"gained") != std::string::npos || name.find(
"changed") != std::string::npos) {
1073 if (name.find(
"frac") != std::string::npos)
1074 histo->GetYaxis()->SetRangeUser(0.0, 1.0);
1076 if (name.find(
"lost") != std::string::npos) {
1077 if (name.find(
"frac") != std::string::npos)
1078 histo->GetYaxis()->SetRangeUser(-1.0, 0.0);
1084 TFile* out_file =
new TFile(file_name.c_str(),
"RECREATE");
1086 char savePath[1000];
1087 sprintf(savePath,
"DQMData/Run %d/HLT/Run summary/EventByEvent/", this->
run);
1088 out_file->mkdir(savePath);
1089 gDirectory->cd(savePath);
1090 gDirectory->Write();
1091 for (
const auto& nameHisto : m_histo)
1092 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