@@ -28,6 +28,7 @@ public CalibrationConstantsLoader() {
2828 // AHDC
2929 public static Map <Integer , double []> AHDC_TIME_OFFSETS = new HashMap <Integer ,double []>(); ///< AHDC Parameters for timing offsets
3030 public static Map <Integer , double []> AHDC_TIME_TO_DISTANCE = new HashMap <Integer ,double []>(); ///< AHDC Parameters for time to distance
31+ public static Map <Integer , double []> AHDC_RAW_HIT_CUTS = new HashMap <Integer ,double []>(); ///< AHDC Parameters for raw hit cuts
3132
3233 // ATOF
3334 public static Map <Integer , double []> ATOF_EFFECTIVE_VELOCITY = new HashMap <Integer ,double []>(); ///< ATOF Parameters for effective velocity
@@ -42,6 +43,7 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
4243
4344 IndexedTable ahdc_timeOffsets = manager .getConstants (runno , "/calibration/alert/ahdc/time_offsets" );
4445 IndexedTable ahdc_time2distance = manager .getConstants (runno , "/calibration/alert/ahdc/time_to_distance" );
46+ IndexedTable ahdc_rawHitCuts = manager .getConstants (runno , "/calibration/alert/ahdc/raw_hit_cuts" );
4547 IndexedTable atof_effectiveVelocity = manager .getConstants (runno , "/calibration/alert/atof/effective_velocity" );
4648 IndexedTable atof_timeWalk = manager .getConstants (runno , "/calibration/alert/atof/time_walk" );
4749 IndexedTable atof_attenuationLength = manager .getConstants (runno , "/calibration/alert/atof/attenuation" );
@@ -95,6 +97,27 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
9597 //System.out.println("p0 : " + p0 + " p1 : " + p1 + " p2 : " + p2 + " p3 : " + p3 + " p4 : " + p4 + " p5 : " + p5);
9698 }
9799
100+ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
101+ // AHDC raw hit cuts
102+ for ( int i = 0 ; i < ahdc_rawHitCuts .getRowCount (); i ++){
103+ int sector = Integer .parseInt ((String )ahdc_rawHitCuts .getValueAt (i , 0 ));
104+ int layer = Integer .parseInt ((String )ahdc_rawHitCuts .getValueAt (i , 1 ));
105+ int component = Integer .parseInt ((String )ahdc_rawHitCuts .getValueAt (i , 2 ));
106+ double t_min = ahdc_rawHitCuts .getDoubleValue ("t_min" , sector , layer , component );
107+ double t_max = ahdc_rawHitCuts .getDoubleValue ("t_max" , sector , layer , component );
108+ double tot_min = ahdc_rawHitCuts .getDoubleValue ("tot_min" , sector , layer , component );
109+ double tot_max = ahdc_rawHitCuts .getDoubleValue ("tot_max" , sector , layer , component );
110+ double adc_min = ahdc_rawHitCuts .getDoubleValue ("adc_min" , sector , layer , component );
111+ double adc_max = ahdc_rawHitCuts .getDoubleValue ("adc_max" , sector , layer , component );
112+ double ped_min = ahdc_rawHitCuts .getDoubleValue ("ped_min" , sector , layer , component );
113+ double ped_max = ahdc_rawHitCuts .getDoubleValue ("ped_max" , sector , layer , component );
114+ // Put in map
115+ int key = sector *10000 + layer *100 + component ;
116+ double params [] = {t_min , t_max , tot_min , tot_max , adc_min , adc_max , ped_min , ped_max };
117+ AHDC_RAW_HIT_CUTS .put (Integer .valueOf (key ), params );
118+ //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);
119+ }
120+
98121 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
99122 // ATOF effective velocity
100123 for ( int i = 0 ; i < atof_effectiveVelocity .getRowCount (); i ++){
@@ -106,9 +129,10 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
106129 double extra1 = atof_effectiveVelocity .getDoubleValue ("extra1" , sector , layer , component );
107130 double extra2 = atof_effectiveVelocity .getDoubleValue ("extra2" , sector , layer , component );
108131 // Put in map
109- int key = sector *10000 + layer *100 + component ;
132+ int key = sector *10000 + layer *1000 + component * 10 ;
110133 double params [] = {veff , dveff , extra1 , extra2 };
111134 ATOF_EFFECTIVE_VELOCITY .put (Integer .valueOf (key ), params );
135+ //System.out.println("veff : " + veff + " dveff : " + dveff + " extra1 : " + extra1 + " extra2 : " + extra2);
112136 }
113137
114138 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -117,6 +141,7 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
117141 int sector = Integer .parseInt ((String )atof_timeWalk .getValueAt (i , 0 ));
118142 int layer = Integer .parseInt ((String )atof_timeWalk .getValueAt (i , 1 ));
119143 int component = Integer .parseInt ((String )atof_timeWalk .getValueAt (i , 2 ));
144+ int order = Integer .parseInt ((String )atof_timeWalk .getValueAt (i , 3 ));
120145 double tw0 = atof_timeWalk .getDoubleValue ("tw0" , sector , layer , component );
121146 double tw1 = atof_timeWalk .getDoubleValue ("tw1" , sector , layer , component );
122147 double tw2 = atof_timeWalk .getDoubleValue ("tw2" , sector , layer , component );
@@ -127,9 +152,10 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
127152 double dtw3 = atof_timeWalk .getDoubleValue ("dtw3" , sector , layer , component );
128153 double chi2ndf = atof_timeWalk .getDoubleValue ("chi2ndf" , sector , layer , component );
129154 // Put in map
130- int key = sector *10000 + layer *100 + component ;
155+ int key = sector *10000 + layer *1000 + component * 10 + order ;
131156 double params [] = {tw0 , tw1 , tw2 , tw3 , dtw0 , dtw1 , dtw2 , dtw3 , chi2ndf };
132157 ATOF_TIME_WALK .put (Integer .valueOf (key ), params );
158+ //System.out.println("tw0 : " + tw0 + " tw1 : " + tw1 + " tw2 : " + tw2 + " tw3 : " + tw3 + " ...");
133159 }
134160
135161 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -143,9 +169,10 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
143169 double extra1 = atof_attenuationLength .getDoubleValue ("extra1" , sector , layer , component );
144170 double extra2 = atof_attenuationLength .getDoubleValue ("extra2" , sector , layer , component );
145171 // Put in map
146- int key = sector *10000 + layer *100 + component ;
172+ int key = sector *10000 + layer *1000 + component * 10 ;
147173 double params [] = {attlen , dattlen , extra1 , extra2 };
148174 ATOF_ATTENUATION_LENGTH .put (Integer .valueOf (key ), params );
175+ //System.out.println("attlen : " + attlen + " dattlen : " + dattlen + " extra1 : " +extra1 + " extra2 : " + extra2 + " ...");
149176 }
150177
151178 ////////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -154,15 +181,17 @@ public static synchronized void Load(int runno, String var, ConstantsManager man
154181 int sector = Integer .parseInt ((String )atof_timeOffsets .getValueAt (i , 0 ));
155182 int layer = Integer .parseInt ((String )atof_timeOffsets .getValueAt (i , 1 ));
156183 int component = Integer .parseInt ((String )atof_timeOffsets .getValueAt (i , 2 ));
184+ int order = Integer .parseInt ((String )atof_timeOffsets .getValueAt (i , 3 )); // we have to use it here !
157185 double t0 = atof_timeOffsets .getDoubleValue ("t0" , sector , layer , component );
158186 double upstream_downstream = atof_timeOffsets .getDoubleValue ("upstream_downstream" , sector , layer , component );
159187 double wedge_bar = atof_timeOffsets .getDoubleValue ("wedge_bar" , sector , layer , component );
160188 double extra1 = atof_timeOffsets .getDoubleValue ("extra1" , sector , layer , component );
161189 double extra2 = atof_timeOffsets .getDoubleValue ("extra2" , sector , layer , component );
162190 // Put in map
163- int key = sector *10000 + layer *100 + component ;
191+ int key = sector *10000 + layer *1000 + component * 10 + order ;
164192 double params [] = {t0 , upstream_downstream , wedge_bar , extra1 , extra2 };
165193 ATOF_TIME_OFFSETS .put (Integer .valueOf (key ), params );
194+ //System.out.println("t0 : " + t0 + " up_down : " + upstream_downstream + " wedge_bar : " + wedge_bar + " ...");
166195 }
167196
168197
0 commit comments