StRrsMaker/StRichGeometryDb.cxx

00001 /******************************************************************* 00002 * $Id: StRichGeometryDb.cxx,v 2.6 2002/02/22 18:37:18 dunlop Exp $ 00003 * 00004 * Description: 00005 * 00006 ******************************************************************* 00007 * $Log: StRichGeometryDb.cxx,v $ 00008 * Revision 2.6 2002/02/22 18:37:18 dunlop 00009 * adjusted production version as short-term fix 00010 * 00011 * Revision 2.5 2001/10/04 22:16:48 dunlop 00012 * Fixing small mistake in new euler angles 00013 * 00014 * Revision 2.4 2001/10/04 19:37:43 dunlop 00015 * Modification to fill in year 2001 information. 00016 * Has TPC in global coordinates + small shift + mod to gap in x and y to match 00017 * machine drawings 00018 * 00019 * Revision 2.3 2001/08/22 16:42:59 lasiuk 00020 * data base functionality to check library environment variable 00021 * 00022 * Revision 2.2 2000/11/21 21:40:45 dunlop 00023 * Tweak for ExB effects 00024 * 00025 * Revision 2.1 2000/10/20 23:25:16 dunlop 00026 * Fine tune for P00hi 00027 * 00028 * Revision 2.0 2000/08/09 16:17:00 gans 00029 * Readded Files That were not added in last CVS. Cosmetic Changes, naming convention 00030 * for StRichDrawableT(foo) 00031 * 00032 * Revision 1.9 2000/05/19 15:15:08 lasiuk 00033 * modification of parameters for ideal geometry for simulation 00034 * normal vector and proximity gap 00035 * 00036 * Revision 1.8 2000/05/15 18:03:45 lasiuk 00037 * change survey parameter distance to pad plane. 00038 * Shift to .13 for t'formation routines. (gjk) 00039 * 00040 * Revision 1.7 2000/03/17 14:54:39 lasiuk 00041 * Large scale revisions after ROOT dependent memory leak 00042 * 00043 * Revision 1.6 2000/03/12 22:18:45 lasiuk 00044 * add from materials Db 00045 * add normal vector value 00046 * 00047 * Revision 1.5 2000/02/29 18:25:46 lasiuk 00048 * change radial placement of detector 00049 * 00050 * Revision 1.4 2000/02/12 21:55:44 lasiuk 00051 * Wire position adjustment 00052 * 00053 * Revision 1.3 2000/02/08 16:26:01 lasiuk 00054 * rmove vector and StGlobals from Interface. 00055 * allocate space for survey parameters 00056 * calculate sector origins and pad corner positions 00057 * 00058 * Revision 1.2 2000/01/25 22:02:20 lasiuk 00059 * Second Revision 00060 * 00061 * Revision 1.1 2000/01/18 21:32:02 lasiuk 00062 * Initial Revision 00063 * 00064 *******************************************************************/ 00065 #include <stdlib.h> 00066 #include "SystemOfUnits.h" 00067 #ifndef ST_NO_NAMESPACES 00068 using namespace units; 00069 #endif 00070 00071 #include "StRichGeometryDb.h" 00072 00073 StRichGeometryDb* StRichGeometryDb::p2Db = 0; 00074 00075 StRichGeometryDb::StRichGeometryDb() 00076 : quads(5), quadsOrigin(5) 00077 { 00078 //StRichGeometryDb::p2Db = this; // access to current instance 00079 00080 //star_fill(); 00081 my_fill(); 00082 } 00083 00084 StRichGeometryDb::~StRichGeometryDb() 00085 { 00086 delete p2Db; 00087 } 00088 void StRichGeometryDb::my_fill() 00089 { 00090 mVersion = 1.0; 00091 00092 // JCD Changed 10/4/2001 to match machine drawings 00093 quad_gap_x = 30.0 * millimeter; // verified 00094 quad_gap_y = 29.8 * millimeter; 00095 00096 wire_spacing = 4.2 * millimeter; // verified 00097 number_of_wires = 192; // verified 00098 00099 pad_side_x = 7.5 * millimeter; // verified 00100 pad_side_y = 7.9 * millimeter; // verified 00101 pad_pitch = 8.0 * millimeter; 00102 row_pitch = 8.4 * millimeter; 00103 pad_spacing = 0.5 * millimeter; // verified 00104 row_spacing = 0.5 * millimeter; 00105 00106 n_pad_x = 80; // verified 00107 n_pad_y = 48; // verified 00108 00109 mNumberOfPadsInaColumn = 96; 00110 mNumberOfPadsInaRow = 160; 00111 00112 number_of_pads = 15360; // verified 00113 00114 // Detector Parameters 00115 length = 1310 * millimeter; // verified 00116 width = 836 * millimeter; // verified 00117 height = 2 * millimeter; // verified 00118 00119 // 00120 // Survey Geometry 00121 // mInclinationAngle = 30. * degree; 00122 //mRadialDistanceToRich = 242.925 * centimeter; 00123 // change from gjk (May 15,2000) 00124 //mRadialDistanceToRich = 243.130 *centimeter; 00125 // Survey Info from jcd (July,10 2000) 00126 // mRadialDistanceToRich = 240.1246 *centimeter; 00127 // 00128 00129 // Calculate the positions of the uppermost left had 00130 // corner pads in the pad plane quadrant. Located in 00131 // StRichGeometryDbInterface.cxx! 00132 00133 // 00134 // Do not use units here, they are already used! 00135 // 00136 00137 //1.9 * centimeter; // verified 00138 quads[1].x0 = quadrantGapInX()/2. + padPitch()*0.5; 00139 quads[4].x0 = quads[1].x0; 00140 00141 // -65.1 * centimeter; // verified 00142 quads[2].x0 = -quadrantGapInX()/2. - padPitch()*(numberOfPadsInAQuadrantRow()-0.5); 00143 quads[3].x0 = quads[2].x0; 00144 00145 // 41.4 * centimeter; // verified 00146 quads[1].y0 = 00147 quadrantGapInY()/2 + rowPitch()*(numberOfRowsInAQuadrantColumn()-0.5); 00148 quads[2].y0 = quads[1].y0; 00149 00150 // -1.92 * centimeter; 00151 quads[3].y0 = -quadrantGapInY()/2. - rowPitch()*0.5; 00152 quads[4].y0 = quads[3].y0; 00153 00154 // 00155 // Origin of Quadrant Centers 00156 //(+/-33.5, +/- 21.65) 00157 quadsOrigin[1].x0 = 00158 quadrantGapInX()/2. + padPitch()*(numberOfPadsInAQuadrantRow()/2.); 00159 quadsOrigin[4].x0 = quadsOrigin[1].x0; 00160 00161 // -65.1 * centimeter; // verified 00162 quadsOrigin[2].x0 = 00163 -quadrantGapInX()/2. - padPitch()*(numberOfPadsInAQuadrantRow()/2.); 00164 quadsOrigin[3].x0 = quadsOrigin[2].x0; 00165 00166 // 41.4 * centimeter; // verified 00167 quadsOrigin[1].y0 = 00168 quadrantGapInY()/2 + rowPitch()*(numberOfRowsInAQuadrantColumn()/2.); 00169 quadsOrigin[2].y0 = quadsOrigin[1].y0; 00170 00171 // -1.92 * centimeter; 00172 quadsOrigin[3].y0 = 00173 -quadrantGapInY()/2. - rowPitch()*(numberOfRowsInAQuadrantColumn()/2.); 00174 quadsOrigin[4].y0 = quadsOrigin[3].y0; 00175 00176 // 00177 // First wire position in x 00178 //41.61 * centimeter; // verified 00179 wire_y0[0] = quad_gap_y/2. + (n_pad_y - 0.5)*row_pitch + wire_spacing/2.; 00180 //-1.71 * centimeter; // verified 00181 wire_y0[1] = -quad_gap_y/2. - (0.5)*row_pitch + wire_spacing/2.; 00182 00183 mRadiatorDimension = StThreeVector<double>(131./2.,83.6/2.,1.)*centimeter; 00184 mQuartzDimension = StThreeVector<double>(131./2.,83.6/2.,.5)*centimeter; 00185 mPadPlaneDimension = StThreeVector<double>(131./2.,83.6/2.,0.)*centimeter; 00186 00187 //Change on July 14, 2000 to make switchable, use survey flexibility 00188 00189 mProximityGap = 8.*centimeter; 00190 00191 #ifdef RICH_SIM_GEOMETRY 00192 00193 // 00194 // This is ideal geometry for historical reasons only 00195 // 00196 // Cylindrical coordinates: 5 o'clock = -60 degrees 00197 // 00198 cout << "StRichGeometryDB::my_fill() use ideal" << endl; 00199 mLocalOriginAngle = -60. * degree; 00200 mLocalOriginR = 243.13 * centimeter; 00201 mLocalOriginZ = 0. * centimeter; 00202 00203 mLocalAngleZ = 30. * degree; 00204 mLocalAngleY = 0. * degree; 00205 mLocalAngleX = 0. * degree; 00206 00207 #else 00208 00209 // 00210 // this would be so much easier with 00211 // strings, but... 00212 // 00213 const char* starVersion = getenv("STAR_VERSION"); 00214 cout << "starVersion= " << starVersion << endl; 00215 00216 if(strstr(starVersion, "00")) { 00217 cout << "Year 2000 Geometry: " << endl; 00218 this->fill2000(); 00219 } 00220 else if(strstr(starVersion, "01he") || strstr(starVersion, "01e")) { 00221 cout << "Year 2000 Geometry 2nd production: " << endl; 00222 this->fill2001he(); 00223 } 00224 else if(strstr(starVersion, "01")||strstr(starVersion, "DEV")||strstr(starVersion,"02")) { 00225 cout << "Year 2001 Geometry: " << endl; 00226 this->fill2001(); 00227 } 00228 else { 00229 cout << "Warning:\n"; 00230 cout << "\tStRichGeometry::my_fill()\n"; 00231 cout << "\tUnknown starVersion: " << starVersion << endl; 00232 cout << "\tUse Year 2001 Geometry" << endl; 00233 this->fill2001(); 00234 } 00235 00236 mNormalVectorToPadPlane = 00237 StThreeVector<double>( 00238 (cos(mLocalAngleZ)*sin(mLocalAngleY)*sin(mLocalAngleX) 00239 - sin(mLocalAngleZ) * cos(mLocalAngleX)), 00240 (sin(mLocalAngleZ)*sin(mLocalAngleY)*sin(mLocalAngleX) 00241 + cos(mLocalAngleZ)*cos(mLocalAngleX)), 00242 (cos(mLocalAngleY)*sin(mLocalAngleX)) 00243 ); 00244 00245 #endif 00246 00247 } 00248 00249 00250 void StRichGeometryDb::fill2000() { 00251 00252 // 00253 // This is the standard 2000 geometry that 00254 // was used for the 2000 november-december 00255 // production 00256 // 00257 // Euler-like angles 00258 // 00259 00260 mLocalAngleX = -0.0200353082209942 * degree ; 00261 mLocalAngleY = 0.037884454328129 * degree ; 00262 mLocalAngleZ = 29.8171493344754 * degree ; 00263 00264 // 00265 // Cylindrical coordinates: 5 o'clock = -60 degrees 00266 // mLocalOriginAngle = -59.9911296661538 * degree ; 00267 // mLocalOriginR = 240.126958857466 * centimeter ; 00268 // mLocalOriginZ = -0.558878974855719 * centimeter ; 00269 // local shift of (0.25,0.17,-0.1) 00270 // 00271 00272 mLocalOriginAngle = -59.9506239157014*degree; 00273 mLocalOriginR = 240.22755151829*centimeter; 00274 mLocalOriginZ = -0.3089772 * centimeter; 00275 } 00276 00277 void StRichGeometryDb::fill2001he() { 00278 00279 cout << "*******************WARNING ************************\a\a" << endl; 00280 cout << "\tStRichGeometryDb::fill2001he()\n"; 00281 cout << "\tNo Geometry defined for year 2001he just yet\n"; 00282 cout << "\tThis is the Year 2000 data produced in the spring/summer 2001\n"; 00283 cout << "\tUsing Year 2000" << endl; 00284 this->fill2000(); 00285 00286 // 00287 // 2001 Survey Geometry 00288 // Euler-like rotations 00289 // 00290 00291 //mLocalAngleX = 00292 //mLocalAngleY = 00293 //mLocalAngleZ = 00294 00295 //mLocalOriginAngle = 00296 //mLocalOriginR = 00297 //mLocalOriginZ = 00298 00299 } 00300 void StRichGeometryDb::fill2001() { 00301 00302 cout << "\tStRichGeometryDb::fill2001()\n"; 00303 // production 00304 // 00305 // Euler-like angles 00306 // 00307 // Use exact from survey 00308 mLocalAngleX = -0.0200353082209942 * degree ; 00309 mLocalAngleY = 0.037884454328129 * degree ; 00310 mLocalAngleZ = 29.8171493344754 * degree ; 00311 // 00312 // P00hm + tpc local->global + (0.03,-0.025,0) local 00313 mLocalOriginAngle = -60.0233755889891 * degree ; 00314 mLocalOriginR = 240.160406174684 * centimeter ; 00315 mLocalOriginZ = -0.470960678181733 * centimeter ; 00316 cout << "mLocalOriginAngle = " << mLocalOriginAngle/degree << endl; 00317 cout << "mLocalOriginR = " << mLocalOriginR/centimeter << endl; 00318 cout << "mLocalOriginZ = " << mLocalOriginZ/centimeter << endl; 00319 00320 00321 } 00322 00323 00324 StRichGeometryDb* StRichGeometryDb::getDb() 00325 { 00326 if(!p2Db) 00327 p2Db = new StRichGeometryDb(); 00328 00329 return p2Db; 00330 } 00331 00332 void StRichGeometryDb::print(ostream& os) const 00333 { 00334 os << "**************** StRichGeometryDb::print() ****************" << endl; 00335 os << "Detector:" << endl; 00336 00337 os << " Detector Length= " << (detectorLength()/centimeter) << " cm" << endl; 00338 os << " Detector Width= " << (detectorWidth()/centimeter) << " cm\n" << endl; 00339 00340 os << " (Xo, Yo) cm (Corner Pad)" << endl; 00341 os << " (" << (quadrantX0(2)/centimeter) << "," << (quadrantY0(2)/centimeter) << ") "; 00342 os << " (" << (quadrantX0(1)/centimeter) << "," << (quadrantY0(1)/centimeter) << ")" << endl; 00343 os << " (" << (quadrantX0(3)/centimeter) << "," << (quadrantY0(3)/centimeter) << ") "; 00344 os << "(" << (quadrantX0(4)/centimeter) << "," << (quadrantY0(4)/centimeter) << ")" << endl; 00345 00346 os << "\nQuadrant Origins" << endl; 00347 os << " (" << (quadrantXOrigin(2)/centimeter) << "," << (quadrantYOrigin(2)/centimeter) << ") "; 00348 os << " (" << (quadrantXOrigin(1)/centimeter) << "," << (quadrantYOrigin(1)/centimeter) << ")" << endl; 00349 os << " (" << (quadrantXOrigin(3)/centimeter) << "," << (quadrantYOrigin(3)/centimeter) << ") "; 00350 os << "(" << (quadrantXOrigin(4)/centimeter) << "," << (quadrantYOrigin(4)/centimeter) << ")\n" << endl; 00351 00352 os << "Quad Gap (x)= " << (quadrantGapInX()/millimeter) << " mm" << endl; 00353 os << "Quad Gap (y)= " << (quadrantGapInY()/millimeter) << " mm" << endl; 00354 00355 os << endl; 00356 os << "radiator Dimension: " << (radiatorDimension()/centimeter) << " cm" << endl; 00357 os << "quartz Dimension: " << (quartzDimension()/centimeter) << " cm" << endl; 00358 os << "pad Plane Dimension: " << (padPlaneDimension()/centimeter) << " cm" << endl; 00359 os << "Proximity Gap: " << (proximityGap()/centimeter) << " cm" << endl; 00360 00361 os << endl; 00362 os << "Total # of Pads: " << (numberOfPads()) << endl; 00363 os << " Complete Row: " << (numberOfPadsInARow()) << endl; 00364 os << " Complete Column: " << (numberOfRowsInAColumn()) << endl; 00365 os << " Quadrant Row: " << (numberOfPadsInAQuadrantRow()) << endl; 00366 os << " Quadrant Column: " << (numberOfRowsInAQuadrantColumn()) << endl; 00367 00368 os << endl; 00369 os << "Pad Width= " << (padWidth()/millimeter) << " mm" << endl; 00370 os << "Pad Length= " << (padLength()/millimeter) << " mm" << endl; 00371 os << "Pad Pitch= " << (padPitch()/millimeter) << " mm" << endl; 00372 os << "Row Pitch= " << (rowPitch()/millimeter) << " mm" << endl; 00373 os << "Pad Spacing= " << (padSpacing()/millimeter) << " mm" << endl; 00374 os << "Row Spacing= " << (rowSpacing()/millimeter) << " mm" << endl; 00375 00376 os << endl; 00377 os << "Number of Wires: " << (numberOfWires()) << endl; 00378 os << "Wire Pitch= " << (wirePitch()/millimeter) << " mm" << endl; 00379 os << "Wire OffSet (+y)= " << (firstWirePositionInY(1)/centimeter) << " cm" << endl; 00380 os << "Wire OffSet (-y)= " << (firstWirePositionInY(-1)/centimeter) << " cm" << endl; 00381 00382 os << endl; 00383 os << "AnodeToPadSpacing= " << (anodeToPadSpacing()/centimeter) << " cm" << endl; 00384 00385 00386 os << "\nGeometry for Local <-> Global:" << endl; 00387 os << "Origin in cylindrical coordinates:" << endl; 00388 os << "Radial distance = " << (localOriginR()/centimeter) << " cm" << endl; 00389 os << "Angle = " << (localOriginAngle()/degree) << " degrees" << endl; 00390 os << "Z position = " << (localOriginZ()/centimeter) << " cm" << endl; 00391 00392 os << "Euler-like angles: local in global = Rz * Ry * Rx * P(xyz->zxy)" << endl; 00393 os << "AngleX = " << (localAngleX()/degree) << " degrees" << endl; 00394 os << "AngleY = " << (localAngleY()/degree) << " degrees" << endl; 00395 os << "AngleZ = " << (localAngleZ()/degree) << " degrees" << endl; 00396 00397 os << "normal Vector: " << normalVectorToPadPlane() << endl; 00398 00399 os << "\n*************** End of Geometry Parameters **********************\n" << endl; 00400 }

Generated on Sun Mar 15 04:55:11 2009 for StRoot by doxygen 1.3.7