CMS 3D CMS Logo

List of all members | Public Member Functions
OptOTiltmeter Class Reference

#include <OptOTiltmeter.h>

Inheritance diagram for OptOTiltmeter:
OpticalObject

Public Member Functions

void constructSolidShape () override
 
void defaultBehaviour (LightRay &lightray, Measurement &meas) override
 
void makeMeasurement (LightRay &lightray, Measurement &meas) override
 
 OptOTiltmeter ()
 
 OptOTiltmeter (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 
 ~OptOTiltmeter () override
 
- Public Member Functions inherited from OpticalObject
void addCoordinateEntryToList (Entry *entry)
 
void addExtraEntryToList (Entry *entry)
 
void addExtraEntryValueOriginalOriginalToList (ALIdouble entry_value)
 
void addExtraEntryValueOriginalToList (ALIdouble entry_value)
 
void addExtraEntryValueToList (ALIdouble entry_value)
 
double addPii (double val)
 
double approxTo0 (double val)
 
CLHEP::HepRotation buildRmFromEntryValuesOriginalOriginal ()
 
const CLHEP::Hep3Vector & centreGlob () const
 
const CLHEP::Hep3Vector & centreGlobal () const
 
const CLHEP::Hep3Vector & centreGlobOriginal () const
 
const CLHEP::Hep3Vector & centreGlobOriginalOriginal () const
 
const CLHEP::Hep3Vector centreLocal () const
 
int checkMatrixEquations (double angleX, double angleY, double angleZ, CLHEP::HepRotation *rot=nullptr)
 
void construct ()
 
void constructFromOptAligInfo (const OpticalAlignInfo &oaInfo)
 
virtual void constructMaterial ()
 
const std::vector< Entry * > & CoordinateEntryList () const
 
void createComponentOptOsFromOptAlignInfo ()
 
virtual void detailedDeviatesLightRay (LightRay &lightray)
 
virtual void detailedTraversesLightRay (LightRay &lightray)
 
double diff2pi (double ang1, double ang2)
 
void displaceCentreGlob (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlob (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginal (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginalOriginal (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginalOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceExtraEntry (const ALIuint entryNo, const ALIdouble disp)
 
void displaceExtraEntryOriginal (const ALIuint entryNo, const ALIdouble disp)
 
void displaceExtraEntryOriginalOriginal (const ALIuint entryNo, const ALIdouble disp)
 
void displaceRmGlobAroundGlobal (OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
void displaceRmGlobAroundLocal (OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
void displaceRmGlobOriginal (const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
void displaceRmGlobOriginalOriginal (const OpticalObject *opto1stRotated, const XYZcoor coor, const ALIdouble disp)
 
bool eq2ang (double ang1, double ang2)
 
const std::vector< Entry * > & ExtraEntryList () const
 
const ALIint extraEntryNo (const ALIstring &entry_name) const
 
std::vector< ALIdouble > & ExtraEntryValueList ()
 
const std::vector< ALIdouble > & ExtraEntryValueOriginalList ()
 
const std::vector< ALIdouble > & ExtraEntryValueOriginalOriginalList ()
 
virtual void fastDeviatesLightRay (LightRay &lightray)
 
virtual void fastTraversesLightRay (LightRay &lightray)
 
virtual void fillIguana ()
 
virtual void fillVRML ()
 
const ALIdouble findExtraEntryValue (const ALIstring &eename) const
 
const ALIbool findExtraEntryValueIfExists (const ALIstring &eename, ALIdouble &value) const
 
const ALIdouble findExtraEntryValueMustExist (const ALIstring &eename) const
 
const ALIuint getCmsswID () const
 
std::vector< ALIstringgetCoordinateFromOptAlignParam (const OpticalAlignParam &oaParam)
 
CLHEP::Hep3Vector getDisplacementInLocalCoordinates (const XYZcoor coor, const ALIdouble disp)
 
const double getEntryCentre (const ALIstring &coor) const
 
const double getEntryCentre (const XYZcoor coor) const
 
const double getEntryRMangle (const ALIstring &coor) const
 
const double getEntryRMangle (const XYZcoor coor) const
 
std::vector< double > getLocalRotationAngles (const std::vector< Entry * > &entries) const
 
CocoaMaterialElementarygetMaterial () const
 
ALIPlane getPlate (const ALIbool forwardPlate, const ALIbool applyWedge)
 
std::vector< double > getRotationAnglesFromMatrix (CLHEP::HepRotation &rmLocal, const std::vector< Entry * > &entries) const
 
std::vector< double > getRotationAnglesInOptOFrame (const OpticalObject *optoAncestor, const std::vector< Entry * > &entries) const
 
CocoaSolidShapegetSolidShape () const
 
CLHEP::Hep3Vector getZAxis ()
 
const ALIuint ID () const
 
const ALIstring longName () const
 
Measurementmeas ()
 
const ALIstringname () const
 
 OpticalObject ()
 
 OpticalObject (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 
const OpticalObjectparent () const
 
virtual void participateInMeasurement (LightRay &lightray, Measurement &meas, const ALIstring &behav)
 
void propagateGlobalRMOriginalOriginalChangeToChildren (const CLHEP::HepRotation &rmorioriold, const CLHEP::HepRotation &rmoriorinew)
 
void resetGlobalCoordinates ()
 
void resetOriginalOriginalCoordinates ()
 
const CLHEP::HepRotation & rmGlob () const
 
const CLHEP::HepRotation & rmGlobOriginal () const
 
const CLHEP::HepRotation & rmGlobOriginalOriginal () const
 
const CLHEP::HepRotation rmLocal () const
 
void setCmsswID (ALIuint id)
 
void setExtraEntryValue (const ALIuint entryNo, const ALIdouble disp)
 
void setGlobalCoordinates ()
 
void setGlobalRMOriginalOriginal (const CLHEP::HepRotation &rmoriori)
 
void setID (ALIuint id)
 
void setMeas (Measurement *meas)
 set current measurement More...
 
void setOriginalEntryValues ()
 
void setRmGlobal (const CLHEP::HepRotation &rm)
 
void setRmGlobalOriginal (const CLHEP::HepRotation &rm)
 
void setType (const ALIstring &type)
 
const ALIstring shortName () const
 
const ALIstringtype () const
 
virtual void userDefinedBehaviour (LightRay &lightray, Measurement &meas, const ALIstring &behav)
 
virtual ~OpticalObject ()
 

Additional Inherited Members

- Protected Member Functions inherited from OpticalObject
virtual void fillExtraEntry (std::vector< ALIstring > &wordlist)
 
- Protected Attributes inherited from OpticalObject
CocoaMaterialElementarytheMaterial
 
CocoaSolidShapetheSolidShape
 
ALIint verbose
 

Detailed Description

Definition at line 18 of file OptOTiltmeter.h.

Constructor & Destructor Documentation

◆ OptOTiltmeter() [1/2]

OptOTiltmeter::OptOTiltmeter ( )
inline

Definition at line 21 of file OptOTiltmeter.h.

21 {};

◆ OptOTiltmeter() [2/2]

OptOTiltmeter::OptOTiltmeter ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
)
inline

Definition at line 22 of file OptOTiltmeter.h.

23  : OpticalObject(parent, type, name, copy_data){};

◆ ~OptOTiltmeter()

OptOTiltmeter::~OptOTiltmeter ( )
inlineoverride

Definition at line 24 of file OptOTiltmeter.h.

24 {};

Member Function Documentation

◆ constructSolidShape()

void OptOTiltmeter::constructSolidShape ( )
overridevirtual

Reimplemented from OpticalObject.

Definition at line 127 of file OptOTiltmeter.cc.

127  {
128  ALIdouble go;
130  gomgr->getGlobalOptionValue("VisScale", go);
131 
133  "Box", go * 2. * cm / m, go * 2. * cm / m, go * 5. * cm / m); //COCOA internal units are meters
134 }

References GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), and visualization-live-secondInstance_cfg::m.

◆ defaultBehaviour()

void OptOTiltmeter::defaultBehaviour ( LightRay lightray,
Measurement meas 
)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 24 of file OptOTiltmeter.cc.

24 { makeMeasurement(lightray, meas); }

◆ makeMeasurement()

void OptOTiltmeter::makeMeasurement ( LightRay lightray,
Measurement meas 
)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 30 of file OptOTiltmeter.cc.

30  {
31  //---------- Get local Z axix
32  CLHEP::HepRotation rmt = rmGlob();
33  CLHEP::Hep3Vector ZAxisl(0., 0., 1.);
34  ZAxisl *= rmt;
35 
36  //--------- Get projection in a global XZ plane
37  /*-plane parallel to global Y (gravity) and to tiltmeter Z
38  CLHEP::Hep3Vector plane_point(0.,0.,0.);
39  CLHEP::Hep3Vector plane_normal = ZAxisl.cross( CLHEP::Hep3Vector(0.,1.,0.) );
40  CLHEP::Hep3Vector ZAxis_proj = (ALIPlane( plane_point, plane_normal)).project( ZAxisl );
41  */
42  CLHEP::Hep3Vector XAxisg(1., 0., 0.);
43  CLHEP::Hep3Vector ZAxisg(0., 0., 1.);
44  CLHEP::Hep3Vector ZAxis_proj = (ZAxisl * XAxisg) * XAxisg + (ZAxisl * ZAxisg) * ZAxisg;
45  ZAxis_proj *= (1. / ZAxis_proj.mag());
46 
47  //--------- Get measurement
48  ALIdouble measvalue = acos(ZAxisl * ZAxis_proj / ZAxisl.mag() / ZAxis_proj.mag());
49  //----- get sign of angle as sign of y component of ZAxis
50  if (ZAxisl.y() != 0)
51  measvalue *= (ZAxisl.y() / fabs(ZAxisl.y()));
52  meas.setValueSimulated(0, measvalue);
53 
54  if (ALIUtils::debug >= 3) {
55  ALIUtils::dump3v(ZAxisl, " OptOTiltmeter: Local Z axis ");
56  ALIUtils::dumprm(rmt, " tiltmeter rotation matrix");
57  ALIUtils::dump3v(ZAxis_proj, " Projection of Local Z axis on global XZ plane ");
58  std::cout << "SIMU value: TA: " << std::setprecision(8) << 1000 * meas.valueSimulated(0) << " (mrad) "
59  << (this)->name() << std::endl;
60  std::cout << "REAL value: TA: " << std::setprecision(8) << 1000 * meas.value()[0] << " (mrad) " << (this)->name()
61  << std::endl;
62  }
63 
64  /*- //---------- Get simulated value:
65  CLHEP::HepRotation rmtori = rmGlobOriginal();
66  CLHEP::Hep3Vector ZAxism(0.,0.,1.);
67  CLHEP::Hep3Vector ZAxism_ori = ZAxism;
68  ZAxism_ori *= rmtori;
69 
70  //---------- Measure rotation with respect to original position, around the X axis defined by the original position, in the original YZ plane
71  CLHEP::Hep3Vector ZAxism_rot = ZAxism;
72  CLHEP::HepRotation rmt = rmGlob();
73  ZAxism_rot *= rmt;
74  //----- Project on original YZ plane
75  CLHEP::Hep3Vector YAxism_ori(0.,1.,0.);
76  YAxism_ori *= rmtori;
77  //--- create original YZ plane
78  CLHEP::Hep3Vector YZplanePoint = centreGlob();
79  CLHEP::Hep3Vector YZplaneNormal = YAxism_ori.cross( ZAxism_ori );
80  ALIPlane yzorig( YZplanePoint, YZplaneNormal );
81  CLHEP::Hep3Vector ZAxism_proj = yzorig.project( ZAxism_rot);
82  //- ALIUtils::dump3v( YAxism_ori, "YAxism_ori");
83  //- ALIUtils::dump3v( ZAxism_ori, "ZAxism_ori");
84  //- ALIUtils::dump3v( ZAxism_rot, "ZAxism_rot");
85  //- ALIUtils::dump3v( ZAxism_proj, "ZAxism_proj");
86  ALIdouble measValue = acos( ZAxism.dot(ZAxism_proj)/ZAxism_proj.mag() );
87  if( ZAxism_proj.x() < 0) measValue *= -1.;
88  meas.setValueSimulated(0 , measValue );
89 
90  if (ALIUtils::debug >= 3) {
91  std::cout << " OptOTiltmeter: Original Z axis " << ZAxism_ori << std::endl;
92  ALIUtils::dumprm(rmt," tiltmeter original rotation matrix");
93  std::cout << " OptOTiltmeter: current Z axis " << ZAxism_rot << std::endl;
94  ALIUtils::dumprm(rmt," tiltmeter current rotation matrix");
95  std::cout << "SIMU value; TA: " << std::setprecision(8) << meas.valueSimulated(0)
96  << " (rad) " << (this)->name() << std::endl;
97  std::cout << "REAL value: TA: " << std::setprecision(8) << meas.value()[0]
98  << " (rad) " << (this)->name() << std::endl;
99 
100  }
101  */
102 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), Skims_PA_cff::name, Measurement::setValueSimulated(), Measurement::value(), and Measurement::valueSimulated().

OpticalObject::meas
Measurement * meas()
Definition: OpticalObject.h:200
GlobalOptionMgr
Definition: GlobalOptionMgr.h:18
OpticalObject::name
const ALIstring & name() const
Definition: OpticalObject.h:58
GlobalOptionMgr::getInstance
static GlobalOptionMgr * getInstance()
Definition: GlobalOptionMgr.cc:18
gather_cfg.cout
cout
Definition: gather_cfg.py:144
GlobalOptionMgr::getGlobalOptionValue
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
Definition: GlobalOptionMgr.cc:115
OpticalObject::theSolidShape
CocoaSolidShape * theSolidShape
Definition: OpticalObject.h:315
CocoaSolidShapeBox
Definition: CocoaSolidShapeBox.h:13
Measurement::setValueSimulated
void setValueSimulated(ALIint coor, ALIdouble value)
Definition: Measurement.h:146
OpticalObject::rmGlob
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
OpticalObject::OpticalObject
OpticalObject()
Definition: OpticalObject.h:40
ALIUtils::dumprm
static void dumprm(const CLHEP::HepRotation &rm, const std::string &msg, std::ostream &out=std::cout)
Definition: ALIUtils.cc:71
type
type
Definition: SiPixelVCal_PayloadInspector.cc:39
OpticalObject::parent
const OpticalObject * parent() const
Definition: OpticalObject.h:60
OptOTiltmeter::makeMeasurement
void makeMeasurement(LightRay &lightray, Measurement &meas) override
Definition: OptOTiltmeter.cc:30
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
Measurement::valueSimulated
const ALIdouble valueSimulated(ALIuint ii) const
Definition: Measurement.h:105
ALIUtils::dump3v
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
Measurement::value
const ALIdouble * value() const
Definition: Measurement.h:109