src/cpp/jail/resonanceDecay/functions.cpp
//*********************************************************************************
// This function reads in the EdN/d3p spectra calculated by spectra via the HYDRO output.
// Set the pt points with the gaussian values given above.  These are the same values
// given to the spectra in the azspectra0p0 program. The default filename is phipspectra.dat

This function reads in the EdN/d3p spectra calculated by spectra via the HYDRO output.
Set the pt points with the gaussian values given above.  These are the same values
given to the spectra in the azspectra0p0 program. The default filename is phipspectra.dat
This function reads in the EdN / d3p spectra calculated by spectra via the HYDRO output . Set the pt points with the gaussian values given above . These are the same values given to the spectra in the azspectra0p0 program . The default filename is phipspectra . dat
void readSpectra(char specfile[FILEDIM], int *particlemax, int *decaymax)
{
    char resofile[FILEDIM] = "EOS/pdg.dat";
    int npa = 0;
    double dum, dum1, dum2;
    FILE *spec = fopen(specfile,"r");
    if(spec == NULL)
    {
        printf(" NO file: %s  available ! \n", specfile);
        printf(" GOOD BYE AND HAVE A NICE DAY! \n");
        exit(0);
    }
    readParticleData(resofile, particlemax, decaymax);
    Table pT_tab("tables/pT_gauss_table.dat");
    Table phi_tab("tables/phi_gauss_table.dat");
    Table y_tab("tables/y_riemann_table_11pt.dat");
    int npT = pT_tab.getNumberOfRows();
    int nphi = phi_tab.getNumberOfRows();
    int ny = y_tab.getNumberOfRows();
    int WarningCounter = 0;
    for (int n = 0; n < *particlemax; n++)
    {
        npa++;
        int pn = n;
        if (pn == -1)
        {
            printf(" particle %i not in reso table ! \n");
            printf(" GOOD BYE AND HAVE A NICE DAY! \n");
            exit(0);
        }
        if (npT > NPT)
        {
            printf(" NPT = %i array to small !\n", npT);
            printf(" GOOD BYE AND HAVE A NICE DAY! \n");
            exit(0);
        }
        if (nphi > NPHI)
        {
            printf(" NPHI = %i array to small !\n", nphi);
            printf(" GOOD BYE AND HAVE A NICE DAY! \n");
            exit(0);
        }
        for (int ipT = 0; ipT < npT; ipT++) particle[pn].pt[ipT] = pT_tab.get(1,ipT + 1);
        for (int iy = 0; iy < ny; iy++) particle[pn].y[iy]       =  y_tab.get(1,iy + 1);
        for (int iphi = 0; iphi < nphi; iphi++) particle[pn].phi[iphi]        = phi_tab.get(1,iphi + 1);
        particle[pn].slope[npT] = 1;
        particle[pn].nphi       = nphi;
        particle[pn].npT        = npT;
        for (int iy = 0; iy < ny; iy++)
        {
            for (int ipT = 0; ipT < npT; ipT++)
            {
              for (int iphi = 0; iphi < nphi; iphi++)
              {
                fscanf(spec,"%lf",&dum);
                particle[pn].dNdypTdpTdphi[iy][ipT][iphi] = dum;
              }
            }
        }
    }
    fclose(spec);
    if (npa > 0) printf(" Successful read in of %5i spectra !\n",npa);
}
void readSpectra ( char specfile [ FILEDIM ] , int * particlemax , int * decaymax ) { char resofile [ FILEDIM ] = " " ; int npa = 0 ; double dum , dum1 , dum2 ; FILE * spec = fopen ( specfile , " " ) ; if ( spec == NULL ) { printf ( " \n " , specfile ) ; printf ( " \n " ) ; exit ( 0 ) ; } readParticleData ( resofile , particlemax , decaymax ) ; Table pT_tab ( " " ) ; Table phi_tab ( " " ) ; Table y_tab ( " " ) ; int npT = pT_tab . getNumberOfRows ( ) ; int nphi = phi_tab . getNumberOfRows ( ) ; int ny = y_tab . getNumberOfRows ( ) ; int WarningCounter = 0 ; for ( int n = 0 ; n < * particlemax ; n ++ ) { npa ++ ; int pn = n ; if ( pn == -1 ) { printf ( " \n " ) ; printf ( " \n " ) ; exit ( 0 ) ; } if ( npT > NPT ) { printf ( " \n " , npT ) ; printf ( " \n " ) ; exit ( 0 ) ; } if ( nphi > NPHI ) { printf ( " \n " , nphi ) ; printf ( " \n " ) ; exit ( 0 ) ; } for ( int ipT = 0 ; ipT < npT ; ipT ++ ) particle [ pn ] . pt [ ipT ] = pT_tab . get ( 1 , ipT + 1 ) ; for ( int iy = 0 ; iy < ny ; iy ++ ) particle [ pn ] . y [ iy ] = y_tab . get ( 1 , iy + 1 ) ; for ( int iphi = 0 ; iphi < nphi ; iphi ++ ) particle [ pn ] . phi [ iphi ] = phi_tab . get ( 1 , iphi + 1 ) ; particle [ pn ] . slope [ npT ] = 1 ; particle [ pn ] . nphi = nphi ; particle [ pn ] . npT = npT ; for ( int iy = 0 ; iy < ny ; iy ++ ) { for ( int ipT = 0 ; ipT < npT ; ipT ++ ) { for ( int iphi = 0 ; iphi < nphi ; iphi ++ ) { fscanf ( spec , " " , & dum ) ; particle [ pn ] . dNdypTdpTdphi [ iy ] [ ipT ] [ iphi ] = dum ; } } } } fclose ( spec ) ; if ( npa > 0 ) printf ( " \n " , npa ) ; }
This function reads in the EdN/d3p spectra calculated by spectra via the HYDRO output.
This function reads in the EdN / d3p spectra calculated by spectra via the HYDRO output .