diff --git a/DataQuality/DataQualityConfigurations/config/common/collisions_run.config b/DataQuality/DataQualityConfigurations/config/common/collisions_run.config index 3817b24c5539e2cb7d2fcbfaf83efb4fffb93029..8962839131d34b139a763a28226ae040e4009214 100644 --- a/DataQuality/DataQualityConfigurations/config/common/collisions_run.config +++ b/DataQuality/DataQualityConfigurations/config/common/collisions_run.config @@ -7,28 +7,32 @@ ####################### reference CentrallyManagedReferences { - file = root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/data17_13TeV.00337491.express_express.merge.HIST.f873_h263.root + location = /eos/atlas/atlascerngroupdisk/data-dqm/references/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/ + file = data17_13TeV.00337491.express_express.merge.HIST.f873_h263.root path = run_337491 info = Run 337491, express name = same_name } reference CentrallyManagedReferences_Main { - file = root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/data17_13TeV.00337491.physics_Main.merge.HIST.f873_h264.root + location = /eos/atlas/atlascerngroupdisk/data-dqm/references/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/ + file = data17_13TeV.00337491.physics_Main.merge.HIST.f873_h264.root path = run_337491 info = Run 337491, physics_Main name = same_name } reference CentrallyManagedReferences_Trigger { - file = root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/data17_13TeV.00337491.express_express.merge.HIST.f873_h263.root + location = /eos/atlas/atlascerngroupdisk/data-dqm/references/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/ + file = data17_13TeV.00337491.express_express.merge.HIST.f873_h263.root path = run_337491 info = Run 337491, express name = same_name } reference CentrallyManagedReferences_TriggerMain { - file = root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/data17_13TeV.00337491.physics_Main.merge.HIST.f873_h264.root + location = /eos/atlas/atlascerngroupdisk/data-dqm/references/,root://eosatlas.cern.ch//eos/atlas/atlascerngroupdisk/data-dqm/references/ + file = data17_13TeV.00337491.physics_Main.merge.HIST.f873_h264.root path = run_337491 info = Run 337491, physics_Main name = same_name diff --git a/DataQuality/DataQualityInterfaces/DataQualityInterfaces/HanConfig.h b/DataQuality/DataQualityInterfaces/DataQualityInterfaces/HanConfig.h index c73cfee2fdd286b98d19f564227285de3e4a7c00..4a6837e865cc9838ed4dbc21744906ce7bcac75e 100644 --- a/DataQuality/DataQualityInterfaces/DataQualityInterfaces/HanConfig.h +++ b/DataQuality/DataQualityInterfaces/DataQualityInterfaces/HanConfig.h @@ -56,6 +56,7 @@ public: std::map<std::string,TSeqCollection*>* outputMap, TSeqCollection *outputList ); virtual TObject* GetReference( std::string& groupName, std::string& name ); + //static std::string SplitReference( std::string ); virtual const HanConfigAssessor* GetAssessor( std::string& groupName, std::string& name ) const; virtual void GetRegexList( std::set<std::string>& regexlist ); diff --git a/DataQuality/DataQualityInterfaces/src/HanConfig.cxx b/DataQuality/DataQualityInterfaces/src/HanConfig.cxx index 841c5444036baad22c6b6a7109c8fcd8416b7953..b3aef560e0e0e23df8bf98862cac25c2150d7950 100644 --- a/DataQuality/DataQualityInterfaces/src/HanConfig.cxx +++ b/DataQuality/DataQualityInterfaces/src/HanConfig.cxx @@ -24,6 +24,7 @@ #include <TKey.h> #include <TBox.h> #include <TLine.h> +#include <TROOT.h> #include "dqm_core/LibraryManager.h" #include "dqm_core/Parameter.h" @@ -256,6 +257,42 @@ GetReference( std::string& groupName, std::string& name ) return 0; } +std::string +SplitReference(std::string refPath, std::string refName ) +{ + //Split comma sepated inputs into individual file names + std::string delimiter = ","; + std::vector<std::string> refFileList; + size_t pos = 0; + std::string token; + while ((pos = refPath.find(delimiter)) != std::string::npos) { + token = refPath.substr(0, pos); + refFileList.push_back(token); + refPath.erase(0, pos + delimiter.length()); + } + refFileList.push_back(refPath); + + //Try to open each file in the list + for(int i=0; i<refFileList.size(); i++){ + std::string fileName=refFileList.at(i)+refName; + size_t first = fileName.find_first_not_of(" "); + fileName.erase(0, first); + if (gROOT->GetListOfFiles()->FindObject(fileName.c_str()) ) { + return fileName; + } + else { + if(TFile::Open(fileName.c_str())){ + return fileName; + } + else{ + std::cerr << "Unable to open " << fileName << ", trying next reference file" << std::endl; + } + } + } + std::cerr << "Unable to open any reference file, reference will not be included" << std::endl; + return ""; +} + const HanConfigAssessor* HanConfig:: GetAssessor( std::string& groupName, std::string& name ) const @@ -302,6 +339,9 @@ Visit( const MiniConfigTreeNode* node ) const TObject* obj; std::string name = node->GetAttribute("name"); std::string fileName = node->GetAttribute("file"); + if(node->GetAttribute("location")!=""){ + fileName = SplitReference(node->GetAttribute("location"), fileName); + } std::string refInfo = node->GetAttribute("info"); if( fileName != "" && name != "" && name != "same_name" ) { std::auto_ptr<TFile> infile( TFile::Open(fileName.c_str()) ); @@ -468,6 +508,9 @@ GetAlgorithmConfiguration( HanConfigAssessor* dqpar, const std::string& algID, algRefName = assessorName; absAlgRefName += algRefName; std::string algRefFile( refConfig.GetStringAttribute(thisRefID,"file") ); + if(refConfig.GetStringAttribute(thisRefID,"location")!=""){ + algRefFile = SplitReference( refConfig.GetStringAttribute(thisRefID,"location"), algRefFile); + } if( algRefFile != "" ) { std::shared_ptr<TFile> infile = GetROOTFile(algRefFile); if ( ! infile.get() ) {