File tree 2 files changed +12
-3
lines changed
packages/phoenix-event-display/src/loaders/objects
2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -192,6 +192,7 @@ Jets are a list of Jet objects with the following attributes :
192
192
* ` energy ` , ` et ` (opt) - energy of the Jets, used to set its length
193
193
* ` coneR ` (opt) - the radius of the jet cone. If not given, radius is 10% of the length
194
194
* ` color ` (opt) - Hexadecimal string representing the color to draw the jet.
195
+ * ` origin_X ` , ` origin_Y ` , ` origin_Z ` (opt) - Origin of the jet
195
196
196
197
#### 'Hits'
197
198
Hits can be defined in 2 ways. Either as an array of positions or as an array of Hit objects.
Original file line number Diff line number Diff line change @@ -208,15 +208,23 @@ export class PhoenixObjects {
208
208
// Jet energy parameter can either be 'energy' or 'et'
209
209
const length = ( jetParams . energy ? jetParams . energy : jetParams . et ) * 0.2 ;
210
210
211
+ // Add displacement of the origin of the jet
212
+ // If x is given else jet is at origin
213
+ const origin_X = jetParams . origin_X ? jetParams . origin_X : 0 ;
214
+ // If y is given else jet is at origin
215
+ const origin_Y = jetParams . origin_Y ? jetParams . origin_Y : 0 ;
216
+ // If z is given else jet is at origin
217
+ const origin_Z = jetParams . origin_Z ? jetParams . origin_Z : 0 ;
218
+
211
219
const sphi = Math . sin ( phi ) ;
212
220
const cphi = Math . cos ( phi ) ;
213
221
const stheta = Math . sin ( theta ) ;
214
222
const ctheta = Math . cos ( theta ) ;
215
223
//
216
224
const translation = new Vector3 (
217
- 0.5 * length * cphi * stheta ,
218
- 0.5 * length * sphi * stheta ,
219
- 0.5 * length * ctheta ,
225
+ 0.5 * length * cphi * stheta + origin_X ,
226
+ 0.5 * length * sphi * stheta + origin_Y ,
227
+ 0.5 * length * ctheta + origin_Z ,
220
228
) ;
221
229
222
230
const width = jetParams . coneR
You can’t perform that action at this time.
0 commit comments