diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CMakeLists.txt b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CMakeLists.txt index 84e54bb667e8b91303aac0b8779153a7940685b3..67e7941127e10e2d56782f66e3c202c5a3337dea 100644 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CMakeLists.txt +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CMakeLists.txt @@ -20,5 +20,3 @@ atlas_add_component( CaloTrkMuIdTools # Install files from the package: atlas_install_headers( CaloTrkMuIdTools ) atlas_install_joboptions( share/*.py ) -atlas_install_runtime( share/CaloMuonLikelihood.PDF.A0.root share/CaloMuonLikelihood.PDF.A1.root share/CaloMuonLikelihood.PDF.A2.root share/CaloMuonLikelihood.PDF.B0.root share/CaloMuonLikelihood.PDF.B1.root share/CaloMuonLikelihood.PDF.B2.root share/CaloMuonLikelihood.PDF.C0.root share/CaloMuonLikelihood.PDF.C1.root share/CaloMuonLikelihood.PDF.C2.root share/CaloTag.CutConfig.root ) -atlas_install_runtime( share/CaloMuonScoreModels/*.onnx ) diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h index c09d7e80a719ea45582b838247883cf21dc00c71..113ea4e53220c6dc83fb6041300c2c52bb1e806f 100644 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/CaloTrkMuIdTools/CaloMuonScoreTool.h @@ -97,7 +97,9 @@ private: std::vector<int64_t> m_input_node_dims; - Gaudi::Property<std::string> m_modelFileName{this,"ModelFileName","CaloMuonCNN_0.onnx"}; + // This path needs to point to the ATLAS calibration area (https://atlas-groupdata.web.cern.ch/atlas-groupdata/) + // It needs to be a full path relative to the root of the calibration area, e.g. `CaloTrkMuIdTools/nnBased_201022/CaloMuonCNN_1.onnx` + Gaudi::Property<std::string> m_modelFileName{this, "ModelFileName", "CaloTrkMuIdTools/nnBased_201022/CaloMuonCNN_1.onnx"}; Gaudi::Property<double> m_CaloMuonEtaCut {this, "CaloMuonEtaCut", 1.0, "Eta cut (absolute value) up to which a track particle's muon score will be calculated"}; }; diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A0.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A0.root deleted file mode 100644 index 5d2ea4cc70b30a0728e4ad83808f29ce6cedca99..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A0.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A1.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A1.root deleted file mode 100644 index b1c8996f49d41633e6b7a00d9233ed2b1208c0b9..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A1.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A2.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A2.root deleted file mode 100644 index d159d5e1038ffa09fe7c5595e92edf559dbdc1bc..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.A2.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B0.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B0.root deleted file mode 100644 index 4c3c527fd9bb7b115bee80bce181f61cef9afe9f..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B0.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B1.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B1.root deleted file mode 100644 index 7ace685f3a03e58bf19de814e4f330f1aaa4f4dc..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B1.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B2.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B2.root deleted file mode 100644 index 8aa59f859ae319775e64a00b92397d3c858b875a..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.B2.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C0.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C0.root deleted file mode 100644 index 74f5ea6749196ad4ccb81546ac265714ff44e8e6..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C0.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C1.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C1.root deleted file mode 100644 index bda254c1805234fab1e45db17100a23e416c97e0..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C1.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C2.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C2.root deleted file mode 100644 index 6f42bc4f86241aa57ce4911c4ad8e363149b6fcf..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonLikelihood.PDF.C2.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonScoreModels/CaloMuonCNN_0.onnx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonScoreModels/CaloMuonCNN_0.onnx deleted file mode 100644 index 41c4ea7706a3d03a918527cc119326180876df9f..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloMuonScoreModels/CaloMuonCNN_0.onnx and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloTag.CutConfig.root b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloTag.CutConfig.root deleted file mode 100644 index 98c3facb861839c038c4c8da7c131b76fe232b91..0000000000000000000000000000000000000000 Binary files a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/share/CaloTag.CutConfig.root and /dev/null differ diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonLikelihoodTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonLikelihoodTool.cxx index 9e6f76a1138d5201172ea224780fcacd0006c301..b1057e176e118bca4b2b5706e80fe736c4e98b9d 100644 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonLikelihoodTool.cxx +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonLikelihoodTool.cxx @@ -26,10 +26,17 @@ /////////////////////////////////////////////////////////////////////////////// CaloMuonLikelihoodTool::CaloMuonLikelihoodTool(const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool(type,name,parent), - m_fileNames{"CaloMuonLikelihood.PDF.A0.root", "CaloMuonLikelihood.PDF.A1.root", - "CaloMuonLikelihood.PDF.A2.root", "CaloMuonLikelihood.PDF.B0.root", "CaloMuonLikelihood.PDF.B1.root", - "CaloMuonLikelihood.PDF.B2.root", "CaloMuonLikelihood.PDF.C0.root", "CaloMuonLikelihood.PDF.C1.root", - "CaloMuonLikelihood.PDF.C2.root"} + m_fileNames{ + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.A0.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.A1.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.A2.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.B0.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.B1.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.B2.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.C0.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.C1.root"), + PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloMuonLikelihood.PDF.C2.root") +} { declareInterface<ICaloMuonLikelihoodTool>(this); declareProperty("RootFileNames", m_fileNames); @@ -71,8 +78,8 @@ StatusCode CaloMuonLikelihoodTool::retrieveHistograms() { } // --- Retrieving root files and list of keys --- - std::string rootFilePath = PathResolver::find_file(fileName, "DATAPATH"); - TFile* rootFile = TFile::Open(rootFilePath.c_str(), "READ"); + + TFile* rootFile = TFile::Open(fileName.c_str(), "READ"); if (!rootFile) { ATH_MSG_FATAL("Could not retrieve root file: " << fileName); return StatusCode::FAILURE; diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx index f4953972cabbf262f251794d67021f47ce19f476..e0801065a0bd803dace176fc87becc7d59cff1f8 100644 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonScoreTool.cxx @@ -34,9 +34,13 @@ StatusCode CaloMuonScoreTool::initialize() { ATH_CHECK( m_svc.retrieve() ); ATH_CHECK(m_caloCellAssociationTool.retrieve()); + + std::string model_file_name = PathResolverFindCalibFile( m_modelFileName ); - if (m_modelFileName.empty()) { - ATH_MSG_FATAL("Could not find an ONNX model file!"); + if (m_modelFileName.empty() || model_file_name.empty() ) { + ATH_MSG_FATAL("Could not find the requested ONNX model file: " << m_modelFileName ); + ATH_MSG_FATAL("Please make sure it exists in the ATLAS calibration area (https://atlas-groupdata.web.cern.ch/atlas-groupdata/), and provide a model file name relative to the root of the calibration area."); + return StatusCode::FAILURE; } @@ -46,8 +50,6 @@ StatusCode CaloMuonScoreTool::initialize() { session_options.SetIntraOpNumThreads(1); session_options.SetGraphOptimizationLevel( ORT_ENABLE_BASIC ); - const std::string model_file_name = PathResolverFindDataFile( m_modelFileName ); - m_session = std::make_unique< Ort::Session > (m_svc->env(), model_file_name.c_str(), session_options); ATH_MSG_INFO("Created ONNX runtime session with model " << model_file_name); diff --git a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonTag.cxx b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonTag.cxx index 21e9bf86487d122ba2d26ca3bf7b50043dfa9378..c72c91af25d6ce7f1ea08635a3e66c70f38780b1 100755 --- a/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonTag.cxx +++ b/Reconstruction/MuonIdentification/CaloTrkMuIdTools/src/CaloMuonTag.cxx @@ -41,7 +41,8 @@ StatusCode CaloMuonTag::initialize() } */ // Retrieve histogram - std::string rootFilePath = PathResolver::find_file("CaloTag.CutConfig.root","DATAPATH"); + std::string rootFilePath = PathResolverFindCalibFile( "CaloTrkMuIdTools/cutBased_release21/CaloTag.CutConfig.root"); + TFile* rootFile = TFile::Open(rootFilePath.c_str(), "READ"); ATH_CHECK(getHist(rootFile, m_tagMode.c_str(), m_hist)); rootFile->Close(); delete rootFile; rootFile = nullptr; // don't need the file anymore diff --git a/Tools/PROCTools/data/master_q221_AOD_digest.ref b/Tools/PROCTools/data/master_q221_AOD_digest.ref index 044525f42e58debdd0e1e87d173d2c91bc9d665c..4a2b8a3adedc13a27463371b7171392037f0260f 100644 --- a/Tools/PROCTools/data/master_q221_AOD_digest.ref +++ b/Tools/PROCTools/data/master_q221_AOD_digest.ref @@ -1,10 +1,10 @@ run event nTopo nIdTracks nJets nMuons nElec nTrueElec nFakeElec nPhot nTruePhot nFakePhot 284500 87473001 122 128 4 1 8 2 6 7 4 3 - 284500 87473014 83 80 6 1 10 1 9 7 5 2 + 284500 87473014 83 80 6 0 10 1 9 7 5 2 284500 87473022 38 29 4 0 4 1 3 3 2 1 284500 87473032 30 33 4 1 10 4 6 5 2 3 284500 87473037 62 38 7 0 12 2 10 6 4 2 - 284500 87473040 107 96 10 0 17 1 16 10 5 5 + 284500 87473040 107 96 10 1 17 1 16 10 5 5 284500 87473051 140 112 11 1 16 1 15 23 16 7 284500 87473063 62 76 5 2 7 1 6 6 4 2 284500 87473068 25 34 1 1 0 0 0 0 0 0 @@ -21,6 +21,6 @@ 284500 87473154 86 89 7 0 14 3 11 9 4 5 284500 87473162 53 52 4 0 7 0 7 3 2 1 284500 87473167 77 54 6 3 14 2 12 13 8 5 - 284500 87473171 77 69 8 4 4 2 2 5 4 1 + 284500 87473171 77 69 8 3 4 2 2 5 4 1 284500 87473184 75 86 5 2 8 1 7 5 3 2 284500 87473192 55 52 4 1 7 4 3 5 4 1