Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix strip geo bug and new uRwell position #75

Closed
wants to merge 2 commits into from
Closed
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 @@ -43,7 +43,7 @@ public class URWellConstants {
"support_skin1_g10", "support_honeycomb_nomex", "support_skin2_g10"};

// URWELL position in the CLAS12 frame
public final static double TGT2DC0 = 228.078; // cm
public final static double TGT2DC0 = 230.078; // cm
// public final static double URWELL2DC0 = 2; // cm
public final static double URWELL2DC0[] = new double[NMAXREGIONS];
public final static double DIST2TGT[] = new double[NMAXREGIONS];
Expand Down Expand Up @@ -116,7 +116,7 @@ public static synchronized void load( DatabaseConstantProvider cp )

for (int i=0; i<NMAXREGIONS; i++){

URWELL2DC0[NMAXREGIONS-i-1] = 2+i*2;
URWELL2DC0[NMAXREGIONS-i-1] = 2.2+i*2;
DIST2TGT[NMAXREGIONS-i-1] = (TGT2DC0-URWELL2DC0[NMAXREGIONS-i-1]);
W2TGT[NMAXREGIONS-i-1] = DIST2TGT[NMAXREGIONS-i-1]/Math.cos(Math.toRadians(THTILT-THMIN));
YMIN[NMAXREGIONS-i-1]= W2TGT[NMAXREGIONS-i-1]*Math.sin(Math.toRadians(THMIN)); // distance from the base chamber1 and beamline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ private Line3d createStrip(int sector, int layer, int strip) {

//strip straight line chamber reference frame -> y = mx +c;
double stereoAngle = URWellConstants.STEREOANGLE;
if (layer % 2 == 0) {
if (layer % 2 != 0) {
stereoAngle = -URWellConstants.STEREOANGLE;
}
double m = Math.tan(Math.toRadians(stereoAngle));
Expand Down Expand Up @@ -252,6 +252,32 @@ private Line3d createStrip(int sector, int layer, int strip) {
}
}

/**
* Provides the given strip line in the Chamber local frame
* @param region (1-2)
* @param sector (1-6)
* @param layer (1-4)
* @param strip (1-N)
* @return the 3D strip line as a Line3d
*/

private Line3d getChamberStrip(int region, int sector, int chamber, int layer, int strip) {


Line3d globalStrip = createStrip(sector, layer, strip);
Geant4Basic chamberVolume = factory.getChamberVolume(sector, chamber, layer, isProto);

Vector3d origin = chamberVolume.getGlobalTransform().invert().transform(globalStrip.origin());
Vector3d end = chamberVolume.getGlobalTransform().invert().transform(globalStrip.end());

Line3d localStrip = new Line3d(origin, end);


return localStrip;
}



/**
* Provides the given strip line in the sector local frame
* @param sector (1-6)
Expand Down Expand Up @@ -411,11 +437,19 @@ public static void main(String[] args) {

URWellGeant4Factory factory = new URWellGeant4Factory(cp,true,2);

URWellStripFactory factory2 = new URWellStripFactory(cp,false,1);
URWellStripFactory factory2 = new URWellStripFactory(cp,true,1);

Plane3D plane = factory2.getPlane(6, 1, 200);
System.out.println(plane.toString());

int strip =20;
System.out.println((strip) + " " + factory2.getLocalStripId(strip) + "\n" + factory2.getChamberStrip(1, 6,1,2,strip)) ;


// for(int istrip=0; istrip<factory2.getNStripSector(); istrip++) {
// System.out.println((istrip+1) + " " + factory2.getChamberIndex(istrip+1) + "\n" + factory2.getStrip(1, 1, istrip+1) + "\n" + factory2.getStrip(1, 2, istrip+1));
// }


}

Expand Down