source: trunk/Mars/msimreflector/MOptics.h@ 19955

Last change on this file since 19955 was 19637, checked in by tbretz, 5 years ago
Added the possibility to turn off Fresnel reflection and added some comments.
File size: 1.4 KB
Line 
1#ifndef MARS_MOptics
2#define MARS_MOptics
3
4#ifndef MARS_MParContainer
5#include "MParContainer.h"
6#endif
7
8class TVector3;
9class MQuaternion;
10
11class MOptics : public MParContainer
12{
13public:
14 MOptics(const char *name=NULL, const char *title=NULL);
15
16 virtual Double_t GetMaxR() const = 0;
17 virtual Double_t GetA() const = 0;
18 virtual Bool_t CanHit(const MQuaternion &p) const = 0;
19
20 virtual Int_t ExecuteOptics(MQuaternion &p, MQuaternion &u, const Short_t &wavelength) const = 0;
21
22 virtual Bool_t IsValid() const = 0;
23
24 // -----------------------------------------------------------
25
26 static double CriticalAngle(double n1, double n2);
27
28 static double SchlickReflectivity(double alpha, double n1, double n2);
29 static double SchlickReflectivity(const TVector3 &u, const TVector3 &n, double n1, double n2);
30
31 static bool ApplyRefraction(TVector3 &u, const TVector3 &n, double n1, double n2);
32 static bool ApplyRefraction(MQuaternion &u, const TVector3 &n, double n1, double n2);
33
34 static int ApplyTransitionFast(TVector3 &u, TVector3 n, double n1, double n2);
35 static int ApplyTransitionFast(MQuaternion &u, const TVector3 &n, double n1, double n2);
36
37 static int ApplyTransition(TVector3 &u, TVector3 n, double n1, double n2, bool fresnel=true);
38 static int ApplyTransition(MQuaternion &u, const TVector3 &n, double n1, double n2, bool fresnel=true);
39
40 ClassDef(MOptics, 1) // Base class for optics (reflector, lens)
41};
42
43#endif
Note: See TracBrowser for help on using the repository browser.