CMS 3D CMS Logo

List of all members | Public Member Functions
OptOModifiedRhomboidPrism Class Reference

#include <OptOModifiedRhomboidPrism.h>

Inheritance diagram for OptOModifiedRhomboidPrism:
OpticalObject

Public Member Functions

void constructSolidShape () override
 
void detailedDeviatesLightRay (LightRay &lightray) override
 
void detailedTraversesLightRay (LightRay &lightray) override
 
void fastDeviatesLightRay (LightRay &lightray) override
 
void fastTraversesLightRay (LightRay &lightray) override
 
ALIPlane getRotatedPlate (const ALIbool forwardPlate)
 
 OptOModifiedRhomboidPrism ()
 
 OptOModifiedRhomboidPrism (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 
 ~OptOModifiedRhomboidPrism () 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 defaultBehaviour (LightRay &lightray, Measurement &meas)
 
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 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
 
virtual void makeMeasurement (LightRay &lightray, Measurement &meas)
 
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 OptOModifiedRhomboidPrism.h.

Constructor & Destructor Documentation

◆ OptOModifiedRhomboidPrism() [1/2]

OptOModifiedRhomboidPrism::OptOModifiedRhomboidPrism ( )
inline

Definition at line 21 of file OptOModifiedRhomboidPrism.h.

21 {};

◆ OptOModifiedRhomboidPrism() [2/2]

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

Definition at line 22 of file OptOModifiedRhomboidPrism.h.

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

◆ ~OptOModifiedRhomboidPrism()

OptOModifiedRhomboidPrism::~OptOModifiedRhomboidPrism ( )
inlineoverride

Definition at line 24 of file OptOModifiedRhomboidPrism.h.

24 {};

Member Function Documentation

◆ constructSolidShape()

void OptOModifiedRhomboidPrism::constructSolidShape ( )
overridevirtual

Reimplemented from OpticalObject.

Definition at line 274 of file OptOModifiedRhomboidPrism.cc.

274  {
275  ALIdouble go;
277  gomgr->getGlobalOptionValue("VisScale", go);
278 
280  "Box", go * 5. * cm / m, go * 5. * cm / m, go * 5. * cm / m); //COCOA internal units are meters
281 }

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

◆ detailedDeviatesLightRay()

void OptOModifiedRhomboidPrism::detailedDeviatesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 28 of file OptOModifiedRhomboidPrism.cc.

28  {
29  if (ALIUtils::debug >= 2)
30  std::cout << "$$$$$ LR: DETAILED DEVIATION IN MODIFIED RHOMBOID PRISM " << name() << std::endl;
31 
32  CLHEP::Hep3Vector XAxis(1., 0., 0.);
33  CLHEP::HepRotation rmt = rmGlob();
34  XAxis = rmt * XAxis;
35  CLHEP::Hep3Vector YAxis(0., 1., 0.);
36  YAxis = rmt * YAxis;
37  CLHEP::Hep3Vector ZAxis(0., 0., 1.);
38  ZAxis = rmt * ZAxis;
39 
40  ALIUtils::dump3v(XAxis, " x axis ");
41  ALIUtils::dump3v(YAxis, " y axis ");
42  ALIUtils::dump3v(ZAxis, " z axis ");
43  if (ALIUtils::debug >= 5) {
44  ALIUtils::dump3v(centreGlob(), " centre ");
45  }
46 
47  if (ALIUtils::debug >= 2)
48  std::cout << "$$$ LR: REFRACTION IN FORWARD PLATE " << std::endl;
49  //---------- Get forward plate
50  ALIPlane plate = getPlate(true, true);
51  //---------- Refract in plate while entering
52  ALIdouble refra_ind1 = 1.;
53  ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
54  lightray.refract(plate, refra_ind1, refra_ind2);
55  if (ALIUtils::debug >= 2) {
56  lightray.dumpData("LightRay after Refraction at entering: ");
57  }
58 
59  if (ALIUtils::debug >= 2)
60  std::cout << std::endl << "$$$ LR: REFLECTION IN FIRST PLATE " << std::endl;
61  //---------- Get up plate rotated
62  plate = getRotatedPlate(true);
63  //---------- Reflect in plate
64  lightray.reflect(plate);
65 
66  if (ALIUtils::debug >= 2)
67  std::cout << std::endl << "$$$ LR: REFLECTION IN SECOND PLATE " << std::endl;
68  //---------- Get up plate rotated
69  plate = getRotatedPlate(false);
70  //---------- Reflect in plate
71  lightray.reflect(plate);
72 
73  if (ALIUtils::debug >= 2)
74  std::cout << std::endl << "$$$ LR: REFRACTION IN BACKWARD PLATE " << std::endl;
75  //---------- Get backward plate
76  plate = getPlate(false, true);
77  //---------- Refract in plate while exiting
78  lightray.refract(plate, refra_ind2, refra_ind1);
79 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), LightRay::dumpData(), Skims_PA_cff::name, LightRay::reflect(), and LightRay::refract().

