CMS 3D CMS Logo

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 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 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
 
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::OptOCubeSplitter ( )
inline

Definition at line 23 of file OptOCubeSplitter.h.

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

Definition at line 24 of file OptOCubeSplitter.h.

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

Member Function Documentation

void OptOCubeSplitter::constructSolidShape ( )
overridevirtual

Reimplemented from OpticalObject.

Definition at line 247 of file OptOCubeSplitter.cc.

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

Referenced by ~OptOCubeSplitter().

248 {
249  ALIdouble go;
251  gomgr->getGlobalOptionValue("VisScale", go );
252 
253  theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
254 }
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 OptOCubeSplitter::detailedDeviatesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 94 of file OptOCubeSplitter.cc.

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().

Referenced by ~OptOCubeSplitter().

95 {
96  if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED REFLECTION IN CUBE SPLITTER " << name() << std::endl;
97 
98  if(ALIUtils::debug >= 2) ALIUtils::dump3v( centreGlob(), "centreGlob");
99  //---------- Get first plate
100  if (ALIUtils::debug >= 3) std::cout << "%%%%% refracting at entering first plate " << std::endl;
101  if (ALIUtils::debug >= 3) std::cout << "%%% getting first plate " << std::endl;
102  ALIPlane plate = getPlate(true, true);
103 
104  //---------- Refract
105  ALIdouble refra_ind1 = 1.;
106  ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
107  lightray.refract( plate, refra_ind1, refra_ind2 );
108 
109  //---------- Get middle plate
110  if (ALIUtils::debug >= 3) std::cout << "%%%%% reflecting in middle plate " << std::endl;
111  if (ALIUtils::debug >= 3) std::cout << "%%% getting middle plate " << std::endl;
112  plate = getMiddlePlate();
113 
114  //---------- Reflect
115  lightray.reflect( plate );
116  if (ALIUtils::debug >= 2) {
117  lightray.dumpData("Reflected in plate");
118  }
119 
120  //--------- Get upper plate
121  if (ALIUtils::debug >= 3) std::cout << "%%%%% getting second plate " << std::endl;
122  plate = getUpperPlate();
123  if (ALIUtils::debug >= 3) std::cout << "%%%%% refracting at exiting second plate " << std::endl;
124  lightray.refract( plate, refra_ind2, refra_ind1 );
125 
126  if (ALIUtils::debug >= 2) {
127  lightray.dumpData("After CubeSplitter");
128  }
129 
130 }
long double ALIdouble
Definition: CocoaGlobals.h:11
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:163
static ALIint debug
Definition: ALIUtils.h:36
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
ALIPlane getUpperPlate()
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:382
ALIPlane getMiddlePlate()
const ALIstring & name() const
Definition: OpticalObject.h:60
void reflect(const ALIPlane &plane)
Definition: LightRay.cc:142
void OptOCubeSplitter::detailedTraversesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 141 of file OptOCubeSplitter.cc.

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

Referenced by ~OptOCubeSplitter().

142 {
143  if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED TRAVERSE CUBE SPLITTER " << name() << std::endl;
144 
145  //---------- Get forward plate
146  ALIPlane plate = getPlate(true, true);
147 
148  //---------- Refract while entering splitter
149  ALIdouble refra_ind1 = 1.;
150  ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
151  lightray.refract( plate, refra_ind1, refra_ind2 );
152  if (ALIUtils::debug >= 2) {
153  lightray.dumpData("Refracted in first plate");
154  }
155 
156  //---------- Get backward plate
157  plate = getPlate(false, true);
158  //---------- Refract while exiting splitter
159  lightray.refract( plate, refra_ind2, refra_ind1 );
160  if (ALIUtils::debug >= 2) {
161  lightray.dumpData("Refracted in first plate");
162  }
163 
164 }
long double ALIdouble
Definition: CocoaGlobals.h:11
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:163
static ALIint debug
Definition: ALIUtils.h:36
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:382
const ALIstring & name() const
Definition: OpticalObject.h:60
void OptOCubeSplitter::fastDeviatesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 27 of file OptOCubeSplitter.cc.

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

Referenced by ~OptOCubeSplitter().

28 {
29  if (ALIUtils::debug >= 2) 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 
47 }
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:241
static ALIint debug
Definition: ALIUtils.h:36
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:382
ALIPlane getMiddlePlate()
const ALIstring & name() const
Definition: OpticalObject.h:60
void reflect(const ALIPlane &plane)
Definition: LightRay.cc:142
void OptOCubeSplitter::fastTraversesLightRay ( LightRay lightray)
overridevirtual

