Skip to content
Snippets Groups Projects
Commit f3c33c5d authored by Zineb Aly's avatar Zineb Aly
Browse files

make black

parent 352fc09e
No related branches found
No related tags found
No related merge requests found
Pipeline #15704 passed
......@@ -781,16 +781,18 @@ def is_CC(fobj):
if all(len_w2lists <= 7): # old nu file have w2list of len 7.
usr = fobj.events.mc_tracks.usr_names
cc_flag = usr[:, 0][:, 3]
out = (cc_flag == b'cc') # not very reliable, found NC files with cc flag!
out = cc_flag == b"cc" # not very reliable, found NC files with cc flag!
else:
if "gseagen" in program.lower():
cc_flag = w2list[:, kw2gsg.W2LIST_GSEAGEN_CC]
out = (cc_flag > 0)
out = cc_flag > 0
if "genhen" in program.lower():
cc_flag = w2list[:, kw2gen.W2LIST_GENHEN_CC]
out = (cc_flag > 0)
out = cc_flag > 0
else:
raise ValueError(f"simulation program {fobj.header.simul.program} is not implemented.")
raise ValueError(
f"simulation program {fobj.header.simul.program} is not implemented."
)
return out
\ No newline at end of file
return out
......@@ -31,7 +31,9 @@ from km3io.tools import (
)
OFFLINE_FILE = OfflineReader(data_path("offline/km3net_offline.root"))
GENHEN_OFFLINE_FILE = OfflineReader(data_path("offline/mcv5.1.genhen_anumuNC.sirene.jte.jchain.aashower.sample.root"))
GENHEN_OFFLINE_FILE = OfflineReader(
data_path("offline/mcv5.1.genhen_anumuNC.sirene.jte.jchain.aashower.sample.root")
)
GSEAGEN_OFFLINE_FILE = OfflineReader(data_path("offline/numucc.root"))
......@@ -528,6 +530,7 @@ class TestUnfoldIndices(unittest.TestCase):
with self.assertRaises(IndexError):
unfold_indices(data, indices)
class TestIsCC(unittest.TestCase):
def test_is_CC(self):
NC_file = is_CC(GENHEN_OFFLINE_FILE)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment