67 THashList* l1 = (const_cast<TAxis*>(a1))->GetLabels();
68 THashList* l2 = (const_cast<TAxis*>(
a2))->GetLabels();
77 if (l1->GetSize() != l2->GetSize()) {
81 for (
int i = 1;
i <= a1->GetNbins(); ++
i) {
82 std::string_view
label1 = a1->GetBinLabel(
i);
83 std::string_view label2 =
a2->GetBinLabel(
i);
94 if (
original->CanExtendAllAxes() &&
toAdd->CanExtendAllAxes()) {
104 original->GetXaxis()->GetXmin() ==
toAdd->GetXaxis()->GetXmin() &&
105 original->GetXaxis()->GetXmax() ==
toAdd->GetXaxis()->GetXmax() &&
107 original->GetYaxis()->GetXmin() ==
toAdd->GetYaxis()->GetXmin() &&
108 original->GetYaxis()->GetXmax() ==
toAdd->GetYaxis()->GetXmax() &&
110 original->GetZaxis()->GetXmin() ==
toAdd->GetZaxis()->GetXmin() &&
111 original->GetZaxis()->GetXmax() ==
toAdd->GetZaxis()->GetXmax() &&
117 edm::LogError(
"MergeFailure") <<
"Found histograms with different axis limits or different labels '"
118 <<
original->GetName() <<
"' not merged.";
161 if (
m_rescope == MonitorElementData::Scope::LUMI) {
163 key.scope_ =
lumi == 0 ? MonitorElementData::Scope::RUN : MonitorElementData::Scope::LUMI;
165 }
else if (
m_rescope == MonitorElementData::Scope::RUN) {
167 key.scope_ = MonitorElementData::Scope::RUN;
169 }
else if (
m_rescope == MonitorElementData::Scope::JOB) {
171 key.scope_ = MonitorElementData::Scope::JOB;
174 assert(!
"Invalid Scope in rescope option.");
179 virtual void setTree(TTree* iTree) = 0;
328 std::shared_ptr<edm::FileBlock>
readFile_()
override;
389 desc.addUntracked<std::vector<std::string>>(
"fileNames")->setComment(
"Names of files to be processed.");
390 desc.addUntracked<
unsigned int>(
"filterOnRun", 0)->setComment(
"Just limit the process to the selected run.");
393 "Accumulate histograms more coarsely."
394 " Options: \"\": keep unchanged, \"RUN\": turn LUMI histograms into RUN histograms, \"JOB\": turn everything "
395 "into JOB histograms.");
396 desc.addUntracked<
bool>(
"skipBadFiles",
false)->setComment(
"Skip the file if it is not valid");
398 ->setComment(
"An alternate file catalog to use instead of the standard site one.");
399 std::vector<edm::LuminosityBlockRange> defaultLumis;
400 desc.addUntracked<std::vector<edm::LuminosityBlockRange>>(
"lumisToProcess", defaultLumis)
401 ->setComment(
"Skip any lumi inside the specified run:lumi range.");
412 m_skipBadFiles(iPSet.getUntrackedParameter<
bool>(
"skipBadFiles",
false)),
413 m_filterOnRun(iPSet.getUntrackedParameter<unsigned
int>(
"filterOnRun", 0)),
415 iPSet.getUntrackedParameter<
std::
string>(
"overrideCatalog")),
419 {
"", MonitorElementData::Scope::LUMI},
420 {
"LUMI", MonitorElementData::Scope::LUMI},
421 {
"RUN", MonitorElementData::Scope::RUN},
422 {
"JOB", MonitorElementData::Scope::JOB}}[iPSet.getUntrackedParameter<
std::string>(
"reScope",
"JOB")]),
424 m_treeReaders(
kNIndicies, std::shared_ptr<TreeReaderBase>()),
426 m_openFiles(std::vector<TFile*>()),
427 m_fileMetadatas(std::vector<FileMetadata>()) {
430 if (m_catalog.fileNames(0).empty()) {
448 produces<DQMToken, edm::Transition::BeginRun>(
"DQMGenerationRecoRun");
449 produces<DQMToken, edm::Transition::BeginLuminosityBlock>(
"DQMGenerationRecoLumi");
454 if (
file !=
nullptr &&
file->IsOpen()) {
474 std::list<std::string> exInfo;
476 bool isGoodFile(
true);
478 const std::vector<std::string>& fNames = fileitem.fileNames();
479 for (std::vector<std::string>::const_iterator it = fNames.begin(); it != fNames.end(); ++it) {
482 file = TFile::Open(it->c_str());
486 if (
e != std::exception_ptr()) {
488 std::rethrow_exception(
e);
497 ex <<
"\nInput file " << it->c_str() <<
" was not found, could not be opened, or is corrupted.\n";
499 for (
auto const&
s : exInfo)
506 for (
auto const&
s :
e.additionalInfo())
518 ex <<
"Input file " << it->c_str() <<
" could not be opened.\n";
521 for (
auto const&
s : exInfo)
540 if (strcmp(
file->GetTitle(),
"1") != 0) {
542 ex <<
"Input file " << fNames[0].c_str() <<
" does not appear to be a DQM Root file.\n";
547 assert(indicesTree !=
nullptr);
559 for (Long64_t
index = 0;
index != indicesTree->GetEntries(); ++
index) {
560 indicesTree->GetEntry(
index);
574 unsigned int run = 0;
575 auto toadd = std::vector<FileMetadata>();
579 FileMetadata
dummy{};
583 toadd.push_back(
dummy);
588 if (!toadd.empty()) {
604 return std::make_shared<edm::FileBlock>();
611 return std::make_shared<edm::RunAuxiliary>(runAux);
619 return std::make_shared<edm::LuminosityBlockAuxiliary>(lumiAux);
668 ULong64_t endIndex =
metadata.m_lastIndex + 1;
692 return previousMetadata.m_run !=
metadata.m_run || previousMetadata.m_lumi !=
metadata.m_lumi;
705 if (previousMetadata.m_run !=
metadata.m_run) {
707 }
else if (previousMetadata.m_lumi !=
metadata.m_lumi) {
714 std::unique_ptr<DQMToken> product = std::make_unique<DQMToken>();
719 std::unique_ptr<DQMToken> product = std::make_unique<DQMToken>();
733 if (
run >= lumiToProcess.startRun() &&
run <= lumiToProcess.endRun()) {
734 if (
lumi >= lumiToProcess.startLumi() &&
lumi <= lumiToProcess.endLumi()) {
736 }
else if (
lumi == 0) {