#!/usr/bin/perl # y % mean p_x (y) $dy=.1; while(<>) { @stuff=split(' '); if(/UQMD/){ } elsif(/projectile:/){ $protar=$_ } elsif(/equation_of_state:/){ $ecm=$stuff[5]; $elab=$stuff[3]; $plab=$stuff[7]; } elsif(/event#/){ $noe++ &nbs p; # numbers of events: noe } else{ if($#stuff==14||$#stuff==13){ @x=@stuff[0..3]; @p=@stuff[4..7]; @id=@stuff[8..11]; $mass=$id[0]; $ityp=$id[1]; $iz2=$id[2]; $charge=$id[3]; # ab hier steht folgende info zur verfuegung: # stuff[0] = r_0 = $x[0] # stuff[1] = r_x = $x[1] # stuff[2] = r_y . # stuff[3] = r_z . # stuff[4] = p_0 = $p[0] # stuff[5] = p_x = $p[1] # stuff[6] = p_y . # stuff[7] = p_z . # stuff[8] = mass = $id[0] # stuff[9] = ityp = $id[1] # stuff[10]= iz2 = $id[2] # stuff[11]= charge = $id[3] if ($id[1]== 40){ #if ($ityp== 40 ){ # if ($ityp==1 && $charge==1){ $number++; $pp=sqrt($p[1]*$p[1]+$p[2]*$p[2]+$p[3]*$p[3]); $y=0.5*log(($pp+$p[3])/($pp-$p[3])); $ymin=-4.05; $iy=int(($y-$ymin)/$dy); $n[$iy]++; $symfac=1; if ($sym==1){ $symfac=2; $number++; $y=-0.5*log(($p[0]+$p[3])/($p[0]-$p[3])); $ymin=-20; $iy=int(($y-$ymin)/$dy); $n[$iy]++; } } } } } $midy=0; open(file, ">ausgabe.txt"); print file ("! ",$protar); print file ("!number/event:",$number/$noe," ,ev:",$noe,"\n"); print file ("\n"); print file ("r_0"," ","r_x"," ","r_y"," ","r_z"," ","p_0"," ","p_x"," ","p_y"," ","p_z"," ","mass"," ","ityp"," ","iz2"," ","charge"," \n"); foreach $i(0 .. $#n){ print file ($x[0]," ",$x[1]," ",$x[2]," ",$x[3]," ",$p[0]," ",$p[1]," ",$p[2]," ",$p[3]," ",$id[0]," ",$id[1]," ",$id[2]," ",$id[3],"\n") } close (file);