CMS 3D CMS Logo

OptOModifiedRhomboidPrism Class Reference

#include <Alignment/CocoaModel/interface/OptOModifiedRhomboidPrism.h>

Inheritance diagram for OptOModifiedRhomboidPrism:

OpticalObject

List of all members.

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 (OpticalObject *parent, const ALIstring &type, const ALIstring &name, const ALIbool copy_data)
 OptOModifiedRhomboidPrism ()
 ~OptOModifiedRhomboidPrism ()


Detailed Description

Definition at line 18 of file OptOModifiedRhomboidPrism.h.


Constructor & Destructor Documentation

OptOModifiedRhomboidPrism::OptOModifiedRhomboidPrism (  )  [inline]

Definition at line 23 of file OptOModifiedRhomboidPrism.h.

00023 { };

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

Definition at line 24 of file OptOModifiedRhomboidPrism.h.

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

OptOModifiedRhomboidPrism::~OptOModifiedRhomboidPrism (  )  [inline]

Definition at line 26 of file OptOModifiedRhomboidPrism.h.

00026 { };


Member Function Documentation

void OptOModifiedRhomboidPrism::constructSolidShape (  )  [virtual]

Reimplemented from OpticalObject.

Definition at line 279 of file OptOModifiedRhomboidPrism.cc.

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

00280 {
00281   ALIdouble go;
00282   GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00283   gomgr->getGlobalOptionValue("VisScale", go );
00284 
00285   theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
00286 }

void OptOModifiedRhomboidPrism::detailedDeviatesLightRay ( LightRay lightray  )  [virtual]

Reimplemented from OpticalObject.

Definition at line 26 of file OptOModifiedRhomboidPrism.cc.

References OpticalObject::centreGlob(), GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, ALIUtils::dump3v(), LightRay::dumpData(), lat::endl(), OpticalObject::findExtraEntryValueMustExist(), OpticalObject::getPlate(), getRotatedPlate(), OpticalObject::name(), LightRay::reflect(), LightRay::refract(), OpticalObject::rmGlob(), and rmt.

00027 {
00028   if (ALIUtils::debug >= 2) std::cout << "$$$$$ LR: DETAILED DEVIATION IN MODIFIED RHOMBOID PRISM " << name() << std::endl;
00029 
00030   CLHEP::Hep3Vector XAxis(1.,0.,0.);
00031   CLHEP::HepRotation rmt = rmGlob();
00032   XAxis = rmt*XAxis;
00033   CLHEP::Hep3Vector YAxis(0.,1.,0.);
00034   YAxis = rmt*YAxis;
00035   CLHEP::Hep3Vector ZAxis(0.,0.,1.);
00036   ZAxis = rmt*ZAxis;
00037 
00038   ALIUtils::dump3v( XAxis , " x axis ");
00039   ALIUtils::dump3v( YAxis , " y axis ");
00040   ALIUtils::dump3v( ZAxis , " z axis ");
00041   if (ALIUtils::debug >= 5) {
00042     ALIUtils::dump3v( centreGlob(), " centre ");
00043   }
00044 
00045   if (ALIUtils::debug >= 2) std::cout << "$$$ LR: REFRACTION IN FORWARD PLATE " << std::endl;
00046   //---------- Get forward plate
00047   ALIPlane plate = getPlate( 1, 1 );
00048   //---------- Refract in plate while entering
00049   ALIdouble refra_ind1 = 1.;
00050   ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
00051   lightray.refract( plate, refra_ind1, refra_ind2 );
00052   if (ALIUtils::debug >= 2) {
00053     lightray.dumpData("LightRay after Refraction at entering: "); 
00054   }
00055 
00056   if (ALIUtils::debug >= 2) std::cout << std::endl << "$$$ LR: REFLECTION IN FIRST PLATE " << std::endl;
00057   //---------- Get up plate rotated
00058   plate = getRotatedPlate( 1 );
00059   //---------- Reflect in plate
00060   lightray.reflect( plate );
00061 
00062   if (ALIUtils::debug >= 2) std::cout << std::endl << "$$$ LR: REFLECTION IN SECOND PLATE " << std::endl;
00063   //---------- Get up plate rotated
00064   plate = getRotatedPlate( 0 );
00065   //---------- Reflect in plate
00066   lightray.reflect( plate );
00067 
00068   if (ALIUtils::debug >= 2) std::cout << std::endl << "$$$ LR: REFRACTION IN BACKWARD PLATE " << std::endl;
00069   //---------- Get backward plate
00070   plate = getPlate( 0, 1 );
00071   //---------- Refract in plate while exiting
00072   lightray.refract( plate, refra_ind2, refra_ind1 );
00073 
00074 }

