CMS 3D CMS Logo

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

#include <OptOModifiedRhomboidPrism.h>

Inheritance diagram for OptOModifiedRhomboidPrism:
OpticalObject

Public Member Functions

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

Constructor & Destructor Documentation

OptOModifiedRhomboidPrism::OptOModifiedRhomboidPrism ( )
inline

Definition at line 23 of file OptOModifiedRhomboidPrism.h.

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

Definition at line 24 of file OptOModifiedRhomboidPrism.h.

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

Definition at line 26 of file OptOModifiedRhomboidPrism.h.

26 { };

Member Function Documentation

void OptOModifiedRhomboidPrism::constructSolidShape ( )
virtual

Reimplemented from OpticalObject.

Definition at line 281 of file OptOModifiedRhomboidPrism.cc.

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

282 {
283  ALIdouble go;
285  gomgr->getGlobalOptionValue("VisScale", go );
286 
287  theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
288 }
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 OptOModifiedRhomboidPrism::detailedDeviatesLightRay ( LightRay lightray)
virtual

Reimplemented from OpticalObject.

Definition at line 28 of file OptOModifiedRhomboidPrism.cc.

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

29 {
30  if (ALIUtils::debug >= 2) 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) std::cout << "$$$ LR: REFRACTION IN FORWARD PLATE " << std::endl;
48  //---------- Get forward plate
49  ALIPlane plate = getPlate( 1, 1 );
50  //---------- Refract in plate while entering
51  ALIdouble refra_ind1 = 1.;
52  ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
53  lightray.refract( plate, refra_ind1, refra_ind2 );
54  if (ALIUtils::debug >= 2) {
55  lightray.dumpData("LightRay after Refraction at entering: ");
56  }
57 
58  if (ALIUtils::debug >= 2) std::cout << std::endl << "$$$ LR: REFLECTION IN FIRST PLATE " << std::endl;
59  //---------- Get up plate rotated
60  plate = getRotatedPlate( 1 );
61  //---------- Reflect in plate
62  lightray.reflect( plate );
63 
64  if (ALIUtils::debug >= 2) std::cout << std::endl << "$$$ LR: REFLECTION IN SECOND PLATE " << std::endl;
65  //---------- Get up plate rotated
66  plate = getRotatedPlate( 0 );
67  //---------- Reflect in plate
68  lightray.reflect( plate );
69 
70  if (ALIUtils::debug >= 2) std::cout << std::endl << "$$$ LR: REFRACTION IN BACKWARD PLATE " << std::endl;
71  //---------- Get backward plate
72  plate = getPlate( 0, 1 );
73  //---------- Refract in plate while exiting
74  lightray.refract( plate, refra_ind2, refra_ind1 );
75 
76 }
long double ALIdouble
Definition: CocoaGlobals.h:11
const ALIdouble findExtraEntryValueMustExist(const ALIstring &eename) const
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:162
static ALIint debug
Definition: ALIUtils.h:35
const CLHEP::HepRotation & rmGlob() const
ALIPlane getRotatedPlate(const ALIbool forwardPlate)
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:381
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void reflect(const ALIPlane &plane)
Definition: LightRay.cc:141
void OptOModifiedRhomboidPrism::detailedTraversesLightRay ( LightRay lightray)
virtual

Reimplemented from OpticalObject.

Definition at line 87 of file OptOModifiedRhomboidPrism.cc.

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

88 {
89  if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED TRAVERSE MODIFIED RHOMBOID PRISM " << name() << std::endl;
90 
91  //---------- Get forward plate
92  ALIPlane plate = getPlate(1, 1);
93  //---------- Refract while entering splitter
94  ALIdouble refra_ind1 = 1.;
95  ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
96  lightray.refract( plate, refra_ind1, refra_ind2 );
97  if (ALIUtils::debug >= 2) {
98  lightray.dumpData("Refracted in first plate");
99  }
100 
101  //---------- Get back ward plate (of triangular piiece)
102  plate = getPlate(1, 0);
103  //---------- Refract while exiting prism
104  lightray.refract( plate, refra_ind2, refra_ind1 );
105  if (ALIUtils::debug >= 2) {
106  lightray.dumpData("Refracted in first plate");
107  }
108 
109 }
long double ALIdouble
Definition: CocoaGlobals.h:11
const ALIdouble findExtraEntryValueMustExist(const ALIstring &eename) const
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:162
static ALIint debug
Definition: ALIUtils.h:35
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:381
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void OptOModifiedRhomboidPrism::fastDeviatesLightRay ( LightRay lightray)
virtual

Reimplemented from OpticalObject.

Definition at line 119 of file OptOModifiedRhomboidPrism.cc.

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

