1
2
3
4
5
6
7
8 package org.lcsim.recon.tracking.seedtracker;
9
10 import java.util.List;
11 import java.util.ArrayList;
12
13 import org.lcsim.recon.tracking.seedtracker.SeedLayer.SeedType;
14
15
16
17
18
19
20 public class SeedStrategy {
21 private String _Name;
22 private List<SeedLayer> _LayerList = new ArrayList<SeedLayer>();
23 private double _MinPT = 1.0;
24 private double _MaxDCA = 10.0;
25 private double _MaxZ0 = 10.0;
26 private double _MaxChisq = 100.;
27 private double _BadHitChisq = 15.;
28 private int _MinConfirm = 1;
29 private int _MinHits = 7;
30
31
32
33
34
35
36
37
38
39
40
41
42
43 public SeedStrategy(String Name, List<SeedLayer> LayerList, double MinPT,
44 double MaxDCA, double MaxZ0, double MaxChisq, double BadHitChisq, int MinConfirm, int MinHits) {
45 this(Name, LayerList);
46 _Name = Name;
47 _MinPT = MinPT;
48 _MaxDCA = MaxDCA;
49 _MaxZ0 = MaxZ0;
50 _MaxChisq = MaxChisq;
51 _BadHitChisq = BadHitChisq;
52 _MinConfirm = MinConfirm;
53 _MinHits = MinHits;
54 }
55
56
57
58
59
60
61 public SeedStrategy(String Name, List<SeedLayer> LayerList) {
62 this(Name);
63 _LayerList.addAll(LayerList);
64 }
65
66
67
68
69
70 public SeedStrategy(String Name) {
71 _Name = Name;
72 }
73
74
75
76
77
78 public String getName() {
79 return _Name;
80 }
81
82
83
84
85
86 public List<SeedLayer> getLayerList() {
87 return _LayerList;
88 }
89
90
91
92
93
94 public double getMinPT() {
95 return _MinPT;
96 }
97
98
99
100
101
102 public double getMaxDCA() {
103 return _MaxDCA;
104 }
105
106
107
108
109
110 public double getMaxZ0() {
111 return _MaxZ0;
112 }
113
114
115
116
117
118 public double getMaxChisq() {
119 return _MaxChisq;
120 }
121
122 public double getBadHitChisq() {
123 return _BadHitChisq;
124 }
125
126
127
128
129
130 public int getMinConfirm() {
131 return _MinConfirm;
132 }
133
134
135
136
137
138 public int getMinHits() {
139 return _MinHits;
140 }
141
142
143
144
145
146 public void putLayerList(List<SeedLayer> LayerList) {
147 _LayerList.addAll(LayerList);
148 return;
149 }
150
151
152
153
154
155 public void putMinPT(double MinPT) {
156 _MinPT = MinPT;
157 return;
158 }
159
160
161
162
163
164 public void putMaxDCA(double MaxDCA) {
165 _MaxDCA = MaxDCA;
166 return;
167 }
168
169
170
171
172
173 public void putMaxZ0(double MaxZ0) {
174 _MaxZ0 = MaxZ0;
175 return;
176 }
177
178
179
180
181
182 public void putMaxChisq(double MaxChisq) {
183 _MaxChisq = MaxChisq;
184 return;
185 }
186
187 public void putBadHitChisq(double BadHitChisq) {
188 _BadHitChisq = BadHitChisq;
189 return;
190 }
191
192
193
194
195
196 public void putMinConfirm(int MinConfirm) {
197 _MinConfirm = MinConfirm;
198 return;
199 }
200
201
202
203
204
205 public void putMinHits(int MinHits) {
206 _MinHits = MinHits;
207 return;
208 }
209
210
211
212
213
214 public void addLayer(SeedLayer Layer) {
215 _LayerList.add(Layer);
216 return;
217 }
218
219
220
221
222
223
224 public List<SeedLayer> getLayers(SeedType type) {
225 List<SeedLayer> layers = new ArrayList();
226 for (SeedLayer layer : _LayerList) {
227 if (layer.getType() == type) layers.add(layer);
228 }
229 return layers;
230 }
231
232
233
234
235
236
237 public void copyCutoffsFromStrategy(SeedStrategy other) {
238 this.putBadHitChisq(other.getBadHitChisq());
239 this.putMaxChisq(other.getMaxChisq());
240 this.putMaxDCA(other.getMaxDCA());
241 this.putMaxZ0(other.getMaxZ0());;
242 this.putMinConfirm(other.getMinConfirm());
243 this.putMinHits(other.getMinHits());
244 this.putMinPT(other.getMinPT());
245 }
246
247 @Override
248 public boolean equals(Object other) {
249
250 if (this == other) return true;
251 if (!(other instanceof SeedStrategy)) return false;
252 SeedStrategy strat = (SeedStrategy) other;
253
254 return ( this._BadHitChisq == strat.getBadHitChisq()
255 && this._MaxChisq == strat.getMaxChisq()
256 && this._MaxDCA == strat.getMaxDCA()
257 && this._MaxZ0 == strat.getMaxZ0()
258 && this._MinConfirm == strat.getMinConfirm()
259 && this._MinHits == strat.getMinHits()
260 && this._MinPT == strat.getMinPT()
261 && this._Name.equals(strat.getName())
262 && this._LayerList.equals(strat.getLayerList()) ) ;
263
264 }
265 }