File indexing completed on 2023-03-17 10:38:44
0001
0002
0003
0004
0005
0006
0007
0008 #include "Alignment/CocoaModel/interface/OptOSource.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/CocoaVisMgr/interface/ALIVRMLMgr.h"
0015 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
0016 #endif
0017 #include "CLHEP/Units/GlobalSystemOfUnits.h"
0018 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeTubs.h"
0019 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
0020
0021
0022 OptOSource::OptOSource() {
0023 setRmGlobalOriginal(CLHEP::HepRotation());
0024 setRmGlobal(CLHEP::HepRotation());
0025 }
0026
0027
0028
0029
0030 void OptOSource::defaultBehaviour(LightRay& lightray, Measurement& meas) {
0031 if (ALIUtils::debug >= 3)
0032 std::cout << "create laser lightray " << std::endl;
0033 lightray.startLightRay(this);
0034 }
0035
0036 #ifdef COCOA_VIS
0037
0038 void OptOSource::fillVRML() {
0039 ALIVRMLMgr& vrmlmgr = ALIVRMLMgr::getInstance();
0040 ALIColour* col = new ALIColour(1., 0., 0., 0.);
0041 vrmlmgr.AddBox(*this, 0.1, 0.1, 0.2, col);
0042 vrmlmgr.SendReferenceFrame(*this, 0.12);
0043 vrmlmgr.SendName(*this, 0.1);
0044 }
0045
0046
0047 void OptOSource::fillIguana() {
0048 ALIColour* col = new ALIColour(1., 0., 0., 0.);
0049 std::vector<ALIdouble> spar;
0050 spar.push_back(1.);
0051 spar.push_back(2.);
0052 CLHEP::HepRotation rm;
0053 rm.rotateX(90. * deg);
0054 IgCocoaFileMgr::getInstance().addSolid(*this, "CYLINDER", spar, col, CLHEP::Hep3Vector(), rm);
0055 }
0056 #endif
0057
0058
0059 void OptOSource::constructSolidShape() {
0060 ALIdouble go;
0061 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
0062 gomgr->getGlobalOptionValue("VisScale", go);
0063
0064 theSolidShape = new CocoaSolidShapeTubs(
0065 "Tubs", go * 0. * cm / m, go * 1. * cm / m, go * 2. * cm / m);
0066 }