Example #1
0
    trackidx_holder = []
    showeridx_holder = []
    if len(dataset) >= 15000 or len(dataset) == 0:
        labels = pc.walker(dataset, 6,
                           20)  # Runs clustering and returns labels list
    else:
        labels = pc.crawlernn(dataset, 6,
                              20)  # Runs clustering and returns labels list

    datasetidx_holder = lh.label_to_idxholder(
        labels, 20
    )  # Converts the labels list into a list of indexvalues for datasets  [ [ list of index], [list of indexes].. [] ]

    Ea.Ana_Object_photons(dataset,
                          datasetidx_holder,
                          jcount,
                          mcinfo,
                          mcqdep,
                          filename='photon_ana_obj')

    print ' AT THE END'
    '''
    ########################
    # mc_datalabel info
    # Call this once and get the mc info for the jsons for later
    ########################
    #mc_dl =  mh.mc_Obj_points(mh.mc_neutron_induced_OBJ(f))

    ########################
    # if the file is bad then continue and fill 
    ########################
    if not file_info[0]:
            #print 'size of dataset : ' , str(len(dataset))
            if len(dataset) == 0:
                continue

########################
# Build the reco testing here
########################
            labels = []
            #trackidx_holder = []
            #showeridx_holder = []

            labels = pc.walker(
                dataset, nn_dist,
                mincluster)  # Runs clustering and returns labels list

            datasetidx_holder = lh.label_to_idxholder(
                labels, mincluster
            )  # Converts the labels list into a list of indexvalues for datasets  [ [ list of index], [list of indexes].. [] ]

            Ea.Ana_Object_photons(
                dataset,
                datasetidx_holder,
                jcount,
                mcinfo,
                mcqdep,
                filename='{}/photon_ana_obj_nn_{}_mspt_{}'.format(
                    method_name, str(nn_dist), str(mincluster)))

        print 'AT THE END for nndist={} and mincluster={}'.format(
            str(nn_dist), str(mincluster))
Example #3
0
                    # STICH :  dataset,datasetidx_holder,labels,gap_dist,k_radius,min_pdelta, angle_error,min_clust_length
                    AE = angle_error / 100.
                    d, labels = st.Track_Stitcher_epts(dataset,
                                                       datasetidx_holder,
                                                       labels, gap_dist,
                                                       k_radius, min_pdelta,
                                                       AE, min_clust_length)
                    #d, labels = st.Track_Stitcher_epts(dataset,datasetidx_holder,labels,100,20,2.0,0.16,10 )
                    datasetidx_holder = lh.label_to_idxholder(
                        labels, mincluster
                    )  # Converts the labels list into a list of indexvalues for datasets  [ [ list of index], [list of indexes].. [] ]
                    Ea.Ana_Object(
                        dataset,
                        datasetidx_holder,
                        jcount,
                        mc_dl,
                        filename=
                        '{}/AnaCosmic_object_gap_{}_krad_{}_ae_{}_pdelta_{}_'.
                        format(method_name, str(gap_dist), str(k_radius),
                               str(angle_error), str(min_pdelta)))

                    #Ea.Ana_Object_photons(dataset, datasetidx_holder, jcount,mcinfo,mcqdep, filename = '{}/photon_ana_obj_nn_{}_mspt_{}'.format(method_name,str(nn_dist),str(mincluster)))
                    if make_jsons:
                        dh.MakeJson_Objects(
                            dataset, datasetidx_holder, labels, jdir, jcount,
                            'Alg_g{}_kr{}_ae{}_pd{}'.format(
                                str(gap_dist), str(k_radius), str(angle_error),
                                str(min_pdelta)), mc_dl)

                print 'AT THE END for gap={} and krad={} and ae={} and pdelta={}'.format(
                    str(gap_dist), str(k_radius), str(angle_error),
Example #4
0
                #if not detector.In_Range_Fid(bloat_dataset[pt], fid_xlo=-10000, fid_xhi=10000, fid_ylo=-10000, fid_yhi=100000, fid_zlo=400, fid_zhi=10000):
                # This is a bad hack for now
                #if not detector.In_TPC_Fid(bloat_dataset[pt], fid_xlo=0, fid_xhi=0, fid_ylo=0, fid_yhi=0, fid_zlo=400, fid_zhi=0):
                out_holder.append(pt)
        if 1.0 * len(out_holder) / len(cl) > 0.1:
            continue
        showeridx_holder_fid_clean.append(cl)

    #if make_jsons:
    #  dh.MakeJson_Objects(dataset,showeridx_holder_fid_clean,plabels,jdir,jcount,'Final_Showers', mc_dl)
    #dh.MakeJson_Objects(dataset,showeridx_holder_fid_clean,plabels,jdir,jcount,'Final_Showers', mc_dl)

    #continue

#######################################################################################

#####################################################################
#####################################################################
###########  Make the ana output here    ############################
#####################################################################
#####################################################################
    Ea.Ana_CosmicPi0_mc_pair_vtx(f,
                                 Charge_thresh,
                                 dataset,
                                 jcount,
                                 showeridx_holder_fid_clean,
                                 trackidx_holder,
                                 mc_dl,
                                 filename='June_Cosmic_pair')
    #Ea.Ana_CosmicPi0_mc_pair_vtx(f,Charge_thresh,bloat_dataset,  jcount, showeridx_holder_fid_clean, trackidx_holder,mc_dl, filename='May_Cosmic_pair')
Example #5
0
    # if the file is bad then continue and fill
    ########################
    if not file_info:
        continue

    ########################
    # Bring in the MC info
    ########################
    mcinfo = mh.gamma_mc_info(f)
    mcqdep = mh.gamma_mc_dep(f)
    print mcinfo
    print mcqdep

    Ea.Ana_Object_photon_mergeall(jcount,
                                  f,
                                  mcinfo,
                                  mcqdep,
                                  filename='photon_ana_obj_mergeall')

    print ' AT THE END'
    '''
    ########################
    #Bring in  Dataset 
    ########################
    dataset = dh.ConvertWC_InTPC_thresh('{}'.format(f),Charge_thresh)
    print 'size of dataset : ' , str(len(dataset))
    
    

    ########################
    # Build the reco testing here