diff --git a/Alignment/OfflineValidation/bin/DiMuonVmerge.cc b/Alignment/OfflineValidation/bin/DiMuonVmerge.cc index a12042f1cc759..7f9d4575f1363 100644 --- a/Alignment/OfflineValidation/bin/DiMuonVmerge.cc +++ b/Alignment/OfflineValidation/bin/DiMuonVmerge.cc @@ -46,10 +46,14 @@ int merge(int argc, char* argv[]) { // std::cout << " Attribute: " << attr.first << " = " << attr.second.data() << std::endl; // } - std::cout << childTree.second.get("file") << std::endl; + std::string file = childTree.second.get("file"); + std::cout << file << std::endl; std::cout << childTree.second.get("title") << std::endl; - std::string toAdd = childTree.second.get("file") + - "/DiMuonVertexValidation.root=" + childTree.second.get("title") + ","; + + // Check if the file contains "/eos/cms/" and add the prefix accordingly + std::string prefixToAdd = file.find("/eos/cms/") != std::string::npos ? "root://eoscms.cern.ch/" : ""; + std::string toAdd = + prefixToAdd + file + "/DiMuonVertexValidation.root=" + childTree.second.get("title") + ","; filesAndLabels += toAdd; } diff --git a/Alignment/OfflineValidation/macros/loopAndPlot.C b/Alignment/OfflineValidation/macros/loopAndPlot.C index 093582435b54d..c4cdd2b0e40f4 100644 --- a/Alignment/OfflineValidation/macros/loopAndPlot.C +++ b/Alignment/OfflineValidation/macros/loopAndPlot.C @@ -68,7 +68,15 @@ void recurseOverKeys(TDirectory *target1, const std::vector &labels, bo /************************************************/ { // Figure out where we are - TString path((char *)strstr(target1->GetPath(), ":")); + TString fullPath = target1->GetPath(); + + // Check if the prefix "root://eoscms.cern.ch/" is present and remove it + TString prefixToRemove = "root://eoscms.cern.ch/"; + if (fullPath.BeginsWith(prefixToRemove)) { + fullPath.Remove(0, prefixToRemove.Length()); + } + + TString path((char *)strstr(fullPath.Data(), ":")); path.Remove(0, 2); sourceFiles[0]->cd(path);