APIο
Hitsο
- class liquidreco.hit.Hit(x=None, y=None, z=None, time=None, weight=None)ο
Very generic detector hit, probably shouldnβt use directly, should instead use one of the derived classes
- timeο
time of the hit
- weightο
the βweightβ of this hit. Typically the charge/light collected
- xο
x position of the hit
- yο
y position of the hit
- zο
z position of the hit
- class liquidreco.hit.Hit2D(x=None, y=None, z=None, fiber_x=None, fiber_y=None, fiber_z=None, time=None, weight=None, secondary_hits=None)ο
Describes a 2D WLS fiber hit
- static get_mean_pos(hits: List[Hit2D], direction: str) floatο
Get the mean position of a list of 2D hits in a particular dimension
- Parameters:
hits (List[Hit2D]) β The hits to take the average of
direction (str) β the dimension to take the average in. e.g. βxβ to get the mean x position βyβ for mean yβ¦
- Returns:
the weighted mean position
- Return type:
float
- is_peak(direction: str) boolο
Checks if this hit is considered a peak in a particular direction i.e. more position info than just the fiber position
- Parameters:
direction (str) β The direction to test
- Returns:
True if this hit has peak info in the specified direction.
- Return type:
bool
- class liquidreco.hit.Hit3D(x=None, y=None, z=None, voxel_x=None, voxel_y=None, voxel_z=None, time=None, weight=None, x_fiber_hit=None, y_fiber_hit=None, z_fiber_hit=None)ο
Describes a 3D hit constructed from two or three WLS fibers
- static from_fiber_hits(x_fiber_hit: Hit2D | None = None, y_fiber_hit: Hit2D | None = None, z_fiber_hit: Hit2D | None = None, n_required_peaks: int | None = None) Hit3Dο
Create a Hit3D from some 2D fiber hits
- Parameters:
x_fiber_hit (Hit2D) β The x fiber
y_fiber_hit (Hit2D) β The y fiber
z_fiber_hit (Hit2D, optional) β The (optional) z fiber, defaults to None
n_required_peaks (int) β require this number of peak hits to be present in each direction to successfuly create a hit. e.g. if n_required_peaks = 1 and 0 of the provided fibers are classified as z peaks, the hit will not be valid. defaults to None
- Returns:
The constructed 3D hit, None if the n_required_peaks condition is not satisfied in any direction
- Return type:
- liquidreco.hit.build_3d_hits(x_fiber_hits: List[Hit2D], y_fiber_hits: List[Hit2D], z_fiber_hits: List[Hit2D], require_3_fibers: bool = True, pitch: Tuple[float] = (10.0, 10.0, 10.0), min_2d_hit_weight: float = 0.0, n_required_peaks: int | None = None, max_weighted_distance: float | None = None) List[Hit]ο
Makes 3D hits from arrays of info about 2d fiber hits
- Parameters:
x_fiber_hits (List[Hit2D]) β List of 2D YZ fibers
y_fiber_hits (List[Hit2D]) β List of 2D XZ fibers
z_fiber_hits (List[Hit2D]) β List of 2D XY fibers
require_3_fibers (bool, optional) β Whether to require 3 fibers to form a hit or allow only on x and one y fiber, defaults to True
pitch (Tuple[float], optional) β The distance between fibers in each direction, defaults to (10.0, 10.0, 10.0)
min_2d_hit_weight (float, optional) β The minimum weight a 2D fiber hit must have to be considered when building 3D hits, defaults to 0.0
n_required_peaks (int, optional) β The number of βpeak hitsβ required in each direction to form a valid 3D hit (see
Hit3D.from_fiber_hits()for more details), defaults to Nonemax_weighed_distance β The maximum βrealβ i.e. peak weighted discance between 2D hits in order for them to be considered for combining into a 3D hit. Specified as a fraction of fiber pitch, defaults to None
- Returns:
list of 3d hits
- Return type:
List[Hit]
- liquidreco.hit.local_normalisation(event_hits, window_size, x_bins, y_bins, z_bins)ο
do a local normalisation of the hits so that lokal peaks have βchargeβ of 1 and hits in the neighbourhood have their charges normalised by this value
Peak_findingο
- class liquidreco.peak_finding.LaplaceFitter(neighbourhood_dist: float = 45.0, peak_candidate_threshold: float = 100.0, amplitude_threshold: float = 50.0, fix_width: float | None = None, min_n_neighbours: int = 0, make_plots=False)ο
Performs a fit of an ensemble of laplace distributions to observed collected charges in fibers in order to try to determine which
- class liquidreco.peak_finding.PeakFinder2D(peak_prominance_threshold: float = 1.0, fit_blobs: bool = False, make_plots: bool = False, DBSCAN_args={'eps': 10.5}, laplace_fit_args={})ο
Finds peaks in raw fiber hits and performs position corrections
- cluster_hits(fiber_hits: List[Hit2D], u: str, v: str) List[List[Hit2D]]ο
Cluster hits using this PeakFinder2Ds _clusterer (default is DBSCAN but you can set it to whatever you want)
- Parameters:
fiber_hits (List['Hit2D']) β The hits to cluster
u (str) β the βuβ direction, should be βxβ, βyβ or βzβ depending on the projection
v (str) β the βvβ direction, should be βxβ, βyβ or βzβ depending on the projection
- Returns:
hits broken down into clusters
- Return type:
List[List[βHit2Dβ]]
- finalise()ο
Tidy up and close open pdfs
Reconstructionο
Module to be used to reconstruct tracks from hits.
- class liquidreco.reconstruction.HesseRidgeDetection(events: list[Event], x_bounds: Tuple[float], y_bounds: Tuple[float], z_bounds: Tuple[float], plot_orthogonal_dirs=False)ο
Performs simple Hough line transform
- class liquidreco.reconstruction.HoughTransform(events: list[Event], min_charge_thresh=80.0, max_plot_charge=100.0, make_gifs=False)ο
Performs simple Hough line transform
- class liquidreco.reconstruction.LocalMeanDBSCAN(events: list[Event], mean_ball_radius=25.0, mean_iterations=1, dbscan_eps=9.0, dbscan_min_samples=25, min_charge_thresh=0.0)ο
- class liquidreco.reconstruction.ReconstructionAlgorithm(events: list[Event])ο
Base reconstruction algorithm.
Should not be used directly but reconstruction algorithms should derive this.
Event Processorο
Plottingο
Appsο
liquidrecoο
LiquidReco main app.
Takes a root file that contains 2D fiber hits, creates an EventProcessor based on the provided arguments, and processes the fiber hits using this.
- raises ValueError:
if input args are not valid