def __init__(self, accept, username="", password="", uid="", process_id="",
              audioFilename="", metadataFilename="", transcriptFilename="",
              service=None, item_id=None, count=None):
     BaseObject.__init__(self, accept, username=username, password=password, uid=uid, process_id=process_id,
                         audioFilename=audioFilename, metadataFilename=metadataFilename, transcriptFilename=transcriptFilename,
                         service=service, item_id=item_id, count=count)
     self.path = 'transcripts/'
Ejemplo n.º 2
0
 def __init__(self, **kwargs):
     BaseObject.__init__(self, **kwargs)
     Config.__init__(self, **kwargs)
     logger_setup = kwargs.get("logger_setup", self.GLOBAL_CONFIG.get("logger_setup"))
     if logger_setup is not None:
         kwargs = logger_setup
     if not kwargs.get("log_filename"):
         appname = self.GLOBAL_CONFIG.get("app_name")
         if appname is not None:
             kwargs.setdefault("log_filename", os.path.expanduser("~/%s.log" % (appname)))
     self._logger = None
     use_conf = kwargs.get("use_conf", True)
     if use_conf:
         d = self.get_conf()
     else:
         d = {}
     for key in self._confkeys:
         val = d.get(key)
         if val is None:
             val = kwargs.get(key)
         if val is None:
             continue
         setattr(self, key, val)
     self.logger_kwargs = kwargs.get("logger_kwargs", {})
     self.set_logger()
     self.bind(property_changed=self._on_own_property_changed)
Ejemplo n.º 3
0
    def import_agencies(cls, directory):
        try:
            f = open(os.path.join(directory, 'agency.txt'), 'rb')
            reader = csv.reader(f)

            mappings = {'agency_name': 'name',
                        'agency_url': 'url',
                        'agency_timezone': 'timezone',
                        'agency_lang': 'language',
                        'agency_phone': 'phone',
                        'agency_fare_url': 'fare_url'}

            # create a headers with an index
            headers = reader.next()
            r_headers = dict([(x, i) for i, x in enumerate(headers)])

            for l2 in reader:
                if len(l2) != len(headers):
                    print >> sys.stderr, 'Invalid line', l2, headers
                    continue
                
                kw = {}
                for i, a in enumerate(l2):
                    key = headers[i]
                    if key in mappings:
                        kw[mappings[key]] = BaseObject.unquote(a)
                # create the agency
                agency = Agency(**kw)
                # set the id
                agency.gtfs_id = BaseObject.unquote(l2[r_headers['agency_id']])

        except IOError, e:
            print >> sys.stderr, 'Unable to open agency.txt:', e
 def __init__(
     self,
     accept,
     username="",
     password="",
     uid="",
     process_id="",
     audioFilename=None,
     metadataFilename=None,
     transcriptFilename=None,
     service=None,
     item_id=None,
     count=None,
     status=None,
 ):
     BaseObject.__init__(
         self,
         accept,
         username=username,
         password=password,
         uid=uid,
         process_id=process_id,
         audioFilename=audioFilename,
         metadataFilename=metadataFilename,
         transcriptFilename=transcriptFilename,
         service=service,
         item_id=item_id,
         count=count,
         status=status,
     )
     self.path = "media/"
     self.path_trans = "/transcribe"
     self.path_publish = "/publish"
     self.path_unpublish = "/unpublish"
Ejemplo n.º 5
0
 def __init__(self, attr):
     BaseObject.__init__(self, attr['name'], 'square')
     SfSceneComponent.__init__(self, attr.get('pixmap', ''))
     self._min = attr.get('min', 0)
     self._max = attr.get('max', 0)
     self._value = float(self.getMin())
     self._stepSize= 0.01
