Merging results from different jobs

When running an application you may get a table of the different types of results. It is usual that you run different jobs with the same setup to accumulate statistics or with different setups to study the dependency of your results with some parameters. In the analysis directory of your GAMOS distribution there are specific utilities for specific outputs, for example, RTPhaseSpace/sumPS, RTDose/sumSqdose, RTDose/sum3ddose, Shielding/sumScores, Shielding/sumActivation, NuclMed/PET/sumProjdata; they are described in the corresponding section of this manual. In this section we will describe an utility to analyse the output tables produced from various runs (extract, sum or compare results) and also how to merge and analyse the output files of good events

If you have run one or several jobs and produced a table with the statistics of good events, we describe here an utility that allows to process these results and present them in a more convenient way. This utiltiy analyses the files containing the output tables and allows you to extract the desired numbers out of them and present them together in a single table, with the possibility to add the numbers from different tables. We will describe the steps you should follow to do this and illustrate them with an example.

The first thing you should do is to write a file that describe what you want to do with the output files. In the first section of this file you should list the names of the files to be used. For each file there should be a line containing two words: the first must be :FILE_TXT and the second the file name. For example if you have run three jobs with three different energy resolution values, you may put in your file


      :FILE_TXT out.pet.5 
      :FILE_TXT out.pet.10 
      :FILE_TXT out.pet.15
    

After this you should describe the actions to be taken. Several actions can be done, for each one you have to write a line in which you describe which lines are going to be processed, which words in these lines and which action is done (print value, sum values from different files, ..)

In this action line you should first describe the criteria to identify which lines in each file are to be processed. This can be done by setting which words in the line are going to be looked for. Instead of setting the full word one can set the starting characters (prefix) or the ending characters (suffix). To set the list of prefixes you add the words:

:PRE or :PREFIX followed by a list of pairs: word position numbers and word characters. For example


      :PRE 1 Events 2 PET 
    

will look for the lines in which the first word starts by Events and the second word starts by PET.

In a similar way it can be done with the suffixes:

:SUF or :SUFFIX followed by a list of pairs: word position numbers and word characters.

If there are several lines in a file satisfying the prefix and suffix conditions, you may set that only one line or a few of them are processed, by using the word :L or :LINE followed by the list of numbers corresponding to the time order the line appears. For example:


      :PRE 1 Events 2 PET :L 1
    

will only process the first line found.

Then you have to define which are the words in the line that are going to be processed by using the word :W or :WORD followed by the list of numbers of the words in the lines. For example:


      :PRE 1 Events 2 PET :L 1 :W 3 4 
    

will process the third and fourth words of the lines selected.

After you have to define the kind of treatment to be done to the words, by using the word :T or :TREATMENT followed by the treatment type. For example:


      :PRE 1 Events 2 PET :L 1 :W 3 4 :T PT
    

The treatment type can be one of the following ones:

Finally you may write a message that will be printed together with the results, that may serve you to identify the output. For example:


      :PRE 1 Events 2 PET :L 1 :W 3 4 :T PT :M PET_EVENTS
    

Example of Analysing text output files

As an example of this utility, we will analyse three PET output files and extract some information from the table of PET events classification. Let's take an output file with a table similar to this one:


      ---------------------------------------------
      Events PET               :  862   8.62 % 
      --------------- Good PET -------------
      ALL                          :  93   0.93 % 
      (   1) PET 2 recHits close to vtx   :  0   0 % 
      (   2) PET 2 recHits far from vtx   :  93   0.93 % 
      (  11) PET 3->2 recHit close to vtx :  0   0 % 
      (  12) PET 3->2 recHit far from vtx :  0   0 % 
      --------------- Random Coincidences -------------
      ALL                          :  769   7.69 % 
      ( 101) PET 2 recHits close to vtx   :  0   0 % 
      ( 102) PET 2 recHits far from vtx   :  769   7.69 % 
      ( 111) PET 3->2 recHit close to vtx :  0   0 % 
      ( 112) PET 3->2 recHit far from vtx :  0   0 % 
      ...
    

We have three files that we have run with different random seeds and we want to extract the following information:

The file to obtain these results, that we name anaout.is: may look like this:


      :FILE_TXT out.exercise3c.1
      :FILE_TXT out.exercise3c.2
      :FILE_TXT out.exercise3c.3
      :PRE 1 Events 2 PET :W 4 :T S :M "Events"
      :PRE 1 ALL :L 1 :W 3 :T M :M "Good PET Events"
      :PRE 1 ALL :L 2 :W 3 :T PT :M "Mean Random coincidences PET Events"
    

And if you run the command:

analysOutput anaout.lis

Then you may get a result like this:


Events 2596 
Good PET Events 92.6667 
Mean Random coincidences PET Events      769      765      763