forked from yetkinyilmaz/tracking
-
Notifications
You must be signed in to change notification settings - Fork 0
/
analyze.py
40 lines (25 loc) · 870 Bytes
/
analyze.py
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
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import Score_cluster as score
import Score_physics
import Plotting
def analyze():
df = pd.read_csv("result_truth_200.csv")
g_eff=[]
g_fake=[]
g_npar=[]
events=np.unique(df['event'].values)
for ievent in events:
df_event=df.loc[df['event']==ievent]
particles=np.unique(df_event['particle'].values)
npar=len(particles)
y_test=df_event['particle'].values.astype(int)
y_pred=df_event['track'].values.astype(int)
eff_event, fake_event = score.evaluate(y_test, y_pred,-1)
g_eff = g_eff + [eff_event]
g_fake = g_fake + [fake_event]
g_npar = g_npar + [npar]
for iparticle in particles:
eff, fake = score.evaluate(y_test, y_pred,iparticle)
return g_eff, g_fake, g_npar