Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "Alignment/CocoaModel/interface/OptOSource.h"
00009 #include "Alignment/CocoaModel/interface/LightRay.h"
00010 #include "Alignment/CocoaModel/interface/Measurement.h"
00011 #include <iostream>
00012 #include <iomanip>
00013 #ifdef COCOA_VIS
00014 #include "Alignment/CocoaVisMgr/interface/ALIVRMLMgr.h"
00015 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
00016 #endif
00017 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00018 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeTubs.h"
00019 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
00020
00021
00022
00023 OptOSource::OptOSource()
00024 {
00025 setRmGlobalOriginal( CLHEP::HepRotation() );
00026 setRmGlobal( CLHEP::HepRotation() );
00027 }
00028
00029
00030
00031
00032 void OptOSource::defaultBehaviour( LightRay& lightray, Measurement& meas )
00033 {
00034 if(ALIUtils::debug >= 3) std::cout << "create laser lightray " << std::endl;
00035 lightray.startLightRay( this );
00036 }
00037
00038
00039 #ifdef COCOA_VIS
00040
00041 void OptOSource::fillVRML()
00042 {
00043 ALIVRMLMgr& vrmlmgr = ALIVRMLMgr::getInstance();
00044 ALIColour* col = new ALIColour( 1., 0., 0., 0. );
00045 vrmlmgr.AddBox( *this, 0.1, 0.1, 0.2,col);
00046 vrmlmgr.SendReferenceFrame( *this, 0.12);
00047 vrmlmgr.SendName( *this, 0.1 );
00048
00049 }
00050
00051
00052 void OptOSource::fillIguana()
00053 {
00054 ALIColour* col = new ALIColour( 1., 0., 0., 0. );
00055 std::vector<ALIdouble> spar;
00056 spar.push_back(1.);
00057 spar.push_back(2.);
00058 CLHEP::HepRotation rm;
00059 rm.rotateX( 90.*deg);
00060 IgCocoaFileMgr::getInstance().addSolid( *this, "CYLINDER", spar, col, CLHEP::Hep3Vector(), rm);
00061 }
00062 #endif
00063
00064
00065 void OptOSource::constructSolidShape()
00066 {
00067 ALIdouble go;
00068 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00069 gomgr->getGlobalOptionValue("VisScale", go );
00070
00071 theSolidShape = new CocoaSolidShapeTubs( "Tubs", go*0.*cm/m, go*1.*cm/m, go*2.*cm/m );
00072 }
00073