Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
*
Expand All @@ -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;
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
}
}
Expand All @@ -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) {
Expand All @@ -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;
}
}
Expand Down Expand Up @@ -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;
}

/**
Expand Down