-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcandidate.py
More file actions
executable file
·44 lines (39 loc) · 1.48 KB
/
candidate.py
File metadata and controls
executable file
·44 lines (39 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#!/usr/bin/python
import os
import math
import array
import numpy as np
import ROOT
# from ROOT import *
import config
from config import *
import objects
from objects import *
def SVD_candidate(clsx,clsy,clsz,clsdx,clsdy,vtx=[],evtx=[]):
isvtx = (len(vtx)>0 and len(evtx)>0)
clusters = [ [cfg["xVtx"], cfg["yVtx"], cfg["zVtx"]] ] if(isvtx) else []
clerrors = [ [cfg["exVtx"],cfg["eyVtx"],cfg["ezVtx"]] ] if(isvtx) else []
for det in cfg["detectors"]:
clusters.append( [clsx[det], clsy[det], clsz[det]] )
clerrors.append( [clsdx[det], clsdy[det], cfg["ezCls"]] )
points = np.array(clusters)
errors = np.array(clerrors)
return points,errors
def Chi2_candidate(clsx,clsy,clsz,clsdx,clsdy,vtx=[],evtx=[]):
isvtx = (len(vtx)>0 and len(evtx)>0)
clusters_x = [cfg["xVtx"]] if(isvtx) else []
clusters_y = [cfg["yVtx"]] if(isvtx) else []
clusters_z = [cfg["zVtx"]] if(isvtx) else []
clerrors_x = [cfg["exVtx"]] if(isvtx) else []
clerrors_y = [cfg["eyVtx"]] if(isvtx) else []
clerrors_z = [cfg["ezVtx"]] if(isvtx) else []
for det in cfg["detectors"]:
clusters_x.append( clsx[det] )
clusters_y.append( clsy[det] )
clusters_z.append( clsz[det] )
clerrors_x.append( clsdx[det] )
clerrors_y.append( clsdy[det] )
clerrors_z.append( cfg["ezCls"] )
points = np.array([ clusters_x,clusters_y,clusters_z ])
errors = np.array([ clerrors_x,clerrors_y,clerrors_z ])
return points,errors