Skip to content

Commit

Permalink
add main
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiaskleiner committed Mar 18, 2024
1 parent c0e28e6 commit 4d013e2
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions utils/query_anasum_runparameters.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import uproot as up
import sys


def get_epoch_effective_area(anasum_file, run):
Expand Down Expand Up @@ -30,3 +31,25 @@ def get_epoch_effective_area(anasum_file, run):
string = string.split(sep=",")
epoch = str(string[1].replace(r" is: ", '').replace(r")", ''))
return epoch, effective_area


def main():
'''
Main function to execute the script.
Usage: python query_anasum_runparameters.py <anasum_file> <run_number>
'''

if len(sys.argv) != 3:
print("Usage: python query_anasum_runparameters.py <anasum_file> <run_number>")
sys.exit(1)

anasum_file = sys.argv[1]
run_number = int(sys.argv[2])

epoch, effective_area = get_epoch_effective_area(anasum_file, run_number)
print("Epoch:", epoch)
print("Effective Area:", effective_area)

if __name__ == "__main__":
main()

0 comments on commit 4d013e2

Please sign in to comment.