SND@LHC Software
Loading...
Searching...
No Matches
SndlhcMuonReco Namespace Reference

Classes

class  hough
 
class  MuonReco
 

Functions

 hit_finder (slope, intercept, box_centers, box_ds, tol=0.)
 
 numPlanesHit (systems, detector_ids)
 

Function Documentation

◆ hit_finder()

SndlhcMuonReco.hit_finder (   slope,
  intercept,
  box_centers,
  box_ds,
  tol = 0. 
)
 Finds hits intersected by Hough line 

Definition at line 9 of file SndlhcMuonReco.py.

9def hit_finder(slope, intercept, box_centers, box_ds, tol = 0.) :
10 """ Finds hits intersected by Hough line """
11
12 # First check if track at center of box is within box limits
13 d = np.abs(box_centers[0,:,1] - (box_centers[0,:,0]*slope + intercept))
14 center_in_box = d < (box_ds[0,:,1]+tol)/2.
15
16 # Now check if, assuming line is not in box at box center, the slope is large enough for line to clip the box at corner
17 clips_corner = np.abs(slope) > np.abs((d - (box_ds[0,:,1]+tol)/2.)/(box_ds[0,:,0]+tol)/2.)
18
19 # If either of these is true, line goes through hit:
20 hit_mask = np.logical_or(center_in_box, clips_corner)
21
22 # Return indices
23 return np.where(hit_mask)[0]
24

◆ numPlanesHit()

SndlhcMuonReco.numPlanesHit (   systems,
  detector_ids 
)

Definition at line 206 of file SndlhcMuonReco.py.

206def numPlanesHit(systems, detector_ids) :
207 scifi_stations = []
208 mufi_ds_planes = []
209 mufi_us_planes = []
210
211 scifi_stations.append( detector_ids[systems == 0]//1000000 )
212 mufi_ds_planes.append( (detector_ids[systems == 3]%10000)//1000 )
213 mufi_us_planes.append( (detector_ids[systems == 2]%10000)//1000 )
214
215 return len(np.unique(scifi_stations)) + len(np.unique(mufi_ds_planes)) + len(np.unique(mufi_us_planes))
216