Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
90ebc10
Prepare repo structure for next-100
gonzaponte Apr 6, 2025
643ad97
Move config files
gonzaponte Apr 21, 2025
6f93122
Move reference files
gonzaponte Apr 21, 2025
cb73d6f
Add .gitignore
gonzaponte Apr 21, 2025
ff2c048
Add bootstrap map for next100
gonzaponte Apr 21, 2025
c4728c6
Add reference files for NEXT-100
gonzaponte Apr 21, 2025
4a9e0a7
Remove detector-specific default parameters
gonzaponte Apr 21, 2025
ca8d9b9
Cosmetics
gonzaponte Apr 21, 2025
53537cf
Add util to store 2d histogram
gonzaponte Apr 21, 2025
394f15c
Use only ok fits in energy band selection
gonzaponte Apr 21, 2025
30cce30
Introduce diffusion band selection
gonzaponte Apr 21, 2025
88c2a90
HACK: hardwire cathode position for NEXT-100
gonzaponte Apr 21, 2025
120637b
Add extra parameters to add_krevol
gonzaponte Apr 21, 2025
f7b8988
Add config files
gonzaponte Apr 21, 2025
dde4216
Templatify config files
gonzaponte Apr 22, 2025
8a178cb
Rename config files
gonzaponte Apr 22, 2025
d4c1f99
Restore LinAlgError
gonzaponte Apr 23, 2025
9906347
Manage invalid fits in fit_lifetime_unbined
gonzaponte Apr 23, 2025
bf5154a
Handle bad fits in time evolution
gonzaponte Apr 23, 2025
24ad4b9
Update time slices in configs
gonzaponte Apr 23, 2025
85ba9df
Lower `min_entries` requirement in band selection
gonzaponte May 15, 2025
0311ee9
Adjust config parameters
gonzaponte May 15, 2025
d3e1be2
Make diffusion-band selection optional
gonzaponte Jul 17, 2025
57ce816
Recover parameter that was always took default value
gonzaponte Jul 17, 2025
c789e43
Rewire conf files in tests
gonzaponte Jul 17, 2025
10d0fd6
Remove deprecated config
gonzaponte Jul 17, 2025
3839d99
Update next-white configs
gonzaponte Jul 17, 2025
59cab70
Fix various tests
gonzaponte Jul 17, 2025
ff37c59
Combine tests
gonzaponte Jul 17, 2025
4d6bd30
Update test file
gonzaponte Jul 17, 2025
2f19852
Remove deprecated file
gonzaponte Jul 17, 2025
5b7dc63
Use production branch on GHA
gonzaponte Jul 18, 2025
94640c4
Manage invalid fits in fit_lifetime_unbined
gonzaponte Apr 23, 2025
fe856bd
Update computing_kr_parameters to work with bootstrap map
carhc Jul 18, 2025
f7322b8
Update kr_time_evolution to work with bootstrap map
carhc Jul 18, 2025
d854421
Update add_krevol to work with bootstrap map
carhc Jul 18, 2025
ded1384
Add norm_options to e0_xy_correction function
carhc Jul 18, 2025
1a87bcb
Propagate norm_options
carhc Jul 18, 2025
378ea78
Fix selection_in_band function
carhc Jul 22, 2025
48f942f
Fix select_physical_events function
carhc Jul 22, 2025
b8a2762
Add rough_geometry_map_v2.h5 file
carhc Jul 29, 2025
fc55a97
Update config for monitoring
carhc Jul 24, 2025
feebca2
Update computing_kr_parameters function
carhc Jul 24, 2025
864ed24
Update band_selection_and_check function
carhc Jul 24, 2025
54c7634
Update recompute_npeaks function to avoid pandas value setting error
carhc Jul 24, 2025
1e72e7b
Update map_builder
carhc Jul 24, 2025
df655a5
Update config file
carhc Jul 28, 2025
0186efc
Update computing_kr_parameters function
carhc Jul 28, 2025
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
3 changes: 3 additions & 0 deletions .github/workflows/test_suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ jobs:
run: |
cd ..
git clone https://github.com/next-exp/IC.git
cd IC
git checkout origin/v2
cd ..


