Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2023-10-25 09:31:45

0001 //   COCOA class implementation file

0002 //Id:  OptOLaser.cc

0003 //CAT: Model

0004 //

0005 //   History: v1.0

0006 //   Pedro Arce

0007 
0008 #include "Alignment/CocoaModel/interface/OptOLaser.h"
0009 #include "Alignment/CocoaModel/interface/LightRay.h"
0010 #include "Alignment/CocoaModel/interface/Measurement.h"
0011 #ifdef COCOA_VIS
0012 #include "Alignment/CocoaVisMgr/interface/ALIVRMLMgr.h"
0013 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
0014 #endif
0015 #include "CLHEP/Units/GlobalSystemOfUnits.h"
0016 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeTubs.h"
0017 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
0018 
0019 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

0020 //@@ default behaviour: create a LightRay object

0021 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

0022 void OptOLaser::defaultBehaviour(LightRay& lightray, Measurement& meas) {
0023   if (ALIUtils::debug >= 3)
0024     std::cout << "create laser lightray " << std::endl;
0025   lightray.startLightRay(this);
0026 }
0027 
0028 #ifdef COCOA_VIS
0029 //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

0030 void OptOLaser::fillVRML() {
0031   ALIVRMLMgr& vrmlmgr = ALIVRMLMgr::getInstance();
0032   ALIColour* col = new ALIColour(1., 0., 0., 0.);
0033   vrmlmgr.AddBox(*this, 0.2, 0.2, 0.5, col);
0034   vrmlmgr.SendReferenceFrame(*this, 0.12);
0035   vrmlmgr.SendName(*this, 0.1);
0036 }
0037 
0038 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

0039 void OptOLaser::fillIguana() {
0040   ALIColour* col = new ALIColour(1., 0., 0., 0.);
0041   std::vector<ALIdouble> spar;
0042   spar.push_back(1.);
0043   spar.push_back(5.);
0044   CLHEP::HepRotation rm;
0045   rm.rotateX(90. * deg);
0046   IgCocoaFileMgr::getInstance().addSolid(*this, "CYLINDER", spar, col, CLHEP::Hep3Vector(), rm);
0047 }
0048 #endif
0049 
0050 //@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

0051 void OptOLaser::constructSolidShape() {
0052   ALIdouble go;
0053   GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
0054   gomgr->getGlobalOptionValue("VisScale", go);
0055 
0056   theSolidShape = new CocoaSolidShapeTubs(
0057       "Tubs", go * 0. * cm / m, go * 1. * cm / m, go * 5. * cm / m);  //COCOA internal units are meters

0058 }