*-------------------------------------------------------------------* * Computes using Heed cluster statistics for a 4 mm long, 1GeV/c * * pion-minus track. for Tohoku setup. * * The cell is not actually used in this example, but is * * required to enter the drift section. The same is true for the * * gas transport properties computed with Magboltz. * *-------------------------------------------------------------------* &CELL pl x -1 pl x +1 period y 1 rows s * * 0 0 1000 &GAS Global gasfile `GAS_CF4.DAT` Call inquire_file(gasfile,exist) If exist Then Get {gasfile} Else magboltz CF4 100 Write {gasfile} Endif heed CF4 100 opt gas-print > GAS_CF4.print &MAIN > -------------------------------------------------------------------* * Compute the cluster statistics, using NEW_TRACK and GET_CLUSTER. * *-------------------------------------------------------------------* &DRIFT Global trackfile `heed_CF4_4mm.txt` track 0 1 0 0.4 1 0 ... pion-minus energy 870.6 MeV multiple-scattering nodelta ***** nodelta DOES NOT MEAN no delta-electrons at all. ***** see manual for detailed information. Call book_histogram(size,100,0,100) Call book_histogram(clusters,50,0,500,`auto,integer`) Call book_histogram(ehist,50,0,100) Call book_histogram(etothist,100,0,20000) Call book_histogram(eneperpair,100,0,200) Call book_histogram(eneperclus,100,0,500) Call book_histogram(his_ntot,300,0,300) Global done=False > {trackfile} For i From 1 To 10000 Do SAY "NEW TRACK " Call new_track Global etot=0 Global ncl=0 Global ntot =0 Until done Do Call get_cluster(xcls,ycls,zcls,npair,ecls,done) if ( done ) Then Iterate Call fill_histogram(size,npair) Call fill_histogram(ehist,ecls*1e6) If npair > 0 Then Call fill_histogram(eneperpair,ecls*1e6/npair) Call fill_histogram(eneperclus,ecls*1e6) Global etot=etot+ecls*1e6 Global ncl=ncl+1 Global ntot=ntot+npair * SAY " xcls {xcls}, zcls {zcls}, ecls {ecls*1e6} eV, npair {npair}" Enddo Call fill_histogram(etothist,etot) Call fill_histogram(clusters,ncl) Call fill_histogram(his_ntot,ntot) Say "ETOT {etot} NTOT {ntot}" Enddo > *-------------------------------------------------------------------* * Plot the histograms and save them in a PS file. * *-------------------------------------------------------------------* !add meta type PostScript file-name "heed_stat.ps" !open meta !act meta !opt log-y Call plot_histogram(size,`Cluster size`,`Cluster size distribution`) !opt lin-y Call plot_histogram(ehist,`Energy [eV]`,`Energy per cluster`) Call plot_histogram(etothist,`Energy loss [eV]`,`Energy loss per 4 mm`) Call plot_histogram(clusters,`Cluster count`,`Clusters per 4 mm`) Call plot_histogram(eneperpair,`Energy per pair`,`ene`) Call plot_histogram(eneperclus,`Energy per cluster`,`ene`) Call plot_histogram(his_ntot,`Number of pairs`,`Number of pairs`) !deact meta !close meta !del meta