-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
handle the transformation of cherenkov photons in a single place
- Loading branch information
Showing
11 changed files
with
581 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
def speed_of_light_in_vacuum_m_per_s(): | ||
return 299792458.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import numpy as np | ||
|
||
|
||
def draw_event_ids_for_debug_output( | ||
num_events_in_run, | ||
min_num_events, | ||
fraction_of_events, | ||
prng, | ||
): | ||
assert num_events_in_run >= 1 | ||
assert 0 <= min_num_events <= num_events_in_run | ||
assert 0.0 <= fraction_of_events <= 1.0 | ||
|
||
num_frac = int(np.round(num_events_in_run * fraction_of_events)) | ||
num = max([num_frac, min_num_events]) | ||
|
||
EVENT_IDS_START_AT_ONE = 1 | ||
|
||
if num == 0: | ||
out = [] | ||
else: | ||
out = EVENT_IDS_START_AT_ONE + prng.choice( | ||
num_events_in_run, | ||
replace=False, | ||
size=num, | ||
) | ||
out = sorted(out) | ||
return np.array(out, dtype=np.int64) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.