15 #include "Alignment/IgCocoaFileWriter/interface/IgCocoaFileMgr.h" 16 #include "Alignment/CocoaVisMgr/interface/ALIColour.h" 21 using namespace CLHEP;
36 const ALIdouble refra_ind = findExtraEntryValueMustExist(
"refra_ind");
40 for( ii = 0; ii < 4; ii++ ) {
43 lightray.
refract(
ALIPlane(faceP[ii],faceV[ii]), refra_ind0, refra_ind );
46 lightray.
refract(
ALIPlane(faceP[ii],faceV[ii]), refra_ind, refra_ind0 );
70 const ALIdouble refra_ind = findExtraEntryValueMustExist(
"refra_ind");
101 lightray.
dumpData(
"intersected at face 3");
145 lightray.
dumpData(
"Shifted and Deviated");
160 CLHEP::Hep3Vector opto_centre = centreGlob();
162 const ALIdouble hlen1 = findExtraEntryValueMustExist(
"length1") / 2.;
163 const ALIdouble hlen2 = findExtraEntryValueMustExist(
"length2") / 2.;
167 faceP[0] = CLHEP::Hep3Vector( 0, 0 , -hlen1 );
168 faceV[0] = CLHEP::Hep3Vector( 0, 0, -1 );
169 faceP[1] = CLHEP::Hep3Vector( 0, hlen1 - hlen2*
sin(ang), hlen1 + hlen2*
cos(ang) );
170 faceV[1] = CLHEP::Hep3Vector( 0,
cos(ang),
sin(ang) );
172 faceP[2] = CLHEP::Hep3Vector( 0, -hlen1 - hlen2*
cos(ang), -hlen1 + hlen2*
sin(ang) );
173 faceV[2] = CLHEP::Hep3Vector( 0, -
sin(ang), -
cos(ang) );
174 faceP[3] = CLHEP::Hep3Vector( 0, hlen1, 0 );
175 faceV[3] = CLHEP::Hep3Vector( 0, 1, 0 );
178 faceP[4] = CLHEP::Hep3Vector( 0, 0, hlen1 + 2*hlen2*
cos(ang) );
179 faceV[4] = CLHEP::Hep3Vector( 0, 0, 1 );
182 CLHEP::HepRotation rmt = rmGlob();
185 std::cout <<
" optical_square centre" << opto_centre << std::endl;
187 for( ii = 0; ii < numberOfFaces; ii++ ) {
188 faceP[
ii] = rmt * faceP[
ii];
189 faceP[
ii] += opto_centre;
190 faceV[
ii] = rmt * faceV[
ii];
192 std::cout <<
"point at face " << ii <<
": " << faceP[
ii] << std::endl;
193 std::cout <<
"normal at face " << ii <<
": " << faceV[
ii] << std::endl;
200 const ALIbool wxy = findExtraEntryValueIfExists(
"wedge", wedge);
202 wedgeX = findExtraEntryValue(
"wedgeX");
203 wedgeY = findExtraEntryValue(
"wedgeY");
210 if(
ALIUtils::debug >= 4)
std::cout <<
"OptOOpticalSquare calculateFaces: wedgeX " << wedgeX <<
" wedgeY " << wedgeY << std::endl;
211 CLHEP::Hep3Vector Axis1(1.,0.,0.);
217 faceV[1].rotate(0.5* wedgeX, Axis1);
219 faceV[2].rotate(-0.5* wedgeX, Axis1);
227 CLHEP::Hep3Vector Axis2 = Axis1;
228 Axis2 = Axis2.cross( faceV[1] );
229 faceV[1].rotate(0.5* wedgeY, Axis2);
232 Axis2 = Axis2.cross( faceV[2] );
233 faceV[2].rotate(-0.5* wedgeY, Axis2);
249 ALIColour*
col =
new ALIColour( 0., 0., 1., 0. );
251 ALIbool wexists = findExtraEntryValueIfExists(
"length1",length1);
252 if( !wexists ) length1 = 4.;
254 wexists = findExtraEntryValueIfExists(
"length2",length2);
255 if( !wexists ) length2 = 4.;
257 std::vector<ALIdouble> spar;
258 spar.push_back(length1);
259 spar.push_back(length2);
260 IgCocoaFileMgr::getInstance().addSolid( *
this,
"OPTSQR", spar, col);
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Sin< T >::type sin(const T &t)
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
static GlobalOptionMgr * getInstance()
virtual void detailedTraversesLightRay(LightRay &lightray)
int getGlobalOptionValue(const ALIstring &sstr, ALIdouble &val)
--— Search a string in theGlobalOptions and return 1 if found
virtual void detailedDeviatesLightRay(LightRay &lightray)
void constructSolidShape()
Cos< T >::type cos(const T &t)
virtual void fastDeviatesLightRay(LightRay &lightray)
static void dump3v(const CLHEP::Hep3Vector &vec, const std::string &msg)
void intersect(const ALIPlane &plane)
void calculateFaces(ALIbool isDetailed)
virtual void fillIguana()
void dumpData(const ALIstring &str) const
void reflect(const ALIPlane &plane)
virtual void fastTraversesLightRay(LightRay &lightray)