Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "Alignment/CocoaModel/interface/OptOPinhole.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/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
00015 #include "Alignment/CocoaVisMgr/interface/ALIColour.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
00024
00025
00026 void OptOPinhole::defaultBehaviour( LightRay& lightray, Measurement& meas )
00027 {
00028 if (ALIUtils::debug >= 2) std::cout << "LR: TRAVERSE PINHOLE " << name() << std::endl;
00029
00030
00031 CLHEP::Hep3Vector source = lightray.point();
00032 CLHEP::Hep3Vector pinhole = centreGlob();
00033 lightray.setDirection( pinhole - source );
00034 lightray.setPoint( pinhole );
00035
00036 if (ALIUtils::debug >= 4) {
00037 ALIUtils::dump3v( source, " source centre ");
00038 ALIUtils::dump3v( pinhole, " pinhole centre ");
00039 }
00040 if (ALIUtils::debug >= 3) {
00041 lightray.dumpData( "lightray at pinhole ");
00042 }
00043
00044 }
00045
00046
00047 #ifdef COCOA_VIS
00048
00049 void OptOPinhole::fillIguana()
00050 {
00051 ALIColour* col = new ALIColour( 1., 1., 1., 0. );
00052 std::vector<ALIdouble> spar;
00053 spar.push_back(0.2);
00054 spar.push_back(0.5);
00055 CLHEP::HepRotation rm;
00056 rm.rotateX( 90.*deg);
00057 IgCocoaFileMgr::getInstance().addSolid( *this, "CYLINDER", spar, col, CLHEP::Hep3Vector(), rm);
00058 }
00059
00060 #endif
00061
00062
00063
00064 void OptOPinhole::constructSolidShape()
00065 {
00066 ALIdouble go;
00067 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00068 gomgr->getGlobalOptionValue("VisScale", go );
00069
00070 theSolidShape = new CocoaSolidShapeTubs( "Tubs", go*0.*cm/m, go*1.*cm/m, go*1.*cm/m );
00071 }