Skip to content
Snippets Groups Projects
Commit c2c02599 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'fetch-models-from-calib-area' into 'master'

Update calo muon NN and fetch binary files from calibration area

See merge request !37437
parents 8a8f6871 3281e3c2
No related branches found
No related tags found
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!37437Update calo muon NN and fetch binary files from calibration area
Showing
with 27 additions and 17 deletions
......@@ -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 )
......@@ -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"};
};
......
File deleted
......@@ -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;
......
......@@ -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);
......
......@@ -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
......
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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment