Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added z coordinates to hits dictionary. #2

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

RomanMBerner
Copy link

No description provided.

@@ -557,7 +557,7 @@ def _parse_events_array(self):
events_dict['q_raw'] = np.array([0.])
if len(event) and len(trigs):
events_dict['ts_start'] = np.array([min(event[0]['timestamp'],trigs[0]['ts'])])
events_dict['ts_end'] = np.array([min(event[-1]['timestamp'],trigs[-1]['ts'])])
events_dict['ts_end'] = np.array([max(event[-1]['timestamp'],trigs[-1]['ts'])])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this!

@@ -588,6 +588,9 @@ def _parse_events_array(self):
ped = np.array([self.pedestal[unique_id]['pedestal_mv'] for unique_id in hit_uniqueid_str])
hits_dict['px'] = xy[:,0]
hits_dict['py'] = xy[:,1]
VD = float(str(self.track_fitter.get_parameters('vd')).split(':')[1][:-1])
Copy link
Member

@peter-madigan peter-madigan Dec 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm hesitant to apply the drift velocity here, since it then makes it so that a drift velocity must always be required to run the evd script (even if you don't want to do the track reconstruction or the drift velocity is zero). It also is more complicated when you have an external trigger, since the z location should be relative to this timestamp. I figured that it was better to not implement the pz variable in the file and let the analysis do that. Something like this:

hit_ref = f['events'][0]['hit_ref']
ext_trig_ref = f['events'][0]['ext_trig_ref'] if f['events'][0]['n_ext_trigs'] > 0 else None
z_scale = f['tracks'].attrs['z_scale']
if ext_trig_ref is not None:
    pz = (f['hits'][hit_ref]['ts'] - f['ext_trigs'][ext_trig_ref][0]['ts']) * z_scale

But... if you're willing to add some logic to this to check for

  • are you using a track fitter? -> if not, don't fill pz
  • are there external triggers in the event? -> if not, don't fill pz

and then do the timestamp relative to the external trigger then I will merge it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants