CMS 3D CMS Logo

List of all members | Public Member Functions
OptODistancemeter Class Reference

#include <OptODistancemeter.h>

Inheritance diagram for OptODistancemeter:
OpticalObject

Public Member Functions

void constructSolidShape () override
 
void defaultBehaviour (LightRay &lightray, Measurement &meas) override
 
void makeMeasurement (LightRay &lightray, Measurement &meas) override
 
 OptODistancemeter ()
 
 OptODistancemeter (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 
 ~OptODistancemeter () 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 OptODistancemeter.h.

Constructor & Destructor Documentation

◆ OptODistancemeter() [1/2]

OptODistancemeter::OptODistancemeter ( )
inline

Definition at line 21 of file OptODistancemeter.h.

21 {};

◆ OptODistancemeter() [2/2]

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

Definition at line 22 of file OptODistancemeter.h.

23  : OpticalObject(parent, type, name, copy_data){};
const ALIstring & name() const
Definition: OpticalObject.h:58
const OpticalObject * parent() const
Definition: OpticalObject.h:60

◆ ~OptODistancemeter()

OptODistancemeter::~OptODistancemeter ( )
inlineoverride

Definition at line 24 of file OptODistancemeter.h.

24 {};

Member Function Documentation

◆ constructSolidShape()

void OptODistancemeter::constructSolidShape ( )
overridevirtual

Reimplemented from OpticalObject.

Definition at line 97 of file OptODistancemeter.cc.

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

97  {
98  ALIdouble go;
100  gomgr->getGlobalOptionValue("VisScale", go);
101 
103  "Tubs", go * 0. * cm / m, go * 2. * cm / m, go * 5. * cm / m); //COCOA internal units are meters
104 }
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

◆ defaultBehaviour()

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

Reimplemented from OpticalObject.

Definition at line 24 of file OptODistancemeter.cc.

References makeMeasurement(), and OpticalObject::meas().

24 { makeMeasurement(lightray, meas); }
void makeMeasurement(LightRay &lightray, Measurement &meas) override
Measurement * meas()

◆ makeMeasurement()

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

Reimplemented from OpticalObject.

Definition at line 29 of file OptODistancemeter.cc.

References OpticalObject::centreGlob(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), Measurement::getPreviousOptO(), ALILine::intersect(), OpticalObject::meas(), OpticalObject::name(), amptDefault_cfi::proj, OpticalObject::rmGlob(), Measurement::setValueSimulated(), Measurement::value(), and Measurement::valueSimulated().

Referenced by defaultBehaviour().

29  {
30  const OpticalObject* opto_prev = meas.getPreviousOptO(this);
31  CLHEP::Hep3Vector dm_centre = centreGlob();
32  CLHEP::Hep3Vector ZAxis(0., 0., 1.);
33  CLHEP::HepRotation rmt = rmGlob();
34  ZAxis = rmt * ZAxis;
35 
36  //----- intersect z of distancemeter with distance target
37  ALILine dm_line(centreGlob(), ZAxis);
38 
39  CLHEP::Hep3Vector ZAxisdt(0., 0., 1.);
40  const CLHEP::HepRotation& rmtdt = opto_prev->rmGlob();
41  ZAxisdt = rmtdt * ZAxisdt;
42  ALIPlane dt_plane(opto_prev->centreGlob(), ZAxisdt);
43 
44  if (ALIUtils::debug >= 3) {
45  ALIUtils::dump3v(dm_centre, "distancemeter centre");
46  ALIUtils::dump3v(ZAxis, "distancemeter direc");
47  ALIUtils::dump3v(opto_prev->centreGlob(), "distance_target centre");
48  ALIUtils::dump3v(ZAxisdt, "distance_target direc");
49  }
50 
51  CLHEP::Hep3Vector inters = dm_line.intersect(dt_plane);
52 
53  dm_centre = inters - dm_centre;
54  if (ALIUtils::debug >= 4) {
55  std::cout << "OptO dm" << name() << dm_line << std::endl;
56  // ALIUtils::dump3v( centreGlob(), " centre Glob ");
57  std::cout << "OptO dt" << opto_prev->name() << std::endl;
58  ALIUtils::dump3v(opto_prev->centreGlob(), " previous OptO centre Glob ");
59  ALIUtils::dump3v(inters, " intersection with target ");
60  ALIUtils::dump3v(dm_centre, " distance std::vector");
61  }
62  ALIdouble proj = dm_centre * ZAxis;
63 
64  //- ALIUtils::dump3v( ZAxis, " zaxis ");
65  //- std::cout << " proj " << proj << std::endl;
66 
68  if (ALIUtils::debug >= 1) {
69  std::cout << "SIMU value: D: " << meas.valueSimulated(0) * 1000. << " (mm) " << (this)->name() << std::endl;
70  std::cout << "REAL value: D: " << meas.value()[0] * 1000. << " (mm) " << (this)->name() << std::endl;
71  }
72 }
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
long double ALIdouble
Definition: CocoaGlobals.h:11
const ALIdouble * value() const
Definition: Measurement.h:109
const OpticalObject * getPreviousOptO(const OpticalObject *Popto) const
Definition: Measurement.cc:584
static ALIint debug
Definition: ALIUtils.h:34
const ALIstring & name() const
Definition: OpticalObject.h:58
const ALIdouble valueSimulated(ALIuint ii) const
Definition: Measurement.h:105
void setValueSimulated(ALIint coor, ALIdouble value)
Definition: Measurement.h:146
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
Measurement * meas()