44 #include "CLHEP/Units/GlobalSystemOfUnits.h"
118 std::vector<ALIstring> wordlist;
120 if (wordlist[0] ==
ALIstring(
"ENTRY" ) ){
150 std::vector<ALIstring> wordlist;
172 if ( wordlist[0] ==
ALIstring(
"length") ) {
174 }
else if ( wordlist[0] ==
ALIstring(
"angle") ) {
176 }
else if ( wordlist[0] ==
ALIstring(
"nodim") ) {
179 std::cerr <<
"!!ERROR: Exiting... unknown type of Extra Entry " << wordlist[0] << std::endl;
188 wordlist.erase( wordlist.begin() );
199 xentry->
fill( wordlist );
221 ALIstring coor_type_reads = coor_type_read.substr(0,6);
222 if( coor_type_reads ==
"center" ) coor_type_reads =
"centre";
228 if(coor_type_read.size() == 7) {
229 if(coor_type_read[6] ==
'G' ) {
231 if(coor_type_expected ==
"centre" ) {
233 }
else if(coor_type_expected ==
"angles" ) {
240 std::vector<ALIstring> wordlist;
244 for(
int ii=0;
ii<4;
ii++ ) {
247 if ( coor_type_reads != coor_type_expected ) {
249 std::cerr <<
"readCoordinates: " << coor_type_expected <<
" should be read here, instead of " << coor_type_reads << std::endl;
255 coor_names[
ii-1] = wordlist[0];
268 std::cerr <<
"!!!EXITING: coordinates have to be cartesian (X ,Y ,Z), or cylindrical (R, PHI, Z) or spherical (R, THE, PHI) " << std::endl
269 <<
" they are " << coor_names[0] <<
", " << coor_names[1] <<
", " << coor_names[2] <<
"." << std::endl;
283 newcoor[0] = R*
cos(phi);
284 newcoor[1] = R*
sin(phi);
289 for( ii = 0; ii < siz; ii++ ) {
290 if(
ALIUtils::debug >= 5 )
std::cout <<
" OpticalObject::transformCylindrical2Cartesian " << ii <<
" " << newcoor[
ii] << std::endl;
318 if ( coor_type ==
ALIstring(
"centre") ) {
320 }
else if ( coor_type ==
ALIstring(
"angles") ) {
323 std::cerr <<
" !!! FATAL ERROR at OpticalObject::fillCoordinateEntry : wrong coordinate type " << coor_type << std::endl;
333 entry->
fill( wordlist );
353 for (
int ii=0;
ii<3;
ii++) {
388 ALIint copy_name_last_slash = opto->
name().rfind(
'/');
389 ALIint copy_name_size = opto->
name().length();
391 theName.append( opto->
name(), copy_name_last_slash, copy_name_size);
395 std::vector<Entry*>::const_iterator vecite;
397 std::vector<ALIstring> wordlist;
398 wordlist.push_back( (*vecite)->type() );
408 std::vector<ALIstring> wordlist;
413 coor_name =
"centre";
415 coor_name =
"angles";
429 wordlist.push_back( entry->
name() );
434 wordlist.push_back( chartmp );
438 wordlist.push_back( chartmp );
457 wordlist.push_back( strtmp );
475 std::vector<ALIstring> vopto_types;
488 std::vector<ALIstring>::iterator vsite;
489 std::vector<ALIstring> wordlist;
490 for( vsite=vopto_types.begin(); vsite!=vopto_types.end(); ++vsite ) {
502 }
else if( wordlist[0] ==
ALIstring(
"copy_components") ) {
507 }
else if ( wordlist[0] != (*vsite) ) {
509 std::cerr <<
"!!! Badly placed OpticalObject: " << wordlist[0] <<
" should be = " << (*vsite) << std::endl;
516 if( !fcopyComponents ) {
517 component_name +=
'/';
518 component_name += wordlist[1];
526 if( wordlist.size() == 3 ) {
544 if (
ALIUtils::debug >= 3 )
std::cout <<
" OpticalObject::createNewOptO optoType " << optoType <<
" optoName " << optoName <<
" parent " << parent->
name() << std::endl;
546 if( optoType ==
"laser" ) {
548 new OptOLaser(
this, optoType, optoName, fcopyComponents );
549 }
else if( optoType ==
"source" ) {
551 new OptOSource(
this, optoType, optoName, fcopyComponents );
552 }
else if( optoType ==
"Xlaser" ) {
554 new OptOXLaser(
this, optoType, optoName, fcopyComponents );
555 }
else if( optoType ==
"mirror" ){
557 new OptOMirror(
this, optoType, optoName, fcopyComponents );
558 }
else if( optoType ==
"plate_splitter" ) {
561 }
else if( optoType ==
"cube_splitter" ) {
564 }
else if( optoType ==
"modified_rhomboid_prism" ) {
567 }
else if( optoType ==
"pseudo_pentaprism" || optoType ==
"optical_square" ) {
570 }
else if( optoType ==
"lens" ) {
572 new OptOLens(
this, optoType, optoName, fcopyComponents );
573 }
else if( optoType ==
"Risley_prism" ) {
576 }
else if( optoType ==
"sensor2D" ) {
578 new OptOSensor2D(
this, optoType, optoName, fcopyComponents );
579 }
else if( optoType ==
"distancemeter" || optoType ==
"distancemeter1dim" ) {
582 }
else if( optoType ==
"distancemeter3dim" ) {
585 }
else if( optoType ==
"distance_target" ) {
587 new OptOScreen(
this, optoType, optoName, fcopyComponents );
588 }
else if( optoType ==
"tiltmeter" ) {
590 new OptOTiltmeter(
this, optoType, optoName, fcopyComponents );
591 }
else if( optoType ==
"pinhole" ) {
593 new OptOPinhole(
this, optoType, optoName, fcopyComponents );
594 }
else if( optoType ==
"COPS" ) {
596 new OptOCOPS(
this, optoType, optoName, fcopyComponents );
603 return OptOcomponent;
624 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily " << std::endl;
650 std::cout <<
" setGlobalRMOriginalOriginal OptO " <<
name() << std::endl;
668 std::vector<OpticalObject*> vopto;
674 std::vector<OpticalObject*>::const_iterator vocite;
675 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
676 CLHEP::HepRotation rmorioriLocalChild = (*vocite)->buildRmFromEntryValuesOriginalOriginal();
677 (*vocite)->setGlobalRMOriginalOriginal( rmorioriLocalChild );
687 std::cout <<
" propagateGlobalRMOriginalOriginalChangeToChildren OptO " <<
name() << std::endl;
694 std::vector<OpticalObject*> vopto;
700 std::vector<OpticalObject*>::const_iterator vocite;
701 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
703 (*vocite)->propagateGlobalRMOriginalOriginalChangeToChildren( rmorioriold, rmoriorinew );
711 CLHEP::HepRotation
rm;
716 rm.rotateX( cel[3]->valueOriginalOriginal() );
718 rm.rotateY( cel[4]->valueOriginalOriginal() );
720 rm.rotateZ( cel[5]->valueOriginalOriginal() );
824 opto_par = opto_par->
parent();
868 std::vector<ALIdouble>::const_iterator vdcite;
886 if ( behav ==
" " ) {
888 }
else if ( behav ==
"D" || behav ==
"DD" ) {
890 }
else if ( behav ==
"T" || behav ==
"DT" ) {
892 }
else if ( behav ==
"FD" ) {
894 }
else if ( behav ==
"FT" ) {
896 }
else if ( behav ==
"M" ) {
909 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement a default behaviour" << std::endl;
910 std::cerr <<
" You have to specify some behaviour, like :D or :T or ..." << std::endl;
920 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement deviation (:D)" << std::endl;
921 std::cerr <<
" Please read documentation for this object type" << std::endl;
931 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement the light traversing (:T)" << std::endl;
932 std::cerr <<
" Please read documentation for this object type" << std::endl;
942 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement detailed deviation (:DD / :D)" << std::endl;
943 std::cerr <<
" Please read documentation for this object type" << std::endl;
953 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement detailed traversing of light ray (:DT / :T)" << std::endl;
954 std::cerr <<
" Please read documentation for this object type" << std::endl;
964 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement making measurement (:M)" << std::endl;
965 std::cerr <<
" Please read documentation for this object type" << std::endl;
971 std::cerr <<
"!!! Optical Object " <<
name() <<
" of type " <<
type() <<
" does not implement user defined behaviour = " << behav << std::endl;
972 std::cerr <<
" Please read documentation for this object type" << std::endl;
994 CLHEP::Hep3Vector ZAxis(0.,0.,1.);
995 CLHEP::HepRotation rmt =
rmGlob();
996 CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
1001 ALIdouble normal_sign = -forwardPlate*2 + 1;
1002 plate_point += normal_sign * width/2. * plate_normal;
1015 CLHEP::Hep3Vector XAxis(1.,0.,0.);
1017 plate_normal.rotate( normal_sign * wedge/2., XAxis );
1020 CLHEP::Hep3Vector YAxis(0.,1.,0.);
1022 plate_normal.rotate( normal_sign * wedge/2., YAxis );
1029 return ALIPlane(plate_point, plate_normal);
1043 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1047 std::vector<OpticalObject*> vopto;
1053 std::vector<OpticalObject*>::const_iterator vocite;
1054 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1055 (*vocite)->displaceCentreGlob( dispVec );
1064 CLHEP::Hep3Vector dispVec;
1067 dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1070 dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
1073 dispVec = CLHEP::Hep3Vector( 0., 0., disp );
1076 std::cerr <<
"!!! DISPLACECENTREGLOB coordinate should be 0-2, not " << coor << std::endl;
1095 std::vector<OpticalObject*> vopto;
1100 std::vector<OpticalObject*>::const_iterator vocite;
1101 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1102 (*vocite)->displaceCentreGlob( dispVec );
1117 Pentry_value = (Pentry_orig_value) + disp;
1131 if (
ALIUtils::debug >= 4 )
std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1133 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1139 std::vector<OpticalObject*> vopto;
1141 std::vector<OpticalObject*>::const_iterator vocite;
1142 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1143 (*vocite)->displaceCentreGlobOriginal( dispVec );
1154 if (
ALIUtils::debug >= 4 )
std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1161 std::vector<OpticalObject*> vopto;
1163 std::vector<OpticalObject*>::const_iterator vocite;
1164 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1165 (*vocite)->displaceCentreGlobOriginal( dispVec );
1174 if (
ALIUtils::debug >= 4 )
std::cout <<
"@@ OpticalObject::displaceCentreGloboriginal " <<
name() <<
" " << coor <<
" " << disp << std::endl;
1176 CLHEP::Hep3Vector dispVec =
getDispVec( coor, disp );
1182 std::vector<OpticalObject*> vopto;
1184 std::vector<OpticalObject*>::const_iterator vocite;
1185 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1186 (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1197 if (
ALIUtils::debug >= 4 )
std::cout <<
" OpticalObject::displaceCentreGloboriginal " <<
name() <<
" dispVec " << dispVec << std::endl;
1204 std::vector<OpticalObject*> vopto;
1206 std::vector<OpticalObject*>::const_iterator vocite;
1207 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1208 (*vocite)->displaceCentreGlobOriginalOriginal( dispVec );
1235 if(opto1stRotated !=
this ) {
1238 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1246 std::vector<OpticalObject*> vopto;
1248 std::vector<OpticalObject*>::const_iterator vocite;
1249 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1250 (*vocite)->displaceRmGlobAroundGlobal( opto1stRotated, coor, disp);
1263 std::cerr <<
"!!!FATAL ERROR: angles in global coordinates not supported momentarily if 'rotateAroundGlobal' is set as a Global Option " << std::endl;
1273 if( coor ==
XCoor ) {
1284 if( coor ==
YCoor ) {
1295 if( coor ==
ZCoor ) {
1326 if(opto1stRotated !=
this ) {
1335 std::vector<OpticalObject*> vopto;
1337 std::vector<OpticalObject*>::const_iterator vocite;
1338 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1339 (*vocite)->displaceRmGlobAroundLocal( opto1stRotated, coor, 0.);
1351 std::vector<OpticalObject*> vopto;
1353 std::vector<OpticalObject*>::const_iterator vocite;
1354 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1355 (*vocite)->setGlobalCoordinates();
1380 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1388 if(opto1stRotated !=
this ) {
1391 CLHEP::Hep3Vector radius_rotated = radiusOriginal;
1394 radius_rotated.rotateX(disp);
1397 radius_rotated.rotateY(disp);
1400 radius_rotated.rotateZ(disp);
1413 std::vector<OpticalObject*> vopto;
1415 std::vector<OpticalObject*>::const_iterator vocite;
1416 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1417 (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1425 std::vector<OpticalObject*> vopto;
1427 std::vector<OpticalObject*>::const_iterator vocite;
1428 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1429 (*vocite)->displaceRmGlobOriginal( opto1stRotated, coor, disp);
1458 std::cerr <<
"!!! DISPLACERMGLOB coordinate should be 0-2, not " << coor << std::endl;
1466 if(opto1stRotated !=
this ) {
1469 CLHEP::Hep3Vector radius_rotated = radiusOriginalOriginal;
1472 radius_rotated.rotateX(disp);
1475 radius_rotated.rotateY(disp);
1478 radius_rotated.rotateZ(disp);
1491 std::vector<OpticalObject*> vopto;
1493 std::vector<OpticalObject*>::const_iterator vocite;
1494 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1495 (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1503 std::vector<OpticalObject*> vopto;
1505 std::vector<OpticalObject*>::const_iterator vocite;
1506 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1507 (*vocite)->displaceRmGlobOriginalOriginal( opto1stRotated, coor, disp);
1522 Pentry_orig_value += disp;
1533 Pentry_orig_value += disp;
1545 std::vector<Entry*>::const_iterator vecite;
1548 if ((*vecite)->name() == entry_name ) {
1565 if( entryNo >= 0 ) {
1567 retval = (Pentry_value);
1575 std::cerr <<
"!!OpticalObject:ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1583 if(
ALIUtils::debug >= 5)
std::cout <<
" OpticalObject::findExtraEntryValue: " << eename <<
" = " << retval << std::endl;
1596 std::cerr <<
"!!OpticalObject::findExtraEntryValueMustExist: ERROR: entry not found; " << eename <<
", in object " <<
name() << std::endl;
1612 return( entryNo >= 0 );
1628 std::vector<ALIdouble>::iterator vdite;
1632 (*vdite) = (*vdcite_o);
1636 std::vector<OpticalObject*> vopto;
1638 std::vector<OpticalObject*>::const_iterator vocite;
1639 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1640 (*vocite)->resetGlobalCoordinates();
1662 std::vector<ALIdouble>::iterator vdite;
1665 std::vector<Entry*>::const_iterator vdciteE =
ExtraEntryList().begin() ;
1668 (*vdite) = (*vdcite_oo);
1669 (*vdite_o) = (*vdcite_oo);
1670 (*vdciteE)->addFittedDisplacementToValue( - (*vdciteE)->valueDisplacementByFitting() );
1686 std::vector<OpticalObject*> vopto;
1688 std::vector<OpticalObject*>::const_iterator vocite;
1689 for (vocite = vopto.begin(); vocite != vopto.end(); ++vocite) {
1690 (*vocite)->resetOriginalOriginalCoordinates();
1713 if( last_slash == -1 ) {
1724 os <<
"OPTICALOBJECT: " << c.
theName <<
" of type: " << c.
theType
1736 CLHEP::HepRotation
rm;
1753 CLHEP::HepRotation rmParent = optoAncestor->
rmGlob();
1758 std::cerr <<
" !!!FATAL ERROR: OpticalObject::getRotationAnglesInOptOFrame theRmGlobOriginal != theRmGlob " << std::endl;
1765 std::cout <<
" OpticalObject::getRotationAnglesInOptOFrame " <<
name() <<
" optoAncestor " << optoAncestor->
name() << std::endl;
1779 std::vector<double> newang(3);
1780 double angleX = entries[3]->value()+entries[3]->valueDisplacementByFitting();
1781 double angleY = entries[4]->value()+entries[4]->valueDisplacementByFitting();
1782 double angleZ = entries[5]->value()+entries[5]->valueDisplacementByFitting();
1784 std::cout <<
" angles as value entries: X= " << angleX <<
" Y= " << angleY <<
" Z " << angleZ << std::endl;
1813 object.rotateX(disp);
1816 object.rotateY(disp);
1819 object.rotateZ(disp);
1873 double diff = fabs( ang1 - ang2 );
1874 diff = diff - int(diff/2./
M_PI) * 2 *
M_PI;
1885 if( diff > 0.00001 ) {
1886 if( fabs( diff - 2*
M_PI ) > 0.00001 ) {
1899 double precision = 1.e-9;
1900 if( fabs(val) < precision ) val = 0;
1922 rot =
new CLHEP::HepRotation();
1923 rot->rotateX( angleX );
1924 rot->rotateY( angleY );
1925 rot->rotateZ( angleZ );
1927 double sx =
sin(angleX);
1928 double cx =
cos(angleX);
1929 double sy =
sin(angleY);
1930 double cy =
cos(angleY);
1931 double sz =
sin(angleZ);
1932 double cz =
cos(angleZ);
1934 double rotxx = cy*cz;
1935 double rotxy = sx*sy*cz-cx*sz;
1936 double rotxz = cx*sy*cz+sx*sz;
1937 double rotyx = cy*sz;
1938 double rotyy = sx*sy*sz+cx*cz;
1939 double rotyz = cx*sy*sz-sx*cz;
1941 double rotzy = sx*cy;
1942 double rotzz = cx*cy;
1944 int matrixElemBad = 0;
1945 if( !
eq2ang( rot->xx(), rotxx ) ) {
1946 std::cerr <<
" EQUATION for xx() IS BAD " << rot->xx() <<
" <> " << rotxx << std::endl;
1949 if( !
eq2ang( rot->xy(), rotxy ) ) {
1950 std::cerr <<
" EQUATION for xy() IS BAD " << rot->xy() <<
" <> " << rotxy << std::endl;
1953 if( !
eq2ang( rot->xz(), rotxz ) ) {
1954 std::cerr <<
" EQUATION for xz() IS BAD " << rot->xz() <<
" <> " << rotxz << std::endl;
1957 if( !
eq2ang( rot->yx(), rotyx ) ) {
1958 std::cerr <<
" EQUATION for yx() IS BAD " << rot->yx() <<
" <> " << rotyx << std::endl;
1961 if( !
eq2ang( rot->yy(), rotyy ) ) {
1962 std::cerr <<
" EQUATION for yy() IS BAD " << rot->yy() <<
" <> " << rotyy << std::endl;
1965 if( !
eq2ang( rot->yz(), rotyz ) ) {
1966 std::cerr <<
" EQUATION for yz() IS BAD " << rot->yz() <<
" <> " << rotyz << std::endl;
1969 if( !
eq2ang( rot->zx(), rotzx ) ) {
1970 std::cerr <<
" EQUATION for zx() IS BAD " << rot->zx() <<
" <> " << rotzx << std::endl;
1973 if( !
eq2ang( rot->zy(), rotzy ) ) {
1974 std::cerr <<
" EQUATION for zy() IS BAD " << rot->zy() <<
" <> " << rotzy << std::endl;
1977 if( !
eq2ang( rot->zz(), rotzz ) ) {
1978 std::cerr <<
" EQUATION for zz() IS BAD " << rot->zz() <<
" <> " << rotzz << std::endl;
1983 return matrixElemBad;
1990 CLHEP::Hep3Vector dispVec;
1993 dispVec = CLHEP::Hep3Vector( disp, 0., 0. );
1996 dispVec = CLHEP::Hep3Vector( 0., disp, 0. );
1999 dispVec = CLHEP::Hep3Vector( 0., 0., disp );
2023 CLHEP::HepRotation rmParentInv = inverseOf(
parent()->
rmGlob() );
2024 cLocal = rmParentInv * cLocal;
2050 if( coorstr ==
"X" ) {
2052 }
else if( coorstr ==
"Y" ) {
2054 }
else if( coorstr ==
"Z" ) {
2074 if( coorstr ==
"X" ) {
2076 }
else if( coorstr ==
"Y" ) {
2078 }
else if( coorstr ==
"Z" ) {
2111 std::vector<OpticalAlignParam> exEnt = oaInfo.
extraEntries_;
2112 std::vector<OpticalAlignParam>::iterator ite;
2113 std::vector<ALIstring> wordlist;
2114 for( ite = exEnt.begin(); ite != exEnt.end(); ++ite ){
2116 wordlist.insert(wordlist.begin(), (*ite).dimType() );
2147 std::cout <<
"constructFromOptAligInfo constructed: " << *
this << std::endl;
2159 std::vector<ALIstring> wordlist;
2160 wordlist.push_back( oaParam.
name() );
2161 gcvt( oaParam.
value(), 10, chartmp );
2162 wordlist.push_back( chartmp );
2163 gcvt( oaParam.
sigma(), 10, chartmp );
2164 wordlist.push_back( chartmp );
2165 if( oaParam.
quality() == 0 ) {
2166 wordlist.push_back(
"fix");
2167 }
else if( oaParam.
quality() == 1 ) {
2168 wordlist.push_back(
"cal");
2169 }
else if( oaParam.
quality() == 2 ) {
2170 wordlist.push_back(
"unk");
2186 std::vector<OpticalAlignInfo> children;
2188 std::vector<OpticalAlignInfo>::const_iterator ite;
2194 for(
int ii = 0;
ii < siz;
ii++ ){
2217 children.push_back(oaInfochild);
2219 std::cout <<
theName <<
"createComponentOptOsFromOptAlignInfo: children added " << oaInfochild.
name_ << std::endl;
2229 std::cout <<
"OpticalObject::createComponentsFromAlignInfo: N components = " << children.size() << std::endl;
2231 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()
std::ostream & operator<<(std::ostream &out, const ALILine &li)
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
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)
tuple size
Write out results.
void setGlobalCoordinates()
CLHEP::Hep3Vector axisZLocalInGlobal
static ALIdouble LengthValueDimensionFactor()
const ALIstring & type() const