ó
Qā^c           @   s   d  d l  m  Z  d  d l m Z d   Z e d k r} xE d d d d g D]. Z d	 e d	 GHe e  Z e e d
  GHqH Wn  d S(   i’’’’(   t   get_energy_bins(   t   get_type_thresholdsc   
      C   s/  |  d k r d GHni
 |  d 6g  d 6g  d 6g  d	 6g  d
 6g  d 6g  d 6g  d 6g  d 6g  d 6} t    } d } xµd d d d g D]”} | | |  d } t |  } xzt t | d   D]b} | d | | d k r½ | d | | d k r½ t | d | d  | d k rĪ| d j |  | d 7} | d j d |  d | d | | d | f  | d	 j | g  | d
 j | g  x d d d d d g D]( } | | j t | | | d   qWq| d j t | d | d   }	 | d	 |	 j |  | d
 |	 j |  q½ q½ Wq W| Sd  S(   Nt   protont   heliumt
   backgroundt   overflowsh   type can be background, proton, helium or overflow (electrons has changin energy bin widhts in its histot   masterch_typet   masterch_idt   masterch_namet   coincest   ch_in_coincest   emaxt   emint   ewidtht	   ebinedgest   ecenteri    t   ABt   ABCt   ABCDt   ABCDEi   s   .2fs   %s: %2.2f-%2.2f MeV(   R   R   R   R   (   R   R    t   ranget   lent   formatt   appendt   index(
   t   typet   master_ch_dictt   thresholds_dictt   masterch_countert   coinct
   thresholdst
   energybinst   subchidxt   energystufft   existing_index(    (    s   get_master_ch_dict.pyt   get_master_ch_dict	   s@    
	0!
2)$ t   __main__R   R   R   R   s   
R   N(   R    R   R#   t   __name__R   R   R   (    (    (    s   get_master_ch_dict.pyt   <module>   s   	)