~ajdobbs/maus/root56

« back to all changes in this revision

Viewing changes to bin/scifi/pat_rec_efficiency.py

  • Committer: Adam Dobbs
  • Date: 2017-03-01 15:55:02 UTC
  • Revision ID: phuccj@gmail.com-20170301155502-x2n2tttxwryoyufp
Style fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
"""  Check tracker efficiency """
4
4
 
5
5
import sys
6
 
import os
7
 
import math
8
6
import matplotlib.pyplot as plt
9
7
import numpy as np
10
8
import ROOT
11
 
import libMausCpp #pylint: disable = W0611
 
9
import libMausCpp # pylint: disable = W0611
12
10
import analysis.scifi_efficiency
13
11
 
 
12
# pylint: disable = W0621
 
13
 
14
14
def main(args):
 
15
    """ Check the efficiency of the tracker pattern recognition """
15
16
    args.pop(0)
16
17
    results = efficiency_real(args)
17
18
    # efficiency_mc(args)
19
20
 
20
21
 
21
22
def efficiency_real(args):
 
23
    """ Check the efficiency of the tracker pattern recognition
 
24
        using recontructed data only (no MC truth) """
22
25
    eff_real = analysis.scifi_efficiency.PatternRecognitionEfficiencyReal()
23
26
    eff_real.check_helical = True
24
27
    eff_real.check_straight = True
31
34
    return eff_real.data
32
35
 
33
36
def efficiency_mc(args):
 
37
    """ Check the efficiency of the tracker pattern recognition 
 
38
        using recontructed data and MC truth """
34
39
    eff_mc = analysis.scifi_efficiency.PatternRecognitionEfficiencyMC()
35
40
    eff_mc.cut_on_tof = True
36
41
    eff_mc.cut_on_tof_time = True
66
71
    ymin = 0.0
67
72
    ymax = 1.0
68
73
 
69
 
    f, ax = plt.subplots()
 
74
    f, ax = plt.subplots() # pylint: disable = W0612, C0103
70
75
    ax.plot(runs, data['tkus_5spoint'], 'r+', label='TkUS 5pt')
71
76
    ax.plot(runs, data['tkus_3to5spoint'], 'm+', label='TkUS 3-5pt')
72
77
    ax.plot(runs, data['tkds_5spoint'], 'bo', label='TkDS 5pt')
83
88
    plt.savefig('efficiency.pdf')
84
89
 
85
90
if __name__ == "__main__":
86
 
    args = sys.argv
 
91
    args = sys.argv # pylint: disable = C0103
87
92
    main(args)