-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Prepare for run 3 analysis incl. HF jets * Make pylint happier
- Loading branch information
Showing
12 changed files
with
952 additions
and
118 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
############################################################################# | ||
## © Copyright CERN 0238. All rights not expressly granted are reserved. ## | ||
## ## | ||
## This program is free software: you can redistribute it and/or modify it ## | ||
## under the terms of the GNU General Public License as published by the ## | ||
## Free Software Foundation, either version 3 of the License, or (at your ## | ||
## option) any later version. This program is distributed in the hope that ## | ||
## it will be useful, but WITHOUT ANY WARRANTY; without even the implied ## | ||
## warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ## | ||
## See the GNU General Public License for more details. ## | ||
## You should have received a copy of the GNU General Public License ## | ||
## along with this program. if not, see <https://www.gnu.org/licenses/>. ## | ||
############################################################################# | ||
|
||
import os | ||
import munch # pylint: disable=import-error, no-name-in-module | ||
from ROOT import TFile # pylint: disable=import-error, no-name-in-module | ||
|
||
from machine_learning_hep.analysis.analyzer import Analyzer | ||
|
||
class AnalyzerJets(Analyzer): | ||
species = "analyzer" | ||
|
||
def __init__(self, datap, case, typean, period): | ||
super().__init__(datap, case, typean, period) | ||
|
||
self.cfg = munch.munchify(datap) | ||
self.cfg.ana = munch.munchify(datap).analysis[typean] | ||
|
||
# output directories | ||
self.d_resultsallpmc = datap["analysis"][typean]["mc"]["results"][period] \ | ||
if period is not None else datap["analysis"][typean]["mc"]["resultsallp"] | ||
self.d_resultsallpdata = datap["analysis"][typean]["data"]["results"][period] \ | ||
if period is not None else datap["analysis"][typean]["data"]["resultsallp"] | ||
|
||
# input directories (processor output) | ||
self.d_resultsallpmc_proc = self.d_resultsallpmc | ||
self.d_resultsallpdata_proc = self.d_resultsallpdata | ||
|
||
# input files | ||
n_filemass_name = datap["files_names"]["histofilename"] | ||
self.n_filemass = os.path.join(self.d_resultsallpdata_proc, n_filemass_name) | ||
self.n_filemass_mc = os.path.join(self.d_resultsallpmc_proc, n_filemass_name) | ||
self.n_fileeff = datap["files_names"]["efffilename"] | ||
self.n_fileeff = os.path.join(self.d_resultsallpmc_proc, self.n_fileeff) | ||
self.n_fileresp = datap["files_names"]["respfilename"] | ||
self.n_fileresp = os.path.join(self.d_resultsallpmc_proc, self.n_fileresp) | ||
|
||
def qa(self): # pylint: disable=too-many-branches, too-many-locals | ||
self.logger.info("Running D0 jet qa") | ||
|
||
with TFile(self.n_filemass) as rfile: | ||
histonorm = rfile.Get("histonorm") | ||
if not histonorm: | ||
self.logger.critical('histonorm not found') | ||
p_nevents = histonorm.GetBinContent(1) | ||
self.logger.debug(f'Number of selected event: {p_nevents}') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
566 changes: 566 additions & 0 deletions
566
machine_learning_hep/data/data_run3/database_ml_parameters_D0pp_jet.yml
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.