Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:44:32

0001 //   COCOA class implementation file
0002 //Id:  OptOSensor2D.cc
0003 //CAT: Model
0004 //
0005 //   History: v1.0
0006 //   Pedro Arce
0007 
0008 #include "Alignment/CocoaModel/interface/OptOSensor2D.h"
0009 #include "Alignment/CocoaModel/interface/LightRay.h"
0010 #include "Alignment/CocoaModel/interface/ALIPlane.h"
0011 #include "Alignment/CocoaModel/interface/Measurement.h"
0012 #include "Alignment/CocoaModel/interface/Model.h"
0013 #include "Alignment/CocoaModel/interface/Entry.h"
0014 #include "Alignment/CocoaModel/interface/DeviationsFromFileSensor2D.h"
0015 #ifdef COCOA_VIS
0016 #include "Alignment/CocoaVisMgr/interface/ALIVRMLMgr.h"
0017 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
0018 #endif
0019 #include "Alignment/CocoaUtilities/interface/ALIFileIn.h"
0020 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeBox.h"
0021 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
0022 #include "FWCore/Utilities/interface/Exception.h"
0023 
0024 #include <iostream>
0025 #include <iomanip>
0026 #include <fstream>
0027 #include <cstdlib>
0028 #include <cmath>  // include floating-point std::abs functions
0029 
0030 using namespace CLHEP;
0031 
0032 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0033 //@@  Make measurement as distance to previous object 'screen'
0034 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0035 void OptOSensor2D::defaultBehaviour(LightRay& lightray, Measurement& meas) { makeMeasurement(lightray, meas); }
0036 
0037 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0038 //@@  Make measurement as distance to previous object 'screen'
0039 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0040 void OptOSensor2D::makeMeasurement(LightRay& lightray, Measurement& meas) {
0041   //---------- check is last and not the only one
0042   /*    if( vocite - OptOList().begin() == 0 ||
0043     OptOList().end() - vocite != 1) {
0044     std::cerr << " last and not only one Optical Object should be 'sensor2D' (unless you specify (:T)raverse) " <<
0045     OptOList().end() - vocite << " size " <<OptOList().size() << std::endl;
0046     DumpBadOrderOptOs(); 
0047     }*/
0048 
0049   //---------- Get simulated value
0050   //---------- Get intersection
0051   CLHEP::Hep3Vector ZAxis(0., 0, 1.);
0052   CLHEP::HepRotation rmt = rmGlob();
0053   ZAxis = rmt * ZAxis;
0054   if (ALIUtils::debug >= 4) {
0055     ALIUtils::dump3v(centreGlob(), " sensor2D centre Glob ");
0056     ALIUtils::dump3v(ZAxis, " snsor2D normal ");
0057   }
0058   //-  ALIUtils::dumprm( rmt, "rot global " );
0059   lightray.intersect(ALIPlane(centreGlob(), ZAxis));
0060   CLHEP::Hep3Vector inters = lightray.point();
0061 
0062   ALIdouble* interslc;
0063   interslc = convertPointToLocalCoordinates(inters);
0064   ALIdouble interslcx = interslc[0];
0065   ALIdouble interslcy = interslc[1];
0066   meas.setValueSimulated(0, interslcx);
0067   meas.setValueSimulated(1, interslcy);
0068 
0069   //----- Dump info
0070   if (ALIUtils::debug >= 2) {
0071     //--- Special for range studies
0072     ALIstring chrg = "";
0073     /*t    if(Model::Ncmslinkrange >= 1 && Model::Ncmslinkrange <= 8 ) {
0074       chrg = "RG";
0075     } else {
0076       chrg = "";
0077       } t*/
0078     CLHEP::Hep3Vector measvv(meas.value()[0], meas.value()[1], 0.);
0079     measvv = rmt * measvv;
0080     ALIUtils::dump3v(measvv, " $$$$$$MEAS IN LOCAL FRAME");
0081     ALIUtils::dump3v(measvv + centreGlob(), " $$$$$$MEAS IN GLOBAL FRAME");
0082 
0083     ALIdouble detH = 1000 * meas.valueSimulated(0);
0084     if (std::abs(detH) <= 1.e-9)
0085       detH = 0.;
0086     ALIdouble detV = 1000 * meas.valueSimulated(1);
0087     if (std::abs(detV) <= 1.e-9)
0088       detV = 0.;
0089     std::cout << "REAL value: " << chrg << meas.valueType(0) << ": " << 1000 * meas.value()[0] << chrg << " "
0090               << meas.valueType(1) << ": " << 1000 * meas.value()[1] << " (mm)  " << (this)->name()
0091               << "   DIFF= " << detH - 1000 * meas.value()[0] << " " << detV - 1000 * meas.value()[1] << std::endl;
0092     std::cout << "SIMU value: " << chrg << " " << meas.valueType(0)
0093               << ": "
0094               // << setprecision(3) << setw(4)
0095               << detH << chrg << " " << meas.valueType(1) << ": " << detV << " (mm)  " << (this)->name() << std::endl;
0096     /*-    std::cout << "SIMU value: " << chrg << " " << meas.valueType(0) << ": "
0097       // << setprecision(3) << setw(4)
0098               << detH / 0.3125
0099           << chrg << " " << meas.valueType(1) << ": " << detV / 0.3125
0100           << " STRIPS  " << (this)->name() << std::endl; */
0101     //   << detH
0102     //   << chrg << " V: " << detV
0103     //   << " (mm)  " << (this)->name() << std::endl;
0104     ALIUtils::dump3v(1000. * (inters - parent()->centreGlob()), " $$$$$$SIMU inters - parent centre");
0105     ALIUtils::dump3v(1000. * (inters - centreGlob()), " $$$$$$SIMU inters - centre");
0106   }
0107   //t    delete &lightray;
0108 
0109   // store the lightray position and direction
0110   meas.setLightRayPosition(lightray.point());
0111   meas.setLightRayDirection(lightray.direction());
0112 
0113   delete[] interslc;
0114 }
0115 
0116 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0117 //@@ Fast simulation of Light Ray traverses
0118 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0119 void OptOSensor2D::fastTraversesLightRay(LightRay& lightray) {
0120   verbose = ALIUtils::debug;
0121   if (ALIUtils::debug >= 2)
0122     std::cout << "LR: FAST TRAVERSES SENSOR2D  " << name() << std::endl;
0123 
0124   //---------- Shift and Deviate
0125 
0126   //---------- Get intersection
0127   CLHEP::Hep3Vector ZAxis(0., 0, 1.);
0128   CLHEP::HepRotation rmt = rmGlob();
0129   ZAxis = rmt * ZAxis;
0130   lightray.intersect(ALIPlane(centreGlob(), ZAxis));
0131   CLHEP::Hep3Vector inters = lightray.point();
0132 
0133   ALIdouble deviX, deviY, devi;
0134   // if deviationsFromFile are applied and this sensors has them get the deviations that corresponds to the intersection point.
0135   // Set this deviation as original one, as it will not be changed for derivatives
0136   if (DeviationsFromFileSensor2D::apply() && fdevi_from_file) {
0137     //-    std::cout << " DeviationsFromFileSensor2D::apply() " << DeviationsFromFileSensor2D::apply() << std::endl;
0138     if (ALIUtils::debug >= 4) {
0139       std::cout << "fdeviFromFile" << fdevi_from_file << std::endl;
0140       //-      std::cout << "deviFromFile" << deviFromFile << std::endl;
0141     }
0142     //--------- get measurement value of the current sensor
0143     std::vector<Measurement*>& measv = Model::MeasurementList();
0144     unsigned int ii;
0145     Measurement* omeas = nullptr;
0146     for (ii = 0; ii < measv.size(); ii++) {
0147       //-   std::cout << " sensor2d finding meas " <<  measv[ii]->sensorName() << " " << name() << std::endl;
0148       if (measv[ii]->sensorName() == name()) {
0149         omeas = measv[ii];
0150         break;
0151       }
0152     }
0153     if (omeas == nullptr) {
0154       throw cms::Exception("LogicError") << "@SUB=OptOSensor2D::fastTraversesLightRay\n"
0155                                          << "meas " << name() << " not found";
0156     }
0157 
0158     ALIdouble interslcx = omeas->value(0);
0159     ALIdouble interslcy = omeas->value(1);
0160     if (ALIUtils::debug >= 5)
0161       std::cout << " interslcx " << interslcx << " interslcy " << interslcy << std::endl;
0162     //----- transform in milimeters and positive
0163     //mum    interslcx = interslcx*1.E6 + 10000.;
0164     //mum    interslcy = interslcy*1.E6 + 10000.;
0165     ALIdouble df = ALIUtils::LengthValueDimensionFactor();
0166     interslcx = interslcx / df + 0.010 / df;
0167     interslcy = interslcy / df + 0.010 / df;
0168     if (ALIUtils::debug >= 5)
0169       std::cout << " interslcx " << interslcx << " interslcy " << interslcy << std::endl;
0170 
0171     //---------- Get deviations from file (they are in microrads)
0172     std::pair<ALIdouble, ALIdouble> devis = deviFromFile->getDevis(interslcx, interslcy);
0173     deviX = devis.second;
0174     deviY = -devis.first;
0175     // deviX = devis.first;
0176     //  deviY = devis.second;
0177 
0178     //o  deviX = *((deviFromFile->deviationsInX()).begin() + pointY*deviFromFile->nPoints() + pointX) * 1.E-6;;
0179     //o  deviY = *((deviFromFile->deviationsInY().begin()) + pointY*deviFromFile->nPoints() + pointX) * 1.E-6;
0180 
0181     //---------- Set this deviation value as original one, as it will not be changed for derivatives (change the entry and also the ExtraEntryValueOriginalList())
0182     ALIuint entryNo = extraEntryNo("deviX");
0183     if (verbose >= 3)
0184       std::cout << "entrynox" << entryNo << name() << verbose << std::endl;
0185     Entry* entryDeviX = *(ExtraEntryList().begin() + entryNo);
0186     entryDeviX->setValue(deviX);
0187     //-    std::vector< ALIdouble >::const_iterator eevolite = static_cast<std::vector< ALIdouble >::iterator>( ExtraEntryValueOriginalList().begin() );
0188     std::vector<ALIdouble> eevil = ExtraEntryValueOriginalList();
0189     //-    std::vector< ALIdouble >::const_iterator eevolite = ( ExtraEntryValueOriginalList().begin() );
0190     std::vector<ALIdouble>::iterator eevolite = eevil.begin();
0191 
0192     *(eevolite + entryNo) = deviX;
0193     if (verbose >= 3)
0194       std::cout << " entryDeviX name " << entryDeviX->name() << entryDeviX->value() << std::endl;
0195     entryNo = extraEntryNo("deviY");
0196     Entry* entryDeviY = *(ExtraEntryList().begin() + entryNo);
0197     //- std::cout << "entrynoy" << entryNo << name() << std::endl;
0198     entryDeviY->setValue(deviY);
0199     *(eevolite + entryNo) = deviY;
0200     //-  std::cout<< entryDeviY << " entryDeviY name " << entryDeviY->name() << entryDeviY->value() << std::endl;
0201 
0202   } else {
0203     deviX = findExtraEntryValue("deviX");
0204     deviY = findExtraEntryValue("deviY");
0205 
0206     //??? why previous does not work??
0207     if (fdevi_from_file) {
0208       if (ALIUtils::debug >= 5)
0209         std::cout << "fdeviFromFile" << fdevi_from_file << std::endl;
0210       ALIuint entryNo = extraEntryNo("deviX");
0211       Entry* entryDeviX = *(ExtraEntryList().begin() + entryNo);
0212       if (verbose >= 3)
0213         std::cout << entryDeviX << " entryDeviX name " << entryDeviX->name() << entryDeviX->value() << std::endl;
0214       deviX = entryDeviX->value();
0215       entryNo = extraEntryNo("deviY");
0216       Entry* entryDeviY = *(ExtraEntryList().begin() + entryNo);
0217       if (verbose >= 3)
0218         std::cout << entryDeviY << " entryDeviY name " << entryDeviY->name() << entryDeviY->value() << std::endl;
0219       deviY = entryDeviY->value();
0220 
0221     } else {
0222       ALIbool bb = findExtraEntryValueIfExists("devi", devi);
0223       if (bb) {
0224         deviX = devi;
0225         deviY = devi;
0226       }
0227       if (ALIUtils::debug >= 4) {
0228         std::cout << "devi " << devi << " devi x  " << deviX << " devi y  " << deviY << std::endl;
0229       }
0230     }
0231   }
0232   if (ALIUtils::debug >= 4) {
0233     std::cout << " devi x  " << deviX << " devi y  " << deviY << std::endl;
0234   }
0235 
0236   lightray.setPoint(inters);
0237 
0238   lightray.shiftAndDeviateWhileTraversing(this, 'T');
0239   if (ALIUtils::debug >= 2) {
0240     lightray.dumpData("Shifted and Deviated");
0241   }
0242 }
0243 
0244 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0245 //@@ Fast simulation of Light Ray traverses
0246 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0247 void OptOSensor2D::detailedTraversesLightRay(LightRay& lightray) {
0248   if (ALIUtils::debug >= 4)
0249     std::cout << "%%% LR: DETAILED TRAVERSES SENSOR2D  " << name() << std::endl;
0250   if (DeviationsFromFileSensor2D::apply() && fdevi_from_file) {
0251     DeviationsFromFileSensor2D::setApply(false);
0252     //- std::cout << "fdeviFromFile" << fdevi_from_file << std::endl;
0253     if (ALIUtils::debug >= 0)
0254       std::cerr << "!!WARNING: sensor " << name()
0255                 << " has read deviation from file and it will not be taken into account. Please use FAST TRAVERSES"
0256                 << deviFromFile << std::endl;
0257   }
0258 
0259   //---------- If width is 0, just keep the intersection point
0260   ALIdouble width = findExtraEntryValue("width");
0261   if (width == 0) {
0262     //---------- Get intersection
0263     CLHEP::Hep3Vector ZAxis(0., 0, 1.);
0264     CLHEP::HepRotation rmt = rmGlob();
0265     ZAxis = rmt * ZAxis;
0266     lightray.intersect(ALIPlane(centreGlob(), ZAxis));
0267     CLHEP::Hep3Vector inters = lightray.point();
0268     lightray.setPoint(inters);
0269     if (ALIUtils::debug >= 2) {
0270       lightray.dumpData("LightRay Sensor2D traversed: ");
0271     }
0272     return;
0273   }
0274 
0275   if (ALIUtils::debug >= 4)
0276     std::cout << std::endl << "$$$ LR: REFRACTION IN FORWARD PLATE " << std::endl;
0277   //---------- Get forward plate
0278   ALIPlane plate = getPlate(true, true);
0279   //---------- Refract while entering object
0280   ALIdouble refra_ind1 = 1.;
0281   ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
0282   lightray.refract(plate, refra_ind1, refra_ind2);
0283 
0284   if (ALIUtils::debug >= 4)
0285     std::cout << std::endl << "$$$ LR: REFRACTION IN BACKWARD PLATE " << std::endl;
0286   //---------- Get backward plate
0287   plate = getPlate(false, true);
0288   //---------- Refract while exiting splitter
0289   lightray.refract(plate, refra_ind2, refra_ind1);
0290 
0291   CLHEP::Hep3Vector inters = lightray.point();
0292   lightray.setPoint(inters);
0293 
0294   if (ALIUtils::debug >= 4) {
0295     lightray.dumpData("LightRay Sensor2D traversed: ");
0296   }
0297 }
0298 
0299 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0300 //@@ fillExtraEntry: fill it from file or fill it the usual way
0301 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0302 void OptOSensor2D::fillExtraEntry(std::vector<ALIstring>& wordlist) {
0303   if (ALIUtils::debug >= 5)
0304     std::cout << "OptOSensor2D fillExtraEntry wordlist[1] " << wordlist[1] << std::endl;
0305   //---------- check if it is deviation read from file
0306   fdevi_from_file = false;
0307   //-  std::cout << "WL " << wordlist[1]<< "WL " << wordlist[2]<< "WL " << wordlist[3] << std::endl;
0308   if (wordlist[1] == ALIstring("devi") && wordlist[2] == ALIstring("from_file")) {
0309     //---------- Open file
0310     ALIstring fnam;
0311     if (wordlist.size() >= 4) {
0312       fnam = wordlist[3];
0313     } else {
0314       //----- Build up file name if it does not exists
0315       fnam = "dat/devi-";
0316       fnam += shortName();
0317       fnam += ".dat";
0318     }
0319 
0320     ALIFileIn& ifdevi = ALIFileIn::getInstance(fnam);
0321 
0322     //----- Check that file exists
0323     if (ALIUtils::debug >= 4)
0324       std::cout << "Opening deviation file: " << fnam << std::endl;
0325     /*-    if( !ifdevi ) {
0326       std::cerr << " !!! Sensor2D Deviation file not found: " << fnam << " of object " << name() << std::endl;
0327       exit(1);
0328       }*/
0329 
0330     deviFromFile = new DeviationsFromFileSensor2D();
0331     fdevi_from_file = true;
0332     if (ALIUtils::debug >= 5)
0333       std::cout << "deviFromFile " << deviFromFile << std::endl;
0334     //----- Read header
0335     ALIstring sensor1_name, sensor2_name;
0336     ALIdouble sensor_dist;
0337     ALIdouble prec_deviX, prec_deviY;
0338 
0339     std::vector<ALIstring> wl;
0340     ifdevi.getWordsInLine(wl);
0341     sensor1_name = wl[0];
0342     sensor2_name = wl[1];
0343     sensor_dist = atof(wl[2].c_str());
0344     // 'c' means that light is traversing the glass
0345     if (sensor1_name[sensor1_name.size() - 2] == 'c') {
0346       sensor1_name = sensor1_name.substr(0, sensor1_name.size() - 1);
0347     }
0348     if (sensor2_name[sensor2_name.size() - 2] == 'c') {
0349       sensor2_name = sensor2_name.substr(0, sensor2_name.size() - 1);
0350     }
0351     if (ALIUtils::debug >= 5)
0352       std::cout << "sensor1_name " << sensor1_name << " sensor2_name " << sensor2_name << " sensor_dist " << sensor_dist
0353                 << " unknown " << wl[3] << std::endl;
0354 
0355     ifdevi.getWordsInLine(wl);
0356     prec_deviX = atof(wl[0].c_str());
0357     prec_deviY = atof(wl[1].c_str());
0358 
0359     if (ALIUtils::debug >= 5)
0360       std::cout << "prec_deviX " << prec_deviX << " prec_deviY " << prec_deviY << std::endl;
0361 
0362     deviFromFile = new DeviationsFromFileSensor2D();
0363     ALIdouble offsetX, offsetY;
0364     if (wl.size() == 5) {
0365       offsetX = ALIUtils::getFloat(wl[3]);
0366       offsetY = ALIUtils::getFloat(wl[4]);
0367       deviFromFile->setOffset(offsetX, offsetY);
0368     }
0369     deviFromFile->readFile(ifdevi);
0370     fdevi_from_file = true;
0371     if (ALIUtils::debug >= 5)
0372       std::cout << "deviFromFile " << deviFromFile << std::endl;
0373 
0374     //--- Fill extra entries 'deviX' & 'deviY' to compute derivatives
0375     std::vector<ALIstring> wlo;
0376     char chartmp[20];
0377     wlo.push_back(wordlist[0]);
0378     wlo.push_back("deviX");
0379     wlo.push_back("0");  // value is set to 0 as it is on the file and the point of intersection is not computed yet
0380     gcvt(prec_deviX, 10, chartmp);
0381     wlo.push_back(ALIstring(chartmp));
0382     wlo.push_back("cal");
0383     std::vector<ALIstring> wl2(wlo);
0384     OpticalObject::fillExtraEntry(wlo);
0385 
0386     wl2[1] = "deviY";
0387     gcvt(prec_deviY, 10, chartmp);
0388     wl2[3] = ALIstring(chartmp);
0389     OpticalObject::fillExtraEntry(wl2);
0390 
0391   } else {
0392     OpticalObject::fillExtraEntry(wordlist);
0393   }
0394 }
0395 
0396 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0397 //@@
0398 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0399 ALIdouble* OptOSensor2D::convertPointToLocalCoordinates(const CLHEP::Hep3Vector& point) {
0400   ALIdouble* interslc = new ALIdouble[2];
0401 
0402   //----- X value
0403   CLHEP::HepRotation rmt = rmGlob();
0404   CLHEP::Hep3Vector XAxism(1., 0., 0.);
0405   XAxism *= rmt;
0406   if (ALIUtils::debug >= 5)
0407     ALIUtils::dump3v((this)->centreGlob(), "centre glob sensor2D");
0408   if (ALIUtils::debug >= 5)
0409     ALIUtils::dumprm(rmt, "rotation matrix sensor2D");
0410   //t  ALIUtils::dump3v(point - (this)->centreGlob() , "inters - (this)->centreGlob()");
0411   if (ALIUtils::debug >= 5)
0412     ALIUtils::dump3v(XAxism, "XAxism");
0413   interslc[0] = (point - (this)->centreGlob()) * XAxism;
0414 
0415   //----- Y value
0416   CLHEP::Hep3Vector YAxism(0., 1., 0.);
0417   YAxism *= rmt;
0418   if (ALIUtils::debug >= 5)
0419     ALIUtils::dump3v(YAxism, "YAxism");
0420   interslc[1] = (point - (this)->centreGlob()) * YAxism;
0421 
0422   if (ALIUtils::debug >= 5) {
0423     std::cout << " intersection in local coordinates: X= " << interslc[0] << "  Y= " << interslc[1] << std::endl;
0424     ALIUtils::dump3v(point - (this)->centreGlob(), " inters - centre ");
0425   }
0426   return interslc;
0427 }
0428 
0429 #ifdef COCOA_VIS
0430 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0431 void OptOSensor2D::fillVRML() {
0432   //-  std::cout << " filling optosensor " << std::endl;
0433   ALIVRMLMgr& vrmlmgr = ALIVRMLMgr::getInstance();
0434   ALIColour* col = new ALIColour(0., 0., 1., 0.);
0435   vrmlmgr.AddBox(*this, 1., 1., .2, col);
0436   vrmlmgr.SendReferenceFrame(*this, 0.6);
0437   vrmlmgr.SendName(*this, 0.1);
0438 }
0439 
0440 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0441 void OptOSensor2D::fillIguana() {
0442   ALIColour* col = new ALIColour(0., 0., 1., 0.);
0443   std::vector<ALIdouble> spar;
0444   spar.push_back(20.);
0445   spar.push_back(20.);
0446   spar.push_back(5.);
0447   IgCocoaFileMgr::getInstance().addSolid(*this, "BOX", spar, col);
0448 }
0449 #endif
0450 
0451 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
0452 void OptOSensor2D::constructSolidShape() {
0453   ALIdouble go;
0454   GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
0455   gomgr->getGlobalOptionValue("VisScale", go);
0456 
0457   theSolidShape = new CocoaSolidShapeBox(
0458       "Box", go * 4. * cm / m, go * 4. * cm / m, go * 1. * cm / m);  //COCOA internal units are meters
0459 }