- name: Run tests
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
__pycache__
95 changes: 95 additions & 0 deletions conf/next-100/kr_he.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
folder = '{folderin}'
file_in = '{filein}'
file_bootstrap_map = '$ICARO/maps/next-100/rough_geometry_map_v0.h5'
file_out_map = '{fileoutmap}'
file_out_hists = '{fileouthist}'

# High Energy Configuration File:
ref_Z_histogram = dict(
ref_histo_file = '$ICARO/reference_files/next-100/krhe_zhist.h5',
key_Z_histo = 'histo_Z_dst' )

# run number 0 is for MC
run_number = '{runnumber}'


diff_band_lower = lambda dt: -0.7 + 0.030 * (dt-20)
diff_band_upper = lambda dt: 2.6 + 0.036 * (dt-20)

diff_band_eff_min = 0
diff_band_eff_max = 1

diff_histo_params = dict(
n_bins = 100,
range_hist = ((0, 1300), (0, 50)),
norm = False,
)

# event selector control

quality_ranges = dict(
r_max = 480 ) # Max R for initial quality cuts

nS1_eff_min = 0. # Min nS1==1 eff. to continue map production.
nS1_eff_max = 1. # Max nS1==1 eff. to continue map production.

nS2_eff_min = 0. # Min nS2==1 eff. to continue map production.
nS2_eff_max = 1. # Max nS2==1 eff. to continue map production.

nsigmas_Zdst = 1000 # Number of sigmas to consider Z dst correct.

n_dev_rate = 500 # Number of rel. dev. to consider rate dst correct.

band_sel_params = dict(
range_Z = (50, 1300) , # Z range to apply selection.
range_E = (8.0e+3,1.0e+4), # Energy range to apply sel.
nbins_z = 80 , # Number of bins in Z axis.
nbins_e = 80 , # Number of bins in energy axis.
nsigma_sel = 3.5 , # Number of sigmas to apply sel.
eff_min = 0. , # Min eff. to continue map prod.
eff_max = 1. ) # Max eff. to continue map prod.

# get automatic binning
thr_evts_for_sel_map_bins = 1e6 # Threshold to use 50 or 100 bins.
default_n_bins = None # If not specified: n_bins=50 or 100.

### Histograms params
ns1_histo_params = dict(
nbins_hist = 10 ,
range_hist = (0,10),
norm = True )

ns2_histo_params = dict(
nbins_hist = 10 ,
range_hist = (0,10),
norm = True )

rate_histo_params = dict(
bin_size = 180 ,
normed = False)

## Map parameters
map_params = dict(
nbins_z = 15 ,
nbins_e = 25 ,
z_range = (20, 1350) ,
e_range = (2000, 10000) ,
chi2_range = (0,100) ,
lt_range = (5000, 55000) ,
nmin = 20 ,
maxFailed = 1000 ,
r_max = 480 ,
x_range = (-500, 500) ,
y_range = (-500, 500) )

krevol_params = dict(
r_fid = 200,
nStimeprofile = 3600 * 2,
zslices_lt = 50,
zrange_lt = (50, 1300),
nbins_dv = 50,
zrange_dv = (1300, 1450),
x_range = map_params["x_range"],
y_range = map_params["y_range"],
detector = "next100",
)
101 changes: 101 additions & 0 deletions conf/next-100/kr_only.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
folder = '{folderin}'
file_in = '{filein}'
file_bootstrap_map = '$ICARO/maps/next-100/rough_geometry_map_v2.h5'
file_out_map = '{fileoutmap}'
file_out_hists = '{fileouthist}'

# High Energy Configuration File:
ref_Z_histogram = dict(
ref_histo_file = '$ICARO/reference_files/next-100/kronly_zhist.h5',
key_Z_histo = 'histo_Z_dst' )