Ejemplo n.º 6
0
 def __init__(self, **kwargs):
     BaseObject.__init__(self, **kwargs)
     Config.__init__(self, **kwargs)
     logger_setup = kwargs.get('logger_setup',
                               self.GLOBAL_CONFIG.get('logger_setup'))
     if logger_setup is not None:
         kwargs = logger_setup
     if not kwargs.get('log_filename'):
         appname = self.GLOBAL_CONFIG.get('app_name')
         if appname is not None:
             kwargs.setdefault('log_filename',
                               os.path.expanduser('~/%s.log' % (appname)))
     self._logger = None
     use_conf = kwargs.get('use_conf', True)
     if use_conf:
         d = self.get_conf()
     else:
         d = {}
     for key in self._confkeys:
         val = d.get(key)
         if val is None:
             val = kwargs.get(key)
         if val is None:
             continue
         setattr(self, key, val)
     self.logger_kwargs = kwargs.get('logger_kwargs', {})
     self.set_logger()
     self.bind(property_changed=self._on_own_property_changed)
    def transcribe(self, success_callback_url="", error_callback_url=""):
        print >>sys.stderr, "making post request to: %s%s" % (self.dest, self.path + self.uid + self.path_trans)

        data = urllib.urlencode(
            {"success_callback_url": success_callback_url, "error_callback_url": error_callback_url}
        )
        request = urllib2.Request(self.dest + self.path + self.uid + self.path_trans, data=data, headers=self.headers)
        BaseObject._execute(self, request)
Ejemplo n.º 8
0
 def transcribe(self):
     print >> sys.stderr, 'making post request to: %s%s' % (self.dest,self.path+self.uid+self.path_trans)
     self.datagen = {}
     #print >> sys.stderr, self.username, self.password
     #print >> sys.stderr, type(self.uid)
     #print >> sys.stderr, type(self.path)
     request = urllib2.Request(self.dest+self.path+self.uid+self.path_trans, data="", headers=self.headers)
     BaseObject._execute(self, request)
Ejemplo n.º 9
0
    def __init__(self, name, coords = None):
        BaseObject.__init__(self)

        self.path_id = Path.new_id()
        self.name = name
        self.coords = coords

        # add us
        Path.paths.append(self)
    def publish(self):
        print >>sys.stderr, "making put request to: %s%s" % (self.dest, self.path + self.uid + self.path_publish)

        data = {}
        if self.service:
            data.update({"service_name": self.service})

        data = urllib.urlencode(data)
        url = "%s/%s/%s/%s?%s" % (self.dest, self.path, self.uid, self.path_publish, data)

        request = urllib2.Request(url, data="", headers=self.headers)
        request.get_method = lambda: "PUT"
        BaseObject._execute(self, request)
Ejemplo n.º 11
0
 def __init__(self, **kwargs):
     BaseObject.__init__(self, **kwargs)
     Config.__init__(self, **kwargs)
     self._default_filetype = None
     self._mimetypes = mimetypes.MimeTypes()
     self.filetypes = {}
     filetype_data = kwargs.get('filetype_data', [])
     for data in filetype_data:
         self.add_filetype(**data)
     self.recent_files = {}
     self.files_by_path = {}
     self.get_recent_files()
     self.bind(current_file=self._on_current_file_set)
Ejemplo n.º 12
0
    def __init__(self, trip_route, start, end, headway):
        BaseObject.__init__(self)

        self.frequency_id = Frequency.new_id()
        
        self.start = start
        self.end = end
        self.headway = headway

        self._trip_route = weakref.ref(trip_route)

        # add us
        Frequency.frequencies.append(self)
Ejemplo n.º 13
0
    def __init__(self, name = None, url = None,
                 timezone = 'America/Chicago', language = 'EN', phone = None, fare_url = None):
        BaseObject.__init__(self)

        self.agency_id = Agency.new_id()
        self.name = name
        self.url = url
        self.timezone = timezone
        self.language = language
        self.phone = phone
        self.fare_url = fare_url

        # add us
        Agency.agencies.append(self)
