ebe_scripts/average_event_spvn_h5_minimumbias.py
def calcualte_event_plane_correlations(vn_array, outputFileName):
    """
        this function compute the scalar-product event plane correlations
        vn_array is a matrix [event_idx, vn_order]
    """
    vn_array = array(vn_array)
    nev = len(vn_array[:, 0])
    v2_array = vn_array[:, 2]
    v3_array = vn_array[:, 3]
    v4_array = vn_array[:, 4]
    v5_array = vn_array[:, 5]
    v6_array = vn_array[:, 6]

    corr_224_JK = zeros(nev)
    corr_22233_JK = zeros(nev)
    corr_2226_JK = zeros(nev)
    corr_336_JK = zeros(nev)
    corr_235_JK = zeros(nev)
    corr_246_JK = zeros(nev)
    corr_234_JK = zeros(nev)
    for iev in range(nev):
        array_idx = [True]*nev
        array_idx[iev] = False
        array_idx = array(array_idx)

        v2_2 = mean(abs(v2_array[array_idx])**2.)
        v3_2 = mean(abs(v3_array[array_idx])**2.)
        v4_2 = mean(abs(v4_array[array_idx])**2.)
        v5_2 = mean(abs(v5_array[array_idx])**2.)
        v6_2 = mean(abs(v6_array[array_idx])**2.)

        # cos(4(Psi_2 - Psi_4))
        corr_224_num = mean(real((v2_array[array_idx]**2.)
                                 *conj(v4_array[array_idx])))
        corr_224_JK[iev] = corr_224_num/sqrt(v2_2*v2_2*v4_2)

        # cos(6(Psi_2 - Psi_3))
        corr_22233_num = mean(real((v2_array[array_idx]**3.)
                                   *conj(v3_array[array_idx])**2.))
        corr_22233_JK[iev] = corr_22233_num/sqrt(v2_2**3.*v3_2**2.)

        # cos(6(Psi_2 - Psi_6))
        corr_2226_num = mean(real(v2_array[array_idx]**3.
                                  *conj(v6_array[array_idx])))
        corr_2226_JK[iev] = corr_2226_num/sqrt((v2_2**3.)*v6_2)

        # cos(6(Psi_3 - Psi_6))
        corr_336_num = mean(real((v3_array[array_idx]**2.)
                                 *conj(v6_array[array_idx])))
        corr_336_JK[iev] = corr_336_num/sqrt((v3_2**2.)*v6_2)

        # cos(2Psi_2 + 3Psi_3 - 5Psi_5)
        corr_235_num = mean(real(v2_array[array_idx]*v3_array[array_idx]
                                 *conj(v5_array[array_idx])))
        corr_235_JK[iev] = corr_235_num/sqrt(v2_2*v3_2*v5_2)

        # cos(2Psi_2 + 4Psi_4 - 6Psi_6)
        corr_246_num = mean(real(v2_array[array_idx]*v4_array[array_idx]
                                 *conj(v6_array[array_idx])))
        corr_246_JK[iev] = corr_246_num/sqrt(v2_2*v4_2*v6_2)

        # cos(2Psi_2 - 6Psi_3 + 4Psi_4)
        corr_234_num = mean(real(v2_array[array_idx]
                                 *(conj(v3_array[array_idx])**2.)
                                 *v4_array[array_idx]))
        corr_234_JK[iev] = corr_234_num/sqrt(v2_2*(v3_2**2.)*v4_2)

    corr_224 = mean(corr_224_JK)
    corr_224_err = sqrt((nev - 1.)/nev*sum((corr_224_JK - corr_224)**2.))
    corr_22233 = mean(corr_22233_JK)
    corr_22233_err = sqrt((nev - 1.)/nev*sum((corr_22233_JK - corr_22233)**2.))
    corr_2226 = mean(corr_2226_JK)
    corr_2226_err = sqrt((nev - 1.)/nev*sum((corr_2226_JK - corr_2226)**2.))
    corr_336 = mean(corr_336_JK)
    corr_336_err = sqrt((nev - 1.)/nev*sum((corr_336_JK - corr_336)**2.))
    corr_235 = mean(corr_235_JK)
    corr_235_err = sqrt((nev - 1.)/nev*sum((corr_235_JK - corr_235)**2.))
    corr_246 = mean(corr_246_JK)
    corr_246_err = sqrt((nev - 1.)/nev*sum((corr_246_JK - corr_246)**2.))
    corr_234 = mean(corr_234_JK)
    corr_234_err = sqrt((nev - 1.)/nev*sum((corr_234_JK - corr_234)**2.))

    f = open(outputFileName, 'w')
    f.write("#correlator  value  value_err\n")
    f.write("4(24)  %.5e  %.5e\n" % (corr_224, corr_224_err))
    f.write("6(23)  %.5e  %.5e\n" % (corr_22233, corr_22233_err))
    f.write("6(26)  %.5e  %.5e\n" % (corr_2226, corr_2226_err))
    f.write("6(36)  %.5e  %.5e\n" % (corr_336, corr_336_err))
    f.write("(235)  %.5e  %.5e\n" % (corr_235, corr_235_err))
    f.write("(246)  %.5e  %.5e\n" % (corr_246, corr_246_err))
    f.write("(234)  %.5e  %.5e\n" % (corr_234, corr_234_err))
    f.close()
    return

        this function compute the scalar-product event plane correlations
        vn_array is a matrix [event_idx, vn_order]
    
