src/cpp/jail/resonanceDecay/functions.cpp
//*********************************************************************************************
// After calculating the spectra in the decay routines, this routine writes that data to file.
// The spectra is written to spec_###.dat in block format for the pt/phi dependence.
// The pt values for each point are saved to specPT_###.dat. The ### corresponds to the
// monte carlo value number assigned the resonance table.  The phi data was already stored in
// angle.dat. (by default)

After calculating the spectra in the decay routines, this routine writes that data to file.
The spectra is written to spec_###.dat in block format for the pt/phi dependence.
The pt values for each point are saved to specPT_###.dat. The ### corresponds to the
monte carlo value number assigned the resonance table.  The phi data was already stored in
angle.dat. (by default)
After calculating the spectra in the decay routines this routine writes that data to file . The spectra is written to spec_### . dat in block format for the pt / phi dependence . The pt values for each point are saved to specPT_### . dat . The ### corresponds to the monte carlo value number assigned the resonance table . The phi data was already stored in angle . dat . ( by default )
void writeSpectra(int particlemax, char outdir[FILEDIM])
{
    FILE *out, *out2;
    char filename[FILEDIM];
    char filename2[FILEDIM];
    char p[SSL];
    int i, j, k;
    for(i=1;i<particlemax;i++)
    {
        if(particle[i].stable == 1) 
        {
            strcpy(filename,outdir);
            strcpy(filename2,outdir);
            strcat(filename, "/spec_");
            strcat(filename2, "/PT_");
            if(particle[i].mcID < 0)
            {
                strcat(filename,"A");
                strcat(filename2, "A");
            }
            convei(abs(particle[i].mcID),p);
            strcat(filename,p);
            strcat(filename2,p);
            strcat(filename,".dat");
            strcat(filename2, ".dat");
            printf(" Produce %s \n", filename);
            printf(" Produce %s \n", filename2);
            out = fopen(filename,"w");
            out2 = fopen(filename2, "w");
            for(k=0;k<particle[i].nphi;k++) 
            {
                for(j=0;j<particle[i].npT;j++)
                {
                    fprintf(out," %11.4lE", particle[i].dNdypTdpTdphi[j][k]);
                }
                fprintf(out,"\n");
            }
            for(j=0;j<particle[i].npT;j++)
            {
                fprintf(out2," %11.4lE", particle[i].pt[j]);
            }
            fprintf(out2,"\n");
            fclose(out);
            fclose(out2);
        }
    }
}
void writeSpectra ( int particlemax , char outdir [ FILEDIM ] ) { FILE * out , * out2 ; char filename [ FILEDIM ] ; char filename2 [ FILEDIM ] ; char p [ SSL ] ; int i , j , k ; for ( i = 1 ; i < particlemax ; i ++ ) { if ( particle [ i ] . stable == 1 ) { strcpy ( filename , outdir ) ; strcpy ( filename2 , outdir ) ; strcat ( filename , " " ) ; strcat ( filename2 , " " ) ; if ( particle [ i ] . mcID < 0 ) { strcat ( filename , " " ) ; strcat ( filename2 , " " ) ; } convei ( abs ( particle [ i ] . mcID ) , p ) ; strcat ( filename , p ) ; strcat ( filename2 , p ) ; strcat ( filename , " " ) ; strcat ( filename2 , " " ) ; printf ( " \n " , filename ) ; printf ( " \n " , filename2 ) ; out = fopen ( filename , " " ) ; out2 = fopen ( filename2 , " " ) ; for ( k = 0 ; k < particle [ i ] . nphi ; k ++ ) { for ( j = 0 ; j < particle [ i ] . npT ; j ++ ) { fprintf ( out , " " , particle [ i ] . dNdypTdpTdphi [ j ] [ k ] ) ; } fprintf ( out , " \n " ) ; } for ( j = 0 ; j < particle [ i ] . npT ; j ++ ) { fprintf ( out2 , " " , particle [ i ] . pt [ j ] ) ; } fprintf ( out2 , " \n " ) ; fclose ( out ) ; fclose ( out2 ) ; } } }
After calculating the spectra in the decay routines, this routine writes that data to file.
After calculating the spectra in the decay routines this routine writes that data to file .
// Cycle through the particles
 //Only print out the stable particles
 //Print out the desired data.