Ejemplo n.º 14
0
    def import_calendars(cls, directory):
        try:
            f = open(os.path.join(directory, 'calendar.txt'), 'rb')
            reader = csv.reader(f)

            mappings = {'service_id': 'service_name',
                        'monday': 'monday',
                        'tuesday': 'tuesday',
                        'wednesday': 'wednesday',
                        'thursday': 'thursday',
                        'friday': 'friday',
                        'saturday': 'saturday',
                        'sunday': 'sunday',
                        'start_date': 'start_date',
                        'end_date': 'end_date',
                    }
            transforms = {'service_id': lambda x: x,
                          'monday': lambda x: int(x),
                          'tuesday': lambda x: int(x),
                          'wednesday': lambda x: int(x),
                          'thursday': lambda x: int(x),
                          'friday': lambda x: int(x),
                          'saturday': lambda x: int(x),
                          'sunday': lambda x: int(x),
                          'start_date': lambda x: x,
                          'end_date': lambda x: x,
                      }

            # create a headers with an index
            headers = reader.next()
            r_headers = dict([(x, i) for i, x in enumerate(headers)])

            for l2 in reader:
                if len(l2) != len(headers):
                    print >> sys.stderr, 'Invalid line', l2, headers
                    continue
                
                kw = {}
                for i, a in enumerate(l2):
                    key = headers[i]
                    if key in mappings:
                        kw[mappings[key]] = transforms[key](BaseObject.unquote(a))
                # create the calendar
                calendar = Calendar(**kw)
                # set the id
                calendar.gtfs_id = BaseObject.unquote(l2[r_headers['service_id']])

        except IOError, e:
            print >> sys.stderr, 'Unable to open calendar.txt:', e
Ejemplo n.º 15
0
Archivo: Trip.py Proyecto: line72/subte
    def import_trips(cls, directory):
        from Route import Route
        from Calendar import Calendar
        from TripRoute import TripRoute
        from Path import Path
        from Stop import Stop

        try:
            f = open(os.path.join(directory, 'trips.txt'), 'rb')
            reader = csv.reader(f)

            mappings = {'route_id': ('route', lambda x: Route.get_by_gtfs_id(x)),
                        'service_id': ('calendar', lambda x: Calendar.get_by_gtfs_id(x)),
                        'trip_id': ('name', lambda x: x),
                        'trip_headsign': ('headsign', lambda x: x),
                        'direction_id': ('direction', lambda x: int(x) if x else 0),
                        'shape_id': ('path', lambda x: Path.get_by_gtfs_id(x)),
            }

            # create a headers with an index
            headers = reader.next()
            r_headers = dict([(x, i) for i, x in enumerate(headers)])

            for l2 in reader:
                if len(l2) != len(headers):
                    print >> sys.stderr, 'Invalid line', l2, headers
                    continue
                
                kw = {}
                for i, a in enumerate(l2):
                    key = headers[i]
                    if key in mappings:
                        kw[mappings[key][0]] = mappings[key][1](BaseObject.unquote(a))
                # create the trip route
                trip_route = TripRoute(**kw)
                # set the id
                trip_route.gtfs_id = BaseObject.unquote(l2[r_headers['trip_id']])
                # create a trip
                trip = trip_route.add_trip()
                trip.gtfs_id = BaseObject.unquote(l2[r_headers['trip_id']])

            # go through the list again and set block ids
            #!mwd - I'm not sure how to do this. We link
            #  blocks by trip ids, but block ids are 
            #  random in gtfs, so we have no way to link
            #  them back

        except IOError, e:
            print >> sys.stderr, 'Unable to open trips.txt:', e
Ejemplo n.º 16
0
Archivo: Trip.py Proyecto: line72/subte
    def __init__(self, name, trip_route, calendar):
        BaseObject.__init__(self)

        self.trip_id = Trip.new_id()
        self.name = name
        self._trip_route = weakref.ref(trip_route)
        self._calendar = weakref.ref(calendar)

        self.stops = []

        self._next_block = None
        self._previous_block = None

        # add us
        Trip.trips.append(self)
