From 320b6ad026778dddb74d7c4379c4db3cb0aaff95 Mon Sep 17 00:00:00 2001 From: tmadlener Date: Tue, 1 Oct 2024 13:20:47 +0200 Subject: [PATCH] Fix formatting --- utils/material_plots_2D.py | 12 +++--------- utils/material_scan_2D.py | 14 +++----------- 2 files changed, 6 insertions(+), 20 deletions(-) diff --git a/utils/material_plots_2D.py b/utils/material_plots_2D.py index 36c5104b3..13ffa46ca 100644 --- a/utils/material_plots_2D.py +++ b/utils/material_plots_2D.py @@ -18,9 +18,7 @@ import ROOT -def create_histogram( - name_and_title: str, argument_name_space: argparse.Namespace -) -> ROOT.TH2F: +def create_histogram(name_and_title: str, argument_name_space: argparse.Namespace) -> ROOT.TH2F: return ROOT.TH2F( name_and_title, name_and_title, @@ -61,9 +59,7 @@ def main(): type=float, help="Eta/theta/cosTheta bin width", ) - parser.add_argument( - "--nPhiBins", default=100, type=int, help="Number of bins in phi" - ) + parser.add_argument("--nPhiBins", default=100, type=int, help="Number of bins in phi") parser.add_argument("--x0max", "-x", default=0.0, type=float, help="Max of x0") parser.add_argument( "--outputDir", @@ -84,9 +80,7 @@ def main(): args = parser.parse_args() output_dir = Path("data") / args.outputDir - output_dir.mkdir( - parents=True, exist_ok=True - ) # Create the directory if it doesn't exist + output_dir.mkdir(parents=True, exist_ok=True) # Create the directory if it doesn't exist ROOT.gStyle.SetNumberContours(100) diff --git a/utils/material_scan_2D.py b/utils/material_scan_2D.py index 86f4625cf..c59a9b757 100644 --- a/utils/material_scan_2D.py +++ b/utils/material_scan_2D.py @@ -23,11 +23,7 @@ help="Compact detector file to use", type=str, default=fspath( - Path(environ["k4geo_DIR"]) - / "ILD" - / "compact" - / "ILD_sl5_v02" - / "ILD_l5_v02.xml" + Path(environ["k4geo_DIR"]) / "ILD" / "compact" / "ILD_sl5_v02" / "ILD_l5_v02.xml" ), ) parser.add_argument( @@ -53,9 +49,7 @@ compact_file = reco_args.compactFile angle_def = reco_args.angleDef output_dir = "data" / Path(reco_args.outputDir) -output_dir.mkdir( - parents=True, exist_ok=True -) # Create the directory if it doesn't exist +output_dir.mkdir(parents=True, exist_ok=True) # Create the directory if it doesn't exist ## parse the given xml file geoservice = GeoSvc("GeoSvc") @@ -71,9 +65,7 @@ # For instance adding envelopeName="BoundaryPostCalorimetry" will perform the scan only till the end of calorimetry. # BoundaryPostCalorimetry is defined in Detector/DetFCChhECalInclined/compact/envelopePreCalo.xml materialservice = MaterialScan_2D_genericAngle("GeoDump") -materialservice.filename = fspath( - output_dir / Path(reco_args.outputFileBase).with_suffix(".root") -) +materialservice.filename = fspath(output_dir / Path(reco_args.outputFileBase).with_suffix(".root")) materialservice.angleDef = angle_def # eta, theta, cosTheta or thetaRad materialservice.angleBinning = 0.05