1
- use crate :: histoer:: {
2
- // cuts::Cut,
3
- configs:: Configs ,
4
- } ;
1
+ use crate :: histoer:: { configs:: Configs , cuts:: Cut } ;
5
2
use polars:: prelude:: * ;
6
3
use std:: f64:: consts:: PI ;
7
4
@@ -51,7 +48,7 @@ pub fn get_column_names_from_lazyframe(lazyframe: &LazyFrame) -> Vec<String> {
51
48
52
49
#[ rustfmt:: skip]
53
50
#[ allow( clippy:: all) ]
54
- pub fn sps_histograms ( ) -> ( Vec < ( String , String ) > , Vec < Configs > ) {
51
+ pub fn sps_histograms ( ) -> ( Vec < ( String , String ) > , Vec < Configs > , Vec < Cut > ) {
55
52
56
53
let mut new_columns = vec ! [ ] ;
57
54
new_columns. push ( ( "( DelayFrontRightEnergy + DelayFrontLeftEnergy ) / 2.0" . into ( ) , "DelayFrontAverageEnergy" . into ( ) ) ) ;
@@ -78,6 +75,12 @@ pub fn sps_histograms() -> (Vec<(String, String)>, Vec<Configs>) {
78
75
// let only_x1_plane_cut = Some(vec![Cut::new_1d("Only X1 Plane", "X1 != -1e6 && X2 == -1e6")]);
79
76
// let only_x2_plane_cut = Some(vec![Cut::new_1d("Only X2 Plane", "X2 != -1e6 && X1 == -1e6")]);
80
77
78
+ let bothplanes_cut = Cut :: new_1d ( "Both Planes" , "X2 != -1e6 && X1 != -1e6" ) ;
79
+ let only_x1_plane_cut = Cut :: new_1d ( "Only X1 Plane" , "X1 != -1e6 && X2 == -1e6" ) ;
80
+ let only_x2_plane_cut = Cut :: new_1d ( "Only X2 Plane" , "X2 != -1e6 && X1 == -1e6" ) ;
81
+
82
+ let cuts = vec ! [ bothplanes_cut, only_x1_plane_cut, only_x2_plane_cut] ;
83
+
81
84
let mut histograms = vec ! [ ] ;
82
85
83
86
let fp_range = ( -300.0 , 300.0 ) ;
@@ -93,6 +96,18 @@ pub fn sps_histograms() -> (Vec<(String, String)>, Vec<Configs>) {
93
96
histograms. push ( Configs :: new_2d ( "SE-SPS/Focal Plane/X2 v X1" , "X1" , "X2" , fp_range, fp_range, ( fp_bins, fp_bins) , None ) ) ;
94
97
histograms. push ( Configs :: new_2d ( "SE-SPS/Focal Plane/Theta v Xavg" , "Xavg" , "Theta" , fp_range, ( 0.0 , PI ) , ( fp_bins, fp_bins) , None ) ) ;
95
98
99
+ let bothplanes_cut = Some ( vec ! [ Cut :: new_1d( "Both Planes" , "X2 != -1e6 && X1 != -1e6" ) ] ) ;
100
+ let only_x1_plane_cut = Some ( vec ! [ Cut :: new_1d( "Only X1 Plane" , "X1 != -1e6 && X2 == -1e6" ) ] ) ;
101
+ let only_x2_plane_cut = Some ( vec ! [ Cut :: new_1d( "Only X2 Plane" , "X2 != -1e6 && X1 == -1e6" ) ] ) ;
102
+
103
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Xavg" , "Xavg" , fp_range, fp_bins, None ) ) ;
104
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Raw: X1" , "X1" , fp_range, fp_bins, None ) ) ;
105
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Both Planes: X1" , "X1" , fp_range, fp_bins, bothplanes_cut. clone ( ) ) ) ;
106
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Only 1 Plane: X1" , "X1" , fp_range, fp_bins, only_x1_plane_cut. clone ( ) ) ) ;
107
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Raw: X2" , "X2" , fp_range, fp_bins, None ) ) ;
108
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Both Planes: X2" , "X2" , fp_range, fp_bins, bothplanes_cut. clone ( ) ) ) ;
109
+ histograms. push ( Configs :: new_1d ( "SE-SPS/Focal Plane/Checks/Only 1 Plane: X2" , "X2" , fp_range, fp_bins, only_x2_plane_cut. clone ( ) ) ) ;
110
+
96
111
// Particle Identification histograms
97
112
histograms. push ( Configs :: new_2d ( "SE-SPS/Particle Identification/AnodeBack v ScintLeft" , "ScintLeftEnergy" , "AnodeBackEnergy" , range, range, ( bins, bins) , None ) ) ;
98
113
histograms. push ( Configs :: new_2d ( "SE-SPS/Particle Identification/AnodeFront v ScintLeft" , "ScintLeftEnergy" , "AnodeFrontEnergy" , range, range, ( bins, bins) , None ) ) ;
@@ -135,7 +150,7 @@ pub fn sps_histograms() -> (Vec<(String, String)>, Vec<Configs>) {
135
150
136
151
// Delay timing relative to anodes histograms
137
152
138
- ( new_columns, histograms)
153
+ ( new_columns, histograms, cuts )
139
154
}
140
155
/*
141
156
// // // //....oooOO0OOooo........oooOO0OOooo........oooOO0OOooo........oooOO0OOooo....
0 commit comments