Ejemplo n.º 17
0
	def __init__(self):
		BaseObject.__init__(self)
		self.name = "Base"
		self.properties += [
			P("fillColor", "Fill Color", PROPTYPE_COLOR, 
				color_parse("#222222")),
			P("borderColor", "Border Color", PROPTYPE_COLOR, 
				color_parse("#DDDDDD")),
			P("borderWidth", "Border Width", PROPTYPE_INTEGER,	5),
			P("rotation", "Rotation", PROPTYPE_INTEGER, 0),
			P("x", "X", PROPTYPE_INTEGER, 10),
			P("y", "Y", PROPTYPE_INTEGER, 10),
			P("width", "Width", PROPTYPE_INTEGER, 50),
			P("height", "Height", PROPTYPE_INTEGER, 50),
			P("text", "Text", PROPTYPE_STRING,	"")
		]
Ejemplo n.º 18
0
    def import_frequencies(cls, directory):
        from Trip import Trip

        try:
            f = open(os.path.join(directory, 'frequencies.txt'), 'rb')
            reader = csv.reader(f)

            mappings = {'trip_id': ('trip_route', lambda x: Trip.get_by_gtfs_id(x).trip_route),
                        'start_time': ('start', lambda x: x),
                        'end_time': ('end', lambda x: x),
                        'headway_secs': ('headway', lambda x: x),
                    }

            # create a headers with an index
            headers = reader.next()
            r_headers = dict([(x, i) for i, x in enumerate(headers)])

            for l2 in reader:
                if len(l2) != len(headers):
                    print >> sys.stderr, 'Invalid line', l2, headers
                    continue
                
                kw = {}
                for i, a in enumerate(l2):
                    key = headers[i]
                    if key in mappings:
                        kw[mappings[key][0]] = mappings[key][1](BaseObject.unquote(a))
                # create the frequency
                frequency = Frequency(**kw)
                trip_route = frequency.trip_route.frequencies.append(frequency)

        except IOError, e:
            print >> sys.stderr, 'Unable to open frequencies.txt:', e
    def get_list(self):
        print >> sys.stderr, 'making get request to: %s%s' % (self.dest, self.path)

        data = {}

        if self.count:
            data.update({'count': self.count})

        if self.status:
            data.update({'status_filter':  '-'.join(map(lambda x: str(x), self.status))})

        data = urllib.urlencode(data)
        url = "%s/%s?%s" % (self.dest, self.path, data)

        request = urllib2.Request(url, headers=self.headers)
        BaseObject._execute(self, request)
Ejemplo n.º 20
0
    def __init__(self, service_name, monday = 0,
                 tuesday = 0, wednesday = 0, thursday = 0,
                 friday = 0, saturday = 0, sunday = 0,
                 start_date = '20120101', end_date = '20140101'):
        BaseObject.__init__(self)

        self.calendar_id = Calendar.new_id()
        self.name = service_name
        self.days = [monday, tuesday, wednesday,
                     thursday, friday, saturday,
                     sunday]
        #self.start_date = start_date or datetime.now()
        #self.end_date = end_date or datetime.now() + relativedelta(years=+1)
        self.start_date = start_date
        self.end_date = end_date

        # add us
        Calendar.calendars.append(self)
Ejemplo n.º 21
0
    def __init__(self, service_name,
                 monday = 1, tuesday = 1, wednesday = 1, thursday = 1,
                 friday = 1, saturday = 1, sunday = 1,
                 start_date = '20150601', end_date = '20170601',
                 added_excn = [], remov_excn = []):
        BaseObject.__init__(self)

        self.calendar_id = Calendar.new_id()
        self.name = service_name
        self.days = [monday, tuesday, wednesday,
                     thursday, friday, saturday,
                     sunday]
        self.start_date = start_date
        self.end_date = end_date
        self.added_excn = added_excn
        self.remov_excn = remov_excn

        # add us
        Calendar.calendars.append(self)
