@@ -53,20 +53,23 @@ public final void fetch_AHDCHits(DataEvent event, AlertDCDetector detector) {
5353 double ped_min = rawHitCuts [6 ];
5454 double ped_max = rawHitCuts [7 ];
5555 //System.out.println("t_min : " + t_min + " t_max : " + t_max + " tot_min : " + tot_min + " tot_max : " + tot_max + " adc_min : " + adc_min + " adc_max : " + adc_max + " ped_min : " + ped_min + " ped_max : " + ped_max);
56- // Apply these cuts
57- if (((adc >= adc_min ) && (adc <= adc_max ) && (leadingEdgeTime >= t_min ) && (leadingEdgeTime <= t_max ) && (timeOverThreshold >= tot_min ) && (timeOverThreshold <= tot_max ) && (adcOffset >= ped_min ) && (adcOffset <= ped_max )) || sim ) {
58- // Retrieve others CCDB
59- double [] timeOffsets = CalibrationConstantsLoader .AHDC_TIME_OFFSETS .get ( key_value );
60- double [] time2distance = CalibrationConstantsLoader .AHDC_TIME_TO_DISTANCE .get ( 10101 ); // the time to distance table has only one row ! (10101 is its only key)
61- double t0 = timeOffsets [0 ];
62- double p0 = time2distance [0 ];
63- double p1 = time2distance [1 ];
64- double p2 = time2distance [2 ];
65- double p3 = time2distance [3 ];
66- double p4 = time2distance [4 ];
67- double p5 = time2distance [5 ];
68-
69- double time = leadingEdgeTime - t0 ;
56+ // Retrieve t0 and t2 from CCDB
57+ // What's about simulation?
58+ double [] timeOffsets = CalibrationConstantsLoader .AHDC_TIME_OFFSETS .get ( key_value );
59+ double [] time2distance = CalibrationConstantsLoader .AHDC_TIME_TO_DISTANCE .get ( 10101 ); // the time to distance table has only one row ! (10101 is its only key)
60+ double t0 = timeOffsets [0 ];
61+ double p0 = time2distance [0 ];
62+ double p1 = time2distance [1 ];
63+ double p2 = time2distance [2 ];
64+ double p3 = time2distance [3 ];
65+ double p4 = time2distance [4 ];
66+ double p5 = time2distance [5 ];
67+ // Apply time calibration
68+ // We may need adc calibration too
69+ double time = leadingEdgeTime - t0 ;
70+
71+ // Apply raw hit cuts
72+ if (((adc >= adc_min ) && (adc <= adc_max ) && (time >= t_min ) && (time <= t_max ) && (timeOverThreshold >= tot_min ) && (timeOverThreshold <= tot_max ) && (adcOffset >= ped_min ) && (adcOffset <= ped_max )) || sim ) {
7073 // we may prevent time to be too small or too big
7174 // CONDITION TO BE ADDED
7275 // we should also use a flag to prevent to read the ccdb if reconstructed event if from simulation
0 commit comments