1082{
1083
1084 if(m_turnOffField == true) {
1085 newb[0] = 0.;
1086 newb[1] = 0.;
1087 newb[2] = 0.;
1088#ifndef BEAN
1089 return StatusCode::SUCCESS;
1090#else
1091 return true;
1092#endif
1093 }
1094
1095
1096 if(m_uniField) {
1098#ifndef BEAN
1099 return StatusCode::SUCCESS;
1100#else
1101 return true;
1102#endif
1103 }
1104
1105
1106
1107 double new_x = -newr.x();
1108 double new_y = newr.y();
1109 double new_z = -newr.z();
1115
1116 if(-2.1*m<r.z() && r.z()<2.1*m && -1.8*m<r.x() && r.x()<1.8*m && -1.8*m<r.y() && r.y()<1.8*m)
1117 {
1118 if(-1.2*m<r.z()&&r.z()<1.2*m&&0*m<=std::sqrt(r.x()*r.x()+r.y()*r.y())&&std::sqrt(r.x()*r.x()+r.y()*r.y())<0.9*m)
1119
1120 {
1121 this->fieldGrid( r,
b );
1122 }
1123 else
1124 {
1125 this->fieldGrid_TE( r,
b );
1126 }
1127 }
1128 if((fabs(r.z())<=1970*mm && sqrt(r.x()*r.x()+r.y()*r.y()) >= 1740*mm) || (fabs(r.z())>=2050*mm))
1129 {
1132 int part = 0, layer = 0, mat = 0;
1133 double theta;
1134 bool ifbar = false;
1135 bool ifend = false;
1136 if(r.x()!=0.){
1137 theta = atan2(fabs(r.y()),fabs(r.x()));
1138 if(0<=theta&&theta<
pi/8) {
1139 mr[0] = fabs(r.x()); mr[1] = -fabs(r.y()); mr[2] = fabs(r.z());
1140 if(mr[2]<=1970*mm&&1740*mm<=mr[0]&&mr[0]<=2620*mm){
1141 part = 1;
1142 if(1740*mm<=mr[0]&&mr[0]<1770*mm) { layer = 0; mat = 0; }
1143 if(1770*mm<=mr[0]&&mr[0]<1810*mm) { layer = 0; mat = 1; }
1144 if(1810*mm<=mr[0]&&mr[0]<1840*mm) { layer = 1; mat = 0; }
1145 if(1840*mm<=mr[0]&&mr[0]<1880*mm) { layer = 1; mat = 1; }
1146 if(1880*mm<=mr[0]&&mr[0]<1910*mm) { layer = 2; mat = 0; }
1147 if(1910*mm<=mr[0]&&mr[0]<1950*mm) { layer = 2; mat = 1; }
1148 if(1950*mm<=mr[0]&&mr[0]<1990*mm) { layer = 3; mat = 0; }
1149 if(1990*mm<=mr[0]&&mr[0]<2030*mm) { layer = 3; mat = 1; }
1150 if(2030*mm<=mr[0]&&mr[0]<2070*mm) { layer = 4; mat = 0; }
1151 if(2070*mm<=mr[0]&&mr[0]<2110*mm) { layer = 4; mat = 1; }
1152 if(2110*mm<=mr[0]&&mr[0]<2190*mm) { layer = 5; mat = 0; }
1153 if(2190*mm<=mr[0]&&mr[0]<2230*mm) { layer = 5; mat = 1; }
1154 if(2230*mm<=mr[0]&&mr[0]<2310*mm) { layer = 6; mat = 0; }
1155 if(2310*mm<=mr[0]&&mr[0]<2350*mm) { layer = 6; mat = 1; }
1156 if(2350*mm<=mr[0]&&mr[0]<2430*mm) { layer = 7; mat = 0; }
1157 if(2430*mm<=mr[0]&&mr[0]<2470*mm) { layer = 7; mat = 1; }
1158 if(2470*mm<=mr[0]&&mr[0]<=2620*mm) { layer = 8; mat = 0; }
1163 ifbar = true;
1164 }
1165 if(2050*mm<=mr[2]&&mr[2]<2090*mm&&1034*mm<=mr[0]&&mr[0]<=2500*mm){
1166 part = 0; layer = 0; mat = 0;
1171 ifend = true;
1172 }
1173 if(2090*mm<=mr[2]&&mr[2]<2130*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1174 part = 0; layer = 0; mat = 1;
1179 ifend = true;
1180 }
1181 if(2130*mm<=mr[2]&&mr[2]<2170*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1182 part = 0; layer = 1; mat = 0;
1187 ifend = true;
1188 }
1189 if(2170*mm<=mr[2]&&mr[2]<2210*mm&&1100*mm<=mr[0]&&mr[0]<=2500*mm) {
1190 part = 0; layer = 1; mat = 1;
1195 ifend = true;
1196 }
1197 if(2210*mm<=mr[2]&&mr[2]<2240*mm&&1100*mm<mr[0]&&mr[0]<=2500*mm) {
1198 part = 0; layer = 2; mat = 0;
1203 ifend = true;
1204 }
1205 if(2240*mm<=mr[2]&&mr[2]<2280*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1206 part = 0; layer = 2; mat = 1;
1211 ifend = true;
1212 }
1213 if(2280*mm<=mr[2]&&mr[2]<2310*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1214 part = 0; layer = 3; mat = 0;
1219 ifend = true;
1220 }
1221 if(2310*mm<=mr[2]&&mr[2]<2350*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1222 part = 0; layer = 3; mat = 1;
1227 ifend = true;
1228 }
1229 if(2350*mm<=mr[2]&&mr[2]<2380*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1230 part = 0; layer = 4; mat = 0;
1235 ifend = true;
1236 }
1237 if(2380*mm<=mr[2]&&mr[2]<2420*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1238 part = 0; layer = 4; mat = 1;
1243 ifend = true;
1244 }
1245 if(2420*mm<=mr[2]&&mr[2]<2470*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1246 part = 0; layer = 5; mat = 0;
1251 ifend = true;
1252 }
1253 if(2470*mm<=mr[2]&&mr[2]<2510*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1254 part = 0; layer = 5; mat =1;
1259 ifend = true;
1260 }
1261 if(2510*mm<=mr[2]&&mr[2]<2590*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1262 part = 0; layer = 6; mat = 0;
1267 ifend = true;
1268 }
1269 if(2590*mm<=mr[2]&&mr[2]<2630*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1270 part = 0; layer = 6; mat = 1;
1275 ifend = true;
1276 }
1277 if(2630*mm<=mr[2]&&mr[2]<2710*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1278 part = 0; layer = 7; mat = 0;
1283 ifend = true;
1284 }
1285 if(2710*mm<=mr[2]&&mr[2]<2750*mm&&1362*mm<=mr[0]&&mr[0]<=2500*mm) {
1286 part = 0; layer = 7; mat = 1;
1291 ifend = true;
1292 }
1293 if(2750*mm<=mr[2]&&mr[2]<=2800*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1294 part = 0; layer = 8; mat = 0;
1299 ifend = true;
1300 }
1301 }
1302 if(
pi/8<=theta&&theta<
pi/4) {
1303 mr[0] = fabs(r.x())*
cos(
pi/4)+fabs(r.y())*
sin(
pi/4);
1304 mr[1] = -fabs(r.x())*
sin(
pi/4)+fabs(r.y())*
cos(
pi/4);
1305 mr[2] = fabs(r.z());
1306 if(mr[2]<=1970*mm&&1740*mm<=mr[0]&&mr[0]<=2620*mm) {
1307 part = 1;
1308 if(1740*mm<=mr[0]&&mr[0]<1770*mm) { layer = 0; mat = 0; }
1309 if(1770*mm<=mr[0]&&mr[0]<1810*mm) { layer = 0; mat = 1; }
1310 if(1810*mm<=mr[0]&&mr[0]<1840*mm) { layer = 1; mat = 0; }
1311 if(1840*mm<=mr[0]&&mr[0]<1880*mm) { layer = 1; mat = 1; }
1312 if(1880*mm<=mr[0]&&mr[0]<1910*mm) { layer = 2; mat = 0; }
1313 if(1910*mm<=mr[0]&&mr[0]<1950*mm) { layer = 2; mat = 1; }
1314 if(1950*mm<=mr[0]&&mr[0]<1990*mm) { layer = 3; mat = 0; }
1315 if(1990*mm<=mr[0]&&mr[0]<2030*mm) { layer = 3; mat = 1; }
1316 if(2030*mm<=mr[0]&&mr[0]<2070*mm) { layer = 4; mat = 0; }
1317 if(2070*mm<=mr[0]&&mr[0]<2110*mm) { layer = 4; mat = 1; }
1318 if(2110*mm<=mr[0]&&mr[0]<2190*mm) { layer = 5; mat = 0; }
1319 if(2190*mm<=mr[0]&&mr[0]<2230*mm) { layer = 5; mat = 1; }
1320 if(2230*mm<=mr[0]&&mr[0]<2310*mm) { layer = 6; mat = 0; }
1321 if(2310*mm<=mr[0]&&mr[0]<2350*mm) { layer = 6; mat = 1; }
1322 if(2350*mm<=mr[0]&&mr[0]<2430*mm) { layer = 7; mat = 0; }
1323 if(2430*mm<=mr[0]&&mr[0]<2470*mm) { layer = 7; mat = 1; }
1324 if(2470*mm<=mr[0]&&mr[0]<=2620*mm) { layer = 8; mat = 0; }
1329 ifbar = true;
1330 }
1331 if(2050*mm<=mr[2]&&mr[2]<2090*mm&&1034*mm<=mr[0]&&mr[0]<=2500*mm){
1332 part = 0; layer = 0; mat = 0;
1337 ifend = true;
1338 }
1339 if(2090*mm<=mr[2]&&mr[2]<2130*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1340 part = 0; layer = 0; mat = 1;
1345 ifend = true;
1346 }
1347 if(2130*mm<=mr[2]&&mr[2]<2170*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1348 part = 0; layer = 1; mat = 0;
1353 ifend = true;
1354 }
1355 if(2170*mm<=mr[2]&&mr[2]<2210*mm&&1100*mm<=mr[0]&&mr[0]<=2500*mm) {
1356 part = 0; layer = 1; mat = 1;
1361 ifend = true;
1362 }
1363 if(2210*mm<=mr[2]&&mr[2]<2240*mm&&1100*mm<mr[0]&&mr[0]<=2500*mm) {
1364 part = 0; layer = 2; mat = 0;
1369 ifend = true;
1370 }
1371 if(2240*mm<=mr[2]&&mr[2]<2280*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1372 part = 0; layer = 2; mat = 1;
1377 ifend = true;
1378 }
1379 if(2280*mm<=mr[2]&&mr[2]<2310*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1380 part = 0; layer = 3; mat = 0;
1385 ifend = true;
1386 }
1387 if(2310*mm<=mr[2]&&mr[2]<2350*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1388 part = 0; layer = 3; mat = 1;
1393 ifend = true;
1394 }
1395 if(2350*mm<=mr[2]&&mr[2]<2380*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1396 part = 0; layer = 4; mat = 0;
1401 ifend = true;
1402 }
1403 if(2380*mm<=mr[2]&&mr[2]<2420*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1404 part = 0; layer = 4; mat = 1;
1409 ifend = true;
1410 }
1411 if(2420*mm<=mr[2]&&mr[2]<2470*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1412 part = 0; layer = 5; mat = 0;
1417 ifend = true;
1418 }
1419 if(2470*mm<=mr[2]&&mr[2]<2510*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1420 part = 0; layer = 5; mat =1;
1425 ifend = true;
1426 }
1427 if(2510*mm<=mr[2]&&mr[2]<2590*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1428 part = 0; layer = 6; mat = 0;
1433 ifend = true;
1434 }
1435 if(2590*mm<=mr[2]&&mr[2]<2630*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1436 part = 0; layer = 6; mat = 1;
1441 ifend = true;
1442 }
1443 if(2630*mm<=mr[2]&&mr[2]<2710*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1444 part = 0; layer = 7; mat = 0;
1449 ifend = true;
1450 }
1451 if(2710*mm<=mr[2]&&mr[2]<2750*mm&&1362*mm<=mr[0]&&mr[0]<=2500*mm) {
1452 part = 0; layer = 7; mat = 1;
1457 ifend = true;
1458 }
1459 if(2750*mm<=mr[2]&&mr[2]<=2800*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1460 part = 0; layer = 8; mat = 0;
1465 ifend = true;
1466 }
1467 }
1468 if(
pi/4<=theta&&theta<3*
pi/8) {
1469 mr[0] = fabs(r.x())*
cos(
pi/4)+fabs(r.y())*
sin(
pi/4);
1470 mr[1] = fabs(r.x())*
sin(
pi/4)-fabs(r.y())*
cos(
pi/4);
1471 mr[2] = fabs(r.z());
1472 if(mr[2]<=1970*mm&&1740*mm<=mr[0]&&mr[0]<=2620*mm) {
1473 part = 1;
1474 if(1740*mm<=mr[0]&&mr[0]<1770*mm) { layer = 0; mat = 0; }
1475 if(1770*mm<=mr[0]&&mr[0]<1810*mm) { layer = 0; mat = 1; }
1476 if(1810*mm<=mr[0]&&mr[0]<1840*mm) { layer = 1; mat = 0; }
1477 if(1840*mm<=mr[0]&&mr[0]<1880*mm) { layer = 1; mat = 1; }
1478 if(1880*mm<=mr[0]&&mr[0]<1910*mm) { layer = 2; mat = 0; }
1479 if(1910*mm<=mr[0]&&mr[0]<1950*mm) { layer = 2; mat = 1; }
1480 if(1950*mm<=mr[0]&&mr[0]<1990*mm) { layer = 3; mat = 0; }
1481 if(1990*mm<=mr[0]&&mr[0]<2030*mm) { layer = 3; mat = 1; }
1482 if(2030*mm<=mr[0]&&mr[0]<2070*mm) { layer = 4; mat = 0; }
1483 if(2070*mm<=mr[0]&&mr[0]<2110*mm) { layer = 4; mat = 1; }
1484 if(2110*mm<=mr[0]&&mr[0]<2190*mm) { layer = 5; mat = 0; }
1485 if(2190*mm<=mr[0]&&mr[0]<2230*mm) { layer = 5; mat = 1; }
1486 if(2230*mm<=mr[0]&&mr[0]<2310*mm) { layer = 6; mat = 0; }
1487 if(2310*mm<=mr[0]&&mr[0]<2350*mm) { layer = 6; mat = 1; }
1488 if(2350*mm<=mr[0]&&mr[0]<2430*mm) { layer = 7; mat = 0; }
1489 if(2430*mm<=mr[0]&&mr[0]<2470*mm) { layer = 7; mat = 1; }
1490 if(2470*mm<=mr[0]&&mr[0]<=2620*mm) { layer = 8; mat = 0; }
1495 ifbar = true;
1496 }
1497 if(2050*mm<=mr[2]&&mr[2]<2090*mm&&1034*mm<=mr[0]&&mr[0]<=2500*mm){
1498 part = 0; layer = 0; mat = 0;
1503 ifend = true;
1504 }
1505 if(2090*mm<=mr[2]&&mr[2]<2130*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1506 part = 0; layer = 0; mat = 1;
1511 ifend = true;
1512 }
1513 if(2130*mm<=mr[2]&&mr[2]<2170*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1514 part = 0; layer = 1; mat = 0;
1519 ifend = true;
1520 }
1521 if(2170*mm<=mr[2]&&mr[2]<2210*mm&&1100*mm<=mr[0]&&mr[0]<=2500*mm) {
1522 part = 0; layer = 1; mat = 1;
1527 ifend = true;
1528 }
1529 if(2210*mm<=mr[2]&&mr[2]<2240*mm&&1100*mm<mr[0]&&mr[0]<=2500*mm) {
1530 part = 0; layer = 2; mat = 0;
1535 ifend = true;
1536 }
1537 if(2240*mm<=mr[2]&&mr[2]<2280*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1538 part = 0; layer = 2; mat = 1;
1543 ifend = true;
1544 }
1545 if(2280*mm<=mr[2]&&mr[2]<2310*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1546 part = 0; layer = 3; mat = 0;
1551 ifend = true;
1552 }
1553 if(2310*mm<=mr[2]&&mr[2]<2350*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1554 part = 0; layer = 3; mat = 1;
1559 ifend = true;
1560 }
1561 if(2350*mm<=mr[2]&&mr[2]<2380*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1562 part = 0; layer = 4; mat = 0;
1567 ifend = true;
1568 }
1569 if(2380*mm<=mr[2]&&mr[2]<2420*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1570 part = 0; layer = 4; mat = 1;
1575 ifend = true;
1576 }
1577 if(2420*mm<=mr[2]&&mr[2]<2470*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1578 part = 0; layer = 5; mat = 0;
1583 ifend = true;
1584 }
1585 if(2470*mm<=mr[2]&&mr[2]<2510*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1586 part = 0; layer = 5; mat =1;
1591 ifend = true;
1592 }
1593 if(2510*mm<=mr[2]&&mr[2]<2590*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1594 part = 0; layer = 6; mat = 0;
1599 ifend = true;
1600 }
1601 if(2590*mm<=mr[2]&&mr[2]<2630*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1602 part = 0; layer = 6; mat = 1;
1607 ifend = true;
1608 }
1609 if(2630*mm<=mr[2]&&mr[2]<2710*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1610 part = 0; layer = 7; mat = 0;
1615 ifend = true;
1616 }
1617 if(2710*mm<=mr[2]&&mr[2]<2750*mm&&1362*mm<=mr[0]&&mr[0]<=2500*mm) {
1618 part = 0; layer = 7; mat = 1;
1623 ifend = true;
1624 }
1625 if(2750*mm<=mr[2]&&mr[2]<=2800*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1626 part = 0; layer = 8; mat = 0;
1631 ifend = true;
1632 }
1633 }
1634 if(3*
pi/8<=theta&&theta<
pi/2) {
1635 mr[0] = fabs(r.y()); mr[1] = -fabs(r.x()); mr[2] = fabs(r.z());
1636 if(mr[2]<=1970*mm&&1740*mm<=mr[0]&&mr[0]<=2620*mm) {
1637 part = 1;
1638 if(1740*mm<=mr[0]&&mr[0]<1770*mm) { layer = 0; mat = 0; }
1639 if(1770*mm<=mr[0]&&mr[0]<1810*mm) { layer = 0; mat = 1; }
1640 if(1810*mm<=mr[0]&&mr[0]<1840*mm) { layer = 1; mat = 0; }
1641 if(1840*mm<=mr[0]&&mr[0]<1880*mm) { layer = 1; mat = 1; }
1642 if(1880*mm<=mr[0]&&mr[0]<1910*mm) { layer = 2; mat = 0; }
1643 if(1910*mm<=mr[0]&&mr[0]<1950*mm) { layer = 2; mat = 1; }
1644 if(1950*mm<=mr[0]&&mr[0]<1990*mm) { layer = 3; mat = 0; }
1645 if(1990*mm<=mr[0]&&mr[0]<2030*mm) { layer = 3; mat = 1; }
1646 if(2030*mm<=mr[0]&&mr[0]<2070*mm) { layer = 4; mat = 0; }
1647 if(2070*mm<=mr[0]&&mr[0]<2110*mm) { layer = 4; mat = 1; }
1648 if(2110*mm<=mr[0]&&mr[0]<2190*mm) { layer = 5; mat = 0; }
1649 if(2190*mm<=mr[0]&&mr[0]<2230*mm) { layer = 5; mat = 1; }
1650 if(2230*mm<=mr[0]&&mr[0]<2310*mm) { layer = 6; mat = 0; }
1651 if(2310*mm<=mr[0]&&mr[0]<2350*mm) { layer = 6; mat = 1; }
1652 if(2350*mm<=mr[0]&&mr[0]<2430*mm) { layer = 7; mat = 0; }
1653 if(2430*mm<=mr[0]&&mr[0]<2470*mm) { layer = 7; mat = 1; }
1654 if(2470*mm<=mr[0]&&mr[0]<=2620*mm) { layer = 8; mat = 0; }
1659 ifbar = true;
1660 }
1661 if(2050*mm<=mr[2]&&mr[2]<2090*mm&&1034*mm<=mr[0]&&mr[0]<=2500*mm){
1662 part = 0; layer = 0; mat = 0;
1667 ifend = true;
1668 }
1669 if(2090*mm<=mr[2]&&mr[2]<2130*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1670 part = 0; layer = 0; mat = 1;
1675 ifend = true;
1676 }
1677 if(2130*mm<=mr[2]&&mr[2]<2170*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1678 part = 0; layer = 1; mat = 0;
1683 ifend = true;
1684 }
1685 if(2170*mm<=mr[2]&&mr[2]<2210*mm&&1100*mm<=mr[0]&&mr[0]<=2500*mm) {
1686 part = 0; layer = 1; mat = 1;
1691 ifend = true;
1692 }
1693 if(2210*mm<=mr[2]&&mr[2]<2240*mm&&1100*mm<mr[0]&&mr[0]<=2500*mm) {
1694 part = 0; layer = 2; mat = 0;
1699 ifend = true;
1700 }
1701 if(2240*mm<=mr[2]&&mr[2]<2280*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1702 part = 0; layer = 2; mat = 1;
1707 ifend = true;
1708 }
1709 if(2280*mm<=mr[2]&&mr[2]<2310*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1710 part = 0; layer = 3; mat = 0;
1715 ifend = true;
1716 }
1717 if(2310*mm<=mr[2]&&mr[2]<2350*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1718 part = 0; layer = 3; mat = 1;
1723 ifend = true;
1724 }
1725 if(2350*mm<=mr[2]&&mr[2]<2380*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1726 part = 0; layer = 4; mat = 0;
1731 ifend = true;
1732 }
1733 if(2380*mm<=mr[2]&&mr[2]<2420*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1734 part = 0; layer = 4; mat = 1;
1739 ifend = true;
1740 }
1741 if(2420*mm<=mr[2]&&mr[2]<2470*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1742 part = 0; layer = 5; mat = 0;
1747 ifend = true;
1748 }
1749 if(2470*mm<=mr[2]&&mr[2]<2510*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1750 part = 0; layer = 5; mat =1;
1755 ifend = true;
1756 }
1757 if(2510*mm<=mr[2]&&mr[2]<2590*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1758 part = 0; layer = 6; mat = 0;
1763 ifend = true;
1764 }
1765 if(2590*mm<=mr[2]&&mr[2]<2630*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1766 part = 0; layer = 6; mat = 1;
1771 ifend = true;
1772 }
1773 if(2630*mm<=mr[2]&&mr[2]<2710*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1774 part = 0; layer = 7; mat = 0;
1779 ifend = true;
1780 }
1781 if(2710*mm<=mr[2]&&mr[2]<2750*mm&&1362*mm<=mr[0]&&mr[0]<=2500*mm) {
1782 part = 0; layer = 7; mat = 1;
1787 ifend = true;
1788 }
1789 if(2750*mm<=mr[2]&&mr[2]<=2800*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1790 part = 0; layer = 8; mat = 0;
1795 ifend = true;
1796 }
1797 }
1798 }
1799 if(r.x()==0.) {
1800 mr[0] = fabs(r.y()); mr[1] = -fabs(r.x()); mr[2] = fabs(r.z());
1801 if(mr[2]<=1970*mm&&1740*mm<=mr[0]&&mr[0]<=2620*mm) {
1802 part = 1;
1803 if(1740*mm<=mr[0]&&mr[0]<1770*mm) { layer = 0; mat = 0; }
1804 if(1770*mm<=mr[0]&&mr[0]<1810*mm) { layer = 0; mat = 1; }
1805 if(1810*mm<=mr[0]&&mr[0]<1840*mm) { layer = 1; mat = 0; }
1806 if(1840*mm<=mr[0]&&mr[0]<1880*mm) { layer = 1; mat = 1; }
1807 if(1880*mm<=mr[0]&&mr[0]<1910*mm) { layer = 2; mat = 0; }
1808 if(1910*mm<=mr[0]&&mr[0]<1950*mm) { layer = 2; mat = 1; }
1809 if(1950*mm<=mr[0]&&mr[0]<1990*mm) { layer = 3; mat = 0; }
1810 if(1990*mm<=mr[0]&&mr[0]<2030*mm) { layer = 3; mat = 1; }
1811 if(2030*mm<=mr[0]&&mr[0]<2070*mm) { layer = 4; mat = 0; }
1812 if(2070*mm<=mr[0]&&mr[0]<2110*mm) { layer = 4; mat = 1; }
1813 if(2110*mm<=mr[0]&&mr[0]<2190*mm) { layer = 5; mat = 0; }
1814 if(2190*mm<=mr[0]&&mr[0]<2230*mm) { layer = 5; mat = 1; }
1815 if(2230*mm<=mr[0]&&mr[0]<2310*mm) { layer = 6; mat = 0; }
1816 if(2310*mm<=mr[0]&&mr[0]<2350*mm) { layer = 6; mat = 1; }
1817 if(2350*mm<=mr[0]&&mr[0]<2430*mm) { layer = 7; mat = 0; }
1818 if(2430*mm<=mr[0]&&mr[0]<2470*mm) { layer = 7; mat = 1; }
1819 if(2470*mm<=mr[0]&&mr[0]<=2620*mm) { layer = 8; mat = 0; }
1824 ifbar = true;
1825 }
1826 if(2050*mm<=mr[2]&&mr[2]<2090*mm&&1034*mm<=mr[0]&&mr[0]<=2500*mm){
1827 part = 0; layer = 0; mat = 0;
1832 ifend = true;
1833 }
1834 if(2090*mm<=mr[2]&&mr[2]<2130*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1835 part = 0; layer = 0; mat = 1;
1840 ifend = true;
1841 }
1842 if(2130*mm<=mr[2]&&mr[2]<2170*mm&&1067*mm<=mr[0]&&mr[0]<=2500*mm) {
1843 part = 0; layer = 1; mat = 0;
1848 ifend = true;
1849 }
1850 if(2170*mm<=mr[2]&&mr[2]<2210*mm&&1100*mm<=mr[0]&&mr[0]<=2500*mm) {
1851 part = 0; layer = 1; mat = 1;
1856 ifend = true;
1857 }
1858 if(2210*mm<=mr[2]&&mr[2]<2240*mm&&1100*mm<mr[0]&&mr[0]<=2500*mm) {
1859 part = 0; layer = 2; mat = 0;
1864 ifend = true;
1865 }
1866 if(2240*mm<=mr[2]&&mr[2]<2280*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1867 part = 0; layer = 2; mat = 1;
1872 ifend = true;
1873 }
1874 if(2280*mm<=mr[2]&&mr[2]<2310*mm&&1133*mm<=mr[0]&&mr[0]<=2500*mm) {
1875 part = 0; layer = 3; mat = 0;
1880 ifend = true;
1881 }
1882 if(2310*mm<=mr[2]&&mr[2]<2350*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1883 part = 0; layer = 3; mat = 1;
1888 ifend = true;
1889 }
1890 if(2350*mm<=mr[2]&&mr[2]<2380*mm&&1167*mm<=mr[0]&&mr[0]<=2500*mm) {
1891 part = 0; layer = 4; mat = 0;
1896 ifend = true;
1897 }
1898 if(2380*mm<=mr[2]&&mr[2]<2420*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1899 part = 0; layer = 4; mat = 1;
1904 ifend = true;
1905 }
1906 if(2420*mm<=mr[2]&&mr[2]<2470*mm&&1203*mm<=mr[0]&&mr[0]<=2500*mm) {
1907 part = 0; layer = 5; mat = 0;
1912 ifend = true;
1913 }
1914 if(2470*mm<=mr[2]&&mr[2]<2510*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1915 part = 0; layer = 5; mat =1;
1920 ifend = true;
1921 }
1922 if(2510*mm<=mr[2]&&mr[2]<2590*mm&&1241*mm<=mr[0]&&mr[0]<=2500*mm) {
1923 part = 0; layer = 6; mat = 0;
1928 ifend = true;
1929 }
1930 if(2590*mm<=mr[2]&&mr[2]<2630*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1931 part = 0; layer = 6; mat = 1;
1936 ifend = true;
1937 }
1938 if(2630*mm<=mr[2]&&mr[2]<2710*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1939 part = 0; layer = 7; mat = 0;
1944 ifend = true;
1945 }
1946 if(2710*mm<=mr[2]&&mr[2]<2750*mm&&1362*mm<=mr[0]&&mr[0]<=2500*mm) {
1947 part = 0; layer = 7; mat = 1;
1952 ifend = true;
1953 }
1954 if(2750*mm<=mr[2]&&mr[2]<=2800*mm&&1302*mm<=mr[0]&&mr[0]<=2500*mm) {
1955 part = 0; layer = 8; mat = 0;
1960 ifend = true;
1961 }
1962 }
1963 if(ifbar==true||ifend==true) {
1964 if( r.x() < 0. && r.y() >= 0. && r.z() > 0. ){
1966 }
1967 else if( r.x() <= 0. && r.y() < 0. && r.z() > 0. ){
1970 }
1971 else if( r.x() > 0. && r.y() < 0. && r.z() > 0. ){
1973 }
1974 else if( r.x() >= 0. && r.y() > 0. && r.z() < 0. ){
1977 }
1978 else if( r.x() < 0. && r.y() >= 0. && r.z() < 0. ){
1980 }
1981 else if( r.x() <= 0. && r.y() < 0. && r.z() < 0. ){
1984 }
1985 else if( r.x() > 0. && r.y() <= 0. && r.z() < 0. ){
1987 }
1988 }
1989 }
1990
1991
1992 newb[0] = -
b[0] * m_scale;
1993 newb[1] =
b[1] * m_scale;
1994 newb[2] = -
b[2] * m_scale;
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008#ifndef BEAN
2009 return StatusCode::SUCCESS;
2010#else
2011 return true;
2012#endif
2013}
double sin(const BesAngle a)
double cos(const BesAngle a)
virtual StatusCode uniFieldVector(const HepPoint3D &xyz, HepVector3D &fvec) const
void getMucField(int part, int layer, int mat, HepPoint3D &r, HepVector3D &b)