|
1 | | -class ConditionSearchAlias(object): |
2 | | - def __init__(self, name, expression, comment): |
3 | | - self.name = name |
4 | | - self.expression = expression |
5 | | - self.comment = comment |
6 | | - |
7 | | - |
8 | | -default_aliases = [ |
9 | | - ConditionSearchAlias('is_production', """run_type in ['hd_all.tsg', 'hd_all.tsg_ps', 'hd_all.bcal_fcal_st.tsg'] and |
10 | | - beam_current and beam_current > 2 and |
11 | | - event_count > 500000 and |
12 | | - solenoid_current and solenoid_current > 100 and |
13 | | - collimator_diameter != 'Blocking'""", |
14 | | - "Is production run"), |
15 | | - |
16 | | - ConditionSearchAlias('is_2018production', """daq_run == 'PHYSICS' and |
17 | | - beam_current > 2 and |
18 | | - event_count > 10000000 and |
19 | | - solenoid_current > 100 and |
20 | | - collimator_diameter != 'Blocking'""", |
21 | | - "Is production run"), |
22 | | - |
23 | | - ConditionSearchAlias('is_primex_production', """daq_run == 'PHYSICS_PRIMEX' and |
24 | | - event_count > 1000000 and |
25 | | - collimator_diameter != 'Blocking'""", |
26 | | - "Is PrimEx production run"), |
27 | | - |
28 | | - ConditionSearchAlias('is_dirc_production', """daq_run == 'PHYSICS_DIRC' and |
29 | | - beam_current > 2 and |
30 | | - event_count > 5000000 and |
31 | | - solenoid_current > 100 and |
32 | | - collimator_diameter != 'Blocking'""", |
33 | | - "Is DIRC production run"), |
34 | | - |
35 | | - ConditionSearchAlias('is_src_production', """daq_run == 'PHYSICS_SRC' and |
36 | | - beam_current > 2 and |
37 | | - event_count > 5000000 and |
38 | | - solenoid_current > 100 and |
39 | | - collimator_diameter != 'Blocking'""", |
40 | | - "Is SRC production run"), |
41 | | - |
42 | | - ConditionSearchAlias('is_cpp_production', """daq_run == 'PHYSICS_CPP' and |
43 | | - beam_current > 2 and |
44 | | - event_count > 5000000 and |
45 | | - solenoid_current > 100 and |
46 | | - collimator_diameter != 'Blocking'""", |
47 | | - "Is CPP production run"), |
48 | | - |
49 | | - ConditionSearchAlias('is_production_long', """daq_run == 'PHYSICS_raw' |
50 | | - beam_current > 2 and |
51 | | - event_count > 5000000 and |
52 | | - solenoid_current > 100 and |
53 | | - collimator_diameter != 'Blocking'""", |
54 | | - "Is production run with long mode data"), |
55 | | - |
56 | | - ConditionSearchAlias('is_cosmic', '"cosmic" in run_config and beam_current < 1 and event_count > 5000', |
57 | | - "Is cosmic run"), |
58 | | - |
59 | | - ConditionSearchAlias('is_empty_target', "target_type == 'EMPTY & Ready'", "Target is empty"), |
60 | | - |
61 | | - # These should be true starting in 2017. Need to check to make sure that 2016 data is accurate... |
62 | | - ConditionSearchAlias('is_amorph_radiator', "polarization_angle < 0.", "Amorphous Radiator"), |
63 | | - ConditionSearchAlias('is_coherent_beam', "polarization_angle >= 0.", "Coherent Beam"), |
64 | | - #ConditionSearchAlias('is_amorph_radiator', "radiator_index == -1 and radiator_type != 'None' and target_type == 'FULL & Ready'", |
65 | | - # "Amorphous Radiator"), |
66 | | - #ConditionSearchAlias('is_coherent_beam', "(radiator_id != 5 and radiator_id > 0) and target_type == 'FULL & Ready'", "Coherent Beam"), |
67 | | - |
68 | | - ConditionSearchAlias('is_field_off', "solenoid_current < 100", " Field Off"), |
69 | | - |
70 | | - ConditionSearchAlias('is_field_on', "solenoid_current >= 100", " Field On"), |
71 | | - |
72 | | - ConditionSearchAlias('status_calibration', "status == 3", "Run status = calibration"), |
73 | | - |
74 | | - ConditionSearchAlias('status_approved_long', "status == 2", "Run status = approved (long)"), |
75 | | - |
76 | | - ConditionSearchAlias('status_approved', "status == 1", "Run status = approved"), |
77 | | - |
78 | | - ConditionSearchAlias('status_unchecked', "status == -1", "Run status = unchecked"), |
79 | | - |
80 | | - ConditionSearchAlias('status_reject', " status == 0", "Run status = reject"), |
81 | | -] |
82 | | - |
83 | | -_def_al_by_name = None |
84 | | - |
85 | | - |
86 | | -def get_default_aliases_by_name(): |
87 | | - global _def_al_by_name |
88 | | - if _def_al_by_name is None: |
89 | | - _def_al_by_name = {al.name:al for al in default_aliases } |
90 | | - return _def_al_by_name |
| 1 | +class ConditionSearchAlias(object): |
| 2 | + def __init__(self, name, expression, comment): |
| 3 | + self.name = name |
| 4 | + self.expression = expression |
| 5 | + self.comment = comment |
| 6 | + |
| 7 | + |
| 8 | +default_aliases = [ |
| 9 | + ConditionSearchAlias('is_production', """run_type in ['hd_all.tsg', 'hd_all.tsg_ps', 'hd_all.bcal_fcal_st.tsg'] and |
| 10 | + beam_current and beam_current > 2 and |
| 11 | + event_count > 500000 and |
| 12 | + solenoid_current and solenoid_current > 100 and |
| 13 | + collimator_diameter != 'Blocking'""", |
| 14 | + "Is production run"), |
| 15 | + |
| 16 | + ConditionSearchAlias('is_2018production', """daq_run == 'PHYSICS' and |
| 17 | + beam_current > 2 and |
| 18 | + event_count > 10000000 and |
| 19 | + solenoid_current > 100 and |
| 20 | + collimator_diameter != 'Blocking'""", |
| 21 | + "Is production run"), |
| 22 | + |
| 23 | + ConditionSearchAlias('is_primex_production', """daq_run == 'PHYSICS_PRIMEX' and |
| 24 | + event_count > 1000000 and |
| 25 | + collimator_diameter != 'Blocking'""", |
| 26 | + "Is PrimEx production run"), |
| 27 | + |
| 28 | + ConditionSearchAlias('is_dirc_production', """daq_run == 'PHYSICS_DIRC' and |
| 29 | + beam_current > 2 and |
| 30 | + event_count > 5000000 and |
| 31 | + solenoid_current > 100 and |
| 32 | + collimator_diameter != 'Blocking'""", |
| 33 | + "Is DIRC production run"), |
| 34 | + |
| 35 | + ConditionSearchAlias('is_dirctrd_production', """(daq_run == 'PHYSICS_DIRC' or daq_run == 'PHYSICS_DIRC_TRD') and |
| 36 | + beam_current > 2 and |
| 37 | + event_count > 5000000 and |
| 38 | + solenoid_current > 100 and |
| 39 | + collimator_diameter != 'Blocking'""", |
| 40 | + "Is DIRC/TRD production run"), |
| 41 | + |
| 42 | + ConditionSearchAlias('is_src_production', """daq_run == 'PHYSICS_SRC' and |
| 43 | + beam_current > 2 and |
| 44 | + event_count > 5000000 and |
| 45 | + solenoid_current > 100 and |
| 46 | + collimator_diameter != 'Blocking'""", |
| 47 | + "Is SRC production run"), |
| 48 | + |
| 49 | + ConditionSearchAlias('is_cpp_production', """daq_run == 'PHYSICS_CPP' and |
| 50 | + beam_current > 2 and |
| 51 | + event_count > 5000000 and |
| 52 | + solenoid_current > 100 and |
| 53 | + collimator_diameter != 'Blocking'""", |
| 54 | + "Is CPP production run"), |
| 55 | + |
| 56 | + ConditionSearchAlias('is_production_long', """daq_run == 'PHYSICS_raw' |
| 57 | + beam_current > 2 and |
| 58 | + event_count > 5000000 and |
| 59 | + solenoid_current > 100 and |
| 60 | + collimator_diameter != 'Blocking'""", |
| 61 | + "Is production run with long mode data"), |
| 62 | + |
| 63 | + ConditionSearchAlias('is_cosmic', '"cosmic" in run_config and beam_current < 1 and event_count > 5000', |
| 64 | + "Is cosmic run"), |
| 65 | + |
| 66 | + ConditionSearchAlias('is_empty_target', "target_type == 'EMPTY & Ready'", "Target is empty"), |
| 67 | + |
| 68 | + # These should be true starting in 2017. Need to check to make sure that 2016 data is accurate... |
| 69 | + ConditionSearchAlias('is_amorph_radiator', "polarization_angle < 0.", "Amorphous Radiator"), |
| 70 | + ConditionSearchAlias('is_coherent_beam', "polarization_angle >= 0.", "Coherent Beam"), |
| 71 | + #ConditionSearchAlias('is_amorph_radiator', "radiator_index == -1 and radiator_type != 'None' and target_type == 'FULL & Ready'", |
| 72 | + # "Amorphous Radiator"), |
| 73 | + #ConditionSearchAlias('is_coherent_beam', "(radiator_id != 5 and radiator_id > 0) and target_type == 'FULL & Ready'", "Coherent Beam"), |
| 74 | + |
| 75 | + ConditionSearchAlias('is_field_off', "solenoid_current < 100", " Field Off"), |
| 76 | + |
| 77 | + ConditionSearchAlias('is_field_on', "solenoid_current >= 100", " Field On"), |
| 78 | + |
| 79 | + ConditionSearchAlias('status_calibration', "status == 3", "Run status = calibration"), |
| 80 | + |
| 81 | + ConditionSearchAlias('status_approved_long', "status == 2", "Run status = approved (long)"), |
| 82 | + |
| 83 | + ConditionSearchAlias('status_approved', "status == 1", "Run status = approved"), |
| 84 | + |
| 85 | + ConditionSearchAlias('status_unchecked', "status == -1", "Run status = unchecked"), |
| 86 | + |
| 87 | + ConditionSearchAlias('status_reject', " status == 0", "Run status = reject"), |
| 88 | +] |
| 89 | + |
| 90 | +_def_al_by_name = None |
| 91 | + |
| 92 | + |
| 93 | +def get_default_aliases_by_name(): |
| 94 | + global _def_al_by_name |
| 95 | + if _def_al_by_name is None: |
| 96 | + _def_al_by_name = {al.name:al for al in default_aliases } |
| 97 | + return _def_al_by_name |
0 commit comments