diff --git a/common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/ATOF/AlertTOFFactory.java b/common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/ATOF/AlertTOFFactory.java index 8b0ff6f5ff..7bdc686481 100644 --- a/common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/ATOF/AlertTOFFactory.java +++ b/common-tools/clas-geometry/src/main/java/org/jlab/geom/detector/alert/ATOF/AlertTOFFactory.java @@ -135,8 +135,8 @@ public AlertTOFLayer createLayer(ConstantProvider cp, int sectorId, int superlay for (int padId = 0; padId < current_ncomponents; padId++) { //Component index increases with increasing z - double len_b = padId * pad_z + padId * gap_pad_z - atof_length/2; // back paddle plan, centered at z = 0 - double len_f = len_b + pad_z - atof_length/2; // front paddle plan, centered at z = 0 + double len_b = padId * pad_z + padId * gap_pad_z;// back paddle plan + double len_f = len_b + pad_z;// front paddle plan Point3D p0 = new Point3D(-dR / 2, -widthBl / 2, len_f); Point3D p1 = new Point3D(dR / 2, -widthTl / 2, len_f); @@ -162,8 +162,8 @@ public AlertTOFLayer createLayer(ConstantProvider cp, int sectorId, int superlay xoffset = (Rl + dR / 2) * Math.cos(Math.toRadians(current_angle_deg)); yoffset = (Rl + dR / 2) * Math.sin(Math.toRadians(current_angle_deg)); - - Paddle.translateXYZ(xoffset, yoffset, 0); + + Paddle.translateXYZ(xoffset, yoffset, - atof_length/2); //centering at z=0 // Add the paddles to the list layer.addComponent(Paddle); diff --git a/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java b/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java index f1ce4751d9..8277987701 100644 --- a/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java +++ b/reconstruction/alert/src/main/java/org/jlab/rec/atof/hit/ATOFHit.java @@ -3,6 +3,8 @@ import org.jlab.geom.base.*; import org.jlab.geom.prim.Point3D; import org.jlab.rec.atof.constants.Parameters; +import java.util.logging.Level; +import java.util.logging.Logger; /** * @@ -15,6 +17,8 @@ */ public class ATOFHit { + static final Logger LOGGER = Logger.getLogger(ATOFHit.class.getName()); + private int sector, layer, component, order; private int tdc, tot; private double time, energy, x, y, z; @@ -182,7 +186,7 @@ public final String makeType() { public final int convertTdcToTime() { double tdc2time, veff, distance_to_sipm; if (null == this.type) { - System.out.print("Null hit type, cannot convert tdc to time."); + LOGGER.finest("Null hit type, cannot convert tdc to time."); return 1; } else { switch (this.type) { @@ -205,11 +209,11 @@ public final int convertTdcToTime() { distance_to_sipm = 0; } case "bar" -> { - System.out.print("Bar hit type, cannot convert tdc to time."); + LOGGER.finest("Bar hit type, cannot convert tdc to time."); return 1; } default -> { - System.out.print("Undefined hit type, cannot convert tdc to time."); + LOGGER.finest("Undefined hit type, cannot convert tdc to time."); return 1; } } @@ -230,7 +234,7 @@ public final int convertTdcToTime() { public final int convertTotToEnergy() { double tot2energy; if (null == this.type) { - System.out.print("Null hit type, cannot convert tot to energy."); + LOGGER.finest("Null hit type, cannot convert tot to energy."); return 1; } else { switch (this.type) { @@ -254,11 +258,11 @@ public final int convertTotToEnergy() { this.energy = tot2energy * this.tot; } case "bar" -> { - System.out.print("Bar hit type, cannot convert tot to energy."); + LOGGER.finest("Bar hit type, cannot convert tot to energy."); return 1; } default -> { - System.out.print("Undefined hit type, cannot convert tot to energy."); + LOGGER.finest("Undefined hit type, cannot convert tot to energy."); return 1; } } @@ -294,12 +298,11 @@ public final int convertSLCToXYZ(Detector atof) { Component comp = atof.getSector(this.sector).getSuperlayer(sl).getLayer(this.layer).getComponent(this.component); Point3D midpoint = comp.getMidpoint(); //Midpoints defined in the system were z=0 is the upstream end of the atof - //Translation to the system were z=0 is the center of the atof //Units are mm this.x = midpoint.x(); this.y = midpoint.y(); - this.z = midpoint.z() - Parameters.LENGTH_ATOF / 2.; - return 0; + this.z = midpoint.z(); + return 0; } /**