![]() |
![]() |
#include <Alignment/CocoaModel/interface/OptOTiltmeter.h>
Public Member Functions | |
void | constructSolidShape () |
virtual void | defaultBehaviour (LightRay &lightray, Measurement &meas) |
virtual void | makeMeasurement (LightRay &lightray, Measurement &meas) |
OptOTiltmeter (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data) | |
OptOTiltmeter () | |
~OptOTiltmeter () |
Definition at line 18 of file OptOTiltmeter.h.
OptOTiltmeter::OptOTiltmeter | ( | ) | [inline] |
OptOTiltmeter::OptOTiltmeter | ( | OpticalObject * | parent, | |
const ALIstring & | type, | |||
const ALIstring & | name, | |||
const ALIbool | copy_data | |||
) | [inline] |
Definition at line 24 of file OptOTiltmeter.h.
00024 : 00025 OpticalObject( parent, type, name, copy_data){ };
OptOTiltmeter::~OptOTiltmeter | ( | ) | [inline] |
void OptOTiltmeter::constructSolidShape | ( | ) | [virtual] |
Reimplemented from OpticalObject.
Definition at line 137 of file OptOTiltmeter.cc.
References GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), m, and OpticalObject::theSolidShape.
00138 { 00139 ALIdouble go; 00140 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance(); 00141 gomgr->getGlobalOptionValue("VisScale", go ); 00142 00143 theSolidShape = new CocoaSolidShapeBox( "Box", go*2.*cm/m, go*2.*cm/m, go*5.*cm/m ); //COCOA internal units are meters 00144 }
void OptOTiltmeter::defaultBehaviour | ( | LightRay & | lightray, | |
Measurement & | meas | |||
) | [virtual] |
Reimplemented from OpticalObject.
Definition at line 22 of file OptOTiltmeter.cc.
References makeMeasurement().
00023 { 00024 makeMeasurement( lightray, meas); 00025 00026 }
void OptOTiltmeter::makeMeasurement | ( | LightRay & | lightray, | |
Measurement & | meas | |||
) | [virtual] |
Reimplemented from OpticalObject.
Definition at line 33 of file OptOTiltmeter.cc.
References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), lat::endl(), OpticalObject::name(), OpticalObject::rmGlob(), rmt, Measurement::setValueSimulated(), Measurement::value(), and Measurement::valueSimulated().
Referenced by defaultBehaviour().
00034 { 00035 00036 //---------- Get local Z axix 00037 CLHEP::HepRotation rmt = rmGlob(); 00038 CLHEP::Hep3Vector ZAxisl(0.,0.,1.); 00039 ZAxisl *= rmt; 00040 00041 //--------- Get projection in a global XZ plane 00042 /*-plane parallel to global Y (gravity) and to tiltmeter Z 00043 CLHEP::Hep3Vector plane_point(0.,0.,0.); 00044 CLHEP::Hep3Vector plane_normal = ZAxisl.cross( CLHEP::Hep3Vector(0.,1.,0.) ); 00045 CLHEP::Hep3Vector ZAxis_proj = (ALIPlane( plane_point, plane_normal)).project( ZAxisl ); 00046 */ 00047 CLHEP::Hep3Vector XAxisg(1.,0.,0.); 00048 CLHEP::Hep3Vector ZAxisg(0.,0.,1.); 00049 CLHEP::Hep3Vector ZAxis_proj = (ZAxisl*XAxisg) * XAxisg + (ZAxisl*ZAxisg) * ZAxisg; 00050 ZAxis_proj *= (1. / ZAxis_proj.mag() ); 00051 00052 //--------- Get measurement 00053 ALIdouble measvalue = acos(ZAxisl*ZAxis_proj / ZAxisl.mag() / ZAxis_proj.mag()); 00054 //----- get sign of angle as sign of y component of ZAxis 00055 if( ZAxisl.y() != 0 ) measvalue *= (ZAxisl.y() / fabs(ZAxisl.y()) ); 00056 meas.setValueSimulated(0 , measvalue ); 00057 00058 if (ALIUtils::debug >= 3) { 00059 ALIUtils::dump3v(ZAxisl," OptOTiltmeter: Local Z axis "); 00060 ALIUtils::dumprm(rmt," tiltmeter rotation matrix"); 00061 ALIUtils::dump3v(ZAxis_proj," Projection of Local Z axis on global XZ plane "); 00062 std::cout << "SIMU value: TA: " << std::setprecision(8) << 1000*meas.valueSimulated(0) 00063 << " (mrad) " << (this)->name() << std::endl; 00064 std::cout << "REAL value: TA: " << std::setprecision(8) << 1000*meas.value()[0] 00065 << " (mrad) " << (this)->name() << std::endl; 00066 00067 } 00068 00069 00070 /*- //---------- Get simulated value: 00071 CLHEP::HepRotation rmtori = rmGlobOriginal(); 00072 CLHEP::Hep3Vector ZAxism(0.,0.,1.); 00073 CLHEP::Hep3Vector ZAxism_ori = ZAxism; 00074 ZAxism_ori *= rmtori; 00075 00076 //---------- Measure rotation with respect to original position, around the X axis defined by the original position, in the original YZ plane 00077 CLHEP::Hep3Vector ZAxism_rot = ZAxism; 00078 CLHEP::HepRotation rmt = rmGlob(); 00079 ZAxism_rot *= rmt; 00080 //----- Project on original YZ plane 00081 CLHEP::Hep3Vector YAxism_ori(0.,1.,0.); 00082 YAxism_ori *= rmtori; 00083 //--- create original YZ plane 00084 CLHEP::Hep3Vector YZplanePoint = centreGlob(); 00085 CLHEP::Hep3Vector YZplaneNormal = YAxism_ori.cross( ZAxism_ori ); 00086 ALIPlane yzorig( YZplanePoint, YZplaneNormal ); 00087 CLHEP::Hep3Vector ZAxism_proj = yzorig.project( ZAxism_rot); 00088 //- ALIUtils::dump3v( YAxism_ori, "YAxism_ori"); 00089 //- ALIUtils::dump3v( ZAxism_ori, "ZAxism_ori"); 00090 //- ALIUtils::dump3v( ZAxism_rot, "ZAxism_rot"); 00091 //- ALIUtils::dump3v( ZAxism_proj, "ZAxism_proj"); 00092 ALIdouble measValue = acos( ZAxism.dot(ZAxism_proj)/ZAxism_proj.mag() ); 00093 if( ZAxism_proj.x() < 0) measValue *= -1.; 00094 meas.setValueSimulated(0 , measValue ); 00095 00096 if (ALIUtils::debug >= 3) { 00097 std::cout << " OptOTiltmeter: Original Z axis " << ZAxism_ori << std::endl; 00098 ALIUtils::dumprm(rmt," tiltmeter original rotation matrix"); 00099 std::cout << " OptOTiltmeter: current Z axis " << ZAxism_rot << std::endl; 00100 ALIUtils::dumprm(rmt," tiltmeter current rotation matrix"); 00101 std::cout << "SIMU value; TA: " << std::setprecision(8) << meas.valueSimulated(0) 00102 << " (rad) " << (this)->name() << std::endl; 00103 std::cout << "REAL value: TA: " << std::setprecision(8) << meas.value()[0] 00104 << " (rad) " << (this)->name() << std::endl; 00105 00106 } 00107 */ 00108 00109 }