Reimplemented from OpticalObject.

Definition at line 59 of file OptOCubeSplitter.cc.

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

Referenced by ~OptOCubeSplitter().

60 {
61  if (ALIUtils::debug >= 2) std::cout << "LR: FAST TRAVERSE CUBE SPLITTER " << name() << std::endl;
62 
63  //---------- Get backward plate
64  ALIPlane plate = getPlate(false, false);
65  lightray.intersect( plate );
66  if (ALIUtils::debug >= 2) {
67  lightray.dumpData("Intersected with plate");
68  }
69  //---------- Shift and Deviate
70  lightray.shiftAndDeviateWhileTraversing( this, 'T');
71  /* ALIdouble shiftX = findExtraEntryValue("shiftX");
72  ALIdouble shiftY = findExtraEntryValue("shiftY");
73  ALIdouble deviTX = findExtraEntryValue("deviTX");
74  ALIdouble deviTY = findExtraEntryValue("deviTY");
75  lightray.shiftAndDeviateWhileTraversing( this, shiftX, shiftY, deviTX, deviTY);*/
76 
77  if (ALIUtils::debug >= 2) {
78  lightray.dumpData("Shifted and Deviated");
79  }
80 
81 }
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:241
static ALIint debug
Definition: ALIUtils.h:36
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:101
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:382
const ALIstring & name() const
Definition: OpticalObject.h:60
ALIPlane OptOCubeSplitter::getMiddlePlate ( )

Definition at line 172 of file OptOCubeSplitter.cc.

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

Referenced by detailedDeviatesLightRay(), fastDeviatesLightRay(), and ~OptOCubeSplitter().

173 {
174  if (ALIUtils::debug >= 4) std::cout << "%%% LR: GET MIDDLE PLATE " << name() << std::endl;
175  //---------- Get centre and normal of plate
176  //----- plate normal before wedge (Z axis of OptO)
177  ALIdouble anglePlanes;
178  ALIbool angpl = findExtraEntryValueIfExists("anglePlanes", anglePlanes);
179  if( !angpl ) {
180  anglePlanes = acos(0.)/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
181  if (ALIUtils::debug >= 4) std::cout << "anglePlanes default = " << anglePlanes/deg << std::endl;
182  }
183  CLHEP::Hep3Vector Axis(0., 0., 1.);
184  CLHEP::Hep3Vector XAxis(1., 0., 0.);
185  Axis.rotate( anglePlanes, XAxis);
186  CLHEP::HepRotation rmt = rmGlob();
187  CLHEP::Hep3Vector plate_normal = rmt*Axis;
188  if (ALIUtils::debug >= 3) {
189  ALIUtils::dumprm( rmt, "rmt before wedge angles" );
190  ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
191  }
192  //----- plate centre = OptO
193  CLHEP::Hep3Vector plate_point = centreGlob();
194 
195  //---------- Return plate plane
196  return ALIPlane(plate_point, plate_normal);
197 
198 }
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
const ALIbool findExtraEntryValueIfExists(const ALIstring &eename, ALIdouble &value) const
static ALIint debug
Definition: ALIUtils.h:36
const CLHEP::HepRotation & rmGlob() const
bool ALIbool
Definition: CocoaGlobals.h:19
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const ALIstring & name() const
Definition: OpticalObject.h:60
ALIPlane OptOCubeSplitter::getUpperPlate ( )

Definition at line 205 of file OptOCubeSplitter.cc.

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

Referenced by detailedDeviatesLightRay(), and ~OptOCubeSplitter().

206 {
207  if (ALIUtils::debug >= 4) std::cout << "LR: GET UPPER PLATE " << name() << std::endl;
208  //---------- Get centre and normal of plate
210  //----- plate normal before wedge (Y axis of OptO)
211  CLHEP::Hep3Vector Axis(0., 1., 0.);
212  CLHEP::HepRotation rmt = rmGlob();
213  CLHEP::Hep3Vector plate_normal = rmt*Axis;
214  if (ALIUtils::debug >= 3) {
215  ALIUtils::dumprm( rmt, "rmt before wedge angles" );
216  ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
217  }
218  //----- plate centre = OptO centre +1/2 width in Y direction
219  CLHEP::Hep3Vector plate_point = centreGlob();
220  plate_point += width/2. * plate_normal;
221 
222  //---------- Return plate plane
223  return ALIPlane(plate_point, plate_normal);
224 
225 }
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
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
const ALIstring & name() const
Definition: OpticalObject.h:60