Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:31:55

0001 /*
0002  *  Creates all the data tables referencing mon_run_iov
0003  *  Requires:  create_mon_core.sql
0004  */
0005 
0006 
0007 
0008 CREATE TABLE mon_run_outcome_def (
0009   def_id                NUMBER(10),
0010   short_desc            VARCHAR2(100),
0011   long_desc             VARCHAR2(1000)
0012 );
0013 
0014 ALTER TABLE mon_run_outcome_def ADD CONSTRAINT mon_run_outcome_def_pk PRIMARY KEY (def_id);
0015 ALTER TABLE mon_run_outcome_def ADD CONSTRAINT mon_run_outcome_def_uk UNIQUE (short_desc);
0016 
0017 CREATE SEQUENCE mon_run_outcome_def_sq INCREMENT BY 1 START WITH 1;
0018 
0019 CREATE TABLE mon_run_dat (
0020   iov_id                NUMBER(10),
0021   logic_id              NUMBER(10), -- ECAL
0022   num_events            NUMBER(10),
0023   run_outcome_id        NUMBER(10),
0024   rootfile_name         VARCHAR2(100),
0025   task_list             NUMBER(10),
0026   task_outcome          NUMBER(10)
0027 );
0028 
0029 ALTER TABLE mon_run_dat ADD CONSTRAINT mon_run_dat_pk PRIMARY KEY (iov_id, logic_id);
0030 ALTER TABLE mon_run_dat ADD CONSTRAINT mon_run_dat_fk1 FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0031 ALTER TABLE mon_run_dat ADD CONSTRAINT mon_run_dat_fk2 FOREIGN KEY (run_outcome_id) REFERENCES mon_run_outcome_def (def_id);
0032 
0033 
0034 
0035 CREATE TABLE mon_crystal_status_def (
0036   def_id                NUMBER(10),
0037   short_desc            VARCHAR2(100),
0038   long_desc             VARCHAR2(1000)
0039 );
0040 
0041 ALTER TABLE mon_crystal_status_def ADD CONSTRAINT mon_crystal_status_def_pk PRIMARY KEY (def_id);
0042 ALTER TABLE mon_crystal_status_def ADD CONSTRAINT mon_crystal_status_def_uk UNIQUE (short_desc);
0043 
0044 CREATE SEQUENCE mon_crystal_status_def_sq INCREMENT BY 1 START WITH 1;
0045 
0046 CREATE TABLE mon_crystal_status_dat (
0047   iov_id                NUMBER(10),
0048   logic_id              NUMBER(10), -- crystal
0049   status_g1             NUMBER(10),
0050   status_g6             NUMBER(10),
0051   status_g12            NUMBER(10)
0052 );
0053 
0054 ALTER TABLE mon_crystal_status_dat ADD CONSTRAINT mon_crystal_status_dat_pk PRIMARY KEY (iov_id, logic_id);
0055 ALTER TABLE mon_crystal_status_dat ADD CONSTRAINT mon_crystal_status_dat_fk1 FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0056 ALTER TABLE mon_crystal_status_dat ADD CONSTRAINT mon_crystal_status_dat_fk2 FOREIGN KEY (status_g1) REFERENCES mon_crystal_status_def (def_id);
0057 ALTER TABLE mon_crystal_status_dat ADD CONSTRAINT mon_crystal_status_dat_fk3 FOREIGN KEY (status_g6) REFERENCES mon_crystal_status_def (def_id);
0058 ALTER TABLE mon_crystal_status_dat ADD CONSTRAINT mon_crystal_status_dat_fk4 FOREIGN KEY (status_g12) REFERENCES mon_crystal_status_def (def_id);
0059 
0060 
0061 
0062 CREATE TABLE mon_pn_status_def (
0063   def_id                NUMBER(10),
0064   short_desc            VARCHAR2(100),
0065   long_desc             VARCHAR2(1000)
0066 );
0067 
0068 ALTER TABLE mon_pn_status_def ADD CONSTRAINT mon_pn_status_def_pk PRIMARY KEY (def_id);
0069 ALTER TABLE mon_pn_status_def ADD CONSTRAINT mon_pn_status_def_uk UNIQUE (short_desc);
0070 
0071 CREATE SEQUENCE mon_pn_status_def_sq INCREMENT BY 1 START WITH 1;
0072 
0073 CREATE TABLE mon_pn_status_dat (
0074   iov_id                NUMBER(10),
0075   logic_id              NUMBER(10), -- PN diode
0076   status_g1             NUMBER(10),
0077   status_g16            NUMBER(10)
0078 );
0079 
0080 ALTER TABLE mon_pn_status_dat ADD CONSTRAINT mon_pn_status_dat_pk PRIMARY KEY (iov_id, logic_id);
0081 ALTER TABLE mon_pn_status_dat ADD CONSTRAINT mon_pn_status_dat_fk1 FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0082 ALTER TABLE mon_pn_status_dat ADD CONSTRAINT mon_pn_status_dat_fk2 FOREIGN KEY (status_g1) REFERENCES mon_pn_status_def (def_id);
0083 ALTER TABLE mon_pn_status_dat ADD CONSTRAINT mon_pn_status_dat_fk3 FOREIGN KEY (status_g16) REFERENCES mon_pn_status_def (def_id);
0084 
0085 
0086 
0087 CREATE TABLE mon_crystal_consistency_dat (
0088   iov_id                NUMBER(10),
0089   logic_id              NUMBER(10), -- cystal
0090   processed_events      NUMBER(10),
0091   problematic_events    NUMBER(10),
0092   problems_id           NUMBER(10),
0093   problems_gain_zero    NUMBER(10),
0094   problems_gain_switch  NUMBER(10),
0095   task_status           CHAR(1)
0096 );
0097 
0098 ALTER TABLE mon_crystal_consistency_dat ADD CONSTRAINT mon_crystal_consistency_dat_pk PRIMARY KEY (iov_id, logic_id);
0099 ALTER TABLE mon_crystal_consistency_dat ADD CONSTRAINT mon_crystal_consistency_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0100 
0101 
0102 
0103 CREATE TABLE mon_tt_consistency_dat (
0104   iov_id                NUMBER(10),
0105   logic_id              NUMBER(10), -- TT
0106   processed_events      NUMBER(10),
0107   problematic_events    NUMBER(10),
0108   problems_id           NUMBER(10),
0109   problems_size         NUMBER(10),
0110   problems_LV1          NUMBER(10),
0111   problems_bunch_X      NUMBER(10),
0112   task_status           CHAR(1)
0113 );
0114 
0115 ALTER TABLE mon_tt_consistency_dat ADD CONSTRAINT mon_tt_consistency_dat_pk PRIMARY KEY (iov_id, logic_id);
0116 ALTER TABLE mon_tt_consistency_dat ADD CONSTRAINT mon_tt_consistency_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0117 
0118 
0119 CREATE TABLE mon_occupancy_dat (
0120   iov_id                NUMBER(10),
0121   logic_id              NUMBER(10), -- crystal
0122   events_over_low_threshold     NUMBER(10),
0123   events_over_high_threshold    NUMBER(10),
0124   avg_energy            BINARY_FLOAT
0125 );
0126 
0127 ALTER TABLE mon_occupancy_dat ADD CONSTRAINT mon_occupancy_dat_pk PRIMARY KEY (iov_id, logic_id);
0128 ALTER TABLE mon_occupancy_dat ADD CONSTRAINT mon_occupancy_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0129 
0130 
0131 
0132 CREATE TABLE mon_pedestals_dat (
0133   iov_id                NUMBER(10),
0134   logic_id              NUMBER(10), -- crystal
0135   ped_mean_g1           BINARY_FLOAT, 
0136   ped_rms_g1            BINARY_FLOAT, 
0137   ped_mean_g6           BINARY_FLOAT, 
0138   ped_rms_g6            BINARY_FLOAT, 
0139   ped_mean_g12          BINARY_FLOAT,
0140   ped_rms_g12           BINARY_FLOAT,
0141   task_status           CHAR(1)
0142 );
0143 
0144 ALTER TABLE mon_pedestals_dat ADD CONSTRAINT mon_pedestals_dat_pk PRIMARY KEY (iov_id, logic_id);
0145 ALTER TABLE mon_pedestals_dat ADD CONSTRAINT mon_pedestals_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0146 
0147 
0148 
0149 CREATE TABLE mon_pedestals_online_dat (
0150   iov_id                NUMBER(10),
0151   logic_id              NUMBER(10), -- crystal
0152   adc_mean_g12          BINARY_FLOAT,
0153   adc_rms_g12           BINARY_FLOAT,
0154   task_status           CHAR(1)
0155 );
0156 
0157 ALTER TABLE mon_pedestals_online_dat ADD CONSTRAINT mon_pedestals_online_dat_pk PRIMARY KEY (iov_id, logic_id);
0158 ALTER TABLE mon_pedestals_online_dat ADD CONSTRAINT mon_pedestals_online_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0159 
0160 
0161 
0162 CREATE TABLE mon_pedestal_offsets_dat (
0163   iov_id                NUMBER(10),
0164   logic_id              NUMBER(10), -- TT
0165   dac_g1                NUMBER(10),
0166   dac_g6                NUMBER(10),
0167   dac_g12               NUMBER(10),
0168   task_status           CHAR(1)
0169 );
0170 
0171 ALTER TABLE mon_pedestal_offsets_dat ADD CONSTRAINT mon_pedestal_offsets_dat_pk PRIMARY KEY (iov_id, logic_id);
0172 ALTER TABLE mon_pedestal_offsets_dat ADD CONSTRAINT mon_pedestal_offsets_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0173 
0174 
0175 
0176 CREATE TABLE mon_test_pulse_dat (
0177   iov_id                NUMBER(10),
0178   logic_id              NUMBER(10), -- crystal
0179   adc_mean_g1           BINARY_FLOAT, 
0180   adc_mean_g6           BINARY_FLOAT, 
0181   adc_mean_g12          BINARY_FLOAT,
0182   adc_rms_g1            BINARY_FLOAT, 
0183   adc_rms_g6            BINARY_FLOAT, 
0184   adc_rms_g12           BINARY_FLOAT,
0185   task_status           CHAR(1)
0186 );
0187 
0188 ALTER TABLE mon_test_pulse_dat ADD CONSTRAINT mon_test_pulse_dat_pk PRIMARY KEY (iov_id, logic_id);
0189 ALTER TABLE mon_test_pulse_dat ADD CONSTRAINT mon_test_pulse_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0190 
0191 
0192 
0193 CREATE TABLE mon_pulse_shape_dat (
0194   iov_id                NUMBER(10),
0195   logic_id              NUMBER(10), -- crystal
0196   g1_avg_sample_01      BINARY_FLOAT,
0197   g1_avg_sample_02      BINARY_FLOAT,
0198   g1_avg_sample_03      BINARY_FLOAT,
0199   g1_avg_sample_04      BINARY_FLOAT,
0200   g1_avg_sample_05      BINARY_FLOAT,
0201   g1_avg_sample_06      BINARY_FLOAT,
0202   g1_avg_sample_07      BINARY_FLOAT,
0203   g1_avg_sample_08      BINARY_FLOAT,
0204   g1_avg_sample_09      BINARY_FLOAT,
0205   g1_avg_sample_10      BINARY_FLOAT,
0206   g6_avg_sample_01      BINARY_FLOAT,
0207   g6_avg_sample_02      BINARY_FLOAT,
0208   g6_avg_sample_03      BINARY_FLOAT,
0209   g6_avg_sample_04      BINARY_FLOAT,
0210   g6_avg_sample_05      BINARY_FLOAT,
0211   g6_avg_sample_06      BINARY_FLOAT,
0212   g6_avg_sample_07      BINARY_FLOAT,
0213   g6_avg_sample_08      BINARY_FLOAT,
0214   g6_avg_sample_09      BINARY_FLOAT,
0215   g6_avg_sample_10      BINARY_FLOAT,
0216   g12_avg_sample_01     BINARY_FLOAT,
0217   g12_avg_sample_02     BINARY_FLOAT,
0218   g12_avg_sample_03     BINARY_FLOAT,
0219   g12_avg_sample_04     BINARY_FLOAT,
0220   g12_avg_sample_05     BINARY_FLOAT,
0221   g12_avg_sample_06     BINARY_FLOAT,
0222   g12_avg_sample_07     BINARY_FLOAT,
0223   g12_avg_sample_08     BINARY_FLOAT,
0224   g12_avg_sample_09     BINARY_FLOAT,
0225   g12_avg_sample_10     BINARY_FLOAT
0226 );
0227 
0228 ALTER TABLE mon_pulse_shape_dat ADD CONSTRAINT mon_pulse_shape_dat_pk PRIMARY KEY (iov_id, logic_id);
0229 ALTER TABLE mon_pulse_shape_dat ADD CONSTRAINT mon_pulse_shape_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0230 
0231 
0232 
0233 CREATE TABLE mon_shape_quality_dat (
0234   iov_id                NUMBER(10),
0235   logic_id              NUMBER(10), -- crystal
0236   avg_chi2              BINARY_FLOAT
0237 );
0238 
0239 ALTER TABLE mon_shape_quality_dat ADD CONSTRAINT mon_shape_quality_dat_pk PRIMARY KEY (iov_id, logic_id);
0240 ALTER TABLE mon_shape_quality_dat ADD CONSTRAINT mon_shape_quality_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0241 
0242 
0243 
0244 CREATE TABLE mon_delays_tt_dat (
0245   iov_id                NUMBER(10),
0246   logic_id              NUMBER(10), -- TT
0247   delay_mean            BINARY_FLOAT,
0248   delay_rms             BINARY_FLOAT,
0249   task_status           CHAR(1)
0250 );
0251 
0252 ALTER TABLE mon_delays_tt_dat ADD CONSTRAINT mon_delays_tt_dat_pk PRIMARY KEY (iov_id, logic_id);
0253 ALTER TABLE mon_delays_tt_dat ADD CONSTRAINT mon_delays_tt_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0254 
0255 
0256 
0257 CREATE TABLE mon_mem_ch_consistency_dat (
0258   iov_id                NUMBER(10),
0259   logic_id              NUMBER(10), -- EB_mem_channel
0260   processed_events      NUMBER(10),
0261   problematic_events    NUMBER(10),
0262   problems_id           NUMBER(10),
0263   problems_gain_zero    NUMBER(10),
0264   problems_gain_switch  NUMBER(10),
0265   task_status           CHAR(1)
0266 );
0267 
0268 ALTER TABLE mon_mem_ch_consistency_dat ADD CONSTRAINT mon_mem_ch_consistency_dat_pk PRIMARY KEY (iov_id, logic_id);
0269 ALTER TABLE mon_mem_ch_consistency_dat ADD CONSTRAINT mon_mem_ch_consistency_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0270 
0271 
0272 
0273 CREATE TABLE mon_mem_tt_consistency_dat (
0274   iov_id                NUMBER(10),
0275   logic_id              NUMBER(10), -- EB_mem_tt
0276   processed_events      NUMBER(10),
0277   problematic_events    NUMBER(10),
0278   problems_id           NUMBER(10),
0279   problems_size         NUMBER(10),
0280   problems_LV1          NUMBER(10),
0281   problems_bunch_X      NUMBER(10),
0282   task_status           CHAR(1)
0283 );
0284 
0285 ALTER TABLE mon_mem_tt_consistency_dat ADD CONSTRAINT mon_mem_tt_consistency_dat_pk PRIMARY KEY (iov_id, logic_id);
0286 ALTER TABLE mon_mem_tt_consistency_dat ADD CONSTRAINT mon_mem_tt_consistency_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0287 
0288 
0289 
0290 CREATE TABLE mon_pn_blue_dat (
0291   iov_id                NUMBER(10),
0292   logic_id              NUMBER(10), -- PN diode
0293   adc_mean_g1           BINARY_FLOAT,
0294   adc_rms_g1            BINARY_FLOAT,
0295   adc_mean_g16          BINARY_FLOAT,
0296   adc_rms_g16           BINARY_FLOAT,
0297   ped_mean_g1           BINARY_FLOAT,
0298   ped_rms_g1            BINARY_FLOAT,
0299   ped_mean_g16          BINARY_FLOAT,
0300   ped_rms_g16           BINARY_FLOAT,
0301   task_status           CHAR(1)
0302 );
0303 
0304 ALTER TABLE mon_pn_blue_dat ADD CONSTRAINT mon_pn_blue_dat_pk PRIMARY KEY (iov_id, logic_id);
0305 ALTER TABLE mon_pn_blue_dat ADD CONSTRAINT mon_pn_blue_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0306 
0307 
0308 
0309 CREATE TABLE mon_pn_green_dat (
0310   iov_id                NUMBER(10),
0311   logic_id              NUMBER(10), -- PN diode
0312   adc_mean_g1           BINARY_FLOAT,
0313   adc_rms_g1            BINARY_FLOAT,
0314   adc_mean_g16          BINARY_FLOAT,
0315   adc_rms_g16           BINARY_FLOAT,
0316   ped_mean_g1           BINARY_FLOAT,
0317   ped_rms_g1            BINARY_FLOAT,
0318   ped_mean_g16          BINARY_FLOAT,
0319   ped_rms_g16           BINARY_FLOAT,
0320   task_status           CHAR(1)
0321 );
0322 
0323 ALTER TABLE mon_pn_green_dat ADD CONSTRAINT mon_pn_green_dat_pk PRIMARY KEY (iov_id, logic_id);
0324 ALTER TABLE mon_pn_green_dat ADD CONSTRAINT mon_pn_green_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0325 
0326 
0327 
0328 CREATE TABLE mon_pn_red_dat (
0329   iov_id                NUMBER(10),
0330   logic_id              NUMBER(10), -- PN diode
0331   adc_mean_g1           BINARY_FLOAT,
0332   adc_rms_g1            BINARY_FLOAT,
0333   adc_mean_g16          BINARY_FLOAT,
0334   adc_rms_g16           BINARY_FLOAT,
0335   ped_mean_g1           BINARY_FLOAT,
0336   ped_rms_g1            BINARY_FLOAT,
0337   ped_mean_g16          BINARY_FLOAT,
0338   ped_rms_g16           BINARY_FLOAT,
0339   task_status           CHAR(1)
0340 );
0341 
0342 ALTER TABLE mon_pn_red_dat ADD CONSTRAINT mon_pn_red_dat_pk PRIMARY KEY (iov_id, logic_id);
0343 ALTER TABLE mon_pn_red_dat ADD CONSTRAINT mon_pn_red_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0344 
0345 
0346 
0347 CREATE TABLE mon_pn_ired_dat (
0348   iov_id                NUMBER(10),
0349   logic_id              NUMBER(10), -- PN diode
0350   adc_mean_g1           BINARY_FLOAT,
0351   adc_rms_g1            BINARY_FLOAT,
0352   adc_mean_g16          BINARY_FLOAT,
0353   adc_rms_g16           BINARY_FLOAT,
0354   ped_mean_g1           BINARY_FLOAT,
0355   ped_rms_g1            BINARY_FLOAT,
0356   ped_mean_g16          BINARY_FLOAT,
0357   ped_rms_g16           BINARY_FLOAT,
0358   task_status           CHAR(1)
0359 );
0360 
0361 ALTER TABLE mon_pn_ired_dat ADD CONSTRAINT mon_pn_ired_dat_pk PRIMARY KEY (iov_id, logic_id);
0362 ALTER TABLE mon_pn_ired_dat ADD CONSTRAINT mon_pn_ired_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0363 
0364 
0365 
0366 CREATE TABLE mon_pn_ped_dat (
0367   iov_id                NUMBER(10),
0368   logic_id              NUMBER(10), -- PN diode
0369   ped_mean_g1           BINARY_FLOAT,
0370   ped_rms_g1            BINARY_FLOAT,
0371   ped_mean_g16          BINARY_FLOAT,
0372   ped_rms_g16           BINARY_FLOAT,
0373   task_status           CHAR(1)
0374 );
0375 
0376 ALTER TABLE mon_pn_ped_dat ADD CONSTRAINT mon_pn_ped_dat_pk PRIMARY KEY (iov_id, logic_id);
0377 ALTER TABLE mon_pn_ped_dat ADD CONSTRAINT mon_pn_ped_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id); 
0378 
0379 
0380 
0381 CREATE TABLE mon_pn_mgpa_dat (
0382   iov_id                NUMBER(10),
0383   logic_id              NUMBER(10), -- PN diode
0384   adc_mean_g1           BINARY_FLOAT,
0385   adc_rms_g1            BINARY_FLOAT,
0386   adc_mean_g16          BINARY_FLOAT,
0387   adc_rms_g16           BINARY_FLOAT,
0388   ped_mean_g1           BINARY_FLOAT,
0389   ped_rms_g1            BINARY_FLOAT,
0390   ped_mean_g16          BINARY_FLOAT,
0391   ped_rms_g16           BINARY_FLOAT,
0392   task_status           CHAR(1)
0393 );
0394 
0395 ALTER TABLE mon_pn_mgpa_dat ADD CONSTRAINT mon_pn_mgpa_dat_pk PRIMARY KEY (iov_id, logic_id);
0396 ALTER TABLE mon_pn_mgpa_dat ADD CONSTRAINT mon_pn_mgpa_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0397 
0398 
0399 
0400 CREATE TABLE mon_laser_blue_dat (
0401   iov_id                NUMBER(10),
0402   logic_id              NUMBER(10), -- crystal
0403   apd_mean              BINARY_FLOAT,
0404   apd_rms               BINARY_FLOAT,
0405   apd_over_pn_mean      BINARY_FLOAT,
0406   apd_over_pn_rms       BINARY_FLOAT,
0407   task_status           CHAR(1)
0408 );
0409 
0410 ALTER TABLE mon_laser_blue_dat ADD CONSTRAINT mon_laser_blue_dat_pk PRIMARY KEY (iov_id, logic_id);
0411 ALTER TABLE mon_laser_blue_dat ADD CONSTRAINT mon_laser_blue_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0412 
0413 
0414 
0415 CREATE TABLE mon_laser_green_dat (
0416   iov_id                NUMBER(10),
0417   logic_id              NUMBER(10), -- crystal
0418   apd_mean              BINARY_FLOAT,
0419   apd_rms               BINARY_FLOAT,
0420   apd_over_pn_mean      BINARY_FLOAT,
0421   apd_over_pn_rms       BINARY_FLOAT,
0422   task_status           CHAR(1)
0423 );
0424 
0425 ALTER TABLE mon_laser_green_dat ADD CONSTRAINT mon_laser_green_dat_pk PRIMARY KEY (iov_id, logic_id);
0426 ALTER TABLE mon_laser_green_dat ADD CONSTRAINT mon_laser_green_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0427 
0428 
0429 
0430 CREATE TABLE mon_laser_red_dat (
0431   iov_id                NUMBER(10),
0432   logic_id              NUMBER(10), -- crystal
0433   apd_mean              BINARY_FLOAT,
0434   apd_rms               BINARY_FLOAT,
0435   apd_over_pn_mean      BINARY_FLOAT,
0436   apd_over_pn_rms       BINARY_FLOAT,
0437   task_status           CHAR(1)
0438 );
0439 
0440 ALTER TABLE mon_laser_red_dat ADD CONSTRAINT mon_laser_red_dat_pk PRIMARY KEY (iov_id, logic_id);
0441 ALTER TABLE mon_laser_red_dat ADD CONSTRAINT mon_laser_red_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0442 
0443 
0444 
0445 CREATE TABLE mon_laser_ired_dat (
0446   iov_id                NUMBER(10),
0447   logic_id              NUMBER(10), -- crystal
0448   apd_mean              BINARY_FLOAT,
0449   apd_rms               BINARY_FLOAT,
0450   apd_over_pn_mean      BINARY_FLOAT,
0451   apd_over_pn_rms       BINARY_FLOAT,
0452   task_status           CHAR(1)
0453 );
0454 
0455 ALTER TABLE mon_laser_ired_dat ADD CONSTRAINT mon_laser_ired_dat_pk PRIMARY KEY (iov_id, logic_id);
0456 ALTER TABLE mon_laser_ired_dat ADD CONSTRAINT mon_laser_ired_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0457 
0458 
0459 
0460 CREATE TABLE mon_h4_table_position_dat (
0461   iov_id                NUMBER(10),
0462   logic_id              NUMBER(10), -- SM
0463   table_x               BINARY_FLOAT,
0464   table_y               BINARY_FLOAT
0465 );
0466 
0467 ALTER TABLE mon_h4_table_position_dat ADD CONSTRAINT mon_h4_table_position_dat_pk PRIMARY KEY (iov_id, logic_id);
0468 ALTER TABLE mon_h4_table_position_dat ADD CONSTRAINT mon_h4_table_position_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0469 
0470 
0471 
0472 CREATE TABLE mon_laser_status_dat (
0473   iov_id                NUMBER(10),
0474   logic_id              NUMBER(10), -- SM
0475   laser_power           BINARY_FLOAT,
0476   laser_filter          BINARY_FLOAT,
0477   laser_wavelength      BINARY_FLOAT,
0478   laser_fanout          CHAR(1)
0479 );
0480 
0481 ALTER TABLE mon_laser_status_dat ADD CONSTRAINT mon_laser_status_dat_pk PRIMARY KEY (iov_id, logic_id);
0482 ALTER TABLE mon_laser_status_dat ADD CONSTRAINT mon_laser_status_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0483 
0484 
0485 
0486 CREATE TABLE mon_laser_pulse_dat (
0487   iov_id                NUMBER(10),
0488   logic_id              NUMBER(10), -- SM
0489   pulse_height_mean     BINARY_FLOAT,
0490   pulse_height_rms      BINARY_FLOAT,
0491   pulse_width_mean      BINARY_FLOAT,
0492   pulse_width_rms       BINARY_FLOAT
0493 );
0494 
0495 ALTER TABLE mon_laser_pulse_dat ADD CONSTRAINT mon_laser_pulse_dat_pk PRIMARY KEY (iov_id, logic_id);
0496 ALTER TABLE mon_laser_pulse_dat ADD CONSTRAINT mon_laser_pulse_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0497 
0498 
0499 CREATE TABLE mon_timing_crystal_dat (
0500   iov_id                NUMBER(10),
0501   logic_id              NUMBER(10), -- xt
0502   timing_mean           BINARY_FLOAT,
0503   timing_rms            BINARY_FLOAT
0504   task_status           CHAR(1)
0505 );
0506 
0507 ALTER TABLE mon_timing_crystal_dat ADD CONSTRAINT mon_timing_crystal_dat_pk PRIMARY KEY (iov_id, logic_id);
0508 ALTER TABLE mon_timing_crystal_dat ADD CONSTRAINT mon_timing_crystal_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0509 
0510 CREATE TABLE mon_timing_tt_dat (
0511   iov_id                NUMBER(10),
0512   logic_id              NUMBER(10), -- tt
0513   timing_mean           BINARY_FLOAT,
0514   timing_rms            BINARY_FLOAT
0515   task_status           CHAR(1)
0516 );
0517 
0518 ALTER TABLE mon_timing_tt_dat ADD CONSTRAINT mon_timing_tt_dat_pk PRIMARY KEY (iov_id, logic_id);
0519 ALTER TABLE mon_timing_tt_dat ADD CONSTRAINT mon_timing_tt_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0520 
0521 
0522 CREATE TABLE mon_LED1_dat (
0523   iov_id                NUMBER(10),
0524   logic_id              NUMBER(10), -- crystal
0525   vpt_mean              BINARY_FLOAT,
0526   vpt_rms               BINARY_FLOAT,
0527   vpt_over_pn_mean      BINARY_FLOAT,
0528   vpt_over_pn_rms       BINARY_FLOAT,
0529   task_status           CHAR(1)
0530 );
0531 
0532 ALTER TABLE mon_led1_dat ADD CONSTRAINT mon_led1_dat_pk PRIMARY KEY (iov_id, logic_id);
0533 ALTER TABLE mon_led1_dat ADD CONSTRAINT mon_led1_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0534 
0535 
0536 CREATE TABLE mon_LED2_dat (
0537   iov_id                NUMBER(10),
0538   logic_id              NUMBER(10), -- crystal
0539   vpt_mean              BINARY_FLOAT,
0540   vpt_rms               BINARY_FLOAT,
0541   vpt_over_pn_mean      BINARY_FLOAT,
0542   vpt_over_pn_rms       BINARY_FLOAT,
0543   task_status           CHAR(1)
0544 );
0545 
0546 ALTER TABLE mon_led2_dat ADD CONSTRAINT mon_led2_dat_pk PRIMARY KEY (iov_id, logic_id);
0547 ALTER TABLE mon_led2_dat ADD CONSTRAINT mon_led2_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0548 
0549 
0550 
0551 CREATE TABLE mon_pn_led1_dat (
0552   iov_id                NUMBER(10),
0553   logic_id              NUMBER(10), -- PN diode
0554   adc_mean_g1           BINARY_FLOAT,
0555   adc_rms_g1            BINARY_FLOAT,
0556   adc_mean_g16          BINARY_FLOAT,
0557   adc_rms_g16           BINARY_FLOAT,
0558   ped_mean_g1           BINARY_FLOAT,
0559   ped_rms_g1            BINARY_FLOAT,
0560   ped_mean_g16          BINARY_FLOAT,
0561   ped_rms_g16           BINARY_FLOAT,
0562   task_status           CHAR(1)
0563 );
0564 
0565 ALTER TABLE mon_pn_led1_dat ADD CONSTRAINT mon_pn_led1_dat_pk PRIMARY KEY (iov_id, logic_id);
0566 ALTER TABLE mon_pn_led1_dat ADD CONSTRAINT mon_pn_led1_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0567 
0568 
0569 
0570 CREATE TABLE mon_pn_led2_dat (
0571   iov_id                NUMBER(10),
0572   logic_id              NUMBER(10), -- PN diode
0573   adc_mean_g1           BINARY_FLOAT,
0574   adc_rms_g1            BINARY_FLOAT,
0575   adc_mean_g16          BINARY_FLOAT,
0576   adc_rms_g16           BINARY_FLOAT,
0577   ped_mean_g1           BINARY_FLOAT,
0578   ped_rms_g1            BINARY_FLOAT,
0579   ped_mean_g16          BINARY_FLOAT,
0580   ped_rms_g16           BINARY_FLOAT,
0581   task_status           CHAR(1)
0582 );
0583 
0584 ALTER TABLE mon_pn_led2_dat ADD CONSTRAINT mon_pn_led2_dat_pk PRIMARY KEY (iov_id, logic_id);
0585 ALTER TABLE mon_pn_led2_dat ADD CONSTRAINT mon_pn_led2_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0586 
0587 
0588 CREATE TABLE mon_timing_xtal_lb_dat (
0589   iov_id                NUMBER(10),
0590   logic_id              NUMBER(10), -- xt
0591   timing_mean           BINARY_FLOAT,
0592   timing_rms            BINARY_FLOAT,
0593   task_status           CHAR(1)
0594 );
0595 
0596 ALTER TABLE mon_timing_xtal_lb_dat ADD CONSTRAINT mon_timing_xtal_lb_dat_pk PRIMARY KEY (iov_id, logic_id);
0597 ALTER TABLE mon_timing_xtal_lb_dat ADD CONSTRAINT mon_timing_xtal_lb_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0598 
0599 CREATE TABLE mon_timing_xtal_lg_dat (
0600   iov_id                NUMBER(10),
0601   logic_id              NUMBER(10), -- xt
0602   timing_mean           BINARY_FLOAT,
0603   timing_rms            BINARY_FLOAT,
0604   task_status           CHAR(1)
0605 );
0606 
0607 ALTER TABLE mon_timing_xtal_lg_dat ADD CONSTRAINT mon_timing_xtal_lg_dat_pk PRIMARY KEY (iov_id, logic_id);
0608 ALTER TABLE mon_timing_xtal_lg_dat ADD CONSTRAINT mon_timing_xtal_lg_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0609 
0610 CREATE TABLE mon_timing_xtal_lr_dat (
0611   iov_id                NUMBER(10),
0612   logic_id              NUMBER(10), -- xt
0613   timing_mean           BINARY_FLOAT,
0614   timing_rms            BINARY_FLOAT,
0615   task_status           CHAR(1)
0616 );
0617 
0618 ALTER TABLE mon_timing_xtal_lr_dat ADD CONSTRAINT mon_timing_xtal_lr_dat_pk PRIMARY KEY (iov_id, logic_id);
0619 ALTER TABLE mon_timing_xtal_lr_dat ADD CONSTRAINT mon_timing_xtal_lr_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0620 
0621 CREATE TABLE mon_timing_xtal_li_dat (
0622   iov_id                NUMBER(10),
0623   logic_id              NUMBER(10), -- xt
0624   timing_mean           BINARY_FLOAT,
0625   timing_rms            BINARY_FLOAT,
0626   task_status           CHAR(1)
0627 );
0628 
0629 ALTER TABLE mon_timing_xtal_li_dat ADD CONSTRAINT mon_timing_xtal_li_dat_pk PRIMARY KEY (iov_id, logic_id);
0630 ALTER TABLE mon_timing_xtal_li_dat ADD CONSTRAINT mon_timing_xtal_li_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0631 
0632 CREATE TABLE mon_timing_xtal_l1_dat (
0633   iov_id                NUMBER(10),
0634   logic_id              NUMBER(10), -- xt
0635   timing_mean           BINARY_FLOAT,
0636   timing_rms            BINARY_FLOAT,
0637   task_status           CHAR(1)
0638 );
0639 
0640 ALTER TABLE mon_timing_xtal_l1_dat ADD CONSTRAINT mon_timing_xtal_l1_dat_pk PRIMARY KEY (iov_id, logic_id);
0641 ALTER TABLE mon_timing_xtal_l1_dat ADD CONSTRAINT mon_timing_xtal_l1_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0642 
0643 CREATE TABLE mon_timing_xtal_l2_dat (
0644   iov_id                NUMBER(10),
0645   logic_id              NUMBER(10), -- xt
0646   timing_mean           BINARY_FLOAT,
0647   timing_rms            BINARY_FLOAT,
0648   task_status           CHAR(1)
0649 );
0650 
0651 ALTER TABLE mon_timing_xtal_l2_dat ADD CONSTRAINT mon_timing_xtal_l2_dat_pk PRIMARY KEY (iov_id, logic_id);
0652 ALTER TABLE mon_timing_xtal_l2_dat ADD CONSTRAINT mon_timing_xtal_l2_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0653 
0654 
0655 
0656 CREATE TABLE mon_timing_TT_lb_dat (
0657   iov_id                NUMBER(10),
0658   logic_id              NUMBER(10), -- xt
0659   timing_mean           BINARY_FLOAT,
0660   timing_rms            BINARY_FLOAT,
0661   task_status           CHAR(1)
0662 );
0663 
0664 ALTER TABLE mon_timing_TT_lb_dat ADD CONSTRAINT mon_timing_TT_lb_dat_pk PRIMARY KEY (iov_id, logic_id);
0665 ALTER TABLE mon_timing_TT_lb_dat ADD CONSTRAINT mon_timing_TT_lb_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0666 
0667 CREATE TABLE mon_timing_TT_lg_dat (
0668   iov_id                NUMBER(10),
0669   logic_id              NUMBER(10), -- xt
0670   timing_mean           BINARY_FLOAT,
0671   timing_rms            BINARY_FLOAT,
0672   task_status           CHAR(1)
0673 );
0674 
0675 ALTER TABLE mon_timing_TT_lg_dat ADD CONSTRAINT mon_timing_TT_lg_dat_pk PRIMARY KEY (iov_id, logic_id);
0676 ALTER TABLE mon_timing_TT_lg_dat ADD CONSTRAINT mon_timing_TT_lg_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0677 
0678 CREATE TABLE mon_timing_TT_lr_dat (
0679   iov_id                NUMBER(10),
0680   logic_id              NUMBER(10), -- xt
0681   timing_mean           BINARY_FLOAT,
0682   timing_rms            BINARY_FLOAT,
0683   task_status           CHAR(1)
0684 );
0685 
0686 ALTER TABLE mon_timing_TT_lr_dat ADD CONSTRAINT mon_timing_TT_lr_dat_pk PRIMARY KEY (iov_id, logic_id);
0687 ALTER TABLE mon_timing_TT_lr_dat ADD CONSTRAINT mon_timing_TT_lr_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0688 
0689 CREATE TABLE mon_timing_TT_li_dat (
0690   iov_id                NUMBER(10),
0691   logic_id              NUMBER(10), -- xt
0692   timing_mean           BINARY_FLOAT,
0693   timing_rms            BINARY_FLOAT,
0694   task_status           CHAR(1)
0695 );
0696 
0697 ALTER TABLE mon_timing_TT_li_dat ADD CONSTRAINT mon_timing_TT_li_dat_pk PRIMARY KEY (iov_id, logic_id);
0698 ALTER TABLE mon_timing_TT_li_dat ADD CONSTRAINT mon_timing_TT_li_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0699 
0700 CREATE TABLE mon_timing_TT_l1_dat (
0701   iov_id                NUMBER(10),
0702   logic_id              NUMBER(10), -- xt
0703   timing_mean           BINARY_FLOAT,
0704   timing_rms            BINARY_FLOAT,
0705   task_status           CHAR(1)
0706 );
0707 
0708 ALTER TABLE mon_timing_TT_l1_dat ADD CONSTRAINT mon_timing_TT_l1_dat_pk PRIMARY KEY (iov_id, logic_id);
0709 ALTER TABLE mon_timing_TT_l1_dat ADD CONSTRAINT mon_timing_TT_l1_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0710 
0711 CREATE TABLE mon_timing_TT_l2_dat (
0712   iov_id                NUMBER(10),
0713   logic_id              NUMBER(10), -- xt
0714   timing_mean           BINARY_FLOAT,
0715   timing_rms            BINARY_FLOAT,
0716   task_status           CHAR(1)
0717 );
0718 
0719 ALTER TABLE mon_timing_TT_l2_dat ADD CONSTRAINT mon_timing_TT_l2_dat_pk PRIMARY KEY (iov_id, logic_id);
0720 ALTER TABLE mon_timing_TT_l2_dat ADD CONSTRAINT mon_timing_TT_l2_dat_fk FOREIGN KEY (iov_id) REFERENCES mon_run_iov (iov_id);
0721 
0722 
0723