File indexing completed on 2024-05-10 02:20:14
0001
0002
0003
0004
0005
0006
0007
0008 #include "Alignment/CocoaModel/interface/OptOPinhole.h"
0009 #include "Alignment/CocoaModel/interface/LightRay.h"
0010 #include "Alignment/CocoaModel/interface/Measurement.h"
0011 #include <iostream>
0012 #include <iomanip>
0013 #ifdef COCOA_VIS
0014 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
0015 #include "Alignment/CocoaVisMgr/interface/ALIColour.h"
0016 #endif
0017 #include <CLHEP/Units/SystemOfUnits.h>
0018 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeTubs.h"
0019 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
0020
0021
0022
0023
0024
0025 void OptOPinhole::defaultBehaviour(LightRay& lightray, Measurement& meas) {
0026 if (ALIUtils::debug >= 2)
0027 std::cout << "LR: TRAVERSE PINHOLE " << name() << std::endl;
0028
0029
0030 CLHEP::Hep3Vector source = lightray.point();
0031 CLHEP::Hep3Vector pinhole = centreGlob();
0032 lightray.setDirection(pinhole - source);
0033 lightray.setPoint(pinhole);
0034
0035 if (ALIUtils::debug >= 4) {
0036 ALIUtils::dump3v(source, " source centre ");
0037 ALIUtils::dump3v(pinhole, " pinhole centre ");
0038 }
0039 if (ALIUtils::debug >= 3) {
0040 lightray.dumpData("lightray at pinhole ");
0041 }
0042 }
0043
0044 #ifdef COCOA_VIS
0045
0046 void OptOPinhole::fillIguana() {
0047 ALIColour* col = new ALIColour(1., 1., 1., 0.);
0048 std::vector<ALIdouble> spar;
0049 spar.push_back(0.2);
0050 spar.push_back(0.5);
0051 CLHEP::HepRotation rm;
0052 rm.rotateX(90. * deg);
0053 IgCocoaFileMgr::getInstance().addSolid(*this, "CYLINDER", spar, col, CLHEP::Hep3Vector(), rm);
0054 }
0055
0056 #endif
0057
0058
0059 void OptOPinhole::constructSolidShape() {
0060 ALIdouble go;
0061 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
0062 gomgr->getGlobalOptionValue("VisScale", go);
0063
0064 theSolidShape = new CocoaSolidShapeTubs("Tubs",
0065 go * 0. * CLHEP::cm / CLHEP::m,
0066 go * 1. * CLHEP::cm / CLHEP::m,
0067 go * 1. * CLHEP::cm / CLHEP::m);
0068 }