CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
LightRay.h
Go to the documentation of this file.
1 // COCOA class header file
2 //Id: LightRay.h
3 //CAT: Model
4 //
5 // Utility class that starts reading the system description file
6 // and contains the static data
7 //
8 // History: v1.0
9 // Pedro Arce
10 
11 #ifndef LIGHTRAY_H
12 #define LIGHTRAY_H
13 
14 class OpticalObject;
15 class ALIPlane;
16 
17 #include "CLHEP/Vector/ThreeVector.h"
19 
20 class LightRay {
21 public:
22  //----- construct a default LigthRay
23  LightRay();
24  // Make a light ray out of the centre_glob points of two OptO:'source' and 'pointLens'
26  LightRay(CLHEP::Hep3Vector& vec1, CLHEP::Hep3Vector& vec2);
27  ~LightRay(){};
28 
29  //@@@@@@@@@@@@@@@@@@@@ Methods for each OptO
30  //----- Make a light ray out of the centre_glob and Z direction of one OptO: 'laser' or 'source'
31  void startLightRay(OpticalObject* opto);
32 
33  //----- Intersect light ray with a plane and change thePoint to the intersection point
34  void intersect(const ALIPlane& plane);
35 
36  //----- Intersect light ray with a OptO (intersect it with its plane perpendicular to Z) and change thePoint to the intersection point
37  void intersect(const OpticalObject& opto);
38 
39  //----- Intersect the LightRay with a plane and then change the direction from reflection on this plane
40  void reflect(const ALIPlane& plane);
41 
42  //----- 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
43  void refract(const ALIPlane& plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2);
44 
45  //----- shift
46  void shiftAndDeviateWhileTraversing(const OpticalObject* opto, char behav);
48  ALIdouble shiftX,
49  ALIdouble shiftY,
50  ALIdouble shiftZ,
51  ALIdouble deviX,
52  ALIdouble deviY,
53  ALIdouble deviZ);
54  // void shiftAndDeviateWhileTraversing( ALIdouble shiftAxis1, ALIdouble shiftAxis2, ALIdouble deviAxis1, ALIdouble deviAxis2 );
55 
56  // ACCESS DATA MEMBERS
57  const CLHEP::Hep3Vector& point() const { return _point; }
58  const CLHEP::Hep3Vector& direction() const { return _direction; }
59  void dumpData(const ALIstring& str) const;
60 
61  // SET DATA MEMBERS
62  void setDirection(const CLHEP::Hep3Vector& direc) { _direction = direc; }
63  void setPoint(const CLHEP::Hep3Vector& point) { _point = point; }
64 
65 private:
66  //-------------- Methods common to several OptO
67  // Intersect a LightRay with the X-Y plane of the GlobalVectorFrame of an OptO
68 public:
69  CLHEP::Hep3Vector IntersectWithOptOPlane(const OpticalObject* optoplane);
70  CLHEP::Hep3Vector IntersectWithPlane(const CLHEP::Hep3Vector& plane_point, const CLHEP::Hep3Vector& plane_normal);
71 
72  // private DATA MEMBERS
73  CLHEP::Hep3Vector _direction;
74  CLHEP::Hep3Vector _point;
75 };
76 
77 #endif
CLHEP::Hep3Vector _point
Definition: LightRay.h:74
CLHEP::Hep3Vector IntersectWithPlane(const CLHEP::Hep3Vector &plane_point, const CLHEP::Hep3Vector &plane_normal)
long double ALIdouble
Definition: CocoaGlobals.h:11
const TString p2
Definition: fwPaths.cc:13
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:235
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:157
CLHEP::Hep3Vector IntersectWithOptOPlane(const OpticalObject *optoplane)
~LightRay()
Definition: LightRay.h:27
void setDirection(const CLHEP::Hep3Vector &direc)
Definition: LightRay.h:62
void setPoint(const CLHEP::Hep3Vector &point)
Definition: LightRay.h:63
std::vector< double > vec1
Definition: HCALResponse.h:15
const CLHEP::Hep3Vector & point() const
Definition: LightRay.h:57
const TString p1
Definition: fwPaths.cc:12
CLHEP::Hep3Vector _direction
Definition: LightRay.h:73
LightRay()
Definition: LightRay.cc:18
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:93
std::string ALIstring
Definition: CocoaGlobals.h:9
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:374
void startLightRay(OpticalObject *opto)
Definition: LightRay.cc:26
void reflect(const ALIPlane &plane)
Definition: LightRay.cc:138
#define str(s)
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
const CLHEP::Hep3Vector & direction() const
Definition: LightRay.h:58