Skip to content

Commit

Permalink
Fixed PPS Alignment paths
Browse files Browse the repository at this point in the history
  • Loading branch information
MatiXOfficial committed Aug 1, 2022
1 parent 9b0cb42 commit aa459ce
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CalibPPS/AlignmentGlobal/plugins/PPSAlignmentHarvester.cc
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <iomanip>
#include <cmath>
#include <utility>
#include <algorithm>

#include "TH1D.h"
#include "TH2D.h"
Expand Down Expand Up @@ -386,6 +387,7 @@ std::unique_ptr<TGraphErrors> PPSAlignmentHarvester::buildGraphFromMonitorElemen
std::string parentPath = me->getPathname();
size_t parentPos = parentPath.substr(0, parentPath.size() - 1).find_last_of('/') + 1;
std::string parentName = parentPath.substr(parentPos);
std::replace(parentName.begin(), parentName.end(), '_', '.'); // replace _ with .
size_t d = parentName.find('-');
const double x_min = std::stod(parentName.substr(0, d));
const double x_max = std::stod(parentName.substr(d + 1));
Expand Down Expand Up @@ -581,7 +583,7 @@ void PPSAlignmentHarvester::xAlignment(DQMStore::IBooker& iBooker,
std::make_pair(cfg.sectorConfig56(), cfg_ref.sectorConfig56())}) {
for (const auto& [rpc, rpc_ref] :
{std::make_pair(sc.rp_F_, sc_ref.rp_F_), std::make_pair(sc.rp_N_, sc_ref.rp_N_)}) {
auto mes_test = iGetter.getAllContents(dqmDir_ + "/worker/" + sc.name_ + "/near_far/x slices, " + rpc.position_);
auto mes_test = iGetter.getAllContents(dqmDir_ + "/worker/" + sc.name_ + "/near_far/x slices " + rpc.position_);
if (mes_test.empty()) {
edm::LogWarning("PPSAlignmentHarvester") << "[x_alignment] " << rpc.name_ << ": could not load mes_test";
continue;
Expand Down
8 changes: 4 additions & 4 deletions CalibPPS/AlignmentGlobal/plugins/PPSAlignmentWorker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ void PPSAlignmentWorker::SectorData::init(DQMStore::IBooker& iBooker,

char buf[100];
sprintf(buf, "%.1f-%.1f", x_min, x_max);

iBooker.setCurrentFolder(rootDir + "/" + scfg_.name_ + "/near_far/x slices, N/" + buf);
std::replace(buf, buf + strlen(buf), '.', '_'); // replace . with _
iBooker.setCurrentFolder(rootDir + "/" + scfg_.name_ + "/near_far/x slices N/" + buf);
x_slice_plots_N.insert({i, SlicePlots(iBooker, cfg, debug)});
}

Expand All @@ -284,8 +284,8 @@ void PPSAlignmentWorker::SectorData::init(DQMStore::IBooker& iBooker,

char buf[100];
sprintf(buf, "%.1f-%.1f", x_min, x_max);

iBooker.setCurrentFolder(rootDir + "/" + scfg_.name_ + "/near_far/x slices, F/" + buf);
std::replace(buf, buf + strlen(buf), '.', '_'); // replace . with _
iBooker.setCurrentFolder(rootDir + "/" + scfg_.name_ + "/near_far/x slices F/" + buf);
x_slice_plots_F.insert({i, SlicePlots(iBooker, cfg, debug)});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <map>
#include <memory>
#include <queue>
#include <algorithm>

#include "TF1.h"
#include "TProfile.h"
Expand Down Expand Up @@ -213,7 +214,7 @@ PPSAlignmentConfigurationESSource::PPSAlignmentConfigurationESSource(const edm::
gDirectory = debugFile->mkdir(rpConfigs[p.first]->name_.c_str())->mkdir("fits_ref");

auto* d_ref = (TDirectory*)ad_ref->Get(
(sectorNames[p.first] + "/near_far/x slices, " + rpConfigs[p.first]->position_).c_str());
(sectorNames[p.first] + "/near_far/x slices " + rpConfigs[p.first]->position_).c_str());
if (d_ref == nullptr) {
edm::LogWarning("PPS") << "[ESSource] could not load d_ref";
} else {
Expand Down Expand Up @@ -627,6 +628,7 @@ std::vector<PPSAlignmentConfiguration::PointErrors> PPSAlignmentConfigurationESS

std::string name = k->GetName();
size_t d = name.find('-');
std::replace(name.begin(), name.end(), '_', '.'); // replace _ with .
const double x_min = std::stod(name.substr(0, d));
const double x_max = std::stod(name.substr(d + 1));

Expand Down

0 comments on commit aa459ce

Please sign in to comment.