65 THashList* l1 = (const_cast<TAxis*>(a1))->GetLabels();
66 THashList* l2 = (const_cast<TAxis*>(
a2))->GetLabels();
75 if (l1->GetSize() != l2->GetSize()) {
79 for (
int i = 1;
i <= a1->GetNbins(); ++
i) {
80 std::string_view
label1 = a1->GetBinLabel(
i);
81 std::string_view
label2 =
a2->GetBinLabel(
i);
92 if (
original->CanExtendAllAxes() &&
toAdd->CanExtendAllAxes()) {
102 original->GetXaxis()->GetXmin() ==
toAdd->GetXaxis()->GetXmin() &&
103 original->GetXaxis()->GetXmax() ==
toAdd->GetXaxis()->GetXmax() &&
105 original->GetYaxis()->GetXmin() ==
toAdd->GetYaxis()->GetXmin() &&
106 original->GetYaxis()->GetXmax() ==
toAdd->GetYaxis()->GetXmax() &&
108 original->GetZaxis()->GetXmin() ==
toAdd->GetZaxis()->GetXmin() &&
109 original->GetZaxis()->GetXmax() ==
toAdd->GetZaxis()->GetXmax() &&
115 edm::LogError(
"MergeFailure") <<
"Found histograms with different axis limits or different labels '"
116 <<
original->GetName() <<
"' not merged.";
159 if (
m_rescope == MonitorElementData::Scope::LUMI) {
161 key.scope_ =
lumi == 0 ? MonitorElementData::Scope::RUN : MonitorElementData::Scope::LUMI;
163 }
else if (
m_rescope == MonitorElementData::Scope::RUN) {
165 key.scope_ = MonitorElementData::Scope::RUN;
167 }
else if (
m_rescope == MonitorElementData::Scope::JOB) {
169 key.scope_ = MonitorElementData::Scope::JOB;
172 assert(!
"Invalid Scope in rescope option.");
177 virtual void setTree(TTree* iTree) = 0;
326 std::unique_ptr<edm::FileBlock>
readFile_()
override;
387 desc.
addUntracked<std::vector<std::string>>(
"fileNames")->setComment(
"Names of files to be processed.");
388 desc.
addUntracked<
unsigned int>(
"filterOnRun", 0)->setComment(
"Just limit the process to the selected run.");
391 "Accumulate histograms more coarsely."
392 " Options: \"\": keep unchanged, \"RUN\": turn LUMI histograms into RUN histograms, \"JOB\": turn everything "
393 "into JOB histograms.");
394 desc.
addUntracked<
bool>(
"skipBadFiles",
false)->setComment(
"Skip the file if it is not valid");
396 ->setComment(
"An alternate file catalog to use instead of the standard site one.");
397 std::vector<edm::LuminosityBlockRange> defaultLumis;
398 desc.
addUntracked<std::vector<edm::LuminosityBlockRange>>(
"lumisToProcess", defaultLumis)
399 ->setComment(
"Skip any lumi inside the specified run:lumi range.");
410 m_skipBadFiles(iPSet.getUntrackedParameter<
bool>(
"skipBadFiles",
false)),
411 m_filterOnRun(iPSet.getUntrackedParameter<unsigned
int>(
"filterOnRun", 0)),
412 m_catalog(iPSet.getUntrackedParameter<
std::vector<
std::
string>>(
"fileNames"),
413 iPSet.getUntrackedParameter<
std::
string>(
"overrideCatalog")),
417 {
"", MonitorElementData::Scope::LUMI},
418 {
"LUMI", MonitorElementData::Scope::LUMI},
419 {
"RUN", MonitorElementData::Scope::RUN},
420 {
"JOB", MonitorElementData::Scope::JOB}}[iPSet.getUntrackedParameter<
std::string>(
"reScope",
"JOB")]),
422 m_treeReaders(
kNIndicies, std::shared_ptr<TreeReaderBase>()),
424 m_openFiles(std::vector<TFile*>()),
425 m_fileMetadatas(std::vector<FileMetadata>()) {
428 if (m_catalog.fileNames(0).empty()) {
446 produces<DQMToken, edm::Transition::BeginRun>(
"DQMGenerationRecoRun");
447 produces<DQMToken, edm::Transition::BeginLuminosityBlock>(
"DQMGenerationRecoLumi");
452 if (
file !=
nullptr &&
file->IsOpen()) {
472 std::list<std::string> exInfo;
474 bool isGoodFile(
true);
476 const std::vector<std::string>& fNames = fileitem.fileNames();
477 for (std::vector<std::string>::const_iterator it = fNames.begin(); it != fNames.end(); ++it) {
480 file = TFile::Open(it->c_str());
484 if (
e != std::exception_ptr()) {
486 std::rethrow_exception(
e);
495 ex <<
"\nInput file " << it->c_str() <<
" was not found, could not be opened, or is corrupted.\n";
497 for (
auto const&
s : exInfo)
504 for (
auto const&
s :
e.additionalInfo())
516 ex <<
"Input file " << it->c_str() <<
" could not be opened.\n";
519 for (
auto const&
s : exInfo)
538 if (strcmp(
file->GetTitle(),
"1") != 0) {
540 ex <<
"Input file " << fNames[0].c_str() <<
" does not appear to be a DQM Root file.\n";
545 assert(indicesTree !=
nullptr);
557 for (Long64_t
index = 0;
index != indicesTree->GetEntries(); ++
index) {
558 indicesTree->GetEntry(
index);
572 unsigned int run = 0;
573 auto toadd = std::vector<FileMetadata>();
577 FileMetadata
dummy{};
581 toadd.push_back(
dummy);
586 if (!toadd.empty()) {
609 return std::make_shared<edm::RunAuxiliary>(runAux);
617 return std::make_shared<edm::LuminosityBlockAuxiliary>(lumiAux);
662 ULong64_t endIndex =
metadata.m_lastIndex + 1;
683 return previousMetadata.m_run !=
metadata.m_run || previousMetadata.m_lumi !=
metadata.m_lumi;
696 if (previousMetadata.m_run !=
metadata.m_run) {
698 }
else if (previousMetadata.m_lumi !=
metadata.m_lumi) {
705 std::unique_ptr<DQMToken> product = std::make_unique<DQMToken>();
710 std::unique_ptr<DQMToken> product = std::make_unique<DQMToken>();
724 if (
run >= lumiToProcess.startRun() &&
run <= lumiToProcess.endRun()) {
725 if (
lumi >= lumiToProcess.startLumi() &&
lumi <= lumiToProcess.endLumi()) {
727 }
else if (
lumi == 0) {