# run number 0 is for MC
run_number = '{runnumber}'

select_diffusion_band = True
diff_band_lower = lambda dt: -0.7 + 0.030 * (dt-20)
diff_band_upper = lambda dt: 2.6 + 0.036 * (dt-20)

diff_band_eff_min = 0
diff_band_eff_max = 1

diff_histo_params = dict(
n_bins = 100,
range_hist = ((0, 1300), (0, 50)),
norm = False,
)

# event selector control

quality_ranges = dict(
r_max = 480 ) # Max R for initial quality cuts

nS1_eff_min = 0. # Min nS1==1 eff. to continue map production.
nS1_eff_max = 1. # Max nS1==1 eff. to continue map production.

nS2_eff_min = 0. # Min nS2==1 eff. to continue map production.
nS2_eff_max = 1. # Max nS2==1 eff. to continue map production.

nsigmas_Zdst = 1000 # Number of sigmas to consider Z dst correct.

n_dev_rate = 500 # Number of rel. dev. to consider rate dst correct.

band_sel_params = dict(
range_Z = (50, 1300) , # Z range to apply selection.
range_E = (7.5e+3,9.5e+3), # Energy range to apply sel.
nbins_z = 80 , # Number of bins in Z axis.
nbins_e = 80 , # Number of bins in energy axis.
nsigma_sel = 3.5 , # Number of sigmas to apply sel.
eff_min = 0. , # Min eff. to continue map prod.
eff_max = 1. ) # Max eff. to continue map prod.

# get automatic binning
thr_evts_for_sel_map_bins = 1e6 # Threshold to use 50 or 100 bins.
default_n_bins = None # If not specified: n_bins=50 or 100.

### Histograms params
ns1_histo_params = dict(
nbins_hist = 10 ,
range_hist = (0,10),
norm = True )

ns2_histo_params = dict(
nbins_hist = 10 ,
range_hist = (0,10),
norm = True )

rate_histo_params = dict(
bin_size = 180 ,
normed = False)

## Map parameters
map_params = dict(
nbins_z = 15 ,
nbins_e = 25 ,
z_range = (20, 1350) ,
e_range = (2000, 10000) ,
chi2_range = (0,100) ,
lt_range = (5000, 55000) ,
nmin = 50 ,
maxFailed = 2000 ,
dv_maxFailed = 2000 ,
r_max = 480 ,
x_range = (-500, 500) ,
y_range = (-500, 500) )


norm_options = dict(
origin = (-125/2, 3*125/2),
radius = 4*15.55)

krevol_params = dict(
r_fid = 200,
nStimeprofile = 2*3600,
zslices_lt = 50,
zrange_lt = (50, 1300),
nbins_dv = 50,
zrange_dv = (1300, 1450),
detector = "next100",
norm_strategy = region,
**norm_options,
)
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,22 @@ map_params = dict(
nmin = 100 ,
maxFailed = 600 ,
r_max = 200 ,
r_fid = 100 ,
nStimeprofile = 1800 ,
x_range = (-200,200) ,
y_range = (-200,200) )
y_range = (-200,200) ,
dv_maxFailed = 0.5 ,
)

krevol_params = dict(
r_fid = 100,
nStimeprofile = 1800,
zslices_lt = 50,
zrange_lt = (0, 550),
nbins_dv = 35,
zrange_dv = (500, 625), # or 640
x_range = map_params["x_range"],
y_range = map_params["y_range"],
detector = "new",
)


select_diffusion_band = False
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,29 @@ map_params = dict(
nbins_z = 15 ,
nbins_e = 25 ,
z_range = (10, 550) ,
e_range = (2000, 18000) ,
e_range = (1000, 15000) ,
chi2_range = (0,10) ,
lt_range = (1000, 15000) ,
nmin = 100 ,
maxFailed = 600 ,
r_max = 200 ,
r_fid = 100 ,
nStimeprofile = 1800 ,
x_range = (-200,200) ,
y_range = (-200,200) )
y_range = (-200,200) ,
dv_maxFailed = 0.5 ,
)

