45 #include "CLHEP/Units/GlobalSystemOfUnits.h" 119 std::vector<ALIstring> wordlist;
121 if (wordlist[0] ==
ALIstring(
"ENTRY" ) ){
151 std::vector<ALIstring> wordlist;
173 if ( wordlist[0] ==
ALIstring(
"length") ) {
175 }
else if ( wordlist[0] ==
ALIstring(
"angle") ) {
177 }
else if ( wordlist[0] ==
ALIstring(
"nodim") ) {
180 std::cerr <<
"!!ERROR: Exiting... unknown type of Extra Entry " << wordlist[0] << std::endl;
189 wordlist.erase( wordlist.begin() );
200 xentry->
fill( wordlist );
222 ALIstring coor_type_reads = coor_type_read.substr(0,6);
223 if( coor_type_reads ==
"center" ) coor_type_reads =
"centre";
229 if(coor_type_read.size() == 7) {
230 if(coor_type_read[6] ==
'G' ) {
232 if(coor_type_expected ==
"centre" ) {
234 }
else if(coor_type_expected ==
"angles" ) {
241 std::vector<ALIstring> wordlist;
245 for(
int ii=0;
ii<4;
ii++ ) {
248 if ( coor_type_reads != coor_type_expected ) {
250 std::cerr <<
"readCoordinates: " << coor_type_expected <<
" should be read here, instead of " << coor_type_reads << std::endl;
256 coor_names[
ii-1] = wordlist[0];
269 std::cerr <<
"!!!EXITING: coordinates have to be cartesian (X ,Y ,Z), or cylindrical (R, PHI, Z) or spherical (R, THE, PHI) " << std::endl
270 <<
" they are " << coor_names[0] <<
", " << coor_names[1] <<
", " << coor_names[2] <<
"." << std::endl;
285 <<
"@SUB=OpticalObject::transformCylindrical2Cartesian\n" 286 <<
"Transformation from cylindrical to cartesian coordinates requires the" 287 <<
" coordinate entry vector to have a size of three.";
296 for( ii = 0; ii < siz; ii++ ) {
297 if(
ALIUtils::debug >= 5 )
std::cout <<
" OpticalObject::transformCylindrical2Cartesian " << ii <<
" " << newcoor[
ii] << std::endl;
325 if ( coor_type ==
ALIstring(
"centre") ) {
327 }
else if ( coor_type ==
ALIstring(
"angles") ) {
330 std::cerr <<
" !!! FATAL ERROR at OpticalObject::fillCoordinateEntry : wrong coordinate type " << coor_type << std::endl;
340 entry->
fill( wordlist );
360 for (
int ii=0;
ii<3;
ii++) {
395 ALIint copy_name_last_slash = opto->
name().rfind(
'/');
396 ALIint copy_name_size = opto->
name().length();
398 theName.append( opto->
name(), copy_name_last_slash, copy_name_size);
402 std::vector<Entry*>::const_iterator vecite;
404 std::vector<ALIstring> wordlist;
405 wordlist.push_back( (*vecite)->type() );
415 std::vector<ALIstring> wordlist;
420 coor_name =
"centre";
422 coor_name =
"angles";
436 wordlist.push_back( entry->
name() );
441 wordlist.push_back( chartmp );
445 wordlist.push_back( chartmp );
464 wordlist.push_back( strtmp );
479 ALIbool fcopyComponents =
false;
482 std::vector<ALIstring> vopto_types;
495 std::vector<ALIstring>::iterator vsite;
496 std::vector<ALIstring> wordlist;
497 for( vsite=vopto_types.begin(); vsite!=vopto_types.end(); ++vsite ) {
507 fcopyComponents =
true;
509 }
else if( wordlist[0] ==
ALIstring(
"copy_components") ) {
512 fcopyComponents =
true;
514 }
else if ( wordlist[0] != (*vsite) ) {
516 std::cerr <<
"!!! Badly placed OpticalObject: " << wordlist[0] <<
" should be = " << (*vsite) << std::endl;
523 if( !fcopyComponents ) {
524 component_name +=
'/';
525 component_name += wordlist[1];
533 if( wordlist.size() == 3 ) {
551 if (
ALIUtils::debug >= 3 )
std::cout <<
" OpticalObject::createNewOptO optoType " << optoType <<
" optoName " << optoName <<
" parent " << parent->
name() << std::endl;
553 if( optoType ==
"laser" ) {
555 new OptOLaser(
this, optoType, optoName, fcopyComponents );
556 }
else if( optoType ==
"source" ) {
558 new OptOSource(
this, optoType, optoName, fcopyComponents );
559 }
else if( optoType ==
"Xlaser" ) {
561 new OptOXLaser(
this, optoType, optoName, fcopyComponents );
562 }
else if( optoType ==
"mirror" ){
564 new OptOMirror(
this, optoType, optoName, fcopyComponents );
565 }
else if( optoType ==
"plate_splitter" ) {
568 }
else if( optoType ==
"cube_splitter" ) {
571 }
else if( optoType ==
"modified_rhomboid_prism" ) {
574 }
else if( optoType ==
"pseudo_pentaprism" || optoType ==
"optical_square" ) {
577 }
else if( optoType ==
"lens" ) {
579 new OptOLens(
this, optoType, optoName, fcopyComponents );
580 }
else if( optoType ==
"Risley_prism" ) {
583 }
else if( optoType ==
"sensor2D" ) {
585 new OptOSensor2D(
this, optoType, optoName, fcopyComponents );
586 }
else if( optoType ==
"distancemeter" || optoType ==
"distancemeter1dim" ) {
589 }
else if( optoType ==
"distancemeter3dim" ) {
592 }
else if( optoType ==
"distance_target" ) {
594 new OptOScreen(
this, optoType, optoName, fcopyComponents );
595 }
else if( optoType ==
"tiltmeter" ) {
597 new OptOTiltmeter(
this, optoType, optoName, fcopyComponents );
598 }
else if( optoType ==
"pinhole" ) {
600 new OptOPinhole(
this, optoType, optoName, fcopyComponents );
601 }
else if( optoType ==
"COPS" ) {
603 new OptOCOPS(
this, optoType, optoName, fcopyComponents );
610 return OptOcomponent;
631 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
657 std::cout <<
" setGlobalRMOriginalOriginal OptO " <<
name() << std::endl;
675 std::vector<OpticalObject*> vopto;
681 std::vector<OpticalObject*>::const_iterator vocite;
682 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
683 CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
684 (*vocite)->setGlobalRMOriginalOriginal( rmorioriLocalChild );
694 std::cout <<
" propagateGlobalRMOriginalOriginalChangeToChildren OptO " <<
name() << std::endl;
701 std::vector<OpticalObject*> vopto;
707 std::vector<OpticalObject*>::const_iterator vocite;
708 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
710 (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmoriorinew );
718 CLHEP::HepRotation
rm;
723 rm.rotateX( cel[3]->valueOriginalOriginal() );
725 rm.rotateY( cel[4]->valueOriginalOriginal() );
727 rm.rotateZ( cel[5]->valueOriginalOriginal() );
831 opto_par = opto_par->
parent();
875 std::vector<ALIdouble>::const_iterator vdcite;
893 if ( behav ==
" " ) {
895 }
else if ( behav ==
"D" || behav ==
"DD" ) {
897 }
else if ( behav ==
"T" || behav ==
"DT" ) {
899 }
else if ( behav ==
"FD" ) {
901 }
else if ( behav ==
"FT" ) {
903 }
else if ( behav ==
"M" ) {
916 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement a default behaviour" << std::endl;
917 std::cerr <<
" You have to specify some behaviour, like :D or :T or ..." << std::endl;
927 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement deviation (:D)" << std::endl;
928 std::cerr <<
" Please read documentation for this object type" << std::endl;
938 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement the light traversing (:T)" << std::endl;
939 std::cerr <<
" Please read documentation for this object type" << std::endl;
949 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement detailed deviation (:DD / :D)" << std::endl;
950 std::cerr <<
" Please read documentation for this object type" << std::endl;
960 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
961 std::cerr <<
" Please read documentation for this object type" << std::endl;
971 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement making measurement (:M)" << std::endl;
972 std::cerr <<
" Please read documentation for this object type" << std::endl;
978 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement user defined behaviour = " << behav << std::endl;
979 std::cerr <<
" Please read documentation for this object type" << std::endl;
1001 CLHEP::Hep3Vector ZAxis(0.,0.,1.);
1002 CLHEP::HepRotation rmt =
rmGlob();
1003 CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
1006 CLHEP::Hep3Vector plate_point =
centreGlob();
1008 ALIdouble normal_sign = -forwardPlate*2 + 1;
1009 plate_point += normal_sign * width/2. * plate_normal;
1022 CLHEP::Hep3Vector XAxis(1.,0.,0.);
1024 plate_normal.rotate( normal_sign * wedge/2., XAxis );
1027 CLHEP::Hep3Vector YAxis(0.,1.,0.);
1029 plate_normal.rotate( normal_sign * wedge/2., YAxis );
1036 return ALIPlane(plate_point, plate_normal);
1050 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1054 std::vector<OpticalObject*> vopto;
1060 std::vector<OpticalObject*>::const_iterator vocite;
1061 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1062 (*vocite)->displaceCentreGlob( dispVec );
1071 CLHEP::Hep3Vector dispVec;
1074 dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1077 dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
1080 dispVec = CLHEP::Hep3Vector( 0., 0., disp );
1083 std::cerr <<
"!!! DISPLACECENTREGLOB coordinate should be 0-2, not " << coor << std::endl;
1102 std::vector<OpticalObject*> vopto;
1107 std::vector<OpticalObject*>::const_iterator vocite;
1108 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1109 (*vocite)->displaceCentreGlob( dispVec );
1121 ALIdouble Pentry_value = (Pentry_orig_value) + disp;
1122 LogDebug(
"OpticalObject::displaceExtraEntry")
1123 <<
" displaceExtraEntry " << Pentry_value <<
" <> " << Pentry_orig_value
1137 if (
ALIUtils::debug >= 4 )
std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1139 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1145 std::vector<OpticalObject*> vopto;
1147 std::vector<OpticalObject*>::const_iterator vocite;
1148 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1149 (*vocite)->displaceCentreGlobOriginal( dispVec );
1160 if (
ALIUtils::debug >= 4 )
std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1167 std::vector<OpticalObject*> vopto;
1169 std::vector<OpticalObject*>::const_iterator vocite;
1170 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1171 (*vocite)->displaceCentreGlobOriginal( dispVec );
1180 if (
ALIUtils::debug >= 4 )
std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1182 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1188 std::vector<OpticalObject*> vopto;
1190 std::vector<OpticalObject*>::const_iterator vocite;
1191 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1192 (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1203 if (
ALIUtils::debug >= 4 )
std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1210 std::vector<OpticalObject*> vopto;
1212 std::vector<OpticalObject*>::const_iterator vocite;
1213 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1214 (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1241 if(opto1stRotated !=
this ) {
1244 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1252 std::vector<OpticalObject*> vopto;
1254 std::vector<OpticalObject*>::const_iterator vocite;
1255 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1256 (*vocite)->displaceRmGlobAroundGlobal( opto1stRotated, coor, disp);
1269 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily if 'rotateAroundGlobal' is set as a Global Option " << std::endl;
1279 if( coor ==
XCoor ) {
1290 if( coor ==
YCoor ) {
1301 if( coor ==
ZCoor ) {
1332 if(opto1stRotated !=
this ) {
1341 std::vector<OpticalObject*> vopto;
1343 std::vector<OpticalObject*>::const_iterator vocite;
1344 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1345 (*vocite)->displaceRmGlobAroundLocal( opto1stRotated, coor, 0.);
1357 std::vector<OpticalObject*> vopto;
1359 std::vector<OpticalObject*>::const_iterator vocite;
1360 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1361 (*vocite)->setGlobalCoordinates();
1386 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1394 if(opto1stRotated !=
this ) {
1397 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1400 radius_rotated.rotateX(disp);
1403 radius_rotated.rotateY(disp);
1406 radius_rotated.rotateZ(disp);
1419 std::vector<OpticalObject*> vopto;
1421 std::vector<OpticalObject*>::const_iterator vocite;
1422 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1423 (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1431 std::vector<OpticalObject*> vopto;
1433 std::vector<OpticalObject*>::const_iterator vocite;
1434 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1435 (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1464 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1472 if(opto1stRotated !=
this ) {
1475 CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1478 radius_rotated.rotateX(disp);
1481 radius_rotated.rotateY(disp);
1484 radius_rotated.rotateZ(disp);
1497 std::vector<OpticalObject*> vopto;
1499 std::vector<OpticalObject*>::const_iterator vocite;
1500 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1501 (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1509 std::vector<OpticalObject*> vopto;
1511 std::vector<OpticalObject*>::const_iterator vocite;
1512 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1513 (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1528 Pentry_orig_value += disp;
1539 Pentry_orig_value += disp;
1551 std::vector<Entry*>::const_iterator vecite;
1554 if ((*vecite)->name() == entry_name ) {
1571 if( entryNo >= 0 ) {
1573 retval = (Pentry_value);
1581 std::cerr <<
"!!OpticalObject:ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1589 if(
ALIUtils::debug >= 5)
std::cout <<
" OpticalObject::findExtraEntryValue: " << eename <<
" = " << retval << std::endl;
1602 std::cerr <<
"!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1618 return( entryNo >= 0 );
1634 std::vector<ALIdouble>::iterator vdite;
1638 (*vdite) = (*vdcite_o);
1642 std::vector<OpticalObject*> vopto;
1644 std::vector<OpticalObject*>::const_iterator vocite;
1645 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1646 (*vocite)->resetGlobalCoordinates();
1668 std::vector<ALIdouble>::iterator vdite;
1671 std::vector<Entry*>::const_iterator vdciteE =
ExtraEntryList().begin() ;
1674 (*vdite) = (*vdcite_oo);
1675 (*vdite_o) = (*vdcite_oo);
1676 (*vdciteE)->addFittedDisplacementToValue( - (*vdciteE)->valueDisplacementByFitting() );
1692 std::vector<OpticalObject*> vopto;
1694 std::vector<OpticalObject*>::const_iterator vocite;
1695 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1696 (*vocite)->resetOriginalOriginalCoordinates();
1719 if( last_slash == -1 ) {
1730 os <<
"OPTICALOBJECT: " << c.
theName <<
" of type: " << c.
theType 1742 CLHEP::HepRotation
rm;
1759 const CLHEP::HepRotation& rmParent = optoAncestor->
rmGlob();
1764 std::cerr <<
" !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob " << std::endl;
1771 std::cout <<
" OpticalObject::getRotationAnglesInOptOFrame " <<
name() <<
" optoAncestor " << optoAncestor->
name() << std::endl;
1785 std::vector<double> newang(3);
1786 double angleX = entries[3]->value()+entries[3]->valueDisplacementByFitting();
1787 double angleY = entries[4]->value()+entries[4]->valueDisplacementByFitting();
1788 double angleZ = entries[5]->value()+entries[5]->valueDisplacementByFitting();
1790 std::cout <<
" angles as value entries: X= " << angleX <<
" Y= " << angleY <<
" Z " << angleZ << std::endl;
1819 object.rotateX(disp);
1822 object.rotateY(disp);
1825 object.rotateZ(disp);
1879 double diff = fabs( ang1 - ang2 );
1891 if( diff > 0.00001 ) {
1892 if( fabs( diff - 2*
M_PI ) > 0.00001 ) {
1906 if( fabs(val) < precision ) val = 0;
1927 if( rot ==
nullptr ) {
1928 rot =
new CLHEP::HepRotation();
1929 rot->rotateX( angleX );
1930 rot->rotateY( angleY );
1931 rot->rotateZ( angleZ );
1933 double sx =
sin(angleX);
1934 double cx =
cos(angleX);
1935 double sy =
sin(angleY);
1936 double cy =
cos(angleY);
1937 double sz =
sin(angleZ);
1938 double cz =
cos(angleZ);
1940 double rotxx = cy*cz;
1941 double rotxy = sx*sy*cz-cx*sz;
1942 double rotxz = cx*sy*cz+sx*sz;
1943 double rotyx = cy*sz;
1944 double rotyy = sx*sy*sz+cx*cz;
1945 double rotyz = cx*sy*sz-sx*cz;
1947 double rotzy = sx*cy;
1948 double rotzz = cx*cy;
1950 int matrixElemBad = 0;
1951 if( !
eq2ang( rot->xx(), rotxx ) ) {
1952 std::cerr <<
" EQUATION for xx() IS BAD " << rot->xx() <<
" <> " << rotxx << std::endl;
1955 if( !
eq2ang( rot->xy(), rotxy ) ) {
1956 std::cerr <<
" EQUATION for xy() IS BAD " << rot->xy() <<
" <> " << rotxy << std::endl;
1959 if( !
eq2ang( rot->xz(), rotxz ) ) {
1960 std::cerr <<
" EQUATION for xz() IS BAD " << rot->xz() <<
" <> " << rotxz << std::endl;
1963 if( !
eq2ang( rot->yx(), rotyx ) ) {
1964 std::cerr <<
" EQUATION for yx() IS BAD " << rot->yx() <<
" <> " << rotyx << std::endl;
1967 if( !
eq2ang( rot->yy(), rotyy ) ) {
1968 std::cerr <<
" EQUATION for yy() IS BAD " << rot->yy() <<
" <> " << rotyy << std::endl;
1971 if( !
eq2ang( rot->yz(), rotyz ) ) {
1972 std::cerr <<
" EQUATION for yz() IS BAD " << rot->yz() <<
" <> " << rotyz << std::endl;
1975 if( !
eq2ang( rot->zx(), rotzx ) ) {
1976 std::cerr <<
" EQUATION for zx() IS BAD " << rot->zx() <<
" <> " << rotzx << std::endl;
1979 if( !
eq2ang( rot->zy(), rotzy ) ) {
1980 std::cerr <<
" EQUATION for zy() IS BAD " << rot->zy() <<
" <> " << rotzy << std::endl;
1983 if( !
eq2ang( rot->zz(), rotzz ) ) {
1984 std::cerr <<
" EQUATION for zz() IS BAD " << rot->zz() <<
" <> " << rotzz << std::endl;
1989 return matrixElemBad;
1996 CLHEP::Hep3Vector dispVec;
1999 dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
2002 dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
2005 dispVec = CLHEP::Hep3Vector( 0., 0., disp );
2029 CLHEP::HepRotation rmParentInv = inverseOf(
parent()->
rmGlob() );
2030 cLocal = rmParentInv * cLocal;
2056 if( coorstr ==
"X" ) {
2058 }
else if( coorstr ==
"Y" ) {
2060 }
else if( coorstr ==
"Z" ) {
2080 if( coorstr ==
"X" ) {
2082 }
else if( coorstr ==
"Y" ) {
2084 }
else if( coorstr ==
"Z" ) {
2117 std::vector<OpticalAlignParam> exEnt = oaInfo.
extraEntries_;
2118 std::vector<OpticalAlignParam>::iterator ite;
2119 std::vector<ALIstring> wordlist;
2120 for( ite = exEnt.begin(); ite != exEnt.end(); ++ite ){
2122 wordlist.insert(wordlist.begin(), (*ite).dimType() );
2153 std::cout <<
"constructFromOptAligInfo constructed: " << *
this << std::endl;
2165 std::vector<ALIstring> wordlist;
2166 wordlist.push_back( oaParam.
name() );
2167 gcvt( oaParam.
value(), 10, chartmp );
2168 wordlist.push_back( chartmp );
2169 gcvt( oaParam.
sigma(), 10, chartmp );
2170 wordlist.push_back( chartmp );
2171 if( oaParam.
quality() == 0 ) {
2172 wordlist.push_back(
"fix");
2173 }
else if( oaParam.
quality() == 1 ) {
2174 wordlist.push_back(
"cal");
2175 }
else if( oaParam.
quality() == 2 ) {
2176 wordlist.push_back(
"unk");
2192 std::vector<OpticalAlignInfo>
children;
2194 std::vector<OpticalAlignInfo>::const_iterator ite;
2200 for(
int ii = 0;
ii < siz;
ii++ ){
2223 children.push_back(oaInfochild);
2225 std::cout <<
theName <<
"createComponentOptOsFromOptAlignInfo: children added " << oaInfochild.
name_ << std::endl;
2235 std::cout <<
"OpticalObject::createComponentsFromAlignInfo: N components = " << children.size() << std::endl;
2237 for( ite = children.begin(); ite != children.end(); ++ite ){
2245 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)
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
const std::vector< ALIdouble > & ExtraEntryValueOriginalList()
void resetGlobalCoordinates()
double approxTo0(double val)
void transformCylindrical2Cartesian()
CLHEP::HepRotation theRmGlob
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
const std::vector< Entry * > & ExtraEntryList() const
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)
Sin< T >::type sin(const T &t)
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
std::vector< ALIdouble > & ExtraEntryValueList()
std::vector< ALIdouble > theExtraEntryValueOriginalOriginalVector
const ALIbool findExtraEntryValueIfExists(const ALIstring &eename, ALIdouble &value) const
const std::vector< Entry * > & CoordinateEntryList() const
std::vector< Entry * > theCoordinateEntryVector
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()
virtual void makeMeasurement(LightRay &lightray, Measurement &meas)
void addExtraEntryValueToList(ALIdouble entry_value)
std::vector< double > getRotationAnglesInOptOFrame(const OpticalObject *optoAncestor, const std::vector< Entry * > &entries) const
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()
std::vector< ALIdouble > theExtraEntryValueVector
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)
static std::vector< OpticalObject * > & OptOList()
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< ALIdouble > theExtraEntryValueOriginalVector
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
friend std::ostream & operator<<(std::ostream &os, const OpticalObject &c)
void SetCentreGlobFromCentreLocal()
const CLHEP::Hep3Vector & centreGlob() const
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void displaceExtraEntry(const ALIuint entryNo, const ALIdouble disp)
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)
static std::vector< double > getRotationAnglesFromMatrix(CLHEP::HepRotation &rmLocal, double origAngleX, double origAngleY, double origAngleZ)
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)
std::map< ALIstring, ALIdouble, std::less< ALIstring > > & GlobalOptions()
virtual void constructMaterial()
CLHEP::Hep3Vector theCentreGlob
void addCoordinateEntryToList(Entry *entry)
void setGlobalCoordinates()
CLHEP::Hep3Vector axisZLocalInGlobal
static ALIdouble LengthValueDimensionFactor()
const ALIstring & type() const