235 def event(self):
236
237
238
239
240
241
242 event = []
243 for reco in self.recotracks:
244 track = reco.getRelatedFrom("Tracks")
245
246 fitres = None
247 state = None
248
249
250 method = 'old'
251
252 if method == 'old':
253
254
255 if not track:
256 print("no track found for recotrack")
257 continue
258 whishPdg = 211
260 if not fitres:
261 continue
262 else:
263
264
265 reps = reco.getRepresentations()
266 irep = 0
267 for irep, rep in enumerate(reps):
268 if not reco.wasFitSuccessful(rep):
269 continue
270 try:
271 state = reco.getMeasuredStateOnPlaneClosestTo(XYZVector(0, 0, 0), rep)
272 rep.extrapolateToLine(state, TVector3(0, 0, -1000), TVector3(0, 0, 2000))
273 except BaseException:
274 continue
275 if not state:
276 continue
277
278
279
280 neuro = reco.getRelatedTo(self.neurotracksname)
281 event.append(self.nonelist.copy())
282 try:
283 neuro = reco.getRelatedTo(self.neurotracksname)
284 except BaseException:
285 neuro = None
286 try:
287 swneuro = reco.getRelatedTo(self.swneurotracksname)
288 except BaseException:
289 swneuro = None
290 try:
291 hwneuro = neuro.getRelatedFrom(self.hwneurotracksname)
292 except BaseException:
293 hwneuro = None
294 try:
295 twod = reco.getRelatedTo(self.twodtracksname)
296 except BaseException:
297 twod = None
298 if method == 'old':
299 event[-1] = self.getrecovalsold(event[-1], fitres)
300 else:
301 event[-1] = self.getrecovals(event[-1], state)
302 event[-1] = self.getneurovals(event[-1], neuro)
303 event[-1] = self.gettwodvals(event[-1], twod)
304 event[-1] = self.getneurovals(event[-1], hwneuro, status="hw")
305 event[-1] = self.getneurovals(event[-1], swneuro, status="sw")
306
307 for neuro in self.neurotracks:
308
309
310 if len(neuro.getRelationsFrom(self.recotracksname)) > 0:
311
312
313 continue
314 event.append(self.nonelist.copy())
315 try:
316 twod = reco.getRelatedTo(self.twodtracksname)
317 except BaseException:
318 twod = None
319 try:
320 hwneuro = neuro.getRelatedFrom(self.hwneurotracksname)
321 except BaseException:
322 hwneuro = None
323 event[-1] = self.getneurovals(event[-1], neuro)
324 event[-1] = self.gettwodvals(event[-1], twod)
325 event[-1] = self.getneurovals(event[-1], hwneuro, status="hw")
326 for swneuro in self.swneurotracks:
327
328
329 if len(swneuro.getRelationsFrom(self.recotracksname)) > 0:
330
331
332 continue
333 event.append(self.nonelist.copy())
334 try:
335 swtwod = reco.getRelatedTo(self.swtwodtracksname)
336 except BaseException:
337 swtwod = None
338 event[-1] = self.getneurovals(event[-1], swneuro, status="sw")
339 event[-1] = self.getswtwodvals(event[-1], swtwod)
340 for twod in self.twodtracks:
341
342
343 if len(twod.getRelationsFrom(self.neurotracksname)) > 0:
344
345
346 continue
347 event.append(self.nonelist.copy())
348 event[-1] = self.gettwodvals(event[-1], twod)
349 for swtwod in self.swtwodtracks:
350
351
352 if len(swtwod.getRelationsFrom(self.swneurotracksname)) > 0:
353
354
355 continue
356 event.append(self.nonelist.copy())
357 event[-1] = self.getswtwodvals(event[-1], swtwod)
358
359
360 if len(event) > self.maxtracks:
361 event = event[0:self.maxtracks]
362 elif len(event) < self.maxtracks:
363 for i in range(self.maxtracks - len(event)):
364 event.append(self.nonelist.copy())
365 self.eventlist.append(event)
366
Provides a type-safe way to pass members of the chargedStableSet set.