gondola_core/
constants.rs

1//! The following file is part of gaps-online-software and published 
2//! under the GPLv3 license
3//! Global constants for TOF operations
4//!
5//! ISSUES:
6//! * there might be constants defined elsewhere,
7//!   also we are defining constants in .toml files
8//!   now. There is an active issue #18
9//!
10
11/// A generic pattern for online files, matching most types 
12pub static GENERIC_ONLINE_FILE_PATTERH : &str = r"Run\d+_\d+\.(\d{6})_(\d{6})UTC(\.tofsum|\.tof)?\.gaps$";
13pub static GENERIC_ONLINE_FILE_PATTERH_CAPTURE : &str = r"Run(?P<run>\d+)_(?P<subrun>\d+)\.(?P<utctime>\d{6}_\d{6})UTC(\.tofsum|\.tof)?\.gaps$";
14pub static GENERIC_TELEMETRY_FILE_PATTERN_CAPUTRE : &str = r"RAW(?P<utctime>\d{6}_\d{6}).bin$";
15
16/// The TimeStamp format for Human readable timestamps
17pub static HUMAN_TIMESTAMP_FORMAT : &str = "%y%m%d_%H%M%S%Z"; 
18
19/// Speed of light in the scintillator paddles
20/// (divine number from the TOF team)
21/// This value is in cm/ns
22pub const C_LIGHT_PADDLE : f32 = 15.4; 
23
24/// Speed of light in the harting cables
25/// (divine number from the TOF team)
26/// This value is in cm/ns
27pub const C_LIGHT_CABLE : f32 = 24.6;
28
29/// Number of AVAILABLE slots for LocalTriggerBoards
30pub const N_LTBS : usize = 25;
31
32/// Number of AVAILABLE channels per each LocalTriggerBoard
33pub const N_CHN_PER_LTB : usize = 16;
34
35/// Number of Channels on the readoutboards
36pub const NCHN          : usize = 9;  
37
38/// Number of entries for each waveform (voltage and timing each)
39pub const NWORDS        : usize = 1024;
40
41/// Masks for 32 bits commands (byte packets)
42///
43pub const MASK_CMD_8BIT  : u32 = 0x000000FF;
44pub const MASK_CMD_16BIT : u32 = 0x0000FFFF;
45pub const MASK_CMD_24BIT : u32 = 0x00FFFFFF;
46pub const MASK_CMD_32BIT : u32 = 0xFFFFFFFF;
47/// Padding for 32 bits commands (byte packets)
48///
49pub const PAD_CMD_32BIT  : u32 = 0x00000000;
50
51/// Si(Li) wafer detector radius, with guardring and all
52pub const SILI_RADIUS : f32 = 5.0;
53
54// These are just for fun 
55
56/// Make a nice ASCII logo for the liftof of flight code
57pub const LIFTOF_LOGO_SHOW  : &str  = "
58                                  ___                         ___           ___     
59                                 /\\__\\                       /\\  \\         /\\__\\    
60                    ___         /:/ _/_         ___         /::\\  \\       /:/ _/_   
61                   /\\__\\       /:/ /\\__\\       /\\__\\       /:/\\:\\  \\     /:/ /\\__\\  
62    ___     ___   /:/__/      /:/ /:/  /      /:/  /      /:/  \\:\\  \\   /:/ /:/  /  
63   /\\  \\   /\\__\\ /::\\  \\     /:/_/:/  /      /:/__/      /:/__/ \\:\\__\\ /:/_/:/  /   
64   \\:\\  \\ /:/  / \\/\\:\\  \\__  \\:\\/:/  /      /::\\  \\      \\:\\  \\ /:/  / \\:\\/:/  /    
65    \\:\\  /:/  /   ~~\\:\\/\\__\\  \\::/__/      /:/\\:\\  \\      \\:\\  /:/  /   \\::/__/     
66     \\:\\/:/  /       \\::/  /   \\:\\  \\      \\/__\\:\\  \\      \\:\\/:/  /     \\:\\  \\     
67      \\::/  /        /:/  /     \\:\\__\\          \\:\\__\\      \\::/  /       \\:\\__\\    
68       \\/__/         \\/__/       \\/__/           \\/__/       \\/__/         \\/__/    
69
70          (LIFTOF - liftof is for tof, Version 0.11.x 'PAKII', Aug 2025)
71          >> with undying support from the Hawaiian islands \u{1f30a}\u{1f308}\u{1f965}\u{1f334}
72
73          * Documentation
74          ==> GitHub   https://github.com/GAPS-Collab/gaps-online-software/tree/LELEWAA-0.11
75          ==> API docs https://gaps-collab.github.io/gaps-online-software/
76
77  ";
78
79
80
81