Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "Alignment/CocoaModel/interface/OptOPlateSplitter.h"
00009 #include "Alignment/CocoaModel/interface/LightRay.h"
00010 #include "Alignment/CocoaModel/interface/ALIPlane.h"
00011 #include "Alignment/CocoaUtilities/interface/ALIUtils.h"
00012 #ifdef COCOA_VIS
00013 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h"
00014 #include "Alignment/CocoaVisMgr/interface/ALIColour.h"
00015 #endif
00016 #include "Alignment/CocoaDDLObjects/interface/CocoaSolidShapeBox.h"
00017 #include "Alignment/CocoaUtilities/interface/GlobalOptionMgr.h"
00018
00019 using namespace CLHEP;
00020
00021
00022
00023
00024
00025
00026 void OptOPlateSplitter::detailedDeviatesLightRay( LightRay& lightray )
00027 {
00028 if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED REFLECTION IN PLATE SPLITTER " << name() << std::endl;
00029 if (ALIUtils::debug >= 3) ALIUtils::dump3v( centreGlob(), " centre Global RF ");
00030
00031
00032 ALIPlane plate = getPlate(1, 1);
00033
00034 lightray.reflect( plate );
00035 if (ALIUtils::debug >= 2) {
00036 std::cout << "Reflected in plate" << std::endl;
00037 lightray.dumpData(" ");
00038 }
00039
00040 }
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051 void OptOPlateSplitter::detailedTraversesLightRay( LightRay& lightray )
00052 {
00053 if (ALIUtils::debug >= 2) std::cout << "LR: DETAILED TRAVERSE IN PLATE SPLITTER " << name() << std::endl;
00054
00055
00056 ALIPlane plate = getPlate(1, 1);
00057
00058 ALIdouble width = findExtraEntryValue("width");
00059 if( width == 0 ) {
00060 if(ALIUtils::debug >= 3) lightray.dumpData("Traversed with 0 width");
00061 return;
00062 }
00063
00064
00065 ALIdouble refra_ind1 = 1.;
00066 ALIdouble refra_ind2 = findExtraEntryValue("refra_ind");
00067 lightray.refract( plate, refra_ind1, refra_ind2 );
00068 if (ALIUtils::debug >= 2) {
00069 lightray.dumpData("Refracted in first plate");
00070 }
00071
00072
00073 plate = getPlate(0, 1);
00074
00075 lightray.refract( plate, refra_ind2, refra_ind1 );
00076 if (ALIUtils::debug >= 2) {
00077 lightray.dumpData("Refracted in first plate");
00078 }
00079
00080 }
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090 void OptOPlateSplitter::fastDeviatesLightRay( LightRay& lightray )
00091 {
00092 if (ALIUtils::debug >= 2) std::cout << "LR: REFLECTION IN PLATE SPLITTER " << name() << std::endl;
00093
00094
00095 ALIPlane plate = getPlate(1, 0);
00096
00097 lightray.reflect( plate );
00098 if (ALIUtils::debug >= 2) {
00099 lightray.dumpData("Reflected in plate");
00100 }
00101
00102 lightray.shiftAndDeviateWhileTraversing( this, 'R' );
00103 if (ALIUtils::debug >= 2) {
00104 lightray.dumpData("Deviated ");
00105 }
00106
00107 }
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119 void OptOPlateSplitter::fastTraversesLightRay( LightRay& lightray )
00120 {
00121 if (ALIUtils::debug >= 2) std::cout << "LR: TRAVERSE PLATE SPLITTER " << name() << std::endl;
00122
00123
00124 ALIPlane plate = getPlate(0, 0);
00125 lightray.intersect( plate );
00126 if (ALIUtils::debug >= 2) {
00127 lightray.dumpData("Intersected with plate");
00128 }
00129
00130 lightray.shiftAndDeviateWhileTraversing( this, 'T' );
00131 if (ALIUtils::debug >= 2) {
00132 lightray.dumpData("Shifted and Deviated");
00133 }
00134
00135 }
00136
00137
00138 #ifdef COCOA_VIS
00139
00140 void OptOPlateSplitter::fillIguana()
00141 {
00142 ALIColour* col = new ALIColour( 0., 0., 0., 0. );
00143 ALIdouble width;
00144 ALIbool wexists = findExtraEntryValueIfExists("width",width);
00145 if( !wexists ) width = 1.;
00146
00147 std::vector<ALIdouble> spar;
00148 spar.push_back(4.);
00149 spar.push_back(4.);
00150 spar.push_back(width);
00151 IgCocoaFileMgr::getInstance().addSolid( *this, "BOX", spar, col);
00152 }
00153 #endif
00154
00155
00156
00157 void OptOPlateSplitter::constructSolidShape()
00158 {
00159 ALIdouble go;
00160 GlobalOptionMgr* gomgr = GlobalOptionMgr::getInstance();
00161 gomgr->getGlobalOptionValue("VisScale", go );
00162
00163 theSolidShape = new CocoaSolidShapeBox( "Box", go*5.*cm/m, go*5.*cm/m, go*1.*cm/m );
00164 }