45 #include "CLHEP/Units/GlobalSystemOfUnits.h"
57 : theParent(parent), theType(type), theName(name), fcopyData(copy_data) {
83 std::cout <<
"@@@@ Reading data of Optical Object " <<
name() << std::endl;
87 std::cout <<
"Copy data of Optical Object " <<
name() << std::endl;
120 std::vector<ALIstring> wordlist;
149 std::vector<ALIstring> wordlist;
168 if (wordlist[0] ==
ALIstring(
"length")) {
170 }
else if (wordlist[0] ==
ALIstring(
"angle")) {
172 }
else if (wordlist[0] ==
ALIstring(
"nodim")) {
175 std::cerr <<
"!!ERROR: Exiting... unknown type of Extra Entry " << wordlist[0] << std::endl;
184 wordlist.erase(wordlist.begin());
195 xentry->
fill(wordlist);
215 ALIstring coor_type_reads = coor_type_read.substr(0, 6);
216 if (coor_type_reads ==
"center")
217 coor_type_reads =
"centre";
223 if (coor_type_read.size() == 7) {
224 if (coor_type_read[6] ==
'G') {
226 std::cout <<
" coordinate global " << coor_type_read << std::endl;
227 if (coor_type_expected ==
"centre") {
229 }
else if (coor_type_expected ==
"angles") {
236 std::vector<ALIstring> wordlist;
240 for (
int ii = 0;
ii < 4;
ii++) {
243 if (coor_type_reads != coor_type_expected) {
245 std::cerr <<
"readCoordinates: " << coor_type_expected <<
" should be read here, instead of " << coor_type_reads
252 coor_names[
ii - 1] = wordlist[0];
266 std::cerr <<
"!!!EXITING: coordinates have to be cartesian (X ,Y ,Z), or cylindrical (R, PHI, Z) or spherical (R, "
269 <<
" they are " << coor_names[0] <<
", " << coor_names[1] <<
", " << coor_names[2] <<
"." << std::endl;
282 throw cms::Exception(
"LogicError") <<
"@SUB=OpticalObject::transformCylindrical2Cartesian\n"
283 <<
"Transformation from cylindrical to cartesian coordinates requires the"
284 <<
" coordinate entry vector to have a size of three.";
294 for (ii = 0; ii < siz; ii++) {
296 std::cout <<
" OpticalObject::transformCylindrical2Cartesian " << ii <<
" " << newcoor[
ii] << std::endl;
319 }
else if (coor_type ==
ALIstring(
"angles")) {
322 std::cerr <<
" !!! FATAL ERROR at OpticalObject::fillCoordinateEntry : wrong coordinate type " << coor_type
333 entry->
fill(wordlist);
349 for (
int ii = 0;
ii < 3;
ii++) {
375 std::cout <<
"entering copyData()" << std::endl;
381 ALIint copy_name_last_slash = opto->
name().rfind(
'/');
382 ALIint copy_name_size = opto->
name().length();
384 theName.append(opto->
name(), copy_name_last_slash, copy_name_size);
389 std::vector<Entry*>::const_iterator vecite;
391 std::vector<ALIstring> wordlist;
392 wordlist.push_back((*vecite)->type());
402 std::vector<ALIstring> wordlist;
407 coor_name =
"centre";
409 coor_name =
"angles";
420 wordlist.push_back(entry->
name());
425 wordlist.push_back(chartmp);
429 wordlist.push_back(chartmp);
446 << inttmp << std::endl;
449 wordlist.push_back(strtmp);
461 ALIbool fcopyComponents =
false;
464 std::vector<ALIstring> vopto_types;
468 std::cout <<
" NO MORE COMPONENTS IN THIS OptO" <<
name() << std::endl;
478 std::vector<ALIstring>::iterator vsite;
479 std::vector<ALIstring> wordlist;
480 for (vsite = vopto_types.begin(); vsite != vopto_types.end(); ++vsite) {
491 fcopyComponents =
true;
493 }
else if (wordlist[0] ==
ALIstring(
"copy_components")) {
495 std::cout <<
"createComponentOptOs: copy_components" << wordlist[0] << std::endl;
497 fcopyComponents =
true;
499 }
else if (wordlist[0] != (*vsite)) {
501 std::cerr <<
"!!! Badly placed OpticalObject: " << wordlist[0] <<
" should be = " << (*vsite) << std::endl;
508 if (!fcopyComponents) {
509 component_name +=
'/';
510 component_name += wordlist[1];
518 if (wordlist.size() == 3) {
538 std::cout <<
" OpticalObject::createNewOptO optoType " << optoType <<
" optoName " << optoName <<
" parent "
539 << parent->
name() << std::endl;
541 if (optoType ==
"laser") {
542 OptOcomponent =
new OptOLaser(
this, optoType, optoName, fcopyComponents);
543 }
else if (optoType ==
"source") {
544 OptOcomponent =
new OptOSource(
this, optoType, optoName, fcopyComponents);
545 }
else if (optoType ==
"Xlaser") {
546 OptOcomponent =
new OptOXLaser(
this, optoType, optoName, fcopyComponents);
547 }
else if (optoType ==
"mirror") {
548 OptOcomponent =
new OptOMirror(
this, optoType, optoName, fcopyComponents);
549 }
else if (optoType ==
"plate_splitter") {
550 OptOcomponent =
new OptOPlateSplitter(
this, optoType, optoName, fcopyComponents);
551 }
else if (optoType ==
"cube_splitter") {
552 OptOcomponent =
new OptOCubeSplitter(
this, optoType, optoName, fcopyComponents);
553 }
else if (optoType ==
"modified_rhomboid_prism") {
555 }
else if (optoType ==
"pseudo_pentaprism" || optoType ==
"optical_square") {
556 OptOcomponent =
new OptOOpticalSquare(
this, optoType, optoName, fcopyComponents);
557 }
else if (optoType ==
"lens") {
558 OptOcomponent =
new OptOLens(
this, optoType, optoName, fcopyComponents);
559 }
else if (optoType ==
"Risley_prism") {
560 OptOcomponent =
new OptORisleyPrism(
this, optoType, optoName, fcopyComponents);
561 }
else if (optoType ==
"sensor2D") {
562 OptOcomponent =
new OptOSensor2D(
this, optoType, optoName, fcopyComponents);
563 }
else if (optoType ==
"distancemeter" || optoType ==
"distancemeter1dim") {
564 OptOcomponent =
new OptODistancemeter(
this, optoType, optoName, fcopyComponents);
565 }
else if (optoType ==
"distancemeter3dim") {
567 }
else if (optoType ==
"distance_target") {
568 OptOcomponent =
new OptOScreen(
this, optoType, optoName, fcopyComponents);
569 }
else if (optoType ==
"tiltmeter") {
570 OptOcomponent =
new OptOTiltmeter(
this, optoType, optoName, fcopyComponents);
571 }
else if (optoType ==
"pinhole") {
572 OptOcomponent =
new OptOPinhole(
this, optoType, optoName, fcopyComponents);
573 }
else if (optoType ==
"COPS") {
574 OptOcomponent =
new OptOCOPS(
this, optoType, optoName, fcopyComponents);
581 return OptOcomponent;
599 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
619 std::cout <<
" setGlobalRMOriginalOriginal OptO " <<
name() << std::endl;
637 std::vector<OpticalObject*> vopto;
643 std::vector<OpticalObject*>::const_iterator vocite;
644 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
645 CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
646 (*vocite)->setGlobalRMOriginalOriginal(rmorioriLocalChild);
653 const CLHEP::HepRotation& rmoriorinew) {
654 std::cout <<
" propagateGlobalRMOriginalOriginalChangeToChildren OptO " <<
name() << std::endl;
661 std::vector<OpticalObject*> vopto;
667 std::vector<OpticalObject*>::const_iterator vocite;
668 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
670 (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren(rmorioriold, rmoriorinew);
676 CLHEP::HepRotation
rm;
683 rm.rotateX(cel[3]->valueOriginalOriginal());
687 rm.rotateY(cel[4]->valueOriginalOriginal());
691 rm.rotateZ(cel[5]->valueOriginalOriginal());
797 opto_par = opto_par->
parent();
837 std::vector<ALIdouble>::const_iterator vdcite;
844 std::cout <<
" setOriginalEntryValues " << std::endl;
855 }
else if (behav ==
"D" || behav ==
"DD") {
857 }
else if (behav ==
"T" || behav ==
"DT") {
859 }
else if (behav ==
"FD") {
861 }
else if (behav ==
"FT") {
863 }
else if (behav ==
"M") {
874 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement a default behaviour"
876 std::cerr <<
" You have to specify some behaviour, like :D or :T or ..." << std::endl;
884 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement deviation (:D)"
886 std::cerr <<
" Please read documentation for this object type" << std::endl;
895 <<
" does not implement the light traversing (:T)" << std::endl;
896 std::cerr <<
" Please read documentation for this object type" << std::endl;
905 <<
" does not implement detailed deviation (:DD / :D)" << std::endl;
906 std::cerr <<
" Please read documentation for this object type" << std::endl;
915 <<
" does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
916 std::cerr <<
" Please read documentation for this object type" << std::endl;
924 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement making measurement (:M)"
926 std::cerr <<
" Please read documentation for this object type" << std::endl;
932 <<
" does not implement user defined behaviour = " << behav << std::endl;
933 std::cerr <<
" Please read documentation for this object type" << std::endl;
948 std::cout <<
"% LR: GET PLATE " <<
name() <<
" forward= " << forwardPlate << std::endl;
954 CLHEP::Hep3Vector ZAxis(0., 0., 1.);
955 CLHEP::HepRotation rmt =
rmGlob();
956 CLHEP::Hep3Vector plate_normal = rmt * ZAxis;
961 ALIdouble normal_sign = -forwardPlate * 2 + 1;
962 plate_point += normal_sign * width / 2. * plate_normal;
975 CLHEP::Hep3Vector XAxis(1., 0., 0.);
977 plate_normal.rotate(normal_sign * wedge / 2., XAxis);
982 CLHEP::Hep3Vector YAxis(0., 1., 0.);
984 plate_normal.rotate(normal_sign * wedge / 2., YAxis);
993 return ALIPlane(plate_point, plate_normal);
1002 std::cout <<
name() <<
" displaceCentreGlob: coor " << coor <<
" disp = " << disp << std::endl;
1005 CLHEP::Hep3Vector dispVec =
getDispVec(coor, disp);
1009 std::vector<OpticalObject*> vopto;
1015 std::vector<OpticalObject*>::const_iterator vocite;
1016 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1017 (*vocite)->displaceCentreGlob(dispVec);
1023 CLHEP::Hep3Vector dispVec;
1026 dispVec = CLHEP::Hep3Vector(disp, 0., 0.);
1029 dispVec = CLHEP::Hep3Vector(0., disp, 0.);
1032 dispVec = CLHEP::Hep3Vector(0., 0., disp);
1035 std::cerr <<
"!!! DISPLACECENTREGLOB coordinate should be 0-2, not " << coor << std::endl;
1048 std::cout <<
name() <<
" displaceCentreGlob: dispVec = " << dispVec << std::endl;
1054 std::vector<OpticalObject*> vopto;
1059 std::vector<OpticalObject*>::const_iterator vocite;
1060 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1061 (*vocite)->displaceCentreGlob(dispVec);
1070 ALIdouble Pentry_value = (Pentry_orig_value) + disp;
1071 LogDebug(
"OpticalObject::displaceExtraEntry")
1072 <<
" displaceExtraEntry " << Pentry_value <<
" <> " << Pentry_orig_value << std::endl;
1084 std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1087 CLHEP::Hep3Vector dispVec =
getDispVec(coor, disp);
1094 std::vector<OpticalObject*> vopto;
1096 std::vector<OpticalObject*>::const_iterator vocite;
1097 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1098 (*vocite)->displaceCentreGlobOriginal(dispVec);
1107 std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1115 std::vector<OpticalObject*> vopto;
1117 std::vector<OpticalObject*>::const_iterator vocite;
1118 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1119 (*vocite)->displaceCentreGlobOriginal(dispVec);
1126 std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1129 CLHEP::Hep3Vector dispVec =
getDispVec(coor, disp);
1136 std::vector<OpticalObject*> vopto;
1138 std::vector<OpticalObject*>::const_iterator vocite;
1139 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1140 (*vocite)->displaceCentreGlobOriginalOriginal(dispVec);
1149 std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1157 std::vector<OpticalObject*> vopto;
1159 std::vector<OpticalObject*>::const_iterator vocite;
1160 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1161 (*vocite)->displaceCentreGlobOriginalOriginal(dispVec);
1173 std::cout <<
name() <<
"DISPLACERMGLOBAROUNDGLOBAL" << coor <<
"disp" << disp << std::endl;
1190 if (opto1stRotated !=
this) {
1193 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1203 std::vector<OpticalObject*> vopto;
1205 std::vector<OpticalObject*>::const_iterator vocite;
1206 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1207 (*vocite)->displaceRmGlobAroundGlobal(opto1stRotated, coor, disp);
1217 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily if 'rotateAroundGlobal' is "
1218 "set as a Global Option "
1224 std::cout <<
name() <<
" DISPLACE_RMGLOB_AROUND_LOCAL " << coor <<
" disp " << disp << std::endl;
1230 if (coor ==
XCoor) {
1242 if (coor ==
YCoor) {
1254 if (coor ==
ZCoor) {
1285 if (opto1stRotated !=
this) {
1294 std::vector<OpticalObject*> vopto;
1296 std::vector<OpticalObject*>::const_iterator vocite;
1297 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1298 (*vocite)->displaceRmGlobAroundLocal(opto1stRotated, coor, 0.);
1306 std::vector<OpticalObject*> vopto;
1308 std::vector<OpticalObject*>::const_iterator vocite;
1309 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1310 (*vocite)->setGlobalCoordinates();
1319 std::cout <<
name() <<
" DISPLACEORIGRMGLOB " << coor <<
" disp " << disp << std::endl;
1336 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1345 if (opto1stRotated !=
this) {
1348 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1351 radius_rotated.rotateX(disp);
1354 radius_rotated.rotateY(disp);
1357 radius_rotated.rotateZ(disp);
1373 std::vector<OpticalObject*> vopto;
1375 std::vector<OpticalObject*>::const_iterator vocite;
1376 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1377 (*vocite)->displaceRmGlobOriginal(opto1stRotated, coor, disp);
1385 std::vector<OpticalObject*> vopto;
1387 std::vector<OpticalObject*>::const_iterator vocite;
1388 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1389 (*vocite)->displaceRmGlobOriginal(opto1stRotated, coor, disp);
1403 std::cout <<
name() <<
" DISPLACEORIGRMGLOB " << coor <<
" disp " << disp << std::endl;
1420 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1429 if (opto1stRotated !=
this) {
1431 CLHEP::Hep3Vector radiusOriginalOriginal =
1433 CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1436 radius_rotated.rotateX(disp);
1439 radius_rotated.rotateY(disp);
1442 radius_rotated.rotateZ(disp);
1458 std::vector<OpticalObject*> vopto;
1460 std::vector<OpticalObject*>::const_iterator vocite;
1461 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1462 (*vocite)->displaceRmGlobOriginalOriginal(opto1stRotated, coor, disp);
1470 std::vector<OpticalObject*> vopto;
1472 std::vector<OpticalObject*>::const_iterator vocite;
1473 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1474 (*vocite)->displaceRmGlobOriginalOriginal(opto1stRotated, coor, disp);
1486 Pentry_orig_value += disp;
1494 Pentry_orig_value += disp;
1503 std::vector<Entry*>::const_iterator vecite;
1506 if ((*vecite)->name() == entry_name) {
1524 retval = (Pentry_value);
1532 std::cerr <<
"!!OpticalObject:ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1541 std::cout <<
" OpticalObject::findExtraEntryValue: " << eename <<
" = " << retval << std::endl;
1552 std::cerr <<
"!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename <<
", in object "
1553 <<
name() << std::endl;
1567 return (entryNo >= 0);
1580 std::vector<ALIdouble>::iterator vdite;
1583 (*vdite) = (*vdcite_o);
1587 std::vector<OpticalObject*> vopto;
1589 std::vector<OpticalObject*>::const_iterator vocite;
1590 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1591 (*vocite)->resetGlobalCoordinates();
1610 std::vector<ALIdouble>::iterator vdite;
1613 std::vector<Entry*>::const_iterator vdciteE =
ExtraEntryList().begin();
1615 ++vdite, ++vdite_o, ++vdcite_oo, ++vdciteE) {
1616 (*vdite) = (*vdcite_oo);
1617 (*vdite_o) = (*vdcite_oo);
1618 (*vdciteE)->addFittedDisplacementToValue(-(*vdciteE)->valueDisplacementByFitting());
1633 std::vector<OpticalObject*> vopto;
1635 std::vector<OpticalObject*>::const_iterator vocite;
1636 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1637 (*vocite)->resetOriginalOriginalCoordinates();
1652 if (last_slash == -1) {
1655 sname =
name().substr(last_slash + 1,
name().
size() - 1);
1670 CLHEP::HepRotation
rm;
1685 const std::vector<Entry*>& entries)
const {
1686 const CLHEP::HepRotation& rmParent = optoAncestor->
rmGlob();
1691 std::cerr <<
" !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob "
1699 std::cout <<
" OpticalObject::getRotationAnglesInOptOFrame " <<
name() <<
" optoAncestor " << optoAncestor->
name()
1711 const std::vector<Entry*>& entries)
const {
1712 std::vector<double> newang(3);
1713 double angleX = entries[3]->value() + entries[3]->valueDisplacementByFitting();
1714 double angleY = entries[4]->value() + entries[4]->valueDisplacementByFitting();
1715 double angleZ = entries[5]->value() + entries[5]->valueDisplacementByFitting();
1717 std::cout <<
" angles as value entries: X= " << angleX <<
" Y= " << angleY <<
" Z " << angleZ << std::endl;
1742 object.rotateX(disp);
1745 object.rotateY(disp);
1748 object.rotateZ(disp);
1754 std::cout <<
" rotateItAroundGlobal coor " << coor <<
" disp " << disp << std::endl;
1801 double diff = fabs(ang1 - ang2);
1802 diff = diff - int(diff / 2. /
M_PI) * 2 *
M_PI;
1811 if (diff > 0.00001) {
1812 if (fabs(diff - 2 *
M_PI) > 0.00001) {
1823 double precision = 1.e-9;
1824 if (fabs(val) < precision)
1843 if (rot ==
nullptr) {
1844 rot =
new CLHEP::HepRotation();
1845 rot->rotateX(angleX);
1846 rot->rotateY(angleY);
1847 rot->rotateZ(angleZ);
1849 double sx =
sin(angleX);
1850 double cx =
cos(angleX);
1851 double sy =
sin(angleY);
1852 double cy =
cos(angleY);
1853 double sz =
sin(angleZ);
1854 double cz =
cos(angleZ);
1856 double rotxx = cy * cz;
1857 double rotxy = sx * sy * cz - cx * sz;
1858 double rotxz = cx * sy * cz + sx * sz;
1859 double rotyx = cy * sz;
1860 double rotyy = sx * sy * sz + cx * cz;
1861 double rotyz = cx * sy * sz - sx * cz;
1863 double rotzy = sx * cy;
1864 double rotzz = cx * cy;
1866 int matrixElemBad = 0;
1867 if (!
eq2ang(rot->xx(), rotxx)) {
1868 std::cerr <<
" EQUATION for xx() IS BAD " << rot->xx() <<
" <> " << rotxx << std::endl;
1871 if (!
eq2ang(rot->xy(), rotxy)) {
1872 std::cerr <<
" EQUATION for xy() IS BAD " << rot->xy() <<
" <> " << rotxy << std::endl;
1875 if (!
eq2ang(rot->xz(), rotxz)) {
1876 std::cerr <<
" EQUATION for xz() IS BAD " << rot->xz() <<
" <> " << rotxz << std::endl;
1879 if (!
eq2ang(rot->yx(), rotyx)) {
1880 std::cerr <<
" EQUATION for yx() IS BAD " << rot->yx() <<
" <> " << rotyx << std::endl;
1883 if (!
eq2ang(rot->yy(), rotyy)) {
1884 std::cerr <<
" EQUATION for yy() IS BAD " << rot->yy() <<
" <> " << rotyy << std::endl;
1887 if (!
eq2ang(rot->yz(), rotyz)) {
1888 std::cerr <<
" EQUATION for yz() IS BAD " << rot->yz() <<
" <> " << rotyz << std::endl;
1891 if (!
eq2ang(rot->zx(), rotzx)) {
1892 std::cerr <<
" EQUATION for zx() IS BAD " << rot->zx() <<
" <> " << rotzx << std::endl;
1895 if (!
eq2ang(rot->zy(), rotzy)) {
1896 std::cerr <<
" EQUATION for zy() IS BAD " << rot->zy() <<
" <> " << rotzy << std::endl;
1899 if (!
eq2ang(rot->zz(), rotzz)) {
1900 std::cerr <<
" EQUATION for zz() IS BAD " << rot->zz() <<
" <> " << rotzz << std::endl;
1905 return matrixElemBad;
1910 CLHEP::Hep3Vector dispVec;
1913 dispVec = CLHEP::Hep3Vector(disp, 0., 0.);
1916 dispVec = CLHEP::Hep3Vector(0., disp, 0.);
1919 dispVec = CLHEP::Hep3Vector(0., 0., disp);
1940 CLHEP::HepRotation rmParentInv = inverseOf(
parent()->
rmGlob());
1941 cLocal = rmParentInv * cLocal;
1964 if (coorstr ==
"X") {
1966 }
else if (coorstr ==
"Y") {
1968 }
else if (coorstr ==
"Z") {
1987 if (coorstr ==
"X") {
1989 }
else if (coorstr ==
"Y") {
1991 }
else if (coorstr ==
"Z") {
2012 "Box", go * 5. * cm /
m, go * 5. * cm /
m, go * 5. * cm /
m);
2020 std::vector<OpticalAlignParam> exEnt = oaInfo.
extraEntries_;
2021 std::vector<OpticalAlignParam>::iterator ite;
2022 std::vector<ALIstring> wordlist;
2023 for (ite = exEnt.begin(); ite != exEnt.end(); ++ite) {
2025 wordlist.insert(wordlist.begin(), (*ite).dimType());
2056 std::cout <<
"constructFromOptAligInfo constructed: " << *
this << std::endl;
2066 std::vector<ALIstring> wordlist;
2067 wordlist.push_back(oaParam.
name());
2068 gcvt(oaParam.
value(), 10, chartmp);
2069 wordlist.push_back(chartmp);
2070 gcvt(oaParam.
sigma(), 10, chartmp);
2071 wordlist.push_back(chartmp);
2073 wordlist.push_back(
"fix");
2074 }
else if (oaParam.
quality() == 1) {
2075 wordlist.push_back(
"cal");
2076 }
else if (oaParam.
quality() == 2) {
2077 wordlist.push_back(
"unk");
2090 std::vector<OpticalAlignInfo> children;
2092 std::vector<OpticalAlignInfo>::const_iterator ite;
2098 for (
int ii = 0;
ii < siz;
ii++) {
2121 children.push_back(oaInfochild);
2123 std::cout <<
theName <<
"createComponentOptOsFromOptAlignInfo: children added " << oaInfochild.
name_
2132 std::cout <<
"OpticalObject::createComponentsFromAlignInfo: N components = " << children.size() << std::endl;
2134 for (ite = children.begin(); ite != children.end(); ++ite) {
2141 ALIbool fcopyComponents =
false;
const double getEntryRMangle(const XYZcoor coor) const
void fillCoordinateEntry(const ALIstring &coor_name, const std::vector< ALIstring > &wordlist)
void setGlobalRMOriginalOriginal(const CLHEP::HepRotation &rmoriori)
std::vector< ALIdouble > theExtraEntryValueVector
static ALIbool getComponentOptOs(const ALIstring &opto_name, std::vector< OpticalObject * > &vcomponents)
--— Get from theOptOList the list of pointers to component OptOs
void setMeas(Measurement *meas)
set current measurement
void resetGlobalCoordinates()
double approxTo0(double val)
void transformCylindrical2Cartesian()
CLHEP::HepRotation theRmGlob
const edm::EventSetup & c
CLHEP::HepRotation buildRmFromEntryValuesOriginalOriginal()
void displaceExtraEntryOriginal(const ALIuint entryNo, const ALIdouble disp)
static ALIFileIn & getInstance(const ALIstring &name)
virtual void defaultBehaviour(LightRay &lightray, Measurement &meas)
CocoaSolidShape * theSolidShape
void SetCentreLocalFromEntryValues()
void setOptOCurrent(OpticalObject *opto)
virtual void fastDeviatesLightRay(LightRay &lightray)
const ALIdouble findExtraEntryValueMustExist(const ALIstring &eename) const
virtual void userDefinedBehaviour(LightRay &lightray, Measurement &meas, const ALIstring &behav)
void addExtraEntryToList(Entry *entry)
ALIdouble valueDisplacementByFitting() const
static std::vector< double > getRotationAnglesFromMatrix(const CLHEP::HepRotation &rmLocal, double origAngleX, double origAngleY, double origAngleZ)
OpticalObject * createNewOptO(OpticalObject *parent, ALIstring optoType, ALIstring optoName, ALIbool fcopyComponents)
const CLHEP::HepRotation rmLocal() const
void displaceCentreGlobOriginal(const XYZcoor coor, const ALIdouble disp)
void displaceRmGlobOriginalOriginal(const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
static std::vector< OpticalObject * > & OptOList()
Sin< T >::type sin(const T &t)
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
const ALIbool findExtraEntryValueIfExists(const ALIstring &eename, ALIdouble &value) const
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
static ALIstring & SDFName()
the name of the System Description File
void displaceCentreGlobOriginalOriginal(const XYZcoor coor, const ALIdouble disp)
static OpticalObject * nextOptOToCopy()
CLHEP::HepRotation theRmGlobOriginalOriginal
static GlobalOptionMgr * getInstance()
std::ostream & operator<<(std::ostream &out, const ALILine &li)
virtual void makeMeasurement(LightRay &lightray, Measurement &meas)
void addExtraEntryValueToList(ALIdouble entry_value)
const std::vector< Entry * > & CoordinateEntryList() const
std::vector< double > getRotationAnglesInOptOFrame(const OpticalObject *optoAncestor, const std::vector< Entry * > &entries) const
const std::vector< ALIdouble > & ExtraEntryValueOriginalList()
static OpticalObjectMgr * getInstance()
Get the only instance.
const CLHEP::HepRotation & rmGlob() const
void displaceRmGlobAroundGlobal(OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
void setOriginalEntryValues()
static std::vector< OpticalAlignInfo > getOpticalAlignments()
void setGlobalCoordinatesOfComponents()
bool eq2ang(double ang1, double ang2)
void addExtraEntryValueOriginalToList(ALIdouble entry_value)
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
const CLHEP::HepRotation & rmGlobOriginalOriginal() const
void setExtraEntryValue(const ALIuint entryNo, const ALIdouble disp)
std::vector< double > getLocalRotationAngles(const std::vector< Entry * > &entries) const
void calculateLocalRotationAxisInGlobal()
const CLHEP::Hep3Vector centreLocal() const
void displaceRmGlobAroundLocal(OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
void readData(ALIFileIn &filein)
CLHEP::Hep3Vector theCentreGlobOriginal
virtual ALIdouble SigmaDimensionFactor() const
void displaceCentreGlob(const XYZcoor coor, const ALIdouble disp)
const OpticalObject * parent() const
virtual void constructSolidShape()
Cos< T >::type cos(const T &t)
double addPii(double val)
const CLHEP::Hep3Vector & centreGlobOriginal() const
void registerMe(OpticalObject *opto)
void SetRMGlobFromRMLocal()
CLHEP::HepRotation theRmGlobOriginal
void rotateItAroundGlobal(T &object, const XYZcoor coor, const double disp)
void displaceRmGlobOriginal(const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
CLHEP::Hep3Vector theCentreGlobOriginalOriginal
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
CLHEP::Hep3Vector getDisplacementInLocalCoordinates(const XYZcoor coor, const ALIdouble disp)
virtual void fastTraversesLightRay(LightRay &lightray)
void displaceExtraEntryOriginalOriginal(const ALIuint entryNo, const ALIdouble disp)
const ALIstring longName() const
static ALIbool createCopyComponentList(const ALIstring &optoname)
**************** FOR COPYING AN OPTO
void addExtraEntryValueOriginalOriginalToList(ALIdouble entry_value)
void fill(const std::vector< ALIstring > &wordlist)
std::vector< ALIdouble > theExtraEntryValueOriginalVector
std::vector< ALIstring > getCoordinateFromOptAlignParam(const OpticalAlignParam &oaParam)
const ALIstring & name() const
virtual void fillExtraEntry(std::vector< ALIstring > &wordlist)
void setCmsswID(ALIuint id)
const CLHEP::HepRotation & rmGlobOriginal() const
void readCoordinates(const ALIstring &coor_type_read, const ALIstring &coor_type_expected, ALIFileIn &filein)
std::vector< Entry * > theCoordinateEntryVector
ALIint getWordsInLine(std::vector< ALIstring > &wl)
const double getEntryCentre(const XYZcoor coor) const
void resetOriginalOriginalCoordinates()
static ALIbool getComponentOptOTypes(const ALIstring &opto_type, std::vector< ALIstring > &vcomponents)
--— Get from theOptODictionary the list of component OptO types
OpticalObject * theParent
CLHEP::Hep3Vector axisYLocalInGlobal
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
static void addEntryToList(Entry *entry)
***************** SET DATA MEMBERS
CocoaMaterialElementary * theMaterial
void buildWordList(const Entry *entry, std::vector< ALIstring > &wordlist)
const ALIint extraEntryNo(const ALIstring &entry_name) const
std::vector< OpticalAlignParam > extraEntries_
static EntryMgr * getInstance()
void propagateGlobalRMOriginalOriginalChangeToChildren(const CLHEP::HepRotation &rmorioriold, const CLHEP::HepRotation &rmoriorinew)
const CLHEP::Hep3Vector & centreGlobOriginalOriginal() const
static void dumpVS(const std::vector< ALIstring > &wl, const std::string &msg, std::ostream &outs=std::cout)
dumps a vector of strings with a message to outs
void SetCentreGlobFromCentreLocal()
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
const CLHEP::Hep3Vector & centreGlob() const
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void displaceExtraEntry(const ALIuint entryNo, const ALIdouble disp)
std::vector< ALIdouble > & ExtraEntryValueList()
virtual void detailedDeviatesLightRay(LightRay &lightray)
const ALIstring shortName() const
virtual ALIdouble ValueDimensionFactor() const
CLHEP::Hep3Vector getDispVec(const XYZcoor coor, const ALIdouble disp)
void transformSpherical2Cartesian()
void SetRMLocalFromEntryValues()
int checkMatrixEquations(double angleX, double angleY, double angleZ, CLHEP::HepRotation *rot=nullptr)
void constructFromOptAligInfo(const OpticalAlignInfo &oaInfo)
double diff2pi(double ang1, double ang2)
virtual void participateInMeasurement(LightRay &lightray, Measurement &meas, const ALIstring &behav)
CLHEP::Hep3Vector axisXLocalInGlobal
std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
static ALIdouble AngleValueDimensionFactor()
void readExtraEntries(ALIFileIn &filein)
const ALIstring & name() const
OpticalObject * OptOCurrent() const
void createComponentOptOs(ALIFileIn &filein)
virtual void detailedTraversesLightRay(LightRay &lightray)
static int getInt(const ALIstring &str)
Convert a string to an integer, checking that it is really an integer.
virtual void fillName(const ALIstring &name)
void createComponentOptOsFromOptAlignInfo()
void SetRMGlobFromRMLocalOriginalOriginal(const CLHEP::HepRotation &rmoriori)
virtual void constructMaterial()
CLHEP::Hep3Vector theCentreGlob
void addCoordinateEntryToList(Entry *entry)
const std::vector< Entry * > & ExtraEntryList() const
tuple size
Write out results.
void setGlobalCoordinates()
CLHEP::Hep3Vector axisZLocalInGlobal
static ALIdouble LengthValueDimensionFactor()
const ALIstring & type() const