krevol_params = dict(
r_fid = 100,
nStimeprofile = 1800,
zslices_lt = 50,
zrange_lt = (0, 550),
nbins_dv = 35,
zrange_dv = (500, 625), # or 640
x_range = map_params["x_range"],
y_range = map_params["y_range"],
detector = "new",
)



select_diffusion_band = False
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ file_out_hists = '{fileouthist}'

# Low Background Configuration File:
ref_Z_histogram = dict(
ref_histo_file = '$ICARO/krcal/map_builder/reference_files/z_dst_LB_mean_ref.h5',
ref_histo_file = '$ICARO/reference_files/next-white/z_dst_LB_mean_ref.h5',
key_Z_histo = 'histo_Z_dst' )

# run number 0 is for MC
Expand Down Expand Up @@ -66,8 +66,21 @@ map_params = dict(
nmin = 50 ,
maxFailed = 600 ,
r_max = 200 ,
r_fid = 100 ,
nStimeprofile = 1800 ,
x_range = (-200,200) ,
y_range = (-200,200) ,
dv_maxFailed = 0.5 )
dv_maxFailed = 0.5 ,
)

krevol_params = dict(
r_fid = 100,
nStimeprofile = 1800,
zslices_lt = 50,
zrange_lt = (0, 550),
nbins_dv = 35,
zrange_dv = (500, 625), # or 640
x_range = map_params["x_range"],
y_range = map_params["y_range"],
detector = "new",
)

select_diffusion_band = False
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,26 @@ map_params = dict(
e_range = (2000, 18000) ,
chi2_range = (0,10000) ,
lt_range = (1000, 15000) ,
nmin = 50 ,
nmin = 50 ,
maxFailed = 600 ,
r_max = 200 ,
r_fid = 100 ,
nStimeprofile = 1800 ,
x_range = (-200,200) ,
y_range = (-200,200) )
y_range = (-200,200) ,
dv_maxFailed = 0.5 ,
)

krevol_params = dict(
r_fid = 100,
nStimeprofile = 1800,
zslices_lt = 50,
zrange_lt = (0, 550),
nbins_dv = 35,
zrange_dv = (500, 625), # or 640
x_range = map_params["x_range"],
y_range = map_params["y_range"],
detector = "new",
)



select_diffusion_band = False
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ rate_histo_params = dict(
bin_size = 180 ,
normed = False)

## Map parameters
## Map parameters
map_params = dict(
nbins_z = 15 ,
Expand All @@ -66,7 +67,23 @@ map_params = dict(
nmin = 100 ,
maxFailed = 600 ,
r_max = 200 ,
r_fid = 100 ,
nStimeprofile = 1800 ,
x_range = (-200,200) ,
y_range = (-200,200) )
y_range = (-200,200) ,
dv_maxFailed = 0.5 ,
)

krevol_params = dict(
r_fid = 100,
nStimeprofile = 1800,
zslices_lt = 50,
zrange_lt = (0, 550),
nbins_dv = 35,
zrange_dv = (500, 625), # or 640
x_range = map_params["x_range"],
y_range = map_params["y_range"],
detector = "new",
)



select_diffusion_band = False
7 changes: 4 additions & 3 deletions krcal/core/correction_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
from invisible_cities.reco.corrections import get_normalization_factor


def e0_xy_correction(map : ASectorMap,
norm_strategy: NormStrategy = NormStrategy.max):
def e0_xy_correction(map : ASectorMap,
norm_strategy : NormStrategy,
**norm_options : dict):
"""
Temporal function to perfrom IC geometric corrections only
"""
normalization = get_normalization_factor(map , norm_strategy)
normalization = get_normalization_factor(map , norm_strategy, **norm_options)
get_xy_corr_fun = maps_coefficient_getter (map.mapinfo, map.e0)
def geo_correction_factor(x : np.array,
y : np.array) -> np.array:
Expand Down
Loading
Loading