Ejemplo n.º 22
0
    def __init__(self, code = None, name = None,
                 description = None, latitude = None, longitude = None,
                 zone_id = None, url = None, location_type = 0, parent_station = None):
        BaseObject.__init__(self)

        self.stop_id = Stop.new_id()
        self.code = code
        self.name = name
        self.description = description
        self.latitude = latitude
        self.longitude = longitude
        self.zone_id = zone_id
        self.url = url
        self.location_type = location_type
        self.parent_station = parent_station

        self.pictures = []

        # add us
        Stop.stops.append(self)
Ejemplo n.º 23
0
  def create(self):
      print >> sys.stderr, 'making post request to: %s%s' % (self.dest,self.path)
      self.datagen = {}

      if len(self.audioFilename) > 0:
        if 'http' in self.audioFilename :
            self.path = self.path +"?media="+ urllib.quote(self.audioFilename)
            self.datagen = "" # should not be empty dict but empty string!
        else :
            if len(self.metadataFilename) > 0:
                self.datagen, headers_ = multipart_encode({ 'metadata' : create_metadata(self.metadataFilename),
                                                         'media' : open(self.audioFilename, "rb") })
            else:
                self.datagen, headers_ = multipart_encode({ 'media' : open(self.audioFilename, "rb") })
            self.headers.update(headers_)

      #print >> sys.stderr, "request headers: ", self.headers

      request = urllib2.Request(self.dest+self.path, data= self.datagen, headers=self.headers)

      BaseObject._execute(self, request)
Ejemplo n.º 24
0
 def __init__(self, **kwargs):
     #super(OSCNode, self).__init__()
     BaseObject.__init__(self, **kwargs)
     dispatch.Receiver.__init__(self)
     self.register_signal('child_added', 'child_removed')
     
     if 'name' in kwargs:
         self.setName(kwargs.get('name'))
     if 'parent' in kwargs:
         self.setParent(kwargs.get('parent'))
         self._oscMaster = self._parent._oscMaster
         self.get_client_cb = self._parent.get_client_cb
     else:
         self._oscMaster = kwargs.get('oscMaster', False)
         self.get_client_cb = kwargs.get('get_client_cb')
     self.is_root_node = kwargs.get('root_node', False)
     self.transmit_callback = kwargs.get('transmit_callback')
     if self.is_root_node:
         self.get_epoch_offset_cb = kwargs.get('get_epoch_offset_cb')
         self._dispatch_thread = OSCDispatchThread(osc_tree=self)
         self._dispatch_thread.start()
Ejemplo n.º 25
0
    def __init__(self, agency = None, short_name = '',
                 long_name = '', description = '',
                 route_type = None, url = '', color = None, text_color = None):
        BaseObject.__init__(self)

        self.route_id = Route.new_id()
        self.agency = agency
        if agency is None:
            self.agency = Agency.agencies[0]
        self.short_name = short_name
        self.long_name = long_name
        self.description = description
        self.route_type = route_type
        self.url = url
        self.color = color
        self.text_color = text_color

        self.trip_routes = []

        # add us
        Route.routes.append(self)
    def create(self):
        print >>sys.stderr, "making post request to: %s%s" % (self.dest, self.path)

        data = {}
        if self.service:
            data.update({"service": self.service, "item_id": self.item_id})

        if "http" in self.audioFilename:
            data.update({"media": self.audioFilename})
        else:
            data.update({"media": FileProgress(open(self.audioFilename, "rb"))})

        if self.transcriptFilename:
            self.datagen.update({"transcript": read_file(self.transcriptFilename)})

        headers = self.headers
        data, headers_ = multipart_encode(data)
        headers.update(headers_)

        request = urllib2.Request(self.dest + self.path, data=data, headers=headers)

        BaseObject._execute(self, request)