void OptOModifiedRhomboidPrism::detailedTraversesLightRay ( LightRay lightray  )  [virtual]

Reimplemented from OpticalObject.

Definition at line 85 of file OptOModifiedRhomboidPrism.cc.

References GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, LightRay::dumpData(), lat::endl(), OpticalObject::findExtraEntryValueMustExist(), OpticalObject::getPlate(), OpticalObject::name(), and LightRay::refract().

00086 {
00087   if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED TRAVERSE MODIFIED RHOMBOID PRISM " << name() << std::endl;
00088 
00089   //---------- Get forward plate
00090   ALIPlane plate = getPlate(1, 1);
00091   //---------- Refract while entering splitter
00092   ALIdouble refra_ind1 = 1.;
00093   ALIdouble refra_ind2 = findExtraEntryValueMustExist("refra_ind");
00094   lightray.refract( plate, refra_ind1, refra_ind2 );
00095   if (ALIUtils::debug >= 2) {
00096     lightray.dumpData("Refracted in first plate"); 
00097   }
00098 
00099   //---------- Get back ward plate (of triangular piiece)
00100   plate = getPlate(1, 0);
00101   //---------- Refract while exiting prism
00102   lightray.refract( plate, refra_ind2, refra_ind1 );
00103   if (ALIUtils::debug >= 2) {
00104     lightray.dumpData("Refracted in first plate"); 
00105   }
00106 
00107 }

void OptOModifiedRhomboidPrism::fastDeviatesLightRay ( LightRay lightray  )  [virtual]

Reimplemented from OpticalObject.

Definition at line 117 of file OptOModifiedRhomboidPrism.cc.

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

00118 {
00119   if (ALIUtils::debug >= 2) std::cout << "LR: FAST REFLECTION IN MODIFIED RHOMBOID PRISM " << name() << std::endl;
00120 
00121   //---------- Get backward plate
00122   ALIPlane plate = getPlate(0, 0);
00123   //---------- Intersect with plate
00124   lightray.intersect( plate );
00125   if (ALIUtils::debug >= 2) {
00126     lightray.dumpData("Intersected in plate"); 
00127   }
00128   //---------- Deviate Lightray 
00129   lightray.shiftAndDeviateWhileTraversing( this, 'R');
00130   /*  ALIdouble deviRX = findExtraEntryValue("deviRX");
00131   ALIdouble deviRY = findExtraEntryValue("deviRY");
00132   ALIdouble shiftRX = findExtraEntryValue("shiftRX");
00133   ALIdouble shiftRY = findExtraEntryValue("shiftRY");
00134   lightray.shiftAndDeviateWhileTraversing( this, shiftRX, shiftRY, deviRX, deviRY);
00135   */
00136 
00137   if (ALIUtils::debug >= 2) {
00138     //    std::cout << " shiftRX " << shiftRX << " shiftRY " << shiftRY << std::endl;
00139     //   std::cout << " deviRX " << deviRX << " deviRY " << deviRY << std::endl;
00140     lightray.dumpData("Deviated ");
00141   }
00142   
00143 }

void OptOModifiedRhomboidPrism::fastTraversesLightRay ( LightRay lightray  )  [virtual]

Reimplemented from OpticalObject.

Definition at line 155 of file OptOModifiedRhomboidPrism.cc.

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

00156 {
00157   if (ALIUtils::debug >= 2) std::cout << "LR: FAST TRAVERSE MODIFIED RHOMBOID PRISM " << name() << std::endl;
00158   
00159   //---------- Get backward plate
00160   ALIPlane plate = getPlate(0, 0);
00161   lightray.intersect( plate );
00162   if (ALIUtils::debug >= 2) {
00163     lightray.dumpData("Intersected with plate"); 
00164   }
00165   //---------- Shift and Deviate
00166   lightray.shiftAndDeviateWhileTraversing( this, 'T');
00167   /*  ALIdouble shiftTX = findExtraEntryValue("shiftTX");
00168   ALIdouble shiftTY = findExtraEntryValue("shiftTY");
00169   ALIdouble deviTX = findExtraEntryValue("deviTX");
00170   ALIdouble deviTY = findExtraEntryValue("deviTY");
00171   lightray.shiftAndDeviateWhileTraversing( this, shiftTX, shiftTY, deviTX, deviTY);*/
00172 
00173   if (ALIUtils::debug >= 2) {
00174     lightray.dumpData("Shifted and Deviated");
00175   }
00176 
00177 }

ALIPlane OptOModifiedRhomboidPrism::getRotatedPlate ( const ALIbool  forwardPlate  ) 

Definition at line 190 of file OptOModifiedRhomboidPrism.cc.

References OpticalObject::centreGlob(), GenMuonPlsPt100GeV_cfg::cout, ALIUtils::debug, ALIUtils::deg, ALIUtils::dump3v(), ALIUtils::dumprm(), lat::endl(), OpticalObject::findExtraEntryValue(), OpticalObject::findExtraEntryValueIfExists(), OpticalObject::name(), OpticalObject::rmGlob(), and rmt.

Referenced by detailedDeviatesLightRay().

00191 {
00192   if (ALIUtils::debug >= 4) std::cout << "% LR: GET ROTATED PLATE " << name() << std::endl;
00193   //---------- Get OptO variables
00194   const ALIdouble shift = (findExtraEntryValue("shiftRY"));
00195   ALIdouble wedgeR = findExtraEntryValue("wedgeR");
00196 
00197   //---------- Get centre of plate
00198   //----- plate centre = OptO centre +/- 1/2 shift
00199   CLHEP::Hep3Vector plate_point = centreGlob();
00200   //--- 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
00201   ALIdouble normal_sign = -forwardPlate*2 + 1;
00202   CLHEP::Hep3Vector YAxis(0.,1.,0.);
00203   CLHEP::HepRotation rmt = rmGlob();
00204   YAxis = rmt*YAxis;
00205   plate_point += normal_sign * shift/2. * YAxis;
00206 
00207   //---------- Get normal of plate
00208   //----- Plate normal before wedgeR (Z axis of OptO rotated 'angle' around X)
00209   CLHEP::Hep3Vector ZAxis(0.,0.,1.);
00210   ALIdouble anglePlanes;
00211   ALIbool we = findExtraEntryValueIfExists("anglePlanes", anglePlanes);
00212   if( !we ) { 
00213     anglePlanes = 45.*ALIUtils::deg;
00214   }
00215   ZAxis.rotateX( anglePlanes );
00216 
00217   //----- Rotate with global rotation matrix
00218   CLHEP::Hep3Vector plate_normal = rmt*ZAxis;
00219   if (ALIUtils::debug >= 3) { 
00220     ALIUtils::dump3v( plate_point, "plate_point");
00221     ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
00222     ALIUtils::dumprm( rmt, "rmt before wedge angles" );
00223   }
00224 
00225   //----- Rotate plate normal by 1/2 wedgeR angles
00226   //--- Around X axis
00227   CLHEP::Hep3Vector XAxis(0.,0.,1.);
00228   XAxis = rmt*XAxis;
00229   plate_normal.rotate( normal_sign * wedgeR/2., XAxis );
00230   if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeR around X ");
00231   //--- Around the axis obtained rotating the prism Y axis by 'anglePlanes' around the prism X axis
00232   YAxis = CLHEP::Hep3Vector(0.,1.,0.);
00233   YAxis.rotateX( anglePlanes );
00234   YAxis = rmt*YAxis;
00235   plate_normal.rotate( normal_sign * wedgeR/2., YAxis );
00236   if (ALIUtils::debug >= 3) ALIUtils::dump3v( plate_normal, "plate_normal after wedgeR around Y ");
00237 
00238   //---------- Return plate plane
00239   return ALIPlane(plate_point, plate_normal);
00240 
00241 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:29:18 2009 for CMSSW by  doxygen 1.5.4