1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
|
// COCOA class implementation file
//Id: OptOLaser.cc
//CAT: Model
//
// History: v1.0
// Pedro Arce
#include "Alignment/CocoaModel/interface/OptOLaser.h"
#include "Alignment/CocoaModel/interface/LightRay.h"
#include "Alignment/CocoaModel/interface/Measurement.h"
#ifdef COCOA_VIS
#include "Alignment/CocoaVisMgr/interface/ALIVRMLMgr.h"
#include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
#endif
#include <CLHEP/Units/SystemOfUnits.h>
#include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeTubs.h"
#include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@ default behaviour: create a LightRay object
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
void OptOLaser::defaultBehaviour(LightRay& lightray, Measurement& meas) {
if (ALIUtils::debug >= 3)
std::cout << "create laser lightray " << std::endl;
lightray.startLightRay(this);
}
#ifdef COCOA_VIS
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void OptOLaser::fillVRML() {
ALIVRMLMgr& vrmlmgr = ALIVRMLMgr::getInstance();
ALIColour* col = new ALIColour(1., 0., 0., 0.);
vrmlmgr.AddBox(*this, 0.2, 0.2, 0.5, col);
vrmlmgr.SendReferenceFrame(*this, 0.12);
vrmlmgr.SendName(*this, 0.1);
}
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
void OptOLaser::fillIguana() {
ALIColour* col = new ALIColour(1., 0., 0., 0.);
std::vector<ALIdouble> spar;
spar.push_back(1.);
spar.push_back(5.);
CLHEP::HepRotation rm;
rm.rotateX(90. * deg);
IgCocoaFileMgr::getInstance().addSolid(*this, "CYLINDER", spar, col, CLHEP::Hep3Vector(), rm);
}
#endif
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
void OptOLaser::constructSolidShape() {
ALIdouble go;
GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
gomgr->getGlobalOptionValue("VisScale", go);
theSolidShape = new CocoaSolidShapeTubs("Tubs",
go * 0. * CLHEP::cm / CLHEP::m,
go * 1. * CLHEP::cm / CLHEP::m,
go * 5. * CLHEP::cm / CLHEP::m); //COCOA internal units are meters
}
|