◆ detailedTraversesLightRay()

void OptOModifiedRhomboidPrism::detailedTraversesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 89 of file OptOModifiedRhomboidPrism.cc.

89  {
90  if (ALIUtils::debug >= 2)
91  std::cout << "LR: DETAILED TRAVERSE MODIFIED RHOMBOID PRISM " << name() << std::endl;
92 
93  //---------- Get forward plate
94  ALIPlane plate = getPlate(true, true);
95  //---------- Refract while entering splitter
96  ALIdouble refra_ind1 = 1.;
97  ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
98  lightray.refract(plate, refra_ind1, refra_ind2);
99  if (ALIUtils::debug >= 2) {
100  lightray.dumpData("Refracted in first plate");
101  }
102 
103  //---------- Get back ward plate (of triangular piiece)
104  plate = getPlate(true, false);
105  //---------- Refract while exiting prism
106  lightray.refract(plate, refra_ind2, refra_ind1);
107  if (ALIUtils::debug >= 2) {
108  lightray.dumpData("Refracted in first plate");
109  }
110 }

References gather_cfg::cout, ALIUtils::debug, LightRay::dumpData(), Skims_PA_cff::name, and LightRay::refract().

◆ fastDeviatesLightRay()

void OptOModifiedRhomboidPrism::fastDeviatesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 119 of file OptOModifiedRhomboidPrism.cc.

119  {
120  if (ALIUtils::debug >= 2)
121  std::cout << "LR: FAST REFLECTION IN MODIFIED RHOMBOID PRISM " << name() << std::endl;
122 
123  //---------- Get backward plate
124  ALIPlane plate = getPlate(false, false);
125  //---------- Intersect with plate
126  lightray.intersect(plate);
127  if (ALIUtils::debug >= 2) {
128  lightray.dumpData("Intersected in plate");
129  }
130  //---------- Deviate Lightray
131  lightray.shiftAndDeviateWhileTraversing(this, 'R');
132  /* ALIdouble deviRX = findExtraEntryValue("deviRX");
133  ALIdouble deviRY = findExtraEntryValue("deviRY");
134  ALIdouble shiftRX = findExtraEntryValue("shiftRX");
135  ALIdouble shiftRY = findExtraEntryValue("shiftRY");
136  lightray.shiftAndDeviateWhileTraversing( this, shiftRX, shiftRY, deviRX, deviRY);
137  */
138 
139  if (ALIUtils::debug >= 2) {
140  // std::cout << " shiftRX " << shiftRX << " shiftRY " << shiftRY << std::endl;
141  // std::cout << " deviRX " << deviRX << " deviRY " << deviRY << std::endl;
142  lightray.dumpData("Deviated ");
143  }
144 }

References gather_cfg::cout, ALIUtils::debug, LightRay::dumpData(), LightRay::intersect(), Skims_PA_cff::name, and LightRay::shiftAndDeviateWhileTraversing().

◆ fastTraversesLightRay()

void OptOModifiedRhomboidPrism::fastTraversesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 155 of file OptOModifiedRhomboidPrism.cc.

155  {
156  if (ALIUtils::debug >= 2)
157  std::cout << "LR: FAST TRAVERSE MODIFIED RHOMBOID PRISM " << name() << std::endl;
158 
159  //---------- Get backward plate
160  ALIPlane plate = getPlate(false, false);
161  lightray.intersect(plate);
162  if (ALIUtils::debug >= 2) {
163  lightray.dumpData("Intersected with plate");
164  }
165  //---------- Shift and Deviate
166  lightray.shiftAndDeviateWhileTraversing(this, 'T');
167  /* ALIdouble shiftTX = findExtraEntryValue("shiftTX");
168  ALIdouble shiftTY = findExtraEntryValue("shiftTY");
169  ALIdouble deviTX = findExtraEntryValue("deviTX");
170  ALIdouble deviTY = findExtraEntryValue("deviTY");
171  lightray.shiftAndDeviateWhileTraversing( this, shiftTX, shiftTY, deviTX, deviTY);*/
172 
173  if (ALIUtils::debug >= 2) {
174  lightray.dumpData("Shifted and Deviated");
175  }
176 }

References gather_cfg::cout, ALIUtils::debug, LightRay::dumpData(), LightRay::intersect(), Skims_PA_cff::name, and LightRay::shiftAndDeviateWhileTraversing().

◆ getRotatedPlate()

ALIPlane OptOModifiedRhomboidPrism::getRotatedPlate ( const ALIbool  forwardPlate)

Definition at line 187 of file OptOModifiedRhomboidPrism.cc.

