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 XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlob (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginal (const CLHEP::Hep3Vector &dispVec)
 
void displaceCentreGlobOriginalOriginal (const XYZcoor coor, const ALIdouble disp)
 
void displaceCentreGlobOriginalOriginal (const CLHEP::Hep3Vector &dispVec)
 
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 XYZcoor coor) const
 
const double getEntryCentre (const ALIstring &coor) const
 
const double getEntryRMangle (const XYZcoor coor) const
 
const double getEntryRMangle (const ALIstring &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::OptOTiltmeter ( )
inline

Definition at line 23 of file OptOTiltmeter.h.

23 { };
OptOTiltmeter::OptOTiltmeter ( OpticalObject parent,
const ALIstring type,
const ALIstring name,
const ALIbool  copy_data 
)
inline

Definition at line 24 of file OptOTiltmeter.h.

24  :
25  OpticalObject( parent, type, name, copy_data){ };
type
Definition: HCALResponse.h:21
const ALIstring & name() const
Definition: OpticalObject.h:60
OptOTiltmeter::~OptOTiltmeter ( )
inlineoverride

Member Function Documentation

void OptOTiltmeter::constructSolidShape ( )
overridevirtual

Reimplemented from OpticalObject.

Definition at line 139 of file OptOTiltmeter.cc.

References GlobalOptionMgr::getGlobalOptionValue(), GlobalOptionMgr::getInstance(), and funct::m.

Referenced by ~OptOTiltmeter().

140 {
141  ALIdouble go;
143  gomgr->getGlobalOptionValue("VisScale", go );
144 
145  theSolidShape = new CocoaSolidShapeBox( "Box", go*2.*cm/m, go*2.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
146 }
long double ALIdouble
Definition: CocoaGlobals.h:11
CocoaSolidShape * theSolidShape
static GlobalOptionMgr * getInstance()
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
void OptOTiltmeter::defaultBehaviour ( LightRay lightray,
Measurement meas 
)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 24 of file OptOTiltmeter.cc.

Referenced by ~OptOTiltmeter().

25 {
26  makeMeasurement( lightray, meas);
27 
28 }
void makeMeasurement(LightRay &lightray, Measurement &meas) override
void OptOTiltmeter::makeMeasurement ( LightRay lightray,
Measurement meas 
)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 35 of file OptOTiltmeter.cc.

References cuy::col, gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), OpticalObject::fillIguana(), OpticalObject::fillVRML(), dataset::name, Measurement::setValueSimulated(), Measurement::value(), and Measurement::valueSimulated().

Referenced by ~OptOTiltmeter().

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