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

[BUG] SPINE always returns zero for num_fragments attribute for Particles #57

Open
dkoh0207 opened this issue Feb 20, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@dkoh0207
Copy link
Contributor

dkoh0207 commented Feb 20, 2025

Describe the bug

SPINE always returns zero for num_fragments attribute of TruthParticle and RecoParticle

To Reproduce

import numpy as np
import sys, os

SOFTWARE_DIR = '/sdf/group/neutrino/koh0207/spine/' # Change this path to your software install

import yaml

# Set software directory
sys.path.append(SOFTWARE_DIR)

ANA_DIR = '/sdf/data/neutrino/koh0207/logs/spine/bnb_nu_corsika/default'
cfg = os.path.join(ANA_DIR, 'config.cfg')
# cfg = '/sdf/data/neutrino/koh0207/logs/spine/bnb_nu_corsika/shower_cut/config.cfg'
DATA_PATH = os.path.join(ANA_DIR, 'file_list.txt')
cfg = open(cfg, 'r').read().replace('DATA_PATH', DATA_PATH)

from spine.driver import Driver

cfg = yaml.safe_load(cfg)

# prepare function configures necessary "handlers"
driver = Driver(cfg)

data = driver.process(entry=0)

sum_truth_fragments = 0
for p in data['truth_particles']:
    sum_truth_fragments += p.num_fragments

reco_truth_fragments = 0
for p in data['reco_particles']:
    reco_truth_fragments += p.num_fragments

print(sum_truth_fragments)
Out [10]: 0
print(reco_truth_fragments)
Out [11]: 0

Expected behavior
All particles will have num_fragments = 0, which does not reflect reconstruction as we build particles from fragments.

Screenshots, histograms, event displays
N/A

Code base
Provide the following:

Additional context
It would be nice to have num_fragments filled properly when we don't build Fragment objects.

Possible solution (optional)
N/A

@dkoh0207 dkoh0207 added the bug Something isn't working label Feb 20, 2025
@dkoh0207 dkoh0207 changed the title [BUG] [BUG] SPINE always returns zero for num_fragments attribute for Particles Feb 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant