CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
List of all members | Public Member Functions
OptOCubeSplitter Class Reference

#include <OptOCubeSplitter.h>

Inheritance diagram for OptOCubeSplitter:
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 getMiddlePlate ()
 
ALIPlane getUpperPlate ()
 
 OptOCubeSplitter ()
 
 OptOCubeSplitter (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 
 ~OptOCubeSplitter () 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 OptOCubeSplitter.h.

Constructor & Destructor Documentation

◆ OptOCubeSplitter() [1/2]

OptOCubeSplitter::OptOCubeSplitter ( )
inline

Definition at line 21 of file OptOCubeSplitter.h.

21 {};

◆ OptOCubeSplitter() [2/2]

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

Definition at line 22 of file OptOCubeSplitter.h.

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

◆ ~OptOCubeSplitter()

OptOCubeSplitter::~OptOCubeSplitter ( )
inlineoverride

Definition at line 24 of file OptOCubeSplitter.h.

24 {};

Member Function Documentation

◆ constructSolidShape()

void OptOCubeSplitter::constructSolidShape ( )
overridevirtual

Reimplemented from OpticalObject.

Definition at line 245 of file OptOCubeSplitter.cc.

245  {
246  ALIdouble go;
248  gomgr->getGlobalOptionValue("VisScale", go);
249 
251  "Box", go * 5. * cm / m, go * 5. * cm / m, go * 5. * cm / m); //COCOA internal units are meters
252 }

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

◆ detailedDeviatesLightRay()

void OptOCubeSplitter::detailedDeviatesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 90 of file OptOCubeSplitter.cc.

90  {
91  if (ALIUtils::debug >= 2)
92  std::cout << "LR: DETAILED REFLECTION IN CUBE SPLITTER " << name() << std::endl;
93 
94  if (ALIUtils::debug >= 2)
95  ALIUtils::dump3v(centreGlob(), "centreGlob");
96  //---------- Get first plate
97  if (ALIUtils::debug >= 3)
98  std::cout << "%%%%% refracting at entering first plate " << std::endl;
99  if (ALIUtils::debug >= 3)
100  std::cout << "%%% getting first plate " << std::endl;
101  ALIPlane plate = getPlate(true, true);
102 
103  //---------- Refract
104  ALIdouble refra_ind1 = 1.;
105  ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
106  lightray.refract(plate, refra_ind1, refra_ind2);
107 
108  //---------- Get middle plate
109  if (ALIUtils::debug >= 3)
110  std::cout << "%%%%% reflecting in middle plate " << std::endl;
111  if (ALIUtils::debug >= 3)
112  std::cout << "%%% getting middle plate " << std::endl;
113  plate = getMiddlePlate();
114 
115  //---------- Reflect
116  lightray.reflect(plate);
117  if (ALIUtils::debug >= 2) {
118  lightray.dumpData("Reflected in plate");
119  }
120 
121  //--------- Get upper plate
122  if (ALIUtils::debug >= 3)
123  std::cout << "%%%%% getting second plate " << std::endl;
124  plate = getUpperPlate();
125  if (ALIUtils::debug >= 3)
126  std::cout << "%%%%% refracting at exiting second plate " << std::endl;
127  lightray.refract(plate, refra_ind2, refra_ind1);
128 
129  if (ALIUtils::debug >= 2) {
130  lightray.dumpData("After CubeSplitter");
131  }
132 }

References OpticalObject::centreGlob(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), LightRay::dumpData(), OpticalObject::findExtraEntryValue(), getMiddlePlate(), OpticalObject::getPlate(), getUpperPlate(), OpticalObject::name(), LightRay::reflect(), and LightRay::refract().

◆ detailedTraversesLightRay()

void OptOCubeSplitter::detailedTraversesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 142 of file OptOCubeSplitter.cc.

142  {
143  if (ALIUtils::debug >= 2)
144  std::cout << "LR: DETAILED TRAVERSE CUBE SPLITTER " << name() << std::endl;
145 
146  //---------- Get forward plate
147  ALIPlane plate = getPlate(true, true);
148 
149  //---------- Refract while entering splitter
150  ALIdouble refra_ind1 = 1.;
151  ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
152  lightray.refract(plate, refra_ind1, refra_ind2);
153  if (ALIUtils::debug >= 2) {
154  lightray.dumpData("Refracted in first plate");
155  }
156 
157  //---------- Get backward plate
158  plate = getPlate(false, true);
159  //---------- Refract while exiting splitter
160  lightray.refract(plate, refra_ind2, refra_ind1);
161  if (ALIUtils::debug >= 2) {
162  lightray.dumpData("Refracted in first plate");
163  }
164 }

References gather_cfg::cout, ALIUtils::debug, LightRay::dumpData(), OpticalObject::findExtraEntryValue(), OpticalObject::getPlate(), OpticalObject::name(), and LightRay::refract().

◆ fastDeviatesLightRay()

void OptOCubeSplitter::fastDeviatesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 27 of file OptOCubeSplitter.cc.

27  {
28  if (ALIUtils::debug >= 2)
29  std::cout << "LR: FAST REFLECTION IN CUBE SPLITTER " << name() << std::endl;
30 
31  //---------- Get forward plate
32  ALIPlane plate = getMiddlePlate();
33  //---------- Reflect in plate (including intersection with it)
34  lightray.reflect(plate);
35  if (ALIUtils::debug >= 2) {
36  lightray.dumpData("Reflected in plate");
37  }
38  //---------- Deviate Lightray
39  // ALIdouble deviRX = findExtraEntryValue("deviRX");
40  // ALIdouble deviRY = findExtraEntryValue("deviRY");
41  // lightray.shiftAndDeviateWhileTraversing( this, 0., 0., 0., deviRX, deviRY, 0.);
42  lightray.shiftAndDeviateWhileTraversing(this, 'R');
43  if (ALIUtils::debug >= 2) {
44  lightray.dumpData("Deviated ");
45  }
46 }

References gather_cfg::cout, ALIUtils::debug, LightRay::dumpData(), getMiddlePlate(), OpticalObject::name(), LightRay::reflect(), and LightRay::shiftAndDeviateWhileTraversing().

◆ fastTraversesLightRay()

void OptOCubeSplitter::fastTraversesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 57 of file OptOCubeSplitter.cc.

57  {
58  if (ALIUtils::debug >= 2)
59  std::cout << "LR: FAST TRAVERSE CUBE SPLITTER " << name() << std::endl;
60 
61  //---------- Get backward plate
62  ALIPlane plate = getPlate(false, false);
63  lightray.intersect(plate);
64  if (ALIUtils::debug >= 2) {
65  lightray.dumpData("Intersected with plate");
66  }
67  //---------- Shift and Deviate
68  lightray.shiftAndDeviateWhileTraversing(this, 'T');
69  /* ALIdouble shiftX = findExtraEntryValue("shiftX");
70  ALIdouble shiftY = findExtraEntryValue("shiftY");
71  ALIdouble deviTX = findExtraEntryValue("deviTX");
72  ALIdouble deviTY = findExtraEntryValue("deviTY");
73  lightray.shiftAndDeviateWhileTraversing( this, shiftX, shiftY, deviTX, deviTY);*/
74 
75  if (ALIUtils::debug >= 2) {
76  lightray.dumpData("Shifted and Deviated");
77  }
78 }

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

◆ getMiddlePlate()

ALIPlane OptOCubeSplitter::getMiddlePlate ( )

Definition at line 171 of file OptOCubeSplitter.cc.

171  {
172  if (ALIUtils::debug >= 4)
173  std::cout << "%%% LR: GET MIDDLE PLATE " << name() << std::endl;
174  //---------- Get centre and normal of plate
175  //----- plate normal before wedge (Z axis of OptO)
176  ALIdouble anglePlanes;
177  ALIbool angpl = findExtraEntryValueIfExists("anglePlanes", anglePlanes);
178  if (!angpl) {
179  anglePlanes =
180  acos(0.) /
181  2.; //default is 45o !!! this creates problem in 'isr_medidas_globales.txt': laser goes along X and does not intersect cube if angles Y 0, anglePlanes 45
182  if (ALIUtils::debug >= 4)
183  std::cout << "anglePlanes default = " << anglePlanes / deg << std::endl;
184  }
185  CLHEP::Hep3Vector Axis(0., 0., 1.);
186  CLHEP::Hep3Vector XAxis(1., 0., 0.);
187  Axis.rotate(anglePlanes, XAxis);
188  CLHEP::HepRotation rmt = rmGlob();
189  CLHEP::Hep3Vector plate_normal = rmt * Axis;
190  if (ALIUtils::debug >= 3) {
191  ALIUtils::dumprm(rmt, "rmt before wedge angles");
192  ALIUtils::dump3v(plate_normal, "plate_normal before wedge");
193  }
194  //----- plate centre = OptO
195  CLHEP::Hep3Vector plate_point = centreGlob();
196 
197  //---------- Return plate plane
198  return ALIPlane(plate_point, plate_normal);
199 }

References OpticalObject::centreGlob(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), OpticalObject::findExtraEntryValueIfExists(), OpticalObject::name(), and OpticalObject::rmGlob().

Referenced by detailedDeviatesLightRay(), and fastDeviatesLightRay().

◆ getUpperPlate()

ALIPlane OptOCubeSplitter::getUpperPlate ( )

Definition at line 206 of file OptOCubeSplitter.cc.

206  {
207  if (ALIUtils::debug >= 4)
208  std::cout << "LR: GET UPPER PLATE " << name() << std::endl;
209  //---------- Get centre and normal of plate
211  //----- plate normal before wedge (Y axis of OptO)
212  CLHEP::Hep3Vector Axis(0., 1., 0.);
213  CLHEP::HepRotation rmt = rmGlob();
214  CLHEP::Hep3Vector plate_normal = rmt * Axis;
215  if (ALIUtils::debug >= 3) {
216  ALIUtils::dumprm(rmt, "rmt before wedge angles");
217  ALIUtils::dump3v(plate_normal, "plate_normal before wedge");
218  }
219  //----- plate centre = OptO centre +1/2 width in Y direction
220  CLHEP::Hep3Vector plate_point = centreGlob();
221  plate_point += width / 2. * plate_normal;
222 
223  //---------- Return plate plane
224  return ALIPlane(plate_point, plate_normal);
225 }

References OpticalObject::centreGlob(), gather_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), ALIUtils::dumprm(), OpticalObject::findExtraEntryValue(), OpticalObject::name(), OpticalObject::rmGlob(), and ApeEstimator_cff::width.

Referenced by detailedDeviatesLightRay().

LightRay::dumpData
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:374
ApeEstimator_cff.width
width
Definition: ApeEstimator_cff.py:24
ALIbool
bool ALIbool
Definition: CocoaGlobals.h:19
OpticalObject::findExtraEntryValue
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
Definition: OpticalObject.cc:1519
OptOCubeSplitter::getUpperPlate
ALIPlane getUpperPlate()
Definition: OptOCubeSplitter.cc:206
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
OptOCubeSplitter::getMiddlePlate
ALIPlane getMiddlePlate()
Definition: OptOCubeSplitter.cc:171
OpticalObject::centreGlob
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:75
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
ALIUtils::dump3v
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:58
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