33import org .jlab .geom .base .*;
44import org .jlab .geom .prim .Point3D ;
55import org .jlab .rec .atof .constants .Parameters ;
6+ import java .util .logging .Level ;
7+ import java .util .logging .Logger ;
68
79/**
810 *
1517 */
1618public class ATOFHit {
1719
20+ static final Logger LOGGER = Logger .getLogger (ATOFHit .class .getName ());
21+
1822 private int sector , layer , component , order ;
1923 private int tdc , tot ;
2024 private double time , energy , x , y , z ;
@@ -182,7 +186,7 @@ public final String makeType() {
182186 public final int convertTdcToTime () {
183187 double tdc2time , veff , distance_to_sipm ;
184188 if (null == this .type ) {
185- System . out . print ("Null hit type, cannot convert tdc to time." );
189+ LOGGER . finest ("Null hit type, cannot convert tdc to time." );
186190 return 1 ;
187191 } else {
188192 switch (this .type ) {
@@ -205,11 +209,11 @@ public final int convertTdcToTime() {
205209 distance_to_sipm = 0 ;
206210 }
207211 case "bar" -> {
208- System . out . print ("Bar hit type, cannot convert tdc to time." );
212+ LOGGER . finest ("Bar hit type, cannot convert tdc to time." );
209213 return 1 ;
210214 }
211215 default -> {
212- System . out . print ("Undefined hit type, cannot convert tdc to time." );
216+ LOGGER . finest ("Undefined hit type, cannot convert tdc to time." );
213217 return 1 ;
214218 }
215219 }
@@ -230,7 +234,7 @@ public final int convertTdcToTime() {
230234 public final int convertTotToEnergy () {
231235 double tot2energy ;
232236 if (null == this .type ) {
233- System . out . print ("Null hit type, cannot convert tot to energy." );
237+ LOGGER . finest ("Null hit type, cannot convert tot to energy." );
234238 return 1 ;
235239 } else {
236240 switch (this .type ) {
@@ -254,11 +258,11 @@ public final int convertTotToEnergy() {
254258 this .energy = tot2energy * this .tot ;
255259 }
256260 case "bar" -> {
257- System . out . print ("Bar hit type, cannot convert tot to energy." );
261+ LOGGER . finest ("Bar hit type, cannot convert tot to energy." );
258262 return 1 ;
259263 }
260264 default -> {
261- System . out . print ("Undefined hit type, cannot convert tot to energy." );
265+ LOGGER . finest ("Undefined hit type, cannot convert tot to energy." );
262266 return 1 ;
263267 }
264268 }
@@ -294,12 +298,11 @@ public final int convertSLCToXYZ(Detector atof) {
294298 Component comp = atof .getSector (this .sector ).getSuperlayer (sl ).getLayer (this .layer ).getComponent (this .component );
295299 Point3D midpoint = comp .getMidpoint ();
296300 //Midpoints defined in the system were z=0 is the upstream end of the atof
297- //Translation to the system were z=0 is the center of the atof
298301 //Units are mm
299302 this .x = midpoint .x ();
300303 this .y = midpoint .y ();
301- this .z = midpoint .z () - Parameters . LENGTH_ATOF / 2. ;
302- return 0 ;
304+ this .z = midpoint .z ();
305+ return 0 ;
303306 }
304307
305308 /**
0 commit comments