2
# This file is part of MAUS: http://micewww.pp.rl.ac.uk/projects/maus
4
# MAUS is free software: you can redistribute it and/or modify
5
# it under the terms of the GNU General Public License as published by
6
# the Free Software Foundation, either version 3 of the License, or
7
# (at your option) any later version.
9
# MAUS is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
# GNU General Public License for more details.
14
# You should have received a copy of the GNU General Public License
15
# along with MAUS. If not, see <http://www.gnu.org/licenses/>.
19
Defines the AnalysisTrack class.
21
A generic track class that can be used to simplify the analysis of track data.
24
# pylint: disable = W0311, R0902, R0904, R0913, C0103, W0102
26
class AnalysisTrack() :
28
A simple, unified class that holds the essential information, when copied
29
from MAUS data types, during various analyses.
31
Some syntax was borrowed from XBoa for simplicity and because I like the
34
def __init__( self, trackpoints={}, chisq=0.0, ndf=0, p_value=1.0, status=0 ) :
38
self.__trackpoints = trackpoints
41
self.__p_value = p_value
42
self.__status = status
45
def __getitem__(self, index) :
47
Return a trackpoint from the track at index ``index''
49
return self.__trackpoints[index]
52
def __setitem__(self, index, item) :
54
Set the value of the trackpoint in the track at index ``index''
56
self.__trackpoints[index] = item
61
Return the number of trackpoints in the track>
63
return len(self.__trackpoints)
66
def get_trackpoint( self, index ) :
68
Return a trackpoint from the track at index ``index''
70
return self.__trackpoints[index]
73
def set_trackpoint( self, index, item ) :
75
Set the value of the trackpoint in the track at index ``index''
77
self.__trackpoints[index] = item
80
def get_p_value( self ) :
82
Return the track p-value
87
def set_p_value( self, pvalue ) :
91
self.__p_value = pvalue
94
def get_chisq( self ) :
96
Return the track chisq squared
101
def set_chisq( self, chisq ) :
103
Set the track chisq squared
108
def get_ndf( self ) :
110
Get the track No. Degrees of Freedom
115
def set_ndf( self, ndf ) :
117
Set the track No. Degrees of Freedom
122
def get_chisq_ndf(self) :
124
Get the track Chisquared / No. Degrees of Freedom
126
return self.__chisq / self.__ndf
129
def set_status(self, status) :
131
Set a undefined status flag
133
self.__status = status
136
def get_status(self) :