120 {
121  if (ALIUtils::debug >= 2) std::cout << "LR: FAST REFLECTION IN MODIFIED RHOMBOID PRISM " << name() << std::endl;
122 
123  //---------- Get backward plate
124  ALIPlane plate = getPlate(0, 0);
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 
145 }
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:240
static ALIint debug
Definition: ALIUtils.h:35
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:100
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:381
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
void OptOModifiedRhomboidPrism::fastTraversesLightRay ( LightRay lightray)
virtual

Reimplemented from OpticalObject.

Definition at line 157 of file OptOModifiedRhomboidPrism.cc.

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

158 {
159  if (ALIUtils::debug >= 2) std::cout << "LR: FAST TRAVERSE MODIFIED RHOMBOID PRISM " << name() << std::endl;
160 
161  //---------- Get backward plate
162  ALIPlane plate = getPlate(0, 0);
163  lightray.intersect( plate );
164  if (ALIUtils::debug >= 2) {
165  lightray.dumpData("Intersected with plate");
166  }
167  //---------- Shift and Deviate
168  lightray.shiftAndDeviateWhileTraversing( this, 'T');
169  /* ALIdouble shiftTX = findExtraEntryValue("shiftTX");
170  ALIdouble shiftTY = findExtraEntryValue("shiftTY");
171  ALIdouble deviTX = findExtraEntryValue("deviTX");
172  ALIdouble deviTY = findExtraEntryValue("deviTY");
173  lightray.shiftAndDeviateWhileTraversing( this, shiftTX, shiftTY, deviTX, deviTY);*/
174 
175  if (ALIUtils::debug >= 2) {
176  lightray.dumpData("Shifted and Deviated");
177  }
178 
179 }
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:240
static ALIint debug
Definition: ALIUtils.h:35
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:100
ALIPlane getPlate(const ALIbool forwardPlate, const ALIbool applyWedge)
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:381
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60
ALIPlane OptOModifiedRhomboidPrism::getRotatedPlate ( const ALIbool  forwardPlate)

Definition at line 192 of file OptOModifiedRhomboidPrism.cc.

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

193 {
194  if (ALIUtils::debug >= 4) std::cout << "% LR: GET ROTATED PLATE " << name() << std::endl;
195  //---------- Get OptO variables
196  const ALIdouble shift = (findExtraEntryValue("shiftRY"));
197  ALIdouble wedgeR = findExtraEntryValue("wedgeR");
198 
199  //---------- Get centre of plate
200  //----- plate centre = OptO centre +/- 1/2 shift
201  CLHEP::Hep3Vector plate_point = centreGlob();
202  //--- 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
203  ALIdouble normal_sign = -forwardPlate*2 + 1;
204  CLHEP::Hep3Vector YAxis(0.,1.,0.);
205  CLHEP::HepRotation rmt = rmGlob();
206  YAxis = rmt*YAxis;
207  plate_point += normal_sign * shift/2. * YAxis;
208 
209  //---------- Get normal of plate
210  //----- Plate normal before wedgeR (Z axis of OptO rotated 'angle' around X)
211  CLHEP::Hep3Vector ZAxis(0.,0.,1.);
212  ALIdouble anglePlanes;
213  ALIbool we = findExtraEntryValueIfExists("anglePlanes", anglePlanes);
214  if( !we ) {
215  anglePlanes = 45.*ALIUtils::deg;
216  }
217  ZAxis.rotateX( anglePlanes );
218 
219  //----- Rotate with global rotation matrix
220  CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
221  if (ALIUtils::debug >= 3) {
222  ALIUtils::dump3v( plate_point, "plate_point");
223  ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
224  ALIUtils::dumprm( rmt, "rmt before wedge angles" );
225  }
226 
227  //----- Rotate plate normal by 1/2 wedgeR angles
228  //--- Around X axis
229  CLHEP::Hep3Vector XAxis(0.,0.,1.);
230  XAxis = rmt*XAxis;
231  plate_normal.rotate( normal_sign * wedgeR/2., XAxis );
232  if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeR around X ");
233  //--- Around the axis obtained rotating the prism Y axis by 'anglePlanes' around the prism X axis
234  YAxis = CLHEP::Hep3Vector(0.,1.,0.);
235  YAxis.rotateX( anglePlanes );
236  YAxis = rmt*YAxis;
237  plate_normal.rotate( normal_sign * wedgeR/2., YAxis );
238  if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeR around Y ");
239 
240  //---------- Return plate plane
241  return ALIPlane(plate_point, plate_normal);
242 
243 }
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:35
const CLHEP::HepRotation & rmGlob() const
bool ALIbool
Definition: CocoaGlobals.h:19
const ALIdouble findExtraEntryValue(const ALIstring &eename) const
static ALIdouble deg
Definition: ALIUtils.h:36
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
Definition: ALIUtils.cc:61
const CLHEP::Hep3Vector & centreGlob() const
Definition: OpticalObject.h:85
static unsigned int const shift
tuple cout
Definition: gather_cfg.py:121
const ALIstring & name() const
Definition: OpticalObject.h:60