Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-09-07 04:34:25

0001 //   COCOA class header file

0002 //Id:  LightRay.h

0003 //CAT: Model

0004 //

0005 //   Utility class that starts reading the system description file

0006 //                and contains the static data

0007 //

0008 //   History: v1.0

0009 //   Pedro Arce

0010 
0011 #ifndef LIGHTRAY_H
0012 #define LIGHTRAY_H
0013 
0014 class OpticalObject;
0015 class ALIPlane;
0016 
0017 #include "CLHEP/Vector/ThreeVector.h"
0018 #include "Alignment/CocoaUtilities/interface/CocoaGlobals.h"
0019 
0020 class LightRay {
0021 public:
0022   //----- construct a default LigthRay

0023   LightRay();
0024   // Make a light ray out of the centre_glob points of two OptO:'source' and 'pointLens'

0025   LightRay(OpticalObject* p1, OpticalObject* p2);
0026   LightRay(CLHEP::Hep3Vector& vec1, CLHEP::Hep3Vector& vec2);
0027   ~LightRay() {}
0028 
0029   //@@@@@@@@@@@@@@@@@@@@ Methods for each OptO

0030   //----- Make a light ray out of the centre_glob and Z direction of one OptO: 'laser' or 'source'

0031   void startLightRay(OpticalObject* opto);
0032 
0033   //----- Intersect light ray with a plane and change thePoint to the intersection point

0034   void intersect(const ALIPlane& plane);
0035 
0036   //----- Intersect light ray with a OptO (intersect it with its plane perpendicular to Z) and change thePoint to the intersection point

0037   void intersect(const OpticalObject& opto);
0038 
0039   //-----  Intersect the LightRay with a plane and then change the direction from reflection on this plane

0040   void reflect(const ALIPlane& plane);
0041 
0042   //----- Deviate a LightRay because of refraction when it passes from a medium of refraction index  refra_ind1 to a medium of refraction index  refra_ind2

0043   void refract(const ALIPlane& plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2);
0044 
0045   //----- shift

0046   void shiftAndDeviateWhileTraversing(const OpticalObject* opto, char behav);
0047   void shiftAndDeviateWhileTraversing(const OpticalObject* opto,
0048                                       ALIdouble shiftX,
0049                                       ALIdouble shiftY,
0050                                       ALIdouble shiftZ,
0051                                       ALIdouble deviX,
0052                                       ALIdouble deviY,
0053                                       ALIdouble deviZ);
0054   // void shiftAndDeviateWhileTraversing( ALIdouble shiftAxis1, ALIdouble shiftAxis2, ALIdouble deviAxis1, ALIdouble deviAxis2 );

0055 
0056   // ACCESS DATA MEMBERS

0057   const CLHEP::Hep3Vector& point() const { return _point; }
0058   const CLHEP::Hep3Vector& direction() const { return _direction; }
0059   void dumpData(const ALIstring& str) const;
0060 
0061   // SET DATA MEMBERS

0062   void setDirection(const CLHEP::Hep3Vector& direc) { _direction = direc; }
0063   void setPoint(const CLHEP::Hep3Vector& point) { _point = point; }
0064 
0065 private:
0066   //-------------- Methods common to several OptO

0067   // Intersect a LightRay with the X-Y plane of the GlobalVectorFrame of an OptO

0068 public:
0069   CLHEP::Hep3Vector IntersectWithOptOPlane(const OpticalObject* optoplane);
0070   CLHEP::Hep3Vector IntersectWithPlane(const CLHEP::Hep3Vector& plane_point, const CLHEP::Hep3Vector& plane_normal);
0071 
0072   // private DATA MEMBERS

0073   CLHEP::Hep3Vector _direction;
0074   CLHEP::Hep3Vector _point;
0075 };
0076 
0077 #endif