this function compute the scalar-product event plane correlations
vn_array is a matrix [event_idx, vn_order]
this function compute the scalar - product event plane correlations vn_array is a matrix [ event_idx vn_order ]
def calcualte_event_plane_correlations(vn_array, outputFileName):
    vn_array = array(vn_array)
    nev = len(vn_array[:, 0])
    v2_array = vn_array[:, 2]
    v3_array = vn_array[:, 3]
    v4_array = vn_array[:, 4]
    v5_array = vn_array[:, 5]
    v6_array = vn_array[:, 6]
    corr_224_JK = zeros(nev)
    corr_22233_JK = zeros(nev)
    corr_2226_JK = zeros(nev)
    corr_336_JK = zeros(nev)
    corr_235_JK = zeros(nev)
    corr_246_JK = zeros(nev)
    corr_234_JK = zeros(nev)
    for iev in range(nev):
        array_idx = [True]*nev
        array_idx[iev] = False
        array_idx = array(array_idx)
        v2_2 = mean(abs(v2_array[array_idx])**2.)
        v3_2 = mean(abs(v3_array[array_idx])**2.)
        v4_2 = mean(abs(v4_array[array_idx])**2.)
        v5_2 = mean(abs(v5_array[array_idx])**2.)
        v6_2 = mean(abs(v6_array[array_idx])**2.)
        corr_224_num = mean(real((v2_array[array_idx]**2.)
                                 *conj(v4_array[array_idx])))
        corr_224_JK[iev] = corr_224_num/sqrt(v2_2*v2_2*v4_2)
        corr_22233_num = mean(real((v2_array[array_idx]**3.)
                                   *conj(v3_array[array_idx])**2.))
        corr_22233_JK[iev] = corr_22233_num/sqrt(v2_2**3.*v3_2**2.)
        corr_2226_num = mean(real(v2_array[array_idx]**3.
                                  *conj(v6_array[array_idx])))
        corr_2226_JK[iev] = corr_2226_num/sqrt((v2_2**3.)*v6_2)
        corr_336_num = mean(real((v3_array[array_idx]**2.)
                                 *conj(v6_array[array_idx])))
        corr_336_JK[iev] = corr_336_num/sqrt((v3_2**2.)*v6_2)
        corr_235_num = mean(real(v2_array[array_idx]*v3_array[array_idx]
                                 *conj(v5_array[array_idx])))
        corr_235_JK[iev] = corr_235_num/sqrt(v2_2*v3_2*v5_2)
        corr_246_num = mean(real(v2_array[array_idx]*v4_array[array_idx]
                                 *conj(v6_array[array_idx])))
        corr_246_JK[iev] = corr_246_num/sqrt(v2_2*v4_2*v6_2)
        corr_234_num = mean(real(v2_array[array_idx]
                                 *(conj(v3_array[array_idx])**2.)
                                 *v4_array[array_idx]))
        corr_234_JK[iev] = corr_234_num/sqrt(v2_2*(v3_2**2.)*v4_2)
    corr_224 = mean(corr_224_JK)
    corr_224_err = sqrt((nev - 1.)/nev*sum((corr_224_JK - corr_224)**2.))
    corr_22233 = mean(corr_22233_JK)
    corr_22233_err = sqrt((nev - 1.)/nev*sum((corr_22233_JK - corr_22233)**2.))
    corr_2226 = mean(corr_2226_JK)
    corr_2226_err = sqrt((nev - 1.)/nev*sum((corr_2226_JK - corr_2226)**2.))
    corr_336 = mean(corr_336_JK)
    corr_336_err = sqrt((nev - 1.)/nev*sum((corr_336_JK - corr_336)**2.))
    corr_235 = mean(corr_235_JK)
    corr_235_err = sqrt((nev - 1.)/nev*sum((corr_235_JK - corr_235)**2.))
    corr_246 = mean(corr_246_JK)
    corr_246_err = sqrt((nev - 1.)/nev*sum((corr_246_JK - corr_246)**2.))
    corr_234 = mean(corr_234_JK)
    corr_234_err = sqrt((nev - 1.)/nev*sum((corr_234_JK - corr_234)**2.))
    f = open(outputFileName, 'w')
    f.write("#correlator  value  value_err\n")
    f.write("4(24)  %.5e  %.5e\n" % (corr_224, corr_224_err))
    f.write("6(23)  %.5e  %.5e\n" % (corr_22233, corr_22233_err))
    f.write("6(26)  %.5e  %.5e\n" % (corr_2226, corr_2226_err))
    f.write("6(36)  %.5e  %.5e\n" % (corr_336, corr_336_err))
    f.write("(235)  %.5e  %.5e\n" % (corr_235, corr_235_err))
    f.write("(246)  %.5e  %.5e\n" % (corr_246, corr_246_err))
    f.write("(234)  %.5e  %.5e\n" % (corr_234, corr_234_err))
    f.close()
    return
