Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Oct 1, 2024
1 parent e22dc4e commit 320b6ad
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
12 changes: 3 additions & 9 deletions utils/material_plots_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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",
Expand All @@ -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)

Expand Down
14 changes: 3 additions & 11 deletions utils/material_scan_2D.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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")
Expand All @@ -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
Expand Down

0 comments on commit 320b6ad

Please sign in to comment.