Example #1
0
    mytrigbranches = [
        'eventNumber', 'eventTimeTank', 'eventTimeMRD', 'vetoHit'
    ]

    myMRDbranches = [
        'eventNumber', 'eventTimeTank', 'eventTimeMRD', 'clusterTime',
        'clusterHits', 'vetoHit', 'numClusterTracks', 'MRDTrackAngle',
        'MRDPenetrationDepth', 'MRDEntryPointRadius', 'MRDEnergyLoss',
        'MRDEnergyLossError', 'MRDTrackLength'
    ]

    PositionDict = {}
    for j, direc in enumerate(SIGNAL_DIRS):
        direcfiles = glob.glob(direc + "*.ntuple.root")

        livetime_estimate = es.EstimateLivetime(direcfiles)
        print("SIGNAL LIVETIME ESTIMATE IN SECONDS IS: " +
              str(livetime_estimate))
        PositionDict[SIGNAL_LABELS[j]] = []
        PositionDict[SIGNAL_LABELS[j]].append(
            GetDataFrame("phaseIITankClusterTree", mybranches, direcfiles))
        PositionDict[SIGNAL_LABELS[j]].append(
            GetDataFrame("phaseIITriggerTree", mytrigbranches, direcfiles))
        PositionDict[SIGNAL_LABELS[j]].append(
            GetDataFrame("phaseIIMRDClusterTree", myMRDbranches, direcfiles))

    Sdf = PositionDict["Beam"][0]
    Sdf_trig = PositionDict["Beam"][1]
    Sdf_mrd = PositionDict["Beam"][2]

    Sdf = Sdf.loc[Sdf["eventTimeTank"] > -9].reset_index(drop=True)
Example #2
0
    #plt.show()

    #Bdf_latewindow_CBCut = Bdf_latewindow.loc[Bdf_latewindow['clusterChargeBalance']<0.4]
    #labels = {'title': 'Comparison of total PE to Charge Point Y-component (No source, >12 $\mu$s, Charge Balance < 0.4)',
    #        'xlabel': 'Total PE', 'ylabel': 'Charge Point Y'}
    #ranges = {'xbins': 30, 'ybins':30, 'xrange':[0,60],'yrange':[-1,1]}
    ##abp.MakeHexJointPlot(Sdf,'clusterPE','clusterChargeBalance',labels,ranges)
    #abp.Make2DHist(Bdf_latewindow_CBCut,'clusterPE','clusterChargePointY',labels,ranges)
    #plt.show()


if __name__ == '__main__':
    slist = glob.glob(SIGNAL_DIR + "*.ntuple.root")
    blist = glob.glob(BKG_DIR + "*.ntuple.root")

    livetime_estimate = es.EstimateLivetime(slist)
    print("SIGNAL LIVETIME ESTIMATE IN SECONDS IS: " + str(livetime_estimate))
    livetime_estimate = es.EstimateLivetime(blist)
    print("BKG LIVETIME ESTIMATE IN SECONDS IS: " + str(livetime_estimate))

    mybranches = [
        'eventNumber', 'eventTimeTank', 'clusterTime', 'SiPMhitQ', 'SiPMNum',
        'SiPMhitT', 'hitT', 'hitQ', 'hitPE', 'hitDetID',
        'clusterChargeBalance', 'clusterPE', 'SiPM1NPulses', 'SiPM2NPulses'
    ]
    SProcessor = rp.ROOTProcessor(treename="phaseIITankClusterTree")
    for f1 in slist:
        SProcessor.addROOTFile(f1, branches_to_get=mybranches)
    Sdata = SProcessor.getProcessedData()
    Sdf = pd.DataFrame(Sdata)