Ejemplo n.º 27
0
    def import_stops(cls, directory):
        try:
            f = open(os.path.join(directory, 'stops.txt'), 'rb')
            reader = csv.reader(f)

            mappings = {'stop_code': ('code', lambda x: x),
                        'stop_name': ('name', lambda x: x),
                        'stop_desc': ('description', lambda x: x),
                        'stop_lat': ('latitude', lambda x: float(x)),
                        'stop_lon': ('longitude', lambda x: float(x)),
                        'zone_id': ('zone_id', lambda x: x),
                        'stop_url': ('url', lambda x: x),
                        'location_type': ('location_type', lambda x: int(x) if x else 0),
                        'parent_station': ('parent_station', lambda x: x),
                    }

            # create a headers with an index
            headers = reader.next()
            r_headers = dict([(x, i) for i, x in enumerate(headers)])

            for l2 in reader:
                if len(l2) != len(headers):
                    print >> sys.stderr, 'Invalid line', l2, headers
                    continue
                
                kw = {}
                for i, a in enumerate(l2):
                    key = headers[i]
                    if key in mappings:
                        kw[mappings[key][0]] = mappings[key][1](BaseObject.unquote(a))
                # create the stop
                stop = Stop(**kw)
                # set the id
                stop.gtfs_id = BaseObject.unquote(l2[r_headers['stop_id']])

        except IOError, e:
            print >> sys.stderr, 'Unable to open stops.txt:', e
Ejemplo n.º 28
0
    def import_routes(cls, directory):
        try:
            f = open(os.path.join(directory, 'routes.txt'), 'rb')
            reader = csv.reader(f)

            mappings = {'agency_id': ('agency', lambda x: Agency.get_by_gtfs_id(x)),
                        'route_short_name': ('short_name', lambda x: x),
                        'route_long_name': ('long_name', lambda x: x),
                        'route_desc': ('description', lambda x: x),
                        'route_type': ('route_type', lambda x: int(x)),
                        'route_url': ('url', lambda x: x),
                        'route_color': ('color', lambda x: x),
                        'route_text_color': ('text_color', lambda x: x),
                    }

            # create a headers with an index
            headers = reader.next()
            r_headers = dict([(x, i) for i, x in enumerate(headers)])

            for l2 in reader:
                if len(l2) != len(headers):
                    print >> sys.stderr, 'Invalid line', l2, headers
                    continue
                
                kw = {}
                for i, a in enumerate(l2):
                    key = headers[i]
                    if key in mappings:
                        kw[mappings[key][0]] = mappings[key][1](BaseObject.unquote(a))
                # create the route
                route = Route(**kw)
                # set the id
                route.gtfs_id = BaseObject.unquote(l2[r_headers['route_id']])

        except IOError, e:
            print >> sys.stderr, 'Unable to open routes.txt:', e
Ejemplo n.º 29
0
    def __init__(self, name, route, calendar, headsign, direction, path = None):
        BaseObject.__init__(self)

        self.trip_route_id = TripRoute.new_id()
        self.name = name
        self._route = None
        self._calendar = None

        self.set_route(route)
        self.set_calendar(calendar)

        self.headsign = headsign
        self.direction = direction
        self.path = path

        self.wheelchair_accessible = 0

        self.trips = []
        self.frequencies = []

        self._stops = []

        # add us
        TripRoute.trip_routes.append(self)
Ejemplo n.º 30
0
 def __init__ (self):
     BaseObject.__init__ (self)
Ejemplo n.º 31
0
 def __init__(self, x, y, button, color):
     BaseObject.__init__(self, x, y, color)
     self.button = button
     self.isDown = False
 def get(self):
     print >> sys.stderr, 'making get request to: %s%s' % (self.dest,self.path+self.uid)
     request = urllib2.Request(self.dest+self.path+self.uid, headers=self.headers)
     BaseObject._execute(self, request)
Ejemplo n.º 33
0
    def test_init(self):
        obj = BaseObject()

        self.assertIsNone(obj.netki_client)
