-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdetector.h
88 lines (69 loc) · 2.35 KB
/
detector.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// detector.h
// Xcode
//
// Created by jacob on 7/18/11.
// Copyright 2011 BMPI. All rights reserved.
//
#ifndef DETECTOR_H
#define DETECTOR_H
#include "vector3D.h"
#include "logger.h"
#include "vectorMath.h"
using namespace VectorMath;
//#include <boost/math/complex/fabs.hpp>
class Detector
{
public:
Detector(const Vector3d ¢erPoint);
Detector(const boost::shared_ptr<Vector3d> centerPoint);
virtual ~Detector();
virtual bool photonPassedThroughDetector(const boost::shared_ptr<Vector3d> p0,
const boost::shared_ptr<Vector3d> p1) = 0;
virtual bool photonHitDetector(const boost::shared_ptr<Vector3d> p0) = 0;
virtual void savePhotonExitCoordinates(const boost::shared_ptr<Vector3d> exitCoords) = 0;
virtual void savePhotonExitWeight(void) = 0;
virtual void setDetectorPlaneXY(void)
{
// Set which plane the detector resides.
xz_plane = false;
yz_plane = false;
xy_plane = true;
// Set the direction that the vector that is normal to the plane.
normalVector.setDirX(0.0f);
normalVector.setDirY(0.0f);
normalVector.setDirZ(1.0f); normalVector.location.z = 1.0f;
}
virtual void setDetectorPlaneXZ(void)
{
// Set which plane the detector resides.
yz_plane = false;
xy_plane = false;
xz_plane = true;
// Set the direction that the vector that is normal to the plane.
normalVector.setDirX(0.0f);
normalVector.setDirY(1.0f); normalVector.location.y = 1.0f;
normalVector.setDirZ(0.0f);
}
virtual void setDetectorPlaneYZ(void)
{
// Set which plane the detector resides.
xz_plane = false;
xy_plane = false;
yz_plane = true;
// Set the direction that the vector that is normal to the plane.
normalVector.setDirX(1.0f); normalVector.location.x = 1.0f;
normalVector.setDirY(0.0f);
normalVector.setDirZ(0.0f);
}
protected:
// Center coordinates of the detector in the medium. [cm]
Vector3d center;
// Vector that is normal to the plane.
Vector3d normalVector;
// possible planes that the detector can be placed in 3D space.
bool xy_plane;
bool xz_plane;
bool yz_plane;
};
#endif