1
2
3
4
5 package org.lcsim.geometry.segmentation;
6
7 import java.util.ArrayList;
8 import java.util.List;
9
10 import org.lcsim.geometry.Layered;
11 import org.jdom.Element;
12 import org.lcsim.geometry.layer.Layering;
13 import org.lcsim.geometry.CylindricalSubdetector;
14 import hep.physics.vec.Hep3Vector;
15
16
17
18
19 public abstract class SegmentationBase extends org.lcsim.geometry.compact.Segmentation
20 {
21
22 public SegmentationBase(Element e)
23 {
24 super(e);
25 }
26
27 public abstract String[] getSegmentationFieldNames();
28
29
30
31
32
33
34
35
36
37
38
39
40 abstract public long findCellContainingXYZ(double x, double y, double z);
41
42
43
44
45
46
47
48
49
50
51 public long findCellContainingXYZ(double[] pos)
52 {
53 return findCellContainingXYZ(pos[0], pos[1], pos[2]);
54 }
55
56
57
58
59
60
61
62
63
64
65 public long findCellContainingXYZ(Hep3Vector pos)
66 {
67 return findCellContainingXYZ(pos.x(), pos.y(), pos.z());
68 }
69
70
71
72
73 protected int getNumberOfLayers()
74 {
75 return ((Layered) detector).getLayering().getLayerCount();
76 }
77
78 protected double[] transformLocalToGlobal(double[] localPos)
79 {
80 return detector.transformLocalToGlobal(localPos);
81 }
82
83
84
85
86 protected Layering getLayering()
87 {
88 return ((Layered) detector).getLayering();
89 }
90
91
92
93
94 protected double getZMin()
95 {
96 return ((CylindricalSubdetector) detector).getZMin();
97 }
98
99
100
101
102 protected double getZMax()
103 {
104 return ((CylindricalSubdetector) detector).getZMax();
105 }
106
107
108
109
110 protected double getRMin()
111 {
112 return ((CylindricalSubdetector) detector).getInnerRadius();
113 }
114
115
116
117
118 protected double getRMax()
119 {
120 return ((CylindricalSubdetector) detector).getOuterRadius();
121 }
122
123
124
125
126 public double getDistanceToSensitive(int layer)
127 {
128 return ((Layered) detector).getLayering().getDistanceToLayerSensorMid(layer);
129 }
130
131 public boolean supportsNeighbours()
132 {
133 return true;
134 }
135
136 public long getID()
137 {
138 return this.getDecoder().getID();
139 }
140 }