def calcualte_event_plane_correlations ( vn_array , outputFileName ) : vn_array = array ( vn_array ) nev = len ( vn_array [ : , 0 ] ) v2_array = vn_array [ : , 2 ] v3_array = vn_array [ : , 3 ] v4_array = vn_array [ : , 4 ] v5_array = vn_array [ : , 5 ] v6_array = vn_array [ : , 6 ] corr_224_JK = zeros ( nev ) corr_22233_JK = zeros ( nev ) corr_2226_JK = zeros ( nev ) corr_336_JK = zeros ( nev ) corr_235_JK = zeros ( nev ) corr_246_JK = zeros ( nev ) corr_234_JK = zeros ( nev ) for iev in range ( nev ) : array_idx = [ True ] * nev array_idx [ iev ] = False array_idx = array ( array_idx ) v2_2 = mean ( abs ( v2_array [ array_idx ] ) ** 2. ) v3_2 = mean ( abs ( v3_array [ array_idx ] ) ** 2. ) v4_2 = mean ( abs ( v4_array [ array_idx ] ) ** 2. ) v5_2 = mean ( abs ( v5_array [ array_idx ] ) ** 2. ) v6_2 = mean ( abs ( v6_array [ array_idx ] ) ** 2. ) corr_224_num = mean ( real ( ( v2_array [ array_idx ] ** 2. ) * conj ( v4_array [ array_idx ] ) ) ) corr_224_JK [ iev ] = corr_224_num / sqrt ( v2_2 * v2_2 * v4_2 ) corr_22233_num = mean ( real ( ( v2_array [ array_idx ] ** 3. ) * conj ( v3_array [ array_idx ] ) ** 2. ) ) corr_22233_JK [ iev ] = corr_22233_num / sqrt ( v2_2 ** 3. * v3_2 ** 2. ) corr_2226_num = mean ( real ( v2_array [ array_idx ] ** 3. * conj ( v6_array [ array_idx ] ) ) ) corr_2226_JK [ iev ] = corr_2226_num / sqrt ( ( v2_2 ** 3. ) * v6_2 ) corr_336_num = mean ( real ( ( v3_array [ array_idx ] ** 2. ) * conj ( v6_array [ array_idx ] ) ) ) corr_336_JK [ iev ] = corr_336_num / sqrt ( ( v3_2 ** 2. ) * v6_2 ) corr_235_num = mean ( real ( v2_array [ array_idx ] * v3_array [ array_idx ] * conj ( v5_array [ array_idx ] ) ) ) corr_235_JK [ iev ] = corr_235_num / sqrt ( v2_2 * v3_2 * v5_2 ) corr_246_num = mean ( real ( v2_array [ array_idx ] * v4_array [ array_idx ] * conj ( v6_array [ array_idx ] ) ) ) corr_246_JK [ iev ] = corr_246_num / sqrt ( v2_2 * v4_2 * v6_2 ) corr_234_num = mean ( real ( v2_array [ array_idx ] * ( conj ( v3_array [ array_idx ] ) ** 2. ) * v4_array [ array_idx ] ) ) corr_234_JK [ iev ] = corr_234_num / sqrt ( v2_2 * ( v3_2 ** 2. ) * v4_2 ) corr_224 = mean ( corr_224_JK ) corr_224_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_224_JK - corr_224 ) ** 2. ) ) corr_22233 = mean ( corr_22233_JK ) corr_22233_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_22233_JK - corr_22233 ) ** 2. ) ) corr_2226 = mean ( corr_2226_JK ) corr_2226_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_2226_JK - corr_2226 ) ** 2. ) ) corr_336 = mean ( corr_336_JK ) corr_336_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_336_JK - corr_336 ) ** 2. ) ) corr_235 = mean ( corr_235_JK ) corr_235_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_235_JK - corr_235 ) ** 2. ) ) corr_246 = mean ( corr_246_JK ) corr_246_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_246_JK - corr_246 ) ** 2. ) ) corr_234 = mean ( corr_234_JK ) corr_234_err = sqrt ( ( nev - 1. ) / nev * sum ( ( corr_234_JK - corr_234 ) ** 2. ) ) f = open ( outputFileName , 'w' ) f . write ( "#correlator  value  value_err\n" ) f . write ( "4(24)  %.5e  %.5e\n" % ( corr_224 , corr_224_err ) ) f . write ( "6(23)  %.5e  %.5e\n" % ( corr_22233 , corr_22233_err ) ) f . write ( "6(26)  %.5e  %.5e\n" % ( corr_2226 , corr_2226_err ) ) f . write ( "6(36)  %.5e  %.5e\n" % ( corr_336 , corr_336_err ) ) f . write ( "(235)  %.5e  %.5e\n" % ( corr_235 , corr_235_err ) ) f . write ( "(246)  %.5e  %.5e\n" % ( corr_246 , corr_246_err ) ) f . write ( "(234)  %.5e  %.5e\n" % ( corr_234 , corr_234_err ) ) f . close ( ) return
this function compute the scalar-product event plane correlations
vn_array is a matrix [event_idx, vn_order]
this function compute the scalar - product event plane correlations vn_array is a matrix [ event_idx vn_order ]
"""
        this function compute the scalar-product event plane correlations
        vn_array is a matrix [event_idx, vn_order]
    """ # cos(4(Psi_2 - Psi_4)) # cos(6(Psi_2 - Psi_3)) # cos(6(Psi_2 - Psi_6)) # cos(6(Psi_3 - Psi_6)) # cos(2Psi_2 + 3Psi_3 - 5Psi_5) # cos(2Psi_2 + 4Psi_4 - 6Psi_6) # cos(2Psi_2 - 6Psi_3 + 4Psi_4)
vn_array
outputFileName