|
| 1 | +package org.jlab.detector.geant4.v2.recoil; |
| 2 | + |
| 3 | + |
| 4 | +import org.jlab.detector.calib.utils.DatabaseConstantProvider; |
| 5 | +import org.jlab.geom.prim.Point3D; |
| 6 | + |
| 7 | + |
| 8 | +public class RecoilConstants { |
| 9 | + |
| 10 | + private final static String CCDBPATH = "/geometry/recoil/"; |
| 11 | + |
| 12 | + public final static int NMAXREGIONS = 3; //max number of regions |
| 13 | + public final static int NREGIONS = 3; //number of regions |
| 14 | + public final static int NSECTORS = 2; //number of sectors |
| 15 | + public final static int NLAYERS = 2; //number of layers |
| 16 | + public final static int NCHAMBERS = 1; //number of chambers in a sector |
| 17 | + |
| 18 | + public final static double HORIZONTHAL_OPENING_ANGLE = 34.; |
| 19 | + public final static double VERTICAL_OPENING_ANGLE = 50.; |
| 20 | + public final static double RADIUS[] = {33.5,55.5,79.5}; |
| 21 | + public final static double WIDTH[] = new double[NMAXREGIONS]; |
| 22 | + public final static double HEIGHT[] = new double[NMAXREGIONS]; |
| 23 | + |
| 24 | + public final static double THTILT = 0; // theta tilt (deg) |
| 25 | + /* public final static double XENLARGEMENT = 0.5; // cm |
| 26 | + public final static double YENLARGEMENT = 1.; // cm |
| 27 | + public final static double ZENLARGEMENT = 0.1; // cm |
| 28 | + |
| 29 | + // Sector geometrical parameters |
| 30 | + public final static double THOPEN = 34.; // opening angle between endplate planes (deg) |
| 31 | + public final static double THTILT = 0; // theta tilt (deg) |
| 32 | + public final static double THMIN = 4.694; // polar angle to the base of first chamber (deg) |
| 33 | + public final static double SECTORHEIGHT = 146.21; //height of each sector (cm) |
| 34 | + public final static double DX0CHAMBER0 = 5.197; // halfbase of chamber 1 (cm)*/ |
| 35 | + |
| 36 | + // Chamber volumes and materials (units are cm) |
| 37 | + public final static double[] CHAMBERVOLUMESTHICKNESS = {0.0025, 0.0005,0.3, // window |
| 38 | + 0.0025, 0.0005,0.4, // cathode |
| 39 | + 0.0005, 0.005, 0.0005, // uRWell + DlC |
| 40 | + 0.0005, 0.005, 0.0005, // Capacitive sharing layer1 |
| 41 | + 0.0005, 0.005, 0.0005, // Capacitive sharing layer2 |
| 42 | + 0.005, 0.0005,0.005, 0.005, 0.0005,0.005, 0.005, // Readout |
| 43 | + 0.0127, 0.3, 0.0125}; // support |
| 44 | + public final static String[] CHAMBERVOLUMESNAME = {"window_kapton", "window_Al", "window_gas", |
| 45 | + "cathode_kapton", "cathode_Al", "cathode_gas", |
| 46 | + "muRwell_Cu", "muRwell_kapton", "muRwell_dlc", |
| 47 | + "capa_sharing_layer1_glue","capa_sharing_layer1_Cr","capa_sharing_layer1_kapton", |
| 48 | + "capa_sharing_layer2_glue","capa_sharing_layer2_Cr","capa_sharing_layer2_kapton", |
| 49 | + "readout1_glue", "readout1_Cu", "readout1_kapton", "readout2_glue", "readout2_Cu", "readout2_kapton", "readout3_glue", |
| 50 | + "support_skin1_g10", "support_honeycomb_nomex", "support_skin2_g10"}; |
| 51 | + |
| 52 | + // URWELL position in the CLAS12 frame |
| 53 | + /* public final static double TGT2DC0 = 228.078; // cm |
| 54 | + // public final static double URWELL2DC0 = 2; // cm |
| 55 | + public final static double URWELL2DC0[] = new double[NMAXREGIONS]; |
| 56 | + public final static double DIST2TGT[] = new double[NMAXREGIONS]; |
| 57 | + public final static double W2TGT[] = new double[NMAXREGIONS];; |
| 58 | + public final static double YMIN[] = new double[NMAXREGIONS]; |
| 59 | + public final static double ZMIN[] = new double[NMAXREGIONS];*/ |
| 60 | + |
| 61 | + public final static double PITCH = 0.1 ; // cm |
| 62 | + public final static double STEREOANGLE = 90; // deg |
| 63 | + |
| 64 | + /* |
| 65 | + * @return String a path to a directory in CCDB of the format {@code "/geometry/detector/"} |
| 66 | + */ |
| 67 | + public static String getCcdbPath() |
| 68 | + { |
| 69 | + return CCDBPATH; |
| 70 | + } |
| 71 | + |
| 72 | + /** |
| 73 | + * Loads the the necessary tables for the URWELL geometry for a given DatabaseConstantProvider. |
| 74 | + * |
| 75 | + * @return DatabaseConstantProvider the same thing |
| 76 | + */ |
| 77 | + public static DatabaseConstantProvider connect( DatabaseConstantProvider cp ) |
| 78 | + { |
| 79 | + // cp.loadTable( CCDBPATH +"RWELL"); |
| 80 | + |
| 81 | + load(cp ); |
| 82 | + return cp; |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Reads all the necessary constants from CCDB into static variables. |
| 87 | + * Please use a DatabaseConstantProvider to access CCDB and load the following tables: |
| 88 | + * @param cp a ConstantProvider that has loaded the necessary tables |
| 89 | + */ |
| 90 | + |
| 91 | + public static synchronized void load( DatabaseConstantProvider cp ) |
| 92 | + { |
| 93 | + // read constants from svt table |
| 94 | +// NREGIONS = cp.getInteger( CCDBPATH+"svt/nRegions", 0 ); |
| 95 | + |
| 96 | + for (int i=0; i<NMAXREGIONS; i++){ |
| 97 | + |
| 98 | +/* URWELL2DC0[i] = -2.+i*1.3; |
| 99 | + DIST2TGT[i] = (TGT2DC0+URWELL2DC0[i]); |
| 100 | + W2TGT[i] = DIST2TGT[i]/Math.cos(Math.toRadians(THTILT-THMIN)); |
| 101 | + YMIN[i]= W2TGT[i]*Math.sin(Math.toRadians(THMIN)); // distance from the base chamber1 and beamline |
| 102 | + ZMIN[i] = W2TGT[i]*Math.cos(Math.toRadians(THMIN)); |
| 103 | + */ |
| 104 | + WIDTH[i]=2.*RADIUS[i]*Math.sin(Math.toRadians(HORIZONTHAL_OPENING_ANGLE)/2); |
| 105 | + HEIGHT[i]=RADIUS[i]*Math.tan(Math.toRadians(VERTICAL_OPENING_ANGLE)/2); |
| 106 | + } |
| 107 | + } |
| 108 | +} |
0 commit comments