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;
290 for( ii = 0; ii < siz; ii++ ) {
291 if(
ALIUtils::debug >= 5 )
std::cout <<
" OpticalObject::transformCylindrical2Cartesian " << ii <<
" " << newcoor[
ii] << std::endl;
319 if ( coor_type ==
ALIstring(
"centre") ) {
321 }
else if ( coor_type ==
ALIstring(
"angles") ) {
324 std::cerr <<
" !!! FATAL ERROR at OpticalObject::fillCoordinateEntry : wrong coordinate type " << coor_type << std::endl;
334 entry->
fill( wordlist );
354 for (
int ii=0;
ii<3;
ii++) {
389 ALIint copy_name_last_slash = opto->
name().rfind(
'/');
390 ALIint copy_name_size = opto->
name().length();
392 theName.append( opto->
name(), copy_name_last_slash, copy_name_size);
396 std::vector<Entry*>::const_iterator vecite;
398 std::vector<ALIstring> wordlist;
399 wordlist.push_back( (*vecite)->type() );
409 std::vector<ALIstring> wordlist;
414 coor_name =
"centre";
416 coor_name =
"angles";
430 wordlist.push_back( entry->
name() );
435 wordlist.push_back( chartmp );
439 wordlist.push_back( chartmp );
458 wordlist.push_back( strtmp );
476 std::vector<ALIstring> vopto_types;
489 std::vector<ALIstring>::iterator vsite;
490 std::vector<ALIstring> wordlist;
491 for( vsite=vopto_types.begin(); vsite!=vopto_types.end(); ++vsite ) {
503 }
else if( wordlist[0] ==
ALIstring(
"copy_components") ) {
508 }
else if ( wordlist[0] != (*vsite) ) {
510 std::cerr <<
"!!! Badly placed OpticalObject: " << wordlist[0] <<
" should be = " << (*vsite) << std::endl;
517 if( !fcopyComponents ) {
518 component_name +=
'/';
519 component_name += wordlist[1];
527 if( wordlist.size() == 3 ) {
545 if (
ALIUtils::debug >= 3 )
std::cout <<
" OpticalObject::createNewOptO optoType " << optoType <<
" optoName " << optoName <<
" parent " << parent->
name() << std::endl;
547 if( optoType ==
"laser" ) {
549 new OptOLaser(
this, optoType, optoName, fcopyComponents );
550 }
else if( optoType ==
"source" ) {
552 new OptOSource(
this, optoType, optoName, fcopyComponents );
553 }
else if( optoType ==
"Xlaser" ) {
555 new OptOXLaser(
this, optoType, optoName, fcopyComponents );
556 }
else if( optoType ==
"mirror" ){
558 new OptOMirror(
this, optoType, optoName, fcopyComponents );
559 }
else if( optoType ==
"plate_splitter" ) {
562 }
else if( optoType ==
"cube_splitter" ) {
565 }
else if( optoType ==
"modified_rhomboid_prism" ) {
568 }
else if( optoType ==
"pseudo_pentaprism" || optoType ==
"optical_square" ) {
571 }
else if( optoType ==
"lens" ) {
573 new OptOLens(
this, optoType, optoName, fcopyComponents );
574 }
else if( optoType ==
"Risley_prism" ) {
577 }
else if( optoType ==
"sensor2D" ) {
579 new OptOSensor2D(
this, optoType, optoName, fcopyComponents );
580 }
else if( optoType ==
"distancemeter" || optoType ==
"distancemeter1dim" ) {
583 }
else if( optoType ==
"distancemeter3dim" ) {
586 }
else if( optoType ==
"distance_target" ) {
588 new OptOScreen(
this, optoType, optoName, fcopyComponents );
589 }
else if( optoType ==
"tiltmeter" ) {
591 new OptOTiltmeter(
this, optoType, optoName, fcopyComponents );
592 }
else if( optoType ==
"pinhole" ) {
594 new OptOPinhole(
this, optoType, optoName, fcopyComponents );
595 }
else if( optoType ==
"COPS" ) {
597 new OptOCOPS(
this, optoType, optoName, fcopyComponents );
604 return OptOcomponent;
625 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
651 std::cout <<
" setGlobalRMOriginalOriginal OptO " <<
name() << std::endl;
669 std::vector<OpticalObject*> vopto;
675 std::vector<OpticalObject*>::const_iterator vocite;
676 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
677 CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
678 (*vocite)->setGlobalRMOriginalOriginal( rmorioriLocalChild );
688 std::cout <<
" propagateGlobalRMOriginalOriginalChangeToChildren OptO " <<
name() << std::endl;
695 std::vector<OpticalObject*> vopto;
701 std::vector<OpticalObject*>::const_iterator vocite;
702 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
704 (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmoriorinew );
712 CLHEP::HepRotation
rm;
717 rm.rotateX( cel[3]->valueOriginalOriginal() );
719 rm.rotateY( cel[4]->valueOriginalOriginal() );
721 rm.rotateZ( cel[5]->valueOriginalOriginal() );
825 opto_par = opto_par->
parent();
869 std::vector<ALIdouble>::const_iterator vdcite;
887 if ( behav ==
" " ) {
889 }
else if ( behav ==
"D" || behav ==
"DD" ) {
891 }
else if ( behav ==
"T" || behav ==
"DT" ) {
893 }
else if ( behav ==
"FD" ) {
895 }
else if ( behav ==
"FT" ) {
897 }
else if ( behav ==
"M" ) {
910 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement a default behaviour" << std::endl;
911 std::cerr <<
" You have to specify some behaviour, like :D or :T or ..." << std::endl;
921 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement deviation (:D)" << std::endl;
922 std::cerr <<
" Please read documentation for this object type" << std::endl;
932 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement the light traversing (:T)" << std::endl;
933 std::cerr <<
" Please read documentation for this object type" << std::endl;
943 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement detailed deviation (:DD / :D)" << std::endl;
944 std::cerr <<
" Please read documentation for this object type" << std::endl;
954 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
955 std::cerr <<
" Please read documentation for this object type" << std::endl;
965 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement making measurement (:M)" << std::endl;
966 std::cerr <<
" Please read documentation for this object type" << std::endl;
972 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement user defined behaviour = " << behav << std::endl;
973 std::cerr <<
" Please read documentation for this object type" << std::endl;
995 CLHEP::Hep3Vector ZAxis(0.,0.,1.);
996 CLHEP::HepRotation rmt =
rmGlob();
997 CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
1000 CLHEP::Hep3Vector plate_point =
centreGlob();
1002 ALIdouble normal_sign = -forwardPlate*2 + 1;
1003 plate_point += normal_sign * width/2. * plate_normal;
1016 CLHEP::Hep3Vector XAxis(1.,0.,0.);
1018 plate_normal.rotate( normal_sign * wedge/2., XAxis );
1021 CLHEP::Hep3Vector YAxis(0.,1.,0.);
1023 plate_normal.rotate( normal_sign * wedge/2., YAxis );
1030 return ALIPlane(plate_point, plate_normal);
1044 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1048 std::vector<OpticalObject*> vopto;
1054 std::vector<OpticalObject*>::const_iterator vocite;
1055 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1056 (*vocite)->displaceCentreGlob( dispVec );
1065 CLHEP::Hep3Vector dispVec;
1068 dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1071 dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
1074 dispVec = CLHEP::Hep3Vector( 0., 0., disp );
1077 std::cerr <<
"!!! DISPLACECENTREGLOB coordinate should be 0-2, not " << coor << std::endl;
1096 std::vector<OpticalObject*> vopto;
1101 std::vector<OpticalObject*>::const_iterator vocite;
1102 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1103 (*vocite)->displaceCentreGlob( dispVec );
1118 Pentry_value = (Pentry_orig_value) + disp;
1119 LogDebug(
"OpticalObject::displaceExtraEntry")
1120 <<
" displaceExtraEntry " << Pentry_value <<
" <> " << Pentry_orig_value
1134 if (
ALIUtils::debug >= 4 )
std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1136 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1142 std::vector<OpticalObject*> vopto;
1144 std::vector<OpticalObject*>::const_iterator vocite;
1145 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1146 (*vocite)->displaceCentreGlobOriginal( dispVec );
1157 if (
ALIUtils::debug >= 4 )
std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1164 std::vector<OpticalObject*> vopto;
1166 std::vector<OpticalObject*>::const_iterator vocite;
1167 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1168 (*vocite)->displaceCentreGlobOriginal( dispVec );
1177 if (
ALIUtils::debug >= 4 )
std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1179 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1185 std::vector<OpticalObject*> vopto;
1187 std::vector<OpticalObject*>::const_iterator vocite;
1188 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1189 (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1200 if (
ALIUtils::debug >= 4 )
std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1207 std::vector<OpticalObject*> vopto;
1209 std::vector<OpticalObject*>::const_iterator vocite;
1210 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1211 (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1238 if(opto1stRotated !=
this ) {
1241 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1249 std::vector<OpticalObject*> vopto;
1251 std::vector<OpticalObject*>::const_iterator vocite;
1252 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1253 (*vocite)->displaceRmGlobAroundGlobal( opto1stRotated, coor, disp);
1266 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily if 'rotateAroundGlobal' is set as a Global Option " << std::endl;
1276 if( coor ==
XCoor ) {
1287 if( coor ==
YCoor ) {
1298 if( coor ==
ZCoor ) {
1329 if(opto1stRotated !=
this ) {
1338 std::vector<OpticalObject*> vopto;
1340 std::vector<OpticalObject*>::const_iterator vocite;
1341 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1342 (*vocite)->displaceRmGlobAroundLocal( opto1stRotated, coor, 0.);
1354 std::vector<OpticalObject*> vopto;
1356 std::vector<OpticalObject*>::const_iterator vocite;
1357 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1358 (*vocite)->setGlobalCoordinates();
1383 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1391 if(opto1stRotated !=
this ) {
1394 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1397 radius_rotated.rotateX(disp);
1400 radius_rotated.rotateY(disp);
1403 radius_rotated.rotateZ(disp);
1416 std::vector<OpticalObject*> vopto;
1418 std::vector<OpticalObject*>::const_iterator vocite;
1419 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1420 (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1428 std::vector<OpticalObject*> vopto;
1430 std::vector<OpticalObject*>::const_iterator vocite;
1431 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1432 (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1461 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1469 if(opto1stRotated !=
this ) {
1472 CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1475 radius_rotated.rotateX(disp);
1478 radius_rotated.rotateY(disp);
1481 radius_rotated.rotateZ(disp);
1494 std::vector<OpticalObject*> vopto;
1496 std::vector<OpticalObject*>::const_iterator vocite;
1497 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1498 (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1506 std::vector<OpticalObject*> vopto;
1508 std::vector<OpticalObject*>::const_iterator vocite;
1509 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1510 (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1525 Pentry_orig_value += disp;
1536 Pentry_orig_value += disp;
1548 std::vector<Entry*>::const_iterator vecite;
1551 if ((*vecite)->name() == entry_name ) {
1568 if( entryNo >= 0 ) {
1570 retval = (Pentry_value);
1578 std::cerr <<
"!!OpticalObject:ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1586 if(
ALIUtils::debug >= 5)
std::cout <<
" OpticalObject::findExtraEntryValue: " << eename <<
" = " << retval << std::endl;
1599 std::cerr <<
"!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1615 return( entryNo >= 0 );
1631 std::vector<ALIdouble>::iterator vdite;
1635 (*vdite) = (*vdcite_o);
1639 std::vector<OpticalObject*> vopto;
1641 std::vector<OpticalObject*>::const_iterator vocite;
1642 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1643 (*vocite)->resetGlobalCoordinates();
1665 std::vector<ALIdouble>::iterator vdite;
1668 std::vector<Entry*>::const_iterator vdciteE =
ExtraEntryList().begin() ;
1671 (*vdite) = (*vdcite_oo);
1672 (*vdite_o) = (*vdcite_oo);
1673 (*vdciteE)->addFittedDisplacementToValue( - (*vdciteE)->valueDisplacementByFitting() );
1689 std::vector<OpticalObject*> vopto;
1691 std::vector<OpticalObject*>::const_iterator vocite;
1692 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1693 (*vocite)->resetOriginalOriginalCoordinates();
1716 if( last_slash == -1 ) {
1727 os <<
"OPTICALOBJECT: " << c.
theName <<
" of type: " << c.
theType 1739 CLHEP::HepRotation
rm;
1756 CLHEP::HepRotation rmParent = optoAncestor->
rmGlob();
1761 std::cerr <<
" !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob " << std::endl;
1768 std::cout <<
" OpticalObject::getRotationAnglesInOptOFrame " <<
name() <<
" optoAncestor " << optoAncestor->
name() << std::endl;
1782 std::vector<double> newang(3);
1783 double angleX = entries[3]->value()+entries[3]->valueDisplacementByFitting();
1784 double angleY = entries[4]->value()+entries[4]->valueDisplacementByFitting();
1785 double angleZ = entries[5]->value()+entries[5]->valueDisplacementByFitting();
1787 std::cout <<
" angles as value entries: X= " << angleX <<
" Y= " << angleY <<
" Z " << angleZ << std::endl;
1816 object.rotateX(disp);
1819 object.rotateY(disp);
1822 object.rotateZ(disp);
1876 double diff = fabs( ang1 - ang2 );
1888 if( diff > 0.00001 ) {
1889 if( fabs( diff - 2*
M_PI ) > 0.00001 ) {
1902 double precision = 1.e-9;
1903 if( fabs(val) < precision ) val = 0;
1925 rot =
new CLHEP::HepRotation();
1926 rot->rotateX( angleX );
1927 rot->rotateY( angleY );
1928 rot->rotateZ( angleZ );
1930 double sx =
sin(angleX);
1931 double cx =
cos(angleX);
1932 double sy =
sin(angleY);
1933 double cy =
cos(angleY);
1934 double sz =
sin(angleZ);
1935 double cz =
cos(angleZ);
1937 double rotxx = cy*cz;
1938 double rotxy = sx*sy*cz-cx*sz;
1939 double rotxz = cx*sy*cz+sx*sz;
1940 double rotyx = cy*sz;
1941 double rotyy = sx*sy*sz+cx*cz;
1942 double rotyz = cx*sy*sz-sx*cz;
1944 double rotzy = sx*cy;
1945 double rotzz = cx*cy;
1947 int matrixElemBad = 0;
1948 if( !
eq2ang( rot->xx(), rotxx ) ) {
1949 std::cerr <<
" EQUATION for xx() IS BAD " << rot->xx() <<
" <> " << rotxx << std::endl;
1952 if( !
eq2ang( rot->xy(), rotxy ) ) {
1953 std::cerr <<
" EQUATION for xy() IS BAD " << rot->xy() <<
" <> " << rotxy << std::endl;
1956 if( !
eq2ang( rot->xz(), rotxz ) ) {
1957 std::cerr <<
" EQUATION for xz() IS BAD " << rot->xz() <<
" <> " << rotxz << std::endl;
1960 if( !
eq2ang( rot->yx(), rotyx ) ) {
1961 std::cerr <<
" EQUATION for yx() IS BAD " << rot->yx() <<
" <> " << rotyx << std::endl;
1964 if( !
eq2ang( rot->yy(), rotyy ) ) {
1965 std::cerr <<
" EQUATION for yy() IS BAD " << rot->yy() <<
" <> " << rotyy << std::endl;
1968 if( !
eq2ang( rot->yz(), rotyz ) ) {
1969 std::cerr <<
" EQUATION for yz() IS BAD " << rot->yz() <<
" <> " << rotyz << std::endl;
1972 if( !
eq2ang( rot->zx(), rotzx ) ) {
1973 std::cerr <<
" EQUATION for zx() IS BAD " << rot->zx() <<
" <> " << rotzx << std::endl;
1976 if( !
eq2ang( rot->zy(), rotzy ) ) {
1977 std::cerr <<
" EQUATION for zy() IS BAD " << rot->zy() <<
" <> " << rotzy << std::endl;
1980 if( !
eq2ang( rot->zz(), rotzz ) ) {
1981 std::cerr <<
" EQUATION for zz() IS BAD " << rot->zz() <<
" <> " << rotzz << std::endl;
1986 return matrixElemBad;
1993 CLHEP::Hep3Vector dispVec;
1996 dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1999 dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
2002 dispVec = CLHEP::Hep3Vector( 0., 0., disp );
2026 CLHEP::HepRotation rmParentInv = inverseOf(
parent()->
rmGlob() );
2027 cLocal = rmParentInv * cLocal;
2053 if( coorstr ==
"X" ) {
2055 }
else if( coorstr ==
"Y" ) {
2057 }
else if( coorstr ==
"Z" ) {
2077 if( coorstr ==
"X" ) {
2079 }
else if( coorstr ==
"Y" ) {
2081 }
else if( coorstr ==
"Z" ) {
2114 std::vector<OpticalAlignParam> exEnt = oaInfo.
extraEntries_;
2115 std::vector<OpticalAlignParam>::iterator ite;
2116 std::vector<ALIstring> wordlist;
2117 for( ite = exEnt.begin(); ite != exEnt.end(); ++ite ){
2119 wordlist.insert(wordlist.begin(), (*ite).dimType() );
2150 std::cout <<
"constructFromOptAligInfo constructed: " << *
this << std::endl;
2162 std::vector<ALIstring> wordlist;
2163 wordlist.push_back( oaParam.
name() );
2164 gcvt( oaParam.
value(), 10, chartmp );
2165 wordlist.push_back( chartmp );
2166 gcvt( oaParam.
sigma(), 10, chartmp );
2167 wordlist.push_back( chartmp );
2168 if( oaParam.
quality() == 0 ) {
2169 wordlist.push_back(
"fix");
2170 }
else if( oaParam.
quality() == 1 ) {
2171 wordlist.push_back(
"cal");
2172 }
else if( oaParam.
quality() == 2 ) {
2173 wordlist.push_back(
"unk");
2189 std::vector<OpticalAlignInfo>
children;
2191 std::vector<OpticalAlignInfo>::const_iterator ite;
2197 for(
int ii = 0;
ii < siz;
ii++ ){
2220 children.push_back(oaInfochild);
2222 std::cout <<
theName <<
"createComponentOptOsFromOptAlignInfo: children added " << oaInfochild.
name_ << std::endl;
2232 std::cout <<
"OpticalObject::createComponentsFromAlignInfo: N components = " << children.size() << std::endl;
2234 for( ite = children.begin(); ite != children.end(); ++ite ){
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=0)
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