CMS 3D CMS Logo

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
LightRay::dumpData
void dumpData(const ALIstring &str) const
Definition: LightRay.cc:374
vec1
std::vector< double > vec1
Definition: HCALResponse.h:15
ALIstring
std::string ALIstring
Definition: CocoaGlobals.h:9
LightRay::LightRay
LightRay()
Definition: LightRay.cc:18
OpticalObject
Definition: OpticalObject.h:35
vec2
std::vector< vec1 > vec2
Definition: HCALResponse.h:16
LightRay::_point
CLHEP::Hep3Vector _point
Definition: LightRay.h:74
LightRay::IntersectWithOptOPlane
CLHEP::Hep3Vector IntersectWithOptOPlane(const OpticalObject *optoplane)
LightRay::intersect
void intersect(const ALIPlane &plane)
Definition: LightRay.cc:93
LightRay::point
const CLHEP::Hep3Vector & point() const
Definition: LightRay.h:57
str
#define str(s)
Definition: TestProcessor.cc:48
p2
double p2[4]
Definition: TauolaWrapper.h:90
LightRay::reflect
void reflect(const ALIPlane &plane)
Definition: LightRay.cc:138
LightRay::shiftAndDeviateWhileTraversing
void shiftAndDeviateWhileTraversing(const OpticalObject *opto, char behav)
Definition: LightRay.cc:235
LightRay
Definition: LightRay.h:20
ALIdouble
long double ALIdouble
Definition: CocoaGlobals.h:11
LightRay::_direction
CLHEP::Hep3Vector _direction
Definition: LightRay.h:73
LightRay::setPoint
void setPoint(const CLHEP::Hep3Vector &point)
Definition: LightRay.h:63
p1
double p1[4]
Definition: TauolaWrapper.h:89
ALIPlane
Definition: ALIPlane.h:15
LightRay::direction
const CLHEP::Hep3Vector & direction() const
Definition: LightRay.h:58
LightRay::startLightRay
void startLightRay(OpticalObject *opto)
Definition: LightRay.cc:26
LightRay::~LightRay
~LightRay()
Definition: LightRay.h:27
LightRay::setDirection
void setDirection(const CLHEP::Hep3Vector &direc)
Definition: LightRay.h:62
LightRay::refract
void refract(const ALIPlane &plate, const ALIdouble refra_ind1, const ALIdouble refra_ind2)
Definition: LightRay.cc:157
CocoaGlobals.h
LightRay::IntersectWithPlane
CLHEP::Hep3Vector IntersectWithPlane(const CLHEP::Hep3Vector &plane_point, const CLHEP::Hep3Vector &plane_normal)