Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ it in future.

### Added

* Add FileSummary to run_fixedTarget.py to save all the options for reference (#1140)
* Add new 2026_04_01_SHiP_MainSpectrometerField_V13.root fieldmap

### Changed
Expand Down
10 changes: 10 additions & 0 deletions macro/run_fixedTarget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: LGPL-3.0-or-later
# SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP Collaboration

import json
import os

import geometry_config
Expand Down Expand Up @@ -500,6 +501,15 @@ def get_work_dir(run_number, tag: str | None = None) -> str:
rc1 = os.system("rm " + outFile)
rc2 = os.system("mv " + tmpFile + " " + outFile)
print("removed out file, moved tmpFile to out file", rc1, rc2)

if rc1 == 0 and rc2 == 0:
print("INFO: Adding file summary")
fsr = vars(args)
with ROOT.TFile.Open(outFile, "UPDATE") as _of:
_of.WriteObject(ROOT.TString(json.dumps(fsr)), "FileSummary")
else:
print("WARNING: tempFile mv or rm not successful. No attempt at FileSummary writing")

fin.SetWritable(False) # bpyass flush error

print(f"Number of events produced with activity after hadron absorber: {nEvents}")
Expand Down
Loading