-
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.
Multiclass: Adjust application and invariant mass fitting (#851)
* Adjust paths in database and analysis type in yml. All steps for warm-up. * Rename output folder after preprocess merge * Rename output folder after test-corr merge * Rename output folder after all-plots merge * Rename output directories after multiclass-config merge * Improve multiclass cuts for mlapplication * Enable apply and invmass steps * Better part in processer * Disable ml training, partially change output folders * Fix inv mass plotting. Application working * Modify hadd paths to be inside home directory * Update hist names in fitting * Enable fitting only * Fix output folders * Remove local adjustments for PR * Update copyright notice * Remove redundant line * Revert "Modify hadd paths to be inside home directory" This reverts commit 39c85de. * Properly use temp dirs with tempfile * Proper solution to pd.query()
- Loading branch information
Showing
8 changed files
with
57 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
############################################################################# | ||
## © Copyright CERN 2018. All rights not expressly granted are reserved. ## | ||
## © Copyright CERN 2023. All rights not expressly granted are reserved. ## | ||
## Author: [email protected] ## | ||
## 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 ## | ||
|
@@ -13,11 +13,12 @@ | |
############################################################################# | ||
|
||
from os.path import join | ||
import tempfile | ||
|
||
from machine_learning_hep.utilities import mergerootfiles, get_timestamp_string | ||
from machine_learning_hep.utilities import mergerootfiles | ||
from machine_learning_hep.logger import get_logger | ||
|
||
def multi_preparenorm(database, case, typean, doperiodbyperiod): | ||
def multi_preparenorm(database, typean, doperiodbyperiod): | ||
|
||
logger = get_logger() | ||
|
||
|
@@ -34,14 +35,14 @@ def multi_preparenorm(database, case, typean, doperiodbyperiod): | |
"correctionsweights.root") | ||
|
||
listempty = [] | ||
tmp_merged = f"/data/tmp/hadd/{case}_{typean}/norm_analyzer/{get_timestamp_string()}/" | ||
useperiod = database["analysis"][typean]["useperiod"] | ||
|
||
for indexp in range(len(resultsdata)): | ||
logger.info("Origin path: %s, target path: %s", lper_normfilesorig[indexp], | ||
lper_normfiles[indexp]) | ||
mergerootfiles([lper_normfilesorig[indexp]], lper_normfiles[indexp], tmp_merged) | ||
if doperiodbyperiod and useperiod[indexp]: | ||
listempty.append(lper_normfiles[indexp]) | ||
with tempfile.TemporaryDirectory() as tmp_merged_dir: | ||
for indexp in range(len(resultsdata)): | ||
logger.info("Origin path: %s, target path: %s", lper_normfilesorig[indexp], | ||
lper_normfiles[indexp]) | ||
mergerootfiles([lper_normfilesorig[indexp]], lper_normfiles[indexp], tmp_merged_dir) | ||
if doperiodbyperiod and useperiod[indexp]: | ||
listempty.append(lper_normfiles[indexp]) | ||
|
||
mergerootfiles(listempty, f_normmerged, tmp_merged) | ||
mergerootfiles(listempty, f_normmerged, tmp_merged_dir) |
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
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
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