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 @@ -132,13 +132,13 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
for (int wireId = 0; wireId < numWires; wireId++) {

// The point given by (wx, wy, wz) is the midpoint of the current wire.
double wx = -R_layer * Math.sin(alphaW_layer * wireId);
double wy = -R_layer * Math.cos(alphaW_layer * wireId);
double wx = R_layer * Math.cos(alphaW_layer * wireId);
double wy = R_layer * Math.sin(alphaW_layer * wireId);

// Find the interesection of the current wire with the end-plate
// planes by construciting a long line that passes through the midpoint
double wx_end = -R_layer * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double wy_end = -R_layer * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double wx_end = R_layer * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double wy_end = R_layer * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
Line3D line = new Line3D(wx, wy, 0, wx_end, wy_end, zl);

Point3D lPoint = new Point3D();
Expand All @@ -150,31 +150,31 @@ public AlertDCLayer createLayer(ConstantProvider cp, int sectorId, int superlaye
// Do not change the code above. It is for signal wires positioning

// Construct the cell around the signal wires created above top
double px_0 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId);
double py_0 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId);
double px_1 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
double py_1 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
double px_2 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
double py_2 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
double px_3 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId);
double py_3 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId);
double px_4 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
double py_4 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
double px_5 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
double py_5 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
double px_0 = (R_layer + 2) * Math.cos(alphaW_layer * wireId);
double py_0 = (R_layer + 2) * Math.sin(alphaW_layer * wireId);
double px_1 = (R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
double py_1 = (R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
double px_2 = (R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2);
double py_2 = (R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2);
double px_3 = (R_layer - 2) * Math.cos(alphaW_layer * wireId);
double py_3 = (R_layer - 2) * Math.sin(alphaW_layer * wireId);
double px_4 = (R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
double py_4 = (R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
double px_5 = (R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2);
double py_5 = (R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2);
// bottom (do not forget to add the +20 deg. twist respect to the "straight" version)
double px_6 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double py_6 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double px_7 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_7 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_8 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_8 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_9 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double py_9 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double px_10 = -(R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_10 = -(R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_11 = -(R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_11 = -(R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_6 = (R_layer + 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double py_6 = (R_layer + 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double px_7 = (R_layer + 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_7 = (R_layer + 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_8 = (R_layer - 2) * Math.cos(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_8 = (R_layer - 2) * Math.sin(alphaW_layer * wireId + alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_9 = (R_layer - 2) * Math.cos(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double py_9 = (R_layer - 2) * Math.sin(alphaW_layer * wireId + thster * (Math.pow(-1, superlayerId)));
double px_10 = (R_layer - 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_10 = (R_layer - 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double px_11 = (R_layer + 2) * Math.cos(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));
double py_11 = (R_layer + 2) * Math.sin(alphaW_layer * wireId - alphaW_layer / 2 + thster * (Math.pow(-1, superlayerId)));

// Group into points with (x,y,z) coordinates
List<Point3D> firstF = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ private void wirePosition() {
R_layer = R_layer + DR_layer * (this.layerId-1);
double alphaW_layer = Math.toRadians(round / (numWires));
//should it be at z = 0? in which case, we need to account for the positive or negative stereo angle...
double wx = -R_layer * Math.sin(alphaW_layer * (this.wireId-1) + 0.5*thster * (Math.pow(-1, this.superLayerId-1)));
double wy = -R_layer * Math.cos(alphaW_layer * (this.wireId-1) + 0.5*thster * (Math.pow(-1, this.superLayerId-1)));
double wx = R_layer * Math.cos(alphaW_layer * (this.wireId-1) + 0.5*thster * (Math.pow(-1, this.superLayerId-1)));
double wy = R_layer * Math.sin(alphaW_layer * (this.wireId-1) + 0.5*thster * (Math.pow(-1, this.superLayerId-1)));

//System.out.println(" superlayer " + this.superLayerId + " layer " + this.layerId + " wire " + this.wireId + " R_layer " + R_layer + " wx " + wx + " wy " + wy);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ public Hit(int superLayer, int layer, int wire, int numWire, double r, double do

R_layer = R_layer + DR_layer * (this.layer-1);//OK
double alphaW_layer = Math.toRadians(round / (numWires));//OK
double wx = -R_layer * Math.sin(alphaW_layer * (this.wire-1));//OK
double wy = -R_layer * Math.cos(alphaW_layer * (this.wire-1));//OK
double wx = R_layer * Math.cos(alphaW_layer * (this.wire-1));//OK
double wy = R_layer * Math.sin(alphaW_layer * (this.wire-1));//OK

double wx_end = -R_layer * Math.sin(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
double wy_end = -R_layer * Math.cos(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
double wx_end = R_layer * Math.cos(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK
double wy_end = R_layer * Math.sin(alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)));//OK

this.phi = Math.atan2( (wy+wy_end)*0.5, (wx+wx_end)*0.5 );
//System.out.println(" superlayer " + this.superLayer + " layer " + this.layer + " wire " + this.wire + " wx " + wx + " wy " + wy + " wx_end " + wx_end + " wy_end " + wy_end + " phi " + this.phi);
Expand All @@ -113,11 +113,11 @@ public Hit(int superLayer, int layer, int wire, int numWire, double r, double do

//calculate the "virtual" left and right wires accounting for the DOCA
double deltaphi = Math.asin(this.doca/R_layer);
double wx_plus = -R_layer * Math.sin( alphaW_layer * (this.wire-1) - deltaphi );//OK
double wy_plus = -R_layer * Math.cos( alphaW_layer * (this.wire-1) - deltaphi );//OK
double wx_plus = R_layer * Math.cos( alphaW_layer * (this.wire-1) - deltaphi );//OK
double wy_plus = R_layer * Math.sin( alphaW_layer * (this.wire-1) - deltaphi );//OK

double wx_plus_end = -R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
double wy_plus_end = -R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
double wx_plus_end = R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK
double wy_plus_end = R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) - deltaphi );//OK

line = new Line3D(wx_plus, wy_plus, -zl/2, wx_plus_end, wy_plus_end, zl/2);
lPoint = new Point3D();
Expand All @@ -128,11 +128,11 @@ public Hit(int superLayer, int layer, int wire, int numWire, double r, double do
wireLine = new Line3D(lPoint, rPoint);
this.line3D_plus = wireLine;

double wx_minus = -R_layer * Math.sin( alphaW_layer * (this.wire-1) + deltaphi );//OK
double wy_minus = -R_layer * Math.cos( alphaW_layer * (this.wire-1) + deltaphi );//OK
double wx_minus = R_layer * Math.cos( alphaW_layer * (this.wire-1) + deltaphi );//OK
double wy_minus = R_layer * Math.sin( alphaW_layer * (this.wire-1) + deltaphi );//OK

double wx_minus_end = -R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
double wy_minus_end = -R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
double wx_minus_end = R_layer * Math.cos( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK
double wy_minus_end = R_layer * Math.sin( alphaW_layer * (this.wire-1) + thster * (Math.pow(-1, this.superLayer-1)) + deltaphi );//OK

line = new Line3D(wx_minus, wy_minus, -zl/2, wx_minus_end, wy_minus_end, zl/2);
lPoint = new Point3D();
Expand Down