Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper function for reading epoch and effarea #211

Merged
merged 8 commits into from
Mar 19, 2024

Conversation

tobiaskleiner
Copy link
Collaborator

Adding a small function to read out epoch and effective area from the anasum.root files using uproot. This avoids using the printAnasumRunParameter in the V2DL3 run script for containerized use with HTCondor.

@GernotMaier
Copy link
Member

Could you change also the integration test (after lines

- name: Eventdisplay-pointlike
) to run without the effective area on the command line.

Does this actually work with the changes you have applied?

e.g.,

python pyV2DL3/script/v2dl3_for_Eventdisplay.py \
               -f ./64080.anasum.root \
                  --logfile test-pointlike.fits.log \
                  test-pointlike-CI.fits.gz|

Meaning only one argument for -f?

Copy link
Member

@GernotMaier GernotMaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See below, this is important to find the anasum file.

Tuple
epoch and effective area
'''
file = up.open(f"./{run}.anasum.root")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this read a local file only? Can we change this so that the full file path (directory + file name) of the anasum file is the function argument?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@GernotMaier
Copy link
Member

What is going wrong?

V2DL3="../../V2DL3/"
ANASUMFILE="/lustre/fs24/group/veritas/shared/processed_data_v490.7//AP/anasum_moderate2tel/6//64554.anasum.root"
RUN=64554

result=$(python -c "from ${V2DL3}/utils/query_anasum_runparameters import get_epoch_effective_area; get_epoch_effective_area(${ANASUMFILE}, ${RUN})")
EPOCH=$(echo $result | cut -d',' -f1)
EFFAREA=$(echo $result | cut -d',' -f2)

gives me

%./dl3_test.sh
  File "<string>", line 1
    from ../../V2DL3//utils/query_anasum_runparameters import get_epoch_effective_area; get_epoch_effective_area(/lustre/fs24/group/veritas/shared/processed_data_v490.7//AP/anasum_moderate2tel/6//64554.anasum.root, 64554)
                                                                                                                                                                                                         ^
SyntaxError: invalid decimal literal

Copy link
Member

@GernotMaier GernotMaier left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good (and we've tested it).

@tobiaskleiner tobiaskleiner merged commit ee2a5fc into main Mar 19, 2024
4 checks passed
@GernotMaier GernotMaier deleted the add-helper-function branch June 16, 2024 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants