CMS 3D CMS Logo

OptOCubeSplitter Class Reference

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

Inheritance diagram for OptOCubeSplitter:

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


Detailed Description

Definition at line 18 of file OptOCubeSplitter.h.


Constructor & Destructor Documentation

OptOCubeSplitter::OptOCubeSplitter (  )  [inline]

Definition at line 23 of file OptOCubeSplitter.h.

00023 { };

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

Definition at line 24 of file OptOCubeSplitter.h.

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

OptOCubeSplitter::~OptOCubeSplitter (  )  [inline]

Definition at line 26 of file OptOCubeSplitter.h.

00026 { };


Member Function Documentation

void OptOCubeSplitter::constructSolidShape (  )  [virtual]

Reimplemented from OpticalObject.

Definition at line 247 of file OptOCubeSplitter.cc.

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

00248 {
00249   ALIdouble go;
00250   GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00251   gomgr->getGlobalOptionValue("VisScale", go );
00252 
00253   theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*5.*cm/m ); //COCOA internal units are meters
00254 }

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

Reimplemented from OpticalObject.

Definition at line 94 of file OptOCubeSplitter.cc.

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

00095 {
00096   if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED REFLECTION IN CUBE SPLITTER " << name() << std::endl;
00097 
00098   if(ALIUtils::debug >= 2) ALIUtils::dump3v( centreGlob(), "centreGlob");
00099   //---------- Get first plate
00100   if (ALIUtils::debug >= 3) std::cout << "%%%%% refracting at entering first plate " << std::endl; 
00101   if (ALIUtils::debug >= 3) std::cout << "%%% getting first plate " << std::endl; 
00102   ALIPlane plate = getPlate(1, 1);
00103 
00104   //---------- Refract  
00105   ALIdouble refra_ind1 = 1.;
00106   ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
00107   lightray.refract( plate, refra_ind1, refra_ind2 );
00108 
00109   //---------- Get middle plate
00110   if (ALIUtils::debug >= 3) std::cout << "%%%%% reflecting in middle plate " << std::endl; 
00111   if (ALIUtils::debug >= 3) std::cout << "%%% getting middle plate " << std::endl; 
00112   plate = getMiddlePlate();
00113 
00114   //---------- Reflect
00115   lightray.reflect( plate );
00116   if (ALIUtils::debug >= 2) {
00117     lightray.dumpData("Reflected in plate"); 
00118   }
00119 
00120   //--------- Get upper plate
00121   if (ALIUtils::debug >= 3) std::cout << "%%%%% getting second plate " << std::endl; 
00122   plate = getUpperPlate();
00123   if (ALIUtils::debug >= 3) std::cout << "%%%%% refracting at exiting second plate " << std::endl; 
00124   lightray.refract( plate, refra_ind2, refra_ind1 );
00125 
00126  if (ALIUtils::debug >= 2) {
00127     lightray.dumpData("After CubeSplitter"); 
00128   }
00129 
00130 }

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

Reimplemented from OpticalObject.

Definition at line 141 of file OptOCubeSplitter.cc.

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

00142 {
00143   if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED TRAVERSE CUBE SPLITTER " << name() << std::endl;
00144 
00145   //---------- Get forward plate
00146   ALIPlane plate = getPlate(1, 1);
00147 
00148   //---------- Refract while entering splitter
00149   ALIdouble refra_ind1 = 1.;
00150   ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
00151   lightray.refract( plate, refra_ind1, refra_ind2 );
00152   if (ALIUtils::debug >= 2) {
00153     lightray.dumpData("Refracted in first plate"); 
00154   }
00155 
00156   //---------- Get backward plate
00157   plate = getPlate(0, 1);
00158   //---------- Refract while exiting splitter
00159   lightray.refract( plate, refra_ind2, refra_ind1 );
00160   if (ALIUtils::debug >= 2) {
00161     lightray.dumpData("Refracted in first plate"); 
00162   }
00163 
00164 }

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

Reimplemented from OpticalObject.

Definition at line 27 of file OptOCubeSplitter.cc.

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

00028 {
00029   if (ALIUtils::debug >= 2) std::cout << "LR: FAST REFLECTION IN CUBE SPLITTER " << name() << std::endl;
00030 
00031   //---------- Get forward plate
00032   ALIPlane plate = getMiddlePlate();
00033   //---------- Reflect in plate (including intersection with it)
00034   lightray.reflect( plate );
00035   if (ALIUtils::debug >= 2) {
00036     lightray.dumpData("Reflected in plate"); 
00037   }
00038   //---------- Deviate Lightray 
00039   //  ALIdouble deviRX = findExtraEntryValue("deviRX");
00040   // ALIdouble deviRY = findExtraEntryValue("deviRY");
00041   //  lightray.shiftAndDeviateWhileTraversing( this, 0., 0., 0., deviRX, deviRY, 0.);
00042   lightray.shiftAndDeviateWhileTraversing( this, 'R' );
00043   if (ALIUtils::debug >= 2) {
00044     lightray.dumpData("Deviated ");
00045   }
00046   
00047 }

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

Reimplemented from OpticalObject.

Definition at line 59 of file OptOCubeSplitter.cc.

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

00060 {
00061   if (ALIUtils::debug >= 2) std::cout << "LR: FAST TRAVERSE CUBE SPLITTER  " << name() << std::endl;
00062   
00063   //---------- Get backward plate
00064   ALIPlane plate = getPlate(0, 0);
00065   lightray.intersect( plate );
00066   if (ALIUtils::debug >= 2) {
00067     lightray.dumpData("Intersected with plate"); 
00068   }
00069   //---------- Shift and Deviate
00070   lightray.shiftAndDeviateWhileTraversing( this, 'T');
00071   /*  ALIdouble shiftX = findExtraEntryValue("shiftX");
00072   ALIdouble shiftY = findExtraEntryValue("shiftY");
00073   ALIdouble deviTX = findExtraEntryValue("deviTX");
00074   ALIdouble deviTY = findExtraEntryValue("deviTY");
00075   lightray.shiftAndDeviateWhileTraversing( this, shiftX, shiftY, deviTX, deviTY);*/
00076 
00077   if (ALIUtils::debug >= 2) {
00078     lightray.dumpData("Shifted and Deviated");
00079   }
00080 
00081 }

ALIPlane OptOCubeSplitter::getMiddlePlate (  ) 

Definition at line 172 of file OptOCubeSplitter.cc.

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

Referenced by detailedDeviatesLightRay(), and fastDeviatesLightRay().

00173 {
00174   if (ALIUtils::debug >= 4) std::cout << "%%% LR: GET MIDDLE PLATE " << name() << std::endl;
00175   //---------- Get centre and normal of plate
00176   //----- plate normal before wedge (Z axis of OptO)
00177   ALIdouble anglePlanes;
00178   ALIbool angpl = findExtraEntryValueIfExists("anglePlanes", anglePlanes);
00179   if( !angpl ) {
00180     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 
00181     if (ALIUtils::debug >= 4) std::cout << "anglePlanes default = " << anglePlanes/deg << std::endl;
00182   }
00183   CLHEP::Hep3Vector Axis(0., 0., 1.);
00184   CLHEP::Hep3Vector XAxis(1., 0., 0.);
00185   Axis.rotate( anglePlanes, XAxis);
00186   CLHEP::HepRotation rmt = rmGlob();
00187   CLHEP::Hep3Vector plate_normal = rmt*Axis;
00188   if (ALIUtils::debug >= 3) { 
00189     ALIUtils::dumprm( rmt, "rmt before wedge angles" );
00190     ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
00191   }
00192   //----- plate centre = OptO 
00193   CLHEP::Hep3Vector plate_point = centreGlob();
00194 
00195   //---------- Return plate plane
00196   return ALIPlane(plate_point, plate_normal);
00197 
00198 }

ALIPlane OptOCubeSplitter::getUpperPlate (  ) 

Definition at line 205 of file OptOCubeSplitter.cc.

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

Referenced by detailedDeviatesLightRay().

00206 {
00207   if (ALIUtils::debug >= 4) std::cout << "LR: GET UPPER PLATE " << name() << std::endl;
00208   //---------- Get centre and normal of plate
00209   ALIdouble width = findExtraEntryValue("width");
00210   //----- plate normal before wedge (Y axis of OptO)
00211   CLHEP::Hep3Vector Axis(0., 1., 0.);
00212   CLHEP::HepRotation rmt = rmGlob();
00213   CLHEP::Hep3Vector plate_normal = rmt*Axis;
00214   if (ALIUtils::debug >= 3) { 
00215     ALIUtils::dumprm( rmt, "rmt before wedge angles" );
00216     ALIUtils::dump3v( plate_normal, "plate_normal before wedge");
00217   }
00218   //----- plate centre = OptO centre +1/2 width in Y direction 
00219   CLHEP::Hep3Vector plate_point = centreGlob();
00220   plate_point += width/2. * plate_normal;
00221 
00222   //---------- Return plate plane
00223   return ALIPlane(plate_point, plate_normal);
00224 
00225 }


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