Skip to content

Conversation

@RomanMBerner
Copy link

No description provided.

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!

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