CMS 3D CMS Logo

OptOSensor2D.cc

Go to the documentation of this file.
00001 //   COCOA class implementation file
00002 //Id:  OptOSensor2D.cc
00003 //CAT: Model
00004 //
00005 //   History: v1.0 
00006 //   Pedro Arce
00007 
00008 #include "Alignment/CocoaModel/interface/OptOSensor2D.h"
00009 #include "Alignment/CocoaModel/interface/LightRay.h"
00010 #include "Alignment/CocoaModel/interface/ALIPlane.h" 
00011 #include "Alignment/CocoaModel/interface/Measurement.h"
00012 #include "Alignment/CocoaModel/interface/Model.h"
00013 #include "Alignment/CocoaModel/interface/Entry.h"
00014 #include "Alignment/CocoaModel/interface/DeviationsFromFileSensor2D.h"
00015 #ifdef COCOA_VIS
00016 #include "Alignment/CocoaVisMgr/interface/ALIVRMLMgr.h"
00017 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
00018 #endif
00019 #include "Alignment/CocoaUtilities/interface/ALIFileIn.h"
00020 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeBox.h"
00021 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
00022 
00023 #include <iostream>
00024 #include <iomanip>
00025 #include <fstream>
00026 
00027 
00028 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00029 //@@  Make measurement as distance to previous object 'screen'
00030 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00031 void OptOSensor2D::defaultBehaviour( LightRay& lightray, Measurement& meas )
00032 {
00033   makeMeasurement( lightray, meas);
00034 }
00035 
00036 
00037 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00038 //@@  Make measurement as distance to previous object 'screen'
00039 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00040 void OptOSensor2D::makeMeasurement( LightRay& lightray, Measurement& meas ) 
00041 {
00042   //---------- check is last and not the only one
00043   /*    if( vocite - OptOList().begin() == 0 ||
00044     OptOList().end() - vocite != 1) {
00045     std::cerr << " last and not only one Optical Object should be 'sensor2D' (unless you specify (:T)raverse) " <<
00046     OptOList().end() - vocite << " size " <<OptOList().size() << std::endl;
00047     DumpBadOrderOptOs();          
00048     }*/
00049 
00050   //---------- Get simulated value 
00051   //---------- Get intersection 
00052   CLHEP::Hep3Vector ZAxis(0.,0,1.);
00053   CLHEP::HepRotation rmt = rmGlob();
00054   ZAxis = rmt * ZAxis;
00055   if( ALIUtils::debug >= 4 ) {
00056     ALIUtils::dump3v( centreGlob(), " sensor2D centre Glob ");
00057     ALIUtils::dump3v( ZAxis, " snsor2D normal ");
00058   }
00059   //-  ALIUtils::dumprm( rmt, "rot global " );
00060   lightray.intersect( ALIPlane(centreGlob(), ZAxis) );
00061   CLHEP::Hep3Vector inters = lightray.point();
00062   
00063   ALIdouble* interslc;
00064   interslc = convertPointToLocalCoordinates( inters );
00065   ALIdouble interslcx = interslc[0];
00066   ALIdouble interslcy = interslc[1];
00067   meas.setValueSimulated( 0, interslcx );
00068   meas.setValueSimulated( 1, interslcy );
00069   
00070   //----- Dump info
00071   if (ALIUtils::debug >= 2) {
00072     //--- Special for range studies
00073     ALIstring chrg = "";
00074     /*t    if(Model::Ncmslinkrange >= 1 && Model::Ncmslinkrange <= 8 ) {
00075       chrg = "RG";
00076     } else {
00077       chrg = "";
00078       } t*/
00079     CLHEP::Hep3Vector measvv( meas.value()[0], meas.value()[1], 0.);
00080     measvv = rmt*measvv;
00081     ALIUtils::dump3v( measvv, " $$$$$$MEAS IN LOCAL FRAME");
00082     ALIUtils::dump3v( measvv+centreGlob(), " $$$$$$MEAS IN GLOBAL FRAME");
00083 
00084     ALIdouble detH =  1000*meas.valueSimulated(0); if(fabs(detH) <= 1.e-9 ) detH = 0.;
00085     ALIdouble detV =  1000*meas.valueSimulated(1); if(fabs(detV) <= 1.e-9 ) detV = 0.;
00086     std::cout << "REAL value: " << chrg << meas.valueType(0) << ": " << 1000*meas.value()[0] << chrg << " " << meas.valueType(1) << ": " << 1000*meas.value()[1]  << " (mm)  " << (this)->name() 
00087          << "   DIFF= " << detH-1000*meas.value()[0] << " " << detV-1000*meas.value()[1] << std::endl;
00088     std::cout << "SIMU value: " << chrg << " " << meas.valueType(0) << ": "
00089       // << setprecision(3) << setw(4)
00090               << detH 
00091               << chrg << " " << meas.valueType(1) << ": " << detV 
00092               << " (mm)  " << (this)->name() << std::endl;
00093     /*-    std::cout << "SIMU value: " << chrg << " " << meas.valueType(0) << ": "
00094       // << setprecision(3) << setw(4)
00095               << detH / 0.3125
00096               << chrg << " " << meas.valueType(1) << ": " << detV / 0.3125
00097               << " STRIPS  " << (this)->name() << std::endl; */
00098     //   << detH 
00099     //   << chrg << " V: " << detV 
00100     //   << " (mm)  " << (this)->name() << std::endl;
00101     ALIUtils::dump3v( 1000.*(inters - parent()->centreGlob()) , " $$$$$$SIMU inters - parent centre");
00102     ALIUtils::dump3v(  1000.*(inters - centreGlob()) , " $$$$$$SIMU inters - centre");
00103   }
00104   //t    delete &lightray;    
00105   
00106   // store the lightray position and direction
00107   meas.setLightRayPosition( lightray.point() );
00108   meas.setLightRayDirection( lightray.direction() );
00109 }
00110 
00111 
00112 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00113 //@@ Fast simulation of Light Ray traverses
00114 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00115 void OptOSensor2D::fastTraversesLightRay( LightRay& lightray )
00116 {
00117   verbose = ALIUtils::debug;
00118   if (ALIUtils::debug >= 2) std::cout << "LR: FAST TRAVERSES SENSOR2D  " << name() << std::endl;
00119 
00120   //---------- Shift and Deviate
00121   ALIdouble shiftX = findExtraEntryValue("shiftX");
00122   ALIdouble shiftY = findExtraEntryValue("shiftY");
00123   ALIdouble shift;
00124   ALIbool bb = findExtraEntryValueIfExists("shift", shift);
00125   if( bb ) {
00126     shiftX = shift;
00127     shiftY = shift;
00128   }
00129 
00130   //---------- Get intersection 
00131   CLHEP::Hep3Vector ZAxis(0.,0,1.);
00132   CLHEP::HepRotation rmt = rmGlob();
00133   ZAxis = rmt * ZAxis;
00134   lightray.intersect( ALIPlane(centreGlob(), ZAxis) );
00135   CLHEP::Hep3Vector inters = lightray.point();
00136 
00137   ALIdouble deviX, deviY, devi;
00138   // if deviationsFromFile are applied and this sensors has them get the deviations that corresponds to the intersection point.
00139   // Set this deviation as original one, as it will not be changed for derivatives
00140   if( DeviationsFromFileSensor2D::apply() && fdevi_from_file) {
00141     //-    std::cout << " DeviationsFromFileSensor2D::apply() " << DeviationsFromFileSensor2D::apply() << std::endl;
00142     if(ALIUtils::debug >= 4) {
00143       std::cout << "fdeviFromFile" << fdevi_from_file << std::endl;
00144       //-      std::cout << "deviFromFile" << deviFromFile << std::endl;
00145     }
00146     //--------- get measurement value of the current sensor
00147     std::vector< Measurement* >& measv = Model::MeasurementList();
00148     uint ii;
00149     Measurement *omeas = 0;
00150     for( ii = 0; ii < measv.size(); ii++ ) {
00151       //-   std::cout << " sensor2d finding meas " <<  measv[ii]->sensorName() << " " << name() << std::endl;
00152       if( measv[ii]->sensorName() == name() ) {
00153         omeas = measv[ii];
00154         break;
00155       }
00156     }
00157     if( omeas == 0 ) {
00158       std::cerr << "!!!EXITING OptOSensor2D::fastTraversesLightRay: meas " << name() << " not found " << std::endl;
00159     }
00160 
00161     ALIdouble interslcx = omeas->value( 0 );
00162     ALIdouble interslcy = omeas->value( 1 );
00163     if(ALIUtils::debug >= 5) std::cout << " interslcx " << interslcx << " interslcy " << interslcy << std::endl;
00164     //----- transform in milimeters and positive
00165     //mum    interslcx = interslcx*1.E6 + 10000.;
00166     //mum    interslcy = interslcy*1.E6 + 10000.;
00167     ALIdouble df = ALIUtils::LengthValueDimensionFactor();
00168     interslcx = interslcx/df + 0.010/df;
00169     interslcy = interslcy/df + 0.010/df;
00170      if(ALIUtils::debug >= 5) std::cout << " interslcx " << interslcx << " interslcy " << interslcy << std::endl;
00171 
00172     //---------- Get deviations from file (they are in microrads)
00173     std::pair< ALIdouble, ALIdouble> devis = deviFromFile->getDevis( interslcx, interslcy );
00174     deviX = devis.second;
00175     deviY = -devis.first;
00176      // deviX = devis.first;
00177      //  deviY = devis.second;
00178     
00179     //o  deviX = *((deviFromFile->deviationsInX()).begin() + pointY*deviFromFile->nPoints() + pointX) * 1.E-6;;
00180     //o  deviY = *((deviFromFile->deviationsInY().begin()) + pointY*deviFromFile->nPoints() + pointX) * 1.E-6;
00181     
00182     //---------- Set this deviation value as original one, as it will not be changed for derivatives (change the entry and also the ExtraEntryValueOriginalList())
00183     ALIuint entryNo = extraEntryNo( "deviX" );
00184     if( verbose >= 3 ) std::cout << "entrynox" << entryNo << name() << verbose << std::endl;
00185     Entry* entryDeviX = *(ExtraEntryList().begin()+entryNo);
00186     entryDeviX->setValue( deviX );
00187     //-    std::vector< ALIdouble >::const_iterator eevolite = static_cast<std::vector< ALIdouble >::iterator>( ExtraEntryValueOriginalList().begin() );
00188     std::vector< ALIdouble > eevil = ExtraEntryValueOriginalList();
00189     //-    std::vector< ALIdouble >::const_iterator eevolite = ( ExtraEntryValueOriginalList().begin() );
00190     std::vector< ALIdouble >::iterator eevolite = eevil.begin();
00191 
00192     *(eevolite+entryNo) = deviX;
00193     if( verbose >= 3 ) std::cout<< " entryDeviX name " << entryDeviX->name() << entryDeviX->value() << std::endl;
00194     entryNo = extraEntryNo( "deviY" );
00195     Entry* entryDeviY = *(ExtraEntryList().begin()+entryNo);
00196     //- std::cout << "entrynoy" << entryNo << name() << std::endl;
00197     entryDeviY->setValue( deviY );
00198     *(eevolite+entryNo) = deviY;
00199     //-  std::cout<< entryDeviY << " entryDeviY name " << entryDeviY->name() << entryDeviY->value() << std::endl;
00200     
00201   } else {
00202     deviX = findExtraEntryValue("deviX");
00203     deviY = findExtraEntryValue("deviY");
00204 
00205     //??? why previous does not work??
00206     if( fdevi_from_file ) {
00207       if( ALIUtils::debug >= 5) std::cout << "fdeviFromFile" << fdevi_from_file << std::endl;
00208       ALIuint entryNo = extraEntryNo( "deviX" );
00209       Entry* entryDeviX = *(ExtraEntryList().begin()+entryNo);
00210      if( verbose >= 3 ) std::cout<< entryDeviX << " entryDeviX name " << entryDeviX->name() << entryDeviX->value() << std::endl;
00211       deviX = entryDeviX->value();
00212       entryNo = extraEntryNo( "deviY" );
00213       Entry* entryDeviY = *(ExtraEntryList().begin()+entryNo);
00214       if( verbose >= 3 )  std::cout<< entryDeviY << " entryDeviY name " << entryDeviY->name() << entryDeviY->value() << std::endl;
00215       deviY = entryDeviY->value();
00216 
00217     } else {
00218       bb = findExtraEntryValueIfExists("devi", devi);
00219       if( bb ) {
00220         deviX = devi;
00221         deviY = devi;
00222       }
00223     }
00224   }
00225   if(ALIUtils::debug >= 4) {
00226     std::cout << "devi " << devi << " devi x  " << deviX << " devi y  " << deviY << std::endl;
00227   }
00228 
00229   lightray.setPoint( inters );
00230 
00231   //  lightray.shiftAndDeviateWhileTraversing( this, shiftX, shiftY, 0., deviX, deviY, 0.);
00232   lightray.shiftAndDeviateWhileTraversing( this, 'T' );
00233   if (ALIUtils::debug >= 2) {
00234     lightray.dumpData("Shifted and Deviated");
00235   }
00236 
00237 }      
00238 
00239 
00240 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00241 //@@ Fast simulation of Light Ray traverses
00242 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00243 void OptOSensor2D::detailedTraversesLightRay( LightRay& lightray )
00244 {
00245   if (ALIUtils::debug >= 4) std::cout << "%%% LR: DETAILED TRAVERSES SENSOR2D  " << name() << std::endl;
00246   if( DeviationsFromFileSensor2D::apply() && fdevi_from_file) {
00247    DeviationsFromFileSensor2D::setApply( 0 );
00248    //- std::cout << "fdeviFromFile" << fdevi_from_file << std::endl;
00249     if(ALIUtils::debug >= 0 )std::cerr << "!!WARNING: sensor " << name() << " has read deviation from file and it will not be taken into account. Please use FAST TRAVERSES" << deviFromFile << std::endl;
00250   }
00251 
00252   //---------- If width is 0, just keep the intersection point 
00253   ALIdouble width = findExtraEntryValue("width");
00254   if( width == 0 ) {
00255     //---------- Get intersection 
00256     CLHEP::Hep3Vector ZAxis(0.,0,1.);
00257     CLHEP::HepRotation rmt = rmGlob();
00258     ZAxis = rmt * ZAxis;
00259     lightray.intersect( ALIPlane(centreGlob(), ZAxis) );
00260     CLHEP::Hep3Vector inters = lightray.point();
00261     lightray.setPoint( inters );
00262     if (ALIUtils::debug >= 2) {
00263       lightray.dumpData("LightRay Sensor2D traversed: "); 
00264     }
00265     return;
00266   }
00267 
00268   if (ALIUtils::debug >= 4) std::cout << std::endl << "$$$ LR: REFRACTION IN FORWARD PLATE " << std::endl;
00269   //---------- Get forward plate
00270   ALIPlane plate = getPlate(1, 1);
00271   //---------- Refract while entering object
00272   ALIdouble refra_ind1 = 1.;
00273   ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
00274   lightray.refract( plate, refra_ind1, refra_ind2 );
00275 
00276   if (ALIUtils::debug >= 4) std::cout << std::endl << "$$$ LR: REFRACTION IN BACKWARD PLATE " << std::endl;
00277   //---------- Get backward plate
00278   plate = getPlate(0, 1);
00279   //---------- Refract while exiting splitter
00280   lightray.refract( plate, refra_ind2, refra_ind1 );
00281 
00282   CLHEP::Hep3Vector inters = lightray.point();
00283   lightray.setPoint( inters );
00284 
00285   if (ALIUtils::debug >= 4) {
00286     lightray.dumpData("LightRay Sensor2D traversed: "); 
00287   }
00288 
00289 
00290 }     
00291 
00292 
00293 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00294 //@@ fillExtraEntry: fill it from file or fill it the usual way
00295 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00296 void OptOSensor2D::fillExtraEntry( std::vector<ALIstring>& wordlist )
00297 {
00298 
00299   if(ALIUtils::debug >= 5) std::cout << "OptOSensor2D fillExtraEntry wordlist[1] " << wordlist[1] << std::endl;
00300   //---------- check if it is deviation read from file 
00301   fdevi_from_file = 0;
00302   //-  std::cout << "WL " << wordlist[1]<< "WL " << wordlist[2]<< "WL " << wordlist[3] << std::endl;
00303   if( wordlist[1] == ALIstring("devi") && wordlist[2] == ALIstring("from_file") ) {
00304     //---------- Open file
00305     ALIstring fnam;
00306     if( wordlist.size() >= 4) {
00307       fnam = wordlist[3];
00308     } else {
00309     //----- Build up file name if it does not exists
00310       fnam = "dat/devi-";
00311       fnam += shortName(); 
00312       fnam += ".dat";
00313     }
00314 
00315     ALIFileIn& ifdevi = ALIFileIn::getInstance( fnam );
00316 
00317     //----- Check that file exists 
00318     if(ALIUtils::debug >= 4) std::cout << "Opening deviation file: " << fnam << std::endl;
00319     /*-    if( !ifdevi ) {
00320       std::cerr << " !!! Sensor2D Deviation file not found: " << fnam << " of object " << name() << std::endl;
00321       exit(1);
00322       }*/
00323 
00324     deviFromFile = new DeviationsFromFileSensor2D();
00325     fdevi_from_file = 1;
00326     if(ALIUtils::debug >= 5 ) std::cout << "deviFromFile " << deviFromFile << std::endl; 
00327     //----- Read header
00328     ALIstring sensor1_name, sensor2_name;
00329     ALIint sensor1_side, sensor2_side;
00330     ALIdouble sensor_dist;
00331     ALIdouble prec_deviX,prec_deviY;
00332 
00333     std::vector<ALIstring> wl;
00334     ifdevi.getWordsInLine( wl );
00335     sensor1_name = wl[0];
00336     sensor2_name = wl[1];
00337     sensor_dist = atof( wl[2].c_str() );
00338     // 'c' means that light is traversing the glass
00339     sensor1_side = 1;
00340     if(sensor1_name[sensor1_name.size()-2] == 'c') {
00341       sensor1_side = 2;
00342       sensor1_name = sensor1_name.substr(0,sensor1_name.size()-1);
00343     }
00344     sensor2_side = 1;
00345     if(sensor2_name[sensor2_name.size()-2] == 'c') {
00346       sensor2_side = 2;
00347       sensor2_name = sensor2_name.substr(0,sensor2_name.size()-1);
00348     }
00349     if(ALIUtils::debug >= 5) std::cout << "sensor1_name " << sensor1_name << " sensor2_name " << sensor2_name  << " sensor_dist " << sensor_dist << " unknown " << wl[3] << std::endl;
00350 
00351     ifdevi.getWordsInLine( wl );
00352     prec_deviX = atof( wl[0].c_str() );
00353     prec_deviY = atof( wl[1].c_str() );
00354 
00355     if(ALIUtils::debug >= 5) std::cout << "prec_deviX " <<  prec_deviX  << " prec_deviY " << prec_deviY << std::endl;
00356 
00357     deviFromFile = new DeviationsFromFileSensor2D();
00358     ALIdouble offsetX, offsetY;
00359     if( wl.size() == 5 ) {
00360       offsetX = ALIUtils::getFloat( wl[3] );
00361       offsetY = ALIUtils::getFloat( wl[4] );
00362       deviFromFile->setOffset( offsetX, offsetY );
00363     }
00364     deviFromFile->readFile( ifdevi );
00365     fdevi_from_file = 1;
00366     if(ALIUtils::debug >= 5 ) std::cout << "deviFromFile " << deviFromFile << std::endl; 
00367 
00368  
00369     //--- Fill extra entries 'deviX' & 'deviY' to compute derivatives 
00370     std::vector<ALIstring> wlo; 
00371     char chartmp[20];
00372     wlo.push_back( wordlist[0] );
00373     wlo.push_back("deviX");
00374     wlo.push_back("0"); // value is set to 0 as it is on the file and the point of intersection is not computed yet
00375     gcvt( prec_deviX, 10, chartmp );
00376     wlo.push_back( ALIstring(chartmp) );
00377     wlo.push_back("cal");
00378     std::vector<ALIstring> wl2(wlo); 
00379     OpticalObject::fillExtraEntry( wlo );
00380 
00381     wl2[1] = "deviY";   
00382     gcvt( prec_deviY, 10, chartmp );
00383     wl2[3] = ALIstring( chartmp );
00384     OpticalObject::fillExtraEntry( wl2 ); 
00385 
00386   } else {
00387     OpticalObject::fillExtraEntry( wordlist );
00388   }
00389 }
00390 
00391 
00392 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00393 //@@ 
00394 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00395 ALIdouble* OptOSensor2D::convertPointToLocalCoordinates( const CLHEP::Hep3Vector& point)
00396 {
00397   ALIdouble interslc[2];
00398   
00399   //----- X value
00400   CLHEP::HepRotation rmt = rmGlob();
00401   CLHEP::Hep3Vector XAxism(1.,0.,0.);
00402   XAxism*=rmt;
00403   if( ALIUtils::debug >= 5) ALIUtils::dump3v( (this)->centreGlob(),  "centre glob sensor2D" );
00404   if( ALIUtils::debug >= 5) ALIUtils::dumprm( rmt,  "rotation matrix sensor2D" );
00405   //t  ALIUtils::dump3v(point - (this)->centreGlob() , "inters - (this)->centreGlob()");
00406   if( ALIUtils::debug >= 5) ALIUtils::dump3v(XAxism , "XAxism");
00407   interslc[0] = (point - (this)->centreGlob() ) * XAxism;
00408   
00409   //----- Y value
00410   CLHEP::Hep3Vector YAxism(0.,1.,0.);
00411   YAxism*=rmt;
00412   if( ALIUtils::debug >= 5)
00413 ALIUtils::dump3v(YAxism , "YAxism");
00414   interslc[1] = (point - (this)->centreGlob() ) * YAxism;
00415   
00416   if( ALIUtils::debug >= 5 ) {
00417     std::cout << " intersection in local coordinates: X= " << interslc[0] << "  Y= " << interslc[1] << std::endl;
00418     ALIUtils::dump3v( point - (this)->centreGlob() , " inters - centre " );
00419   }
00420   return interslc;
00421 }
00422 
00423 #ifdef COCOA_VIS
00424 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00425 void OptOSensor2D::fillVRML()
00426 {
00427   //-  std::cout << " filling optosensor " << std::endl;
00428   ALIVRMLMgr& vrmlmgr = ALIVRMLMgr::getInstance();
00429   ALIColour* col = new ALIColour( 0., 0., 1., 0. );
00430   vrmlmgr.AddBox( *this, 1., 1., .2, col);
00431   vrmlmgr.SendReferenceFrame( *this, 0.6); 
00432   vrmlmgr.SendName( *this, 0.1 );
00433 }
00434 
00435 
00436 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00437 void OptOSensor2D::fillIguana()
00438 {
00439   ALIColour* col = new ALIColour( 0., 0., 1., 0. );
00440   std::vector<ALIdouble> spar;
00441   spar.push_back(20.);
00442   spar.push_back(20.);
00443   spar.push_back(5.);
00444   IgCocoaFileMgr::getInstance().addSolid( *this, "BOX", spar, col);
00445 }
00446 #endif
00447 
00448 
00449 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
00450 void OptOSensor2D::constructSolidShape()
00451 {
00452   ALIdouble go;
00453   GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00454   gomgr->getGlobalOptionValue("VisScale", go );
00455 
00456   theSolidShape = new CocoaSolidShapeBox( "Box", go*4.*cm/m, go*4.*cm/m, go*1.*cm/m ); //COCOA internal units are meters
00457 }

Generated on Tue Jun 9 17:23:40 2009 for CMSSW by  doxygen 1.5.4