187  {
188  if (ALIUtils::debug >= 4)
189  std::cout << "% LR: GET ROTATED PLATE " << name() << std::endl;
190  //---------- Get OptO variables
191  const ALIdouble shift = (findExtraEntryValue("shiftRY"));
192  ALIdouble wedgeR = findExtraEntryValue("wedgeR");
193 
194  //---------- Get centre of plate
195  //----- plate centre = OptO centre +/- 1/2 shift
196  CLHEP::Hep3Vector plate_point = centreGlob();
197  //--- Add to it half of the shift following the direction of the prism Y. -1/2 if it is forward plate, +1/2 if it is backward plate
198  ALIdouble normal_sign = -forwardPlate * 2 + 1;
199  CLHEP::Hep3Vector YAxis(0., 1., 0.);
200  CLHEP::HepRotation rmt = rmGlob();
201  YAxis = rmt * YAxis;
202  plate_point += normal_sign * shift / 2. * YAxis;
203 
204  //---------- Get normal of plate
205  //----- Plate normal before wedgeR (Z axis of OptO rotated 'angle' around X)
206  CLHEP::Hep3Vector ZAxis(0., 0., 1.);
207  ALIdouble anglePlanes;
208  ALIbool we = findExtraEntryValueIfExists("anglePlanes", anglePlanes);
209  if (!we) {
210  anglePlanes = 45. * ALIUtils::deg;
211  }
212  ZAxis.rotateX(anglePlanes);
213 
214  //----- Rotate with global rotation matrix
215  CLHEP::Hep3Vector plate_normal = rmt * ZAxis;
216  if (ALIUtils::debug >= 3) {
217  ALIUtils::dump3v(plate_point, "plate_point");
218  ALIUtils::dump3v(plate_normal, "plate_normal before wedge");
219  ALIUtils::dumprm(rmt, "rmt before wedge angles");
220  }
221 
222  //----- Rotate plate normal by 1/2 wedgeR angles
223  //--- Around X axis
224  CLHEP::Hep3Vector XAxis(0., 0., 1.);
225  XAxis = rmt * XAxis;
226  plate_normal.rotate(normal_sign * wedgeR / 2., XAxis);
227  if (ALIUtils::debug >= 3)
228  ALIUtils::dump3v(plate_normal, "plate_normal after wedgeR around X ");
229  //--- Around the axis obtained rotating the prism Y axis by 'anglePlanes' around the prism X axis
230  YAxis = CLHEP::Hep3Vector(0., 1., 0.);
231  YAxis.rotateX(anglePlanes);
232  YAxis = rmt * YAxis;
233  plate_normal.rotate(normal_sign * wedgeR / 2., YAxis);
234  if (ALIUtils::debug >= 3)
235  ALIUtils::dump3v(plate_normal, "plate_normal after wedgeR around Y ");
236 
237  //---------- Return plate plane
238  return ALIPlane(plate_point, plate_normal);
239 }

References gather_cfg::cout, ALIUtils::debug, ALIUtils::deg, ALIUtils::dump3v(), ALIUtils::dumprm(), Skims_PA_cff::name, and edm::shift.

LightRay::dumpData
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:374
ALIbool
bool ALIbool
Definition: CocoaGlobals.h:19
OpticalObject::findExtraEntryValue
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
Definition: OpticalObject.cc:1519
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
OpticalObject::findExtraEntryValueIfExists
const ALIbool findExtraEntryValueIfExists(const ALIstring &eename, ALIdouble &value) const
Definition: OpticalObject.cc:1563
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
OpticalObject::centreGlob
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
OptOModifiedRhomboidPrism::getRotatedPlate
ALIPlane getRotatedPlate(const ALIbool forwardPlate)
Definition: OptOModifiedRhomboidPrism.cc:187
OpticalObject::rmGlob
const CLHEP::HepRotation & rmGlob() const
Definition: OpticalObject.h:83
LightRay::intersect
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:93
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
ALIUtils::debug
static ALIint debug
Definition: ALIUtils.h:34
LightRay::reflect
void reflect(const ALIPlane &plane)
Definition: LightRay.cc:138
LightRay::shiftAndDeviateWhileTraversing
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:235
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
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
ALIPlane
Definition: ALIPlane.h:15
OpticalObject::findExtraEntryValueMustExist
const ALIdouble findExtraEntryValueMustExist(const ALIstring &eename) const
Definition: OpticalObject.cc:1548
ALIUtils::dump3v
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
edm::shift
static unsigned const int shift
Definition: LuminosityBlockID.cc:7
LightRay::refract
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:157
OpticalObject::getPlate
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
Definition: OpticalObject.cc:946
ALIUtils::deg
static ALIdouble deg
Definition: ALIUtils.h:35