Project

General

Profile

Bug #1832

Interesting feature in TOF data structure when accessed from python

Added by Rogers, Chris over 5 years ago. Updated over 5 years ago.

Status:
Open
Priority:
Normal
Category:
TOF
Target version:
Start date:
16 March 2016
Due date:
% Done:

0%

Estimated time:
Workflow:
New Issue

Description

Here is an interesting feature in the TOF data structure. The attached script generates toy TOF0, TOF1, TOF2 space points and puts them on a TOF Event. The script then pulls them off the TOF event and prints them. Features which look fishy to me:

1. the TOF1 and TOF2 events when read have the same memory address
2. All of the TOF space points have the same member data

TOF data structure stores everything as a value (no pointers involved as far as I can see). The SetBlah functions should be doing a copy operation, so I don't see how this is possible.

For information I am trying to set up a test for the global track fit, so I want to generate dummy data.


Files

test_tof_sp.log (995 Bytes) test_tof_sp.log Rogers, Chris, 16 March 2016 09:32
test_tof_sp.py (2.23 KB) test_tof_sp.py Rogers, Chris, 16 March 2016 09:32
test_tof_sp.cc (4.18 KB) test_tof_sp.cc Rajaram, Durga, 16 March 2016 20:38
Makefile.testtof (330 Bytes) Makefile.testtof Rajaram, Durga, 16 March 2016 20:38
cpp_test_tof_sp.log (624 Bytes) cpp_test_tof_sp.log Rajaram, Durga, 16 March 2016 20:38
#1

Updated by Rajaram, Durga over 5 years ago

I'm not sure if there's some pythonic pointer handling going on behind the scenes

All of the TOF space points have the same member data

Are you referring to the "third" get? If so, that should be expected since tof_sp is basically what you have from the last "set" from within the
 for station, z in enumerate(..)
loop?

I took your python test and turned into a c++ program and I don't see those features
attached cc, make, log

Also available in: Atom PDF