Ejemplo n.º 34
0
    def test_set_netki_client(self):
        obj = BaseObject()
        obj.set_netki_client('new client')

        self.assertEqual('new client', obj.netki_client)
Ejemplo n.º 35
0
Archivo: Trip.py Proyecto: line72/subte
 def __init__(self, stop, arrival = None, departure = None):
     BaseObject.__init__(self)
     self.arrival = arrival
     self.departure = departure or arrival
     self._stop = weakref.ref(stop)
Ejemplo n.º 36
0
 def __init__(self, x, y, color):
     BaseObject.__init__(self, x, y, color)
     self.isAlive = False
     self.index = -1
Ejemplo n.º 37
0
import ROOT,math,os
from BaseObject import BaseObject
from mkdir_p import mkdir_p

# ________________________________________________________________________________________________________________________ ||
ROOT.gROOT.SetBatch(ROOT.kTRUE)

# ________________________________________________________________________________________________________________________ ||
hist_cfgs = [
                BaseObject(
                    "ALP_MuMu",
                    cfgs=[ BaseObject(
                            "H-To-ALP-ALP_M"+str(m),
                            inputPath="/home/lucien/AnalysisCode/Higgs/ALP/genproductions/bin/MadGraph5_aMCatNLO/workDir_acc_study_hTOzalpTO4mu_eps2e-2_mZd%s/UnpackTarball/cmsgrid_final_lhe.root"%str(m),
                            x_label = str(m)+ "GeV",
                            mass = m,
                            ) 
                            for m in [4,5,7,15,20,25,30,] ],
                    color = ROOT.kRed,
                    ),

                BaseObject(
                    "Zd_MuMu",
                    cfgs=[ BaseObject(
                            "H-To-Zd-Zd_M"+str(m),
                            inputPath="/home/lucien/AnalysisCode/Higgs/ALP/genproductions/bin/MadGraph5_aMCatNLO/workDir_acc_study_hTOzzpTO4mu_eps2e-2_mZd%s/UnpackTarball/cmsgrid_final_lhe.root"%str(m),
                            x_label = str(m)+ "GeV",
                            mass = m,
                            ) 
                            for m in [4,5,7,15,20,25,30,] ],
                    color = ROOT.kBlue,
Ejemplo n.º 38
0
window_down     = mass_float-float(width)
selection       = "(massZ2 > %s) && (massZ2 < %s)"%(window_down,window_up)
#outPlotDir      = "/home/lucien/public_html/Higgs/ALP/KinematicStudy/2019-10-09_hToXX_mX"+mass+"/"
#outPlotDir      = "/home/lucien/public_html/Higgs/ALP/KinematicStudy/2019-11-25_hToXX_mX"+mass+"/"
outPlotDir      = "/home/lucien/public_html/Higgs/ALP/KinematicStudy/2019-11-26_hToZX_mX"+mass+"/"
kinemlist       = [
                    "mass4l",
                    "eta3","eta4","eta5","eta6","phi3","phi4","phi5","phi6",
                    "pto1","pto2","pto3","pto4",
                    "massZ1","massZ2","pT4l",
                    "costheta1","costheta2","costhetastar","phi","phi1",
                    ]
titleTemplate   = "pp #rightarrow H #rightarrow ZX #rightarrow 4l, mZ_{d} = %d GeV%s"
extratitle      = ""
plotlist        = [
    BaseObject("mass4l",xmin=124.0,xmax=126.0,binwidth=0.02,xlabel="m_{4l} [GeV]",ylabel=str("%.5f" % 0.5)+" [GeV]",xminrange=100.0,xmaxrange=170.0,ymaxrange=0.6),
    BaseObject("massZ1",xmin=40.0,xmax=120.0,binwidth=1.0,xlabel="m_{Z1} [GeV]",ylabel=str("%.5f" % 0.5)+" [GeV]",xminrange=40.0,xmaxrange=120.0,ymaxrange=0.6),
    BaseObject("massZ2",xmin=mass_float-1.,xmax=mass_float+1.,binwidth=0.02,xlabel="m_{Z2} [GeV]",ylabel=str("%.5f" % 0.5)+" [GeV]",xminrange=mass_float-1.,xmaxrange=mass_float+1.,ymaxrange=0.6),
    BaseObject("eta3",xmin=-2.8,xmax=2.8,binwidth=0.2,xlabel="#eta_{3}",ylabel=str("%.5f" % 0.2),xminrange=-2.8,xmaxrange=2.8,ymaxrange=0.07),
    BaseObject("eta4",xmin=-2.8,xmax=2.8,binwidth=0.2,xlabel="#eta_{4}",ylabel=str("%.5f" % 0.2),xminrange=-2.8,xmaxrange=2.8,ymaxrange=0.07),
    BaseObject("eta5",xmin=-2.8,xmax=2.8,binwidth=0.2,xlabel="#eta_{5}",ylabel=str("%.5f" % 0.2),xminrange=-2.8,xmaxrange=2.8,ymaxrange=0.07),
    BaseObject("eta6",xmin=-2.8,xmax=2.8,binwidth=0.2,xlabel="#eta_{6}",ylabel=str("%.5f" % 0.2),xminrange=-2.8,xmaxrange=2.8,ymaxrange=0.07),
    BaseObject("phi3",xmin=-np.pi,xmax=np.pi,binwidth=np.pi/20,xlabel="#phi_{3}"+" [radians]",ylabel=str("%.5f" % (np.pi/20))+" [radians]",xminrange=-3.5,xmaxrange=3.5,ymaxrange=0.04),
    BaseObject("phi4",xmin=-np.pi,xmax=np.pi,binwidth=np.pi/20,xlabel="#phi_{4}"+" [radians]",ylabel=str("%.5f" % (np.pi/20))+" [radians]",xminrange=-3.5,xmaxrange=3.5,ymaxrange=0.04),
    BaseObject("phi5",xmin=-np.pi,xmax=np.pi,binwidth=np.pi/20,xlabel="#phi_{5}"+" [radians]",ylabel=str("%.5f" % (np.pi/20))+" [radians]",xminrange=-3.5,xmaxrange=3.5,ymaxrange=0.04),
    BaseObject("phi6",xmin=-np.pi,xmax=np.pi,binwidth=np.pi/20,xlabel="#phi_{6}"+" [radians]",ylabel=str("%.5f" % (np.pi/20))+" [radians]",xminrange=-3.5,xmaxrange=3.5,ymaxrange=0.04),
    BaseObject("pto1",xmin=0.0,xmax=120.0,binwidth=1.0,xlabel="p_{T,1} [GeV]",ylabel=str("%.5f" % 1.0)+" [GeV]",xminrange=0.0,xmaxrange=120.0,ymaxrange=0.1),
    BaseObject("pto2",xmin=0.0,xmax=120.0,binwidth=1.0,xlabel="p_{T,2} [GeV]",ylabel=str("%.5f" % 1.0)+" [GeV]",xminrange=0.0,xmaxrange=120.0,ymaxrange=0.1),
    BaseObject("pto3",xmin=0.0,xmax=120.0,binwidth=1.0,xlabel="p_{T,3} [GeV]",ylabel=str("%.5f" % 1.0)+" [GeV]",xminrange=0.0,xmaxrange=120.0,ymaxrange=0.1),
    BaseObject("pto4",xmin=0.0,xmax=120.0,binwidth=1.0,xlabel="p_{T,4} [GeV]",ylabel=str("%.5f" % 1.0)+" [GeV]",xminrange=0.0,xmaxrange=120.0,ymaxrange=0.1),
    BaseObject("costheta1",xmin=-1.0,xmax=1.0,binwidth=0.05,xlabel="cos(#theta_{1})",ylabel=str("%.5f" % 0.05),xminrange=-1.2,xmaxrange=1.2,ymaxrange=0.05),