Index: trunk/MagicSoft/MarsOctober/Data/GeomPixel.dat
===================================================================
--- trunk/MagicSoft/MarsOctober/Data/GeomPixel.dat	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Data/GeomPixel.dat	(revision 447)
@@ -0,0 +1,577 @@
+ID:      0         0.0000       0.0000       0.0000
+ID:      1        30.0000       0.0000       3.0000
+ID:      2        15.0000      25.9808       3.0000
+ID:      3       -15.0000      25.9808       3.0000
+ID:      4       -30.0000       0.0000       3.0000
+ID:      5       -15.0000     -25.9808       3.0000
+ID:      6        15.0000     -25.9808       3.0000
+ID:      7        60.0000       0.0000       3.0000
+ID:      8        45.0000      25.9808       3.0000
+ID:      9        30.0000      51.9615       3.0000
+ID:     10         0.0000      51.9615       3.0000
+ID:     11       -30.0000      51.9615       3.0000
+ID:     12       -45.0000      25.9808       3.0000
+ID:     13       -60.0000       0.0000       3.0000
+ID:     14       -45.0000     -25.9808       3.0000
+ID:     15       -30.0000     -51.9615       3.0000
+ID:     16         0.0000     -51.9615       3.0000
+ID:     17        30.0000     -51.9615       3.0000
+ID:     18        45.0000     -25.9808       3.0000
+ID:     19        90.0000       0.0000       3.0000
+ID:     20        75.0000      25.9808       3.0000
+ID:     21        60.0000      51.9615       3.0000
+ID:     22        45.0000      77.9423       3.0000
+ID:     23        15.0000      77.9423       3.0000
+ID:     24       -15.0000      77.9423       3.0000
+ID:     25       -45.0000      77.9423       3.0000
+ID:     26       -60.0000      51.9615       3.0000
+ID:     27       -75.0000      25.9808       3.0000
+ID:     28       -90.0000       0.0000       3.0000
+ID:     29       -75.0000     -25.9808       3.0000
+ID:     30       -60.0000     -51.9615       3.0000
+ID:     31       -45.0000     -77.9423       3.0000
+ID:     32       -15.0000     -77.9423       3.0000
+ID:     33        15.0000     -77.9423       3.0000
+ID:     34        45.0000     -77.9423       3.0000
+ID:     35        60.0000     -51.9615       3.0000
+ID:     36        75.0000     -25.9808       3.0000
+ID:     37       120.0000       0.0000       3.0000
+ID:     38       105.0000      25.9808       3.0000
+ID:     39        90.0000      51.9615       3.0000
+ID:     40        75.0000      77.9423       3.0000
+ID:     41        60.0000     103.9230       3.0000
+ID:     42        30.0000     103.9230       3.0000
+ID:     43         0.0000     103.9230       3.0000
+ID:     44       -30.0000     103.9230       3.0000
+ID:     45       -60.0000     103.9230       3.0000
+ID:     46       -75.0000      77.9423       3.0000
+ID:     47       -90.0000      51.9615       3.0000
+ID:     48      -105.0000      25.9808       3.0000
+ID:     49      -120.0000       0.0000       3.0000
+ID:     50      -105.0000     -25.9808       3.0000
+ID:     51       -90.0000     -51.9615       3.0000
+ID:     52       -75.0000     -77.9423       3.0000
+ID:     53       -60.0000    -103.9230       3.0000
+ID:     54       -30.0000    -103.9230       3.0000
+ID:     55         0.0000    -103.9230       3.0000
+ID:     56        30.0000    -103.9230       3.0000
+ID:     57        60.0000    -103.9230       3.0000
+ID:     58        75.0000     -77.9423       3.0000
+ID:     59        90.0000     -51.9615       3.0000
+ID:     60       105.0000     -25.9808       3.0000
+ID:     61       150.0000       0.0000       3.0000
+ID:     62       135.0000      25.9808       3.0000
+ID:     63       120.0000      51.9615       3.0000
+ID:     64       105.0000      77.9423       3.0000
+ID:     65        90.0000     103.9230       3.0000
+ID:     66        75.0000     129.9038       3.0000
+ID:     67        45.0000     129.9038       3.0000
+ID:     68        15.0000     129.9038       3.0000
+ID:     69       -15.0000     129.9038       3.0000
+ID:     70       -45.0000     129.9038       3.0000
+ID:     71       -75.0000     129.9038       3.0000
+ID:     72       -90.0000     103.9230       3.0000
+ID:     73      -105.0000      77.9423       3.0000
+ID:     74      -120.0000      51.9615       3.0000
+ID:     75      -135.0000      25.9808       3.0000
+ID:     76      -150.0000       0.0000       3.0000
+ID:     77      -135.0000     -25.9808       3.0000
+ID:     78      -120.0000     -51.9615       3.0000
+ID:     79      -105.0000     -77.9423       3.0000
+ID:     80       -90.0000    -103.9230       3.0000
+ID:     81       -75.0000    -129.9038       3.0000
+ID:     82       -45.0000    -129.9038       3.0000
+ID:     83       -15.0000    -129.9038       3.0000
+ID:     84        15.0000    -129.9038       3.0000
+ID:     85        45.0000    -129.9038       3.0000
+ID:     86        75.0000    -129.9038       3.0000
+ID:     87        90.0000    -103.9230       3.0000
+ID:     88       105.0000     -77.9423       3.0000
+ID:     89       120.0000     -51.9615       3.0000
+ID:     90       135.0000     -25.9808       3.0000
+ID:     91       180.0000       0.0000       3.0000
+ID:     92       165.0000      25.9808       3.0000
+ID:     93       150.0000      51.9615       3.0000
+ID:     94       135.0000      77.9423       3.0000
+ID:     95       120.0000     103.9230       3.0000
+ID:     96       105.0000     129.9038       3.0000
+ID:     97        90.0000     155.8846       3.0000
+ID:     98        60.0000     155.8846       3.0000
+ID:     99        30.0000     155.8846       3.0000
+ID:    100         0.0000     155.8846       3.0000
+ID:    101       -30.0000     155.8846       3.0000
+ID:    102       -60.0000     155.8846       3.0000
+ID:    103       -90.0000     155.8846       3.0000
+ID:    104      -105.0000     129.9038       3.0000
+ID:    105      -120.0000     103.9230       3.0000
+ID:    106      -135.0000      77.9423       3.0000
+ID:    107      -150.0000      51.9615       3.0000
+ID:    108      -165.0000      25.9808       3.0000
+ID:    109      -180.0000       0.0000       3.0000
+ID:    110      -165.0000     -25.9808       3.0000
+ID:    111      -150.0000     -51.9615       3.0000
+ID:    112      -135.0000     -77.9423       3.0000
+ID:    113      -120.0000    -103.9230       3.0000
+ID:    114      -105.0000    -129.9038       3.0000
+ID:    115       -90.0000    -155.8846       3.0000
+ID:    116       -60.0000    -155.8846       3.0000
+ID:    117       -30.0000    -155.8846       3.0000
+ID:    118         0.0000    -155.8846       3.0000
+ID:    119        30.0000    -155.8846       3.0000
+ID:    120        60.0000    -155.8846       3.0000
+ID:    121        90.0000    -155.8846       3.0000
+ID:    122       105.0000    -129.9038       3.0000
+ID:    123       120.0000    -103.9230       3.0000
+ID:    124       135.0000     -77.9423       3.0000
+ID:    125       150.0000     -51.9615       3.0000
+ID:    126       165.0000     -25.9808       3.0000
+ID:    127       210.0000       0.0000       3.0000
+ID:    128       195.0000      25.9808       3.0000
+ID:    129       180.0000      51.9615       3.0000
+ID:    130       165.0000      77.9423       3.0000
+ID:    131       150.0000     103.9230       3.0000
+ID:    132       135.0000     129.9038       3.0000
+ID:    133       120.0000     155.8846       3.0000
+ID:    134       105.0000     181.8653       3.0000
+ID:    135        75.0000     181.8653       3.0000
+ID:    136        45.0000     181.8653       3.0000
+ID:    137        15.0000     181.8653       3.0000
+ID:    138       -15.0000     181.8653       3.0000
+ID:    139       -45.0000     181.8653       3.0000
+ID:    140       -75.0000     181.8653       3.0000
+ID:    141      -105.0000     181.8653       3.0000
+ID:    142      -120.0000     155.8846       3.0000
+ID:    143      -135.0000     129.9038       3.0000
+ID:    144      -150.0000     103.9230       3.0000
+ID:    145      -165.0000      77.9423       3.0000
+ID:    146      -180.0000      51.9615       3.0000
+ID:    147      -195.0000      25.9808       3.0000
+ID:    148      -210.0000       0.0000       3.0000
+ID:    149      -195.0000     -25.9808       3.0000
+ID:    150      -180.0000     -51.9615       3.0000
+ID:    151      -165.0000     -77.9423       3.0000
+ID:    152      -150.0000    -103.9230       3.0000
+ID:    153      -135.0000    -129.9038       3.0000
+ID:    154      -120.0000    -155.8846       3.0000
+ID:    155      -105.0000    -181.8653       3.0000
+ID:    156       -75.0000    -181.8653       3.0000
+ID:    157       -45.0000    -181.8653       3.0000
+ID:    158       -15.0000    -181.8653       3.0000
+ID:    159        15.0000    -181.8653       3.0000
+ID:    160        45.0000    -181.8653       3.0000
+ID:    161        75.0000    -181.8653       3.0000
+ID:    162       105.0000    -181.8653       3.0000
+ID:    163       120.0000    -155.8846       3.0000
+ID:    164       135.0000    -129.9038       3.0000
+ID:    165       150.0000    -103.9230       3.0000
+ID:    166       165.0000     -77.9423       3.0000
+ID:    167       180.0000     -51.9615       3.0000
+ID:    168       195.0000     -25.9808       3.0000
+ID:    169       240.0000       0.0000       3.0000
+ID:    170       225.0000      25.9808       3.0000
+ID:    171       210.0000      51.9615       3.0000
+ID:    172       195.0000      77.9423       3.0000
+ID:    173       180.0000     103.9230       3.0000
+ID:    174       165.0000     129.9038       3.0000
+ID:    175       150.0000     155.8846       3.0000
+ID:    176       135.0000     181.8653       3.0000
+ID:    177       120.0000     207.8461       3.0000
+ID:    178        90.0000     207.8461       3.0000
+ID:    179        60.0000     207.8461       3.0000
+ID:    180        30.0000     207.8461       3.0000
+ID:    181         0.0000     207.8461       3.0000
+ID:    182       -30.0000     207.8461       3.0000
+ID:    183       -60.0000     207.8461       3.0000
+ID:    184       -90.0000     207.8461       3.0000
+ID:    185      -120.0000     207.8461       3.0000
+ID:    186      -135.0000     181.8653       3.0000
+ID:    187      -150.0000     155.8846       3.0000
+ID:    188      -165.0000     129.9038       3.0000
+ID:    189      -180.0000     103.9230       3.0000
+ID:    190      -195.0000      77.9423       3.0000
+ID:    191      -210.0000      51.9615       3.0000
+ID:    192      -225.0000      25.9808       3.0000
+ID:    193      -240.0000       0.0000       3.0000
+ID:    194      -225.0000     -25.9808       3.0000
+ID:    195      -210.0000     -51.9615       3.0000
+ID:    196      -195.0000     -77.9423       3.0000
+ID:    197      -180.0000    -103.9230       3.0000
+ID:    198      -165.0000    -129.9038       3.0000
+ID:    199      -150.0000    -155.8846       3.0000
+ID:    200      -135.0000    -181.8653       3.0000
+ID:    201      -120.0000    -207.8461       3.0000
+ID:    202       -90.0000    -207.8461       3.0000
+ID:    203       -60.0000    -207.8461       3.0000
+ID:    204       -30.0000    -207.8461       3.0000
+ID:    205         0.0000    -207.8461       3.0000
+ID:    206        30.0000    -207.8461       3.0000
+ID:    207        60.0000    -207.8461       3.0000
+ID:    208        90.0000    -207.8461       3.0000
+ID:    209       120.0000    -207.8461       3.0000
+ID:    210       135.0000    -181.8653       3.0000
+ID:    211       150.0000    -155.8846       3.0000
+ID:    212       165.0000    -129.9038       3.0000
+ID:    213       180.0000    -103.9230       3.0000
+ID:    214       195.0000     -77.9423       3.0000
+ID:    215       210.0000     -51.9615       3.0000
+ID:    216       225.0000     -25.9808       3.0000
+ID:    217       270.0000       0.0000       3.0000
+ID:    218       255.0000      25.9808       3.0000
+ID:    219       240.0000      51.9615       3.0000
+ID:    220       225.0000      77.9423       3.0000
+ID:    221       210.0000     103.9230       3.0000
+ID:    222       195.0000     129.9038       3.0000
+ID:    223       180.0000     155.8846       3.0000
+ID:    224       165.0000     181.8653       3.0000
+ID:    225       150.0000     207.8461       3.0000
+ID:    226       135.0000     233.8269       3.0000
+ID:    227       105.0000     233.8269       3.0000
+ID:    228        75.0000     233.8269       3.0000
+ID:    229        45.0000     233.8269       3.0000
+ID:    230        15.0000     233.8269       3.0000
+ID:    231       -15.0000     233.8269       3.0000
+ID:    232       -45.0000     233.8269       3.0000
+ID:    233       -75.0000     233.8269       3.0000
+ID:    234      -105.0000     233.8269       3.0000
+ID:    235      -135.0000     233.8269       3.0000
+ID:    236      -150.0000     207.8461       3.0000
+ID:    237      -165.0000     181.8653       3.0000
+ID:    238      -180.0000     155.8846       3.0000
+ID:    239      -195.0000     129.9038       3.0000
+ID:    240      -210.0000     103.9230       3.0000
+ID:    241      -225.0000      77.9423       3.0000
+ID:    242      -240.0000      51.9615       3.0000
+ID:    243      -255.0000      25.9808       3.0000
+ID:    244      -270.0000       0.0000       3.0000
+ID:    245      -255.0000     -25.9808       3.0000
+ID:    246      -240.0000     -51.9615       3.0000
+ID:    247      -225.0000     -77.9423       3.0000
+ID:    248      -210.0000    -103.9230       3.0000
+ID:    249      -195.0000    -129.9038       3.0000
+ID:    250      -180.0000    -155.8846       3.0000
+ID:    251      -165.0000    -181.8653       3.0000
+ID:    252      -150.0000    -207.8461       3.0000
+ID:    253      -135.0000    -233.8269       3.0000
+ID:    254      -105.0000    -233.8269       3.0000
+ID:    255       -75.0000    -233.8269       3.0000
+ID:    256       -45.0000    -233.8269       3.0000
+ID:    257       -15.0000    -233.8269       3.0000
+ID:    258        15.0000    -233.8269       3.0000
+ID:    259        45.0000    -233.8269       3.0000
+ID:    260        75.0000    -233.8269       3.0000
+ID:    261       105.0000    -233.8269       3.0000
+ID:    262       135.0000    -233.8269       3.0000
+ID:    263       150.0000    -207.8461       3.0000
+ID:    264       165.0000    -181.8653       3.0000
+ID:    265       180.0000    -155.8846       3.0000
+ID:    266       195.0000    -129.9038       3.0000
+ID:    267       210.0000    -103.9230       3.0000
+ID:    268       225.0000     -77.9423       3.0000
+ID:    269       240.0000     -51.9615       3.0000
+ID:    270       255.0000     -25.9808       3.0000
+ID:    271       300.0000       0.0000       3.0000
+ID:    272       285.0000      25.9808       3.0000
+ID:    273       270.0000      51.9615       3.0000
+ID:    274       255.0000      77.9423       3.0000
+ID:    275       240.0000     103.9230       3.0000
+ID:    276       225.0000     129.9038       3.0000
+ID:    277       210.0000     155.8846       3.0000
+ID:    278       195.0000     181.8653       3.0000
+ID:    279       180.0000     207.8461       3.0000
+ID:    280       165.0000     233.8269       3.0000
+ID:    281       150.0000     259.8076       3.0000
+ID:    282       120.0000     259.8076       3.0000
+ID:    283        90.0000     259.8076       3.0000
+ID:    284        60.0000     259.8076       3.0000
+ID:    285        30.0000     259.8076       3.0000
+ID:    286         0.0000     259.8076       3.0000
+ID:    287       -30.0000     259.8076       3.0000
+ID:    288       -60.0000     259.8076       3.0000
+ID:    289       -90.0000     259.8076       3.0000
+ID:    290      -120.0000     259.8076       3.0000
+ID:    291      -150.0000     259.8076       3.0000
+ID:    292      -165.0000     233.8269       3.0000
+ID:    293      -180.0000     207.8461       3.0000
+ID:    294      -195.0000     181.8653       3.0000
+ID:    295      -210.0000     155.8846       3.0000
+ID:    296      -225.0000     129.9038       3.0000
+ID:    297      -240.0000     103.9230       3.0000
+ID:    298      -255.0000      77.9423       3.0000
+ID:    299      -270.0000      51.9615       3.0000
+ID:    300      -285.0000      25.9808       3.0000
+ID:    301      -300.0000       0.0000       3.0000
+ID:    302      -285.0000     -25.9808       3.0000
+ID:    303      -270.0000     -51.9615       3.0000
+ID:    304      -255.0000     -77.9423       3.0000
+ID:    305      -240.0000    -103.9230       3.0000
+ID:    306      -225.0000    -129.9038       3.0000
+ID:    307      -210.0000    -155.8846       3.0000
+ID:    308      -195.0000    -181.8653       3.0000
+ID:    309      -180.0000    -207.8461       3.0000
+ID:    310      -165.0000    -233.8269       3.0000
+ID:    311      -150.0000    -259.8076       3.0000
+ID:    312      -120.0000    -259.8076       3.0000
+ID:    313       -90.0000    -259.8076       3.0000
+ID:    314       -60.0000    -259.8076       3.0000
+ID:    315       -30.0000    -259.8076       3.0000
+ID:    316         0.0000    -259.8076       3.0000
+ID:    317        30.0000    -259.8076       3.0000
+ID:    318        60.0000    -259.8076       3.0000
+ID:    319        90.0000    -259.8076       3.0000
+ID:    320       120.0000    -259.8076       3.0000
+ID:    321       150.0000    -259.8076       3.0000
+ID:    322       165.0000    -233.8269       3.0000
+ID:    323       180.0000    -207.8461       3.0000
+ID:    324       195.0000    -181.8653       3.0000
+ID:    325       210.0000    -155.8846       3.0000
+ID:    326       225.0000    -129.9038       3.0000
+ID:    327       240.0000    -103.9230       3.0000
+ID:    328       255.0000     -77.9423       3.0000
+ID:    329       270.0000     -51.9615       3.0000
+ID:    330       285.0000     -25.9808       3.0000
+ID:    331       330.0000       0.0000       3.0000
+ID:    332       315.0000      25.9808       3.0000
+ID:    333       300.0000      51.9615       3.0000
+ID:    334       285.0000      77.9423       3.0000
+ID:    335       270.0000     103.9230       3.0000
+ID:    336       255.0000     129.9038       3.0000
+ID:    337       240.0000     155.8846       3.0000
+ID:    338       225.0000     181.8653       3.0000
+ID:    339       210.0000     207.8461       3.0000
+ID:    340       195.0000     233.8269       3.0000
+ID:    341       180.0000     259.8076       3.0000
+ID:    342       165.0000     285.7884       3.0000
+ID:    343       135.0000     285.7884       3.0000
+ID:    344       105.0000     285.7884       3.0000
+ID:    345        75.0000     285.7884       3.0000
+ID:    346        45.0000     285.7884       3.0000
+ID:    347        15.0000     285.7884       3.0000
+ID:    348       -15.0000     285.7884       3.0000
+ID:    349       -45.0000     285.7884       3.0000
+ID:    350       -75.0000     285.7884       3.0000
+ID:    351      -105.0000     285.7884       3.0000
+ID:    352      -135.0000     285.7884       3.0000
+ID:    353      -165.0000     285.7884       3.0000
+ID:    354      -180.0000     259.8076       3.0000
+ID:    355      -195.0000     233.8269       3.0000
+ID:    356      -210.0000     207.8461       3.0000
+ID:    357      -225.0000     181.8653       3.0000
+ID:    358      -240.0000     155.8846       3.0000
+ID:    359      -255.0000     129.9038       3.0000
+ID:    360      -270.0000     103.9230       3.0000
+ID:    361      -285.0000      77.9423       3.0000
+ID:    362      -300.0000      51.9615       3.0000
+ID:    363      -315.0000      25.9808       3.0000
+ID:    364      -330.0000       0.0000       3.0000
+ID:    365      -315.0000     -25.9808       3.0000
+ID:    366      -300.0000     -51.9615       3.0000
+ID:    367      -285.0000     -77.9423       3.0000
+ID:    368      -270.0000    -103.9230       3.0000
+ID:    369      -255.0000    -129.9038       3.0000
+ID:    370      -240.0000    -155.8846       3.0000
+ID:    371      -225.0000    -181.8653       3.0000
+ID:    372      -210.0000    -207.8461       3.0000
+ID:    373      -195.0000    -233.8269       3.0000
+ID:    374      -180.0000    -259.8076       3.0000
+ID:    375      -165.0000    -285.7884       3.0000
+ID:    376      -135.0000    -285.7884       3.0000
+ID:    377      -105.0000    -285.7884       3.0000
+ID:    378       -75.0000    -285.7884       3.0000
+ID:    379       -45.0000    -285.7884       3.0000
+ID:    380       -15.0000    -285.7884       3.0000
+ID:    381        15.0000    -285.7884       3.0000
+ID:    382        45.0000    -285.7884       3.0000
+ID:    383        75.0000    -285.7884       3.0000
+ID:    384       105.0000    -285.7884       3.0000
+ID:    385       135.0000    -285.7884       3.0000
+ID:    386       165.0000    -285.7884       3.0000
+ID:    387       180.0000    -259.8076       3.0000
+ID:    388       195.0000    -233.8269       3.0000
+ID:    389       210.0000    -207.8461       3.0000
+ID:    390       225.0000    -181.8653       3.0000
+ID:    391       240.0000    -155.8846       3.0000
+ID:    392       255.0000    -129.9038       3.0000
+ID:    393       270.0000    -103.9230       3.0000
+ID:    394       285.0000     -77.9423       3.0000
+ID:    395       300.0000     -51.9615       3.0000
+ID:    396       315.0000     -25.9808       3.0000
+ID:    397       360.0000      34.6410       6.0000
+ID:    398       330.0000      86.6025       6.0000
+ID:    399       300.0000     138.5641       6.0000
+ID:    400       270.0000     190.5256       6.0000
+ID:    401       240.0000     242.4871       6.0000
+ID:    402       210.0000     294.4486       6.0000
+ID:    403       150.0000     329.0897       6.0000
+ID:    404        90.0000     329.0897       6.0000
+ID:    405        30.0000     329.0897       6.0000
+ID:    406       -30.0000     329.0897       6.0000
+ID:    407       -90.0000     329.0897       6.0000
+ID:    408      -150.0000     329.0897       6.0000
+ID:    409      -210.0000     294.4486       6.0000
+ID:    410      -240.0000     242.4871       6.0000
+ID:    411      -270.0000     190.5256       6.0000
+ID:    412      -300.0000     138.5641       6.0000
+ID:    413      -330.0000      86.6025       6.0000
+ID:    414      -360.0000      34.6410       6.0000
+ID:    415      -360.0000     -34.6410       6.0000
+ID:    416      -330.0000     -86.6025       6.0000
+ID:    417      -300.0000    -138.5641       6.0000
+ID:    418      -270.0000    -190.5256       6.0000
+ID:    419      -240.0000    -242.4871       6.0000
+ID:    420      -210.0000    -294.4486       6.0000
+ID:    421      -150.0000    -329.0897       6.0000
+ID:    422       -90.0000    -329.0897       6.0000
+ID:    423       -30.0000    -329.0897       6.0000
+ID:    424        30.0000    -329.0897       6.0000
+ID:    425        90.0000    -329.0897       6.0000
+ID:    426       150.0000    -329.0897       6.0000
+ID:    427       210.0000    -294.4486       6.0000
+ID:    428       240.0000    -242.4871       6.0000
+ID:    429       270.0000    -190.5256       6.0000
+ID:    430       300.0000    -138.5641       6.0000
+ID:    431       330.0000     -86.6025       6.0000
+ID:    432       360.0000     -34.6410       6.0000
+ID:    433       420.0000      34.6410       6.0000
+ID:    434       390.0000      86.6025       6.0000
+ID:    435       360.0000     138.5641       6.0000
+ID:    436       330.0000     190.5256       6.0000
+ID:    437       300.0000     242.4871       6.0000
+ID:    438       270.0000     294.4486       6.0000
+ID:    439       240.0000     346.4102       6.0000
+ID:    440       180.0000     381.0512       6.0000
+ID:    441       120.0000     381.0512       6.0000
+ID:    442        60.0000     381.0512       6.0000
+ID:    443         0.0000     381.0512       6.0000
+ID:    444       -60.0000     381.0512       6.0000
+ID:    445      -120.0000     381.0512       6.0000
+ID:    446      -180.0000     381.0512       6.0000
+ID:    447      -240.0000     346.4102       6.0000
+ID:    448      -270.0000     294.4486       6.0000
+ID:    449      -300.0000     242.4871       6.0000
+ID:    450      -330.0000     190.5256       6.0000
+ID:    451      -360.0000     138.5641       6.0000
+ID:    452      -390.0000      86.6025       6.0000
+ID:    453      -420.0000      34.6410       6.0000
+ID:    454      -420.0000     -34.6410       6.0000
+ID:    455      -390.0000     -86.6025       6.0000
+ID:    456      -360.0000    -138.5641       6.0000
+ID:    457      -330.0000    -190.5256       6.0000
+ID:    458      -300.0000    -242.4871       6.0000
+ID:    459      -270.0000    -294.4486       6.0000
+ID:    460      -240.0000    -346.4102       6.0000
+ID:    461      -180.0000    -381.0512       6.0000
+ID:    462      -120.0000    -381.0512       6.0000
+ID:    463       -60.0000    -381.0512       6.0000
+ID:    464         0.0000    -381.0512       6.0000
+ID:    465        60.0000    -381.0512       6.0000
+ID:    466       120.0000    -381.0512       6.0000
+ID:    467       180.0000    -381.0512       6.0000
+ID:    468       240.0000    -346.4102       6.0000
+ID:    469       270.0000    -294.4486       6.0000
+ID:    470       300.0000    -242.4871       6.0000
+ID:    471       330.0000    -190.5256       6.0000
+ID:    472       360.0000    -138.5641       6.0000
+ID:    473       390.0000     -86.6025       6.0000
+ID:    474       420.0000     -34.6410       6.0000
+ID:    475       480.0000      34.6410       6.0000
+ID:    476       450.0000      86.6025       6.0000
+ID:    477       420.0000     138.5641       6.0000
+ID:    478       390.0000     190.5256       6.0000
+ID:    479       360.0000     242.4871       6.0000
+ID:    480       330.0000     294.4486       6.0000
+ID:    481       300.0000     346.4102       6.0000
+ID:    482       270.0000     398.3717       6.0000
+ID:    483       210.0000     433.0127       6.0000
+ID:    484       150.0000     433.0127       6.0000
+ID:    485        90.0000     433.0127       6.0000
+ID:    486        30.0000     433.0127       6.0000
+ID:    487       -30.0000     433.0127       6.0000
+ID:    488       -90.0000     433.0127       6.0000
+ID:    489      -150.0000     433.0127       6.0000
+ID:    490      -210.0000     433.0127       6.0000
+ID:    491      -270.0000     398.3717       6.0000
+ID:    492      -300.0000     346.4102       6.0000
+ID:    493      -330.0000     294.4486       6.0000
+ID:    494      -360.0000     242.4871       6.0000
+ID:    495      -390.0000     190.5256       6.0000
+ID:    496      -420.0000     138.5641       6.0000
+ID:    497      -450.0000      86.6025       6.0000
+ID:    498      -480.0000      34.6410       6.0000
+ID:    499      -480.0000     -34.6410       6.0000
+ID:    500      -450.0000     -86.6025       6.0000
+ID:    501      -420.0000    -138.5641       6.0000
+ID:    502      -390.0000    -190.5256       6.0000
+ID:    503      -360.0000    -242.4871       6.0000
+ID:    504      -330.0000    -294.4486       6.0000
+ID:    505      -300.0000    -346.4102       6.0000
+ID:    506      -270.0000    -398.3717       6.0000
+ID:    507      -210.0000    -433.0127       6.0000
+ID:    508      -150.0000    -433.0127       6.0000
+ID:    509       -90.0000    -433.0127       6.0000
+ID:    510       -30.0000    -433.0127       6.0000
+ID:    511        30.0000    -433.0127       6.0000
+ID:    512        90.0000    -433.0127       6.0000
+ID:    513       150.0000    -433.0127       6.0000
+ID:    514       210.0000    -433.0127       6.0000
+ID:    515       270.0000    -398.3717       6.0000
+ID:    516       300.0000    -346.4102       6.0000
+ID:    517       330.0000    -294.4486       6.0000
+ID:    518       360.0000    -242.4871       6.0000
+ID:    519       390.0000    -190.5256       6.0000
+ID:    520       420.0000    -138.5641       6.0000
+ID:    521       450.0000     -86.6025       6.0000
+ID:    522       480.0000     -34.6410       6.0000
+ID:    523       540.0000      34.6410       6.0000
+ID:    524       510.0000      86.6025       6.0000
+ID:    525       480.0000     138.5641       6.0000
+ID:    526       450.0000     190.5256       6.0000
+ID:    527       420.0000     242.4871       6.0000
+ID:    528       390.0000     294.4486       6.0000
+ID:    529       360.0000     346.4102       6.0000
+ID:    530       330.0000     398.3717       6.0000
+ID:    531       300.0000     450.3332       6.0000
+ID:    532       240.0000     484.9742       6.0000
+ID:    533       180.0000     484.9742       6.0000
+ID:    534       120.0000     484.9742       6.0000
+ID:    535        60.0000     484.9742       6.0000
+ID:    536         0.0000     484.9742       6.0000
+ID:    537       -60.0000     484.9742       6.0000
+ID:    538      -120.0000     484.9742       6.0000
+ID:    539      -180.0000     484.9742       6.0000
+ID:    540      -240.0000     484.9742       6.0000
+ID:    541      -300.0000     450.3332       6.0000
+ID:    542      -330.0000     398.3717       6.0000
+ID:    543      -360.0000     346.4102       6.0000
+ID:    544      -390.0000     294.4486       6.0000
+ID:    545      -420.0000     242.4871       6.0000
+ID:    546      -450.0000     190.5256       6.0000
+ID:    547      -480.0000     138.5641       6.0000
+ID:    548      -510.0000      86.6025       6.0000
+ID:    549      -540.0000      34.6410       6.0000
+ID:    550      -540.0000     -34.6410       6.0000
+ID:    551      -510.0000     -86.6025       6.0000
+ID:    552      -480.0000    -138.5641       6.0000
+ID:    553      -450.0000    -190.5256       6.0000
+ID:    554      -420.0000    -242.4871       6.0000
+ID:    555      -390.0000    -294.4486       6.0000
+ID:    556      -360.0000    -346.4102       6.0000
+ID:    557      -330.0000    -398.3717       6.0000
+ID:    558      -300.0000    -450.3332       6.0000
+ID:    559      -240.0000    -484.9742       6.0000
+ID:    560      -180.0000    -484.9742       6.0000
+ID:    561      -120.0000    -484.9742       6.0000
+ID:    562       -60.0000    -484.9742       6.0000
+ID:    563         0.0000    -484.9742       6.0000
+ID:    564        60.0000    -484.9742       6.0000
+ID:    565       120.0000    -484.9742       6.0000
+ID:    566       180.0000    -484.9742       6.0000
+ID:    567       240.0000    -484.9742       6.0000
+ID:    568       300.0000    -450.3332       6.0000
+ID:    569       330.0000    -398.3717       6.0000
+ID:    570       360.0000    -346.4102       6.0000
+ID:    571       390.0000    -294.4486       6.0000
+ID:    572       420.0000    -242.4871       6.0000
+ID:    573       450.0000    -190.5256       6.0000
+ID:    574       480.0000    -138.5641       6.0000
+ID:    575       510.0000     -86.6025       6.0000
+ID:    576       540.0000     -34.6410       6.0000
Index: trunk/MagicSoft/MarsOctober/LinkDef.h
===================================================================
--- trunk/MagicSoft/MarsOctober/LinkDef.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/LinkDef.h	(revision 447)
@@ -0,0 +1,7 @@
+#ifdef __CINT__
+
+#pragma link off all globals;
+#pragma link off all classes;
+#pragma link off all functions;
+
+#endif
Index: trunk/MagicSoft/MarsOctober/Makefile
===================================================================
--- trunk/MagicSoft/MarsOctober/Makefile	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Makefile	(revision 447)
@@ -0,0 +1,87 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+include Makefile.conf.$(OSTYPE)
+include Makefile.conf.general
+
+# @endcode 
+
+# @code 
+
+PROGRAM = mars
+SOLIB   = mars.so
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I./ -I$(INCLUDE_MBASE) -I./mrootformat/ -I./mocttest/
+
+#
+#  ----->>>   mars libraries
+#
+
+MARS_LIB = -L./ -lmocttest -lmrootformat -lmbase 
+MARS_LIBB = libmbase.a libmocttest.a libmrootformat.a
+
+#------------------------------------------------------------------------------
+
+#.SILENT:
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+
+SRCFILES = 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) mars.o
+
+############################################################
+
+all: rmlib $(PROGRAM) $(SOLIB)
+
+$(PROGRAM): $(MARS_LIBB) $(OBJS) MCint.o 
+	@echo "Linking $(PROGRAM) ..." 
+	$(CXX) $(CXXFLAGS) $(OBJS) $(MARS_LIB) MCint.o $(ROOTLIBS) $(ROOTGLIBS) -o $@
+        
+$(SOLIB): $(MARS_LIBB) $(OBJS) MCint.o
+	@echo "Linking $(SOLIB) ..."
+	$(CXX) $(CXXFLAGS) -shared $(OBJS) $(MARS_LIB) MCint.o $(ROOTLIBS) $(ROOTGLIBS) -o $@
+
+libmbase.a:
+	@echo "Creating libmbase.a ..."
+	(cd mbase; make; cp libmbase.a ../libmbase.a; cd ..) 
+
+libmocttest.a:
+	@echo "Creating libmocttest.a ..."
+	(cd mocttest; make; cp libmocttest.a ../libmocttest.a; cd ..) 
+
+
+libmrootformat.a:
+	@echo "Creating libmrootformat.a ..."
+	(cd mrootformat; make; cp libmrootformat.a ../libmrootformat.a; cd ..) 
+
+MCint.cc:	$(HEADERS)
+	       	@echo "Generating dictionary MCint.cc..."
+		@$(ROOTSYS)/bin/rootcint -f MCint.cc \
+                -c $(INCLUDES) $(HEADERS) LinkDef.h 
+
+include Makefile.rules
+
+clean:	rmlib rmcint rmobjs rmcore rmbin
+
+# @endcode
+
Index: trunk/MagicSoft/MarsOctober/Makefile.conf.general
===================================================================
--- trunk/MagicSoft/MarsOctober/Makefile.conf.general	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Makefile.conf.general	(revision 447)
@@ -0,0 +1,16 @@
+#
+#  ----->>>   root libraries
+#
+
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
Index: trunk/MagicSoft/MarsOctober/Makefile.conf.linux-gnu
===================================================================
--- trunk/MagicSoft/MarsOctober/Makefile.conf.linux-gnu	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Makefile.conf.linux-gnu	(revision 447)
@@ -0,0 +1,41 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# 
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  ----->>>  includes
+#
+
+INCLUDE_ROOT    = ${ROOTSYS}/include
+INCLUDE_CPLUS   = /usr/include/g++
+INCLUDE_MBASE   = ./mbase
+
+
+# compilers
+
+CC            = g++
+CXX           = g++
+F77           = f77
+
+#
+#  ----->>>   settings for compilation
+#
+
+OPTIM    = -O2 -Wall -fno-rtti -fno-exceptions -fPIC
+DEBUG    = -g 
+
+# uncomment this for quiet compilation
+
+.SILENT:
+
+# @endcode
+##EOF
+
+
Index: trunk/MagicSoft/MarsOctober/Makefile.conf.osf1
===================================================================
--- trunk/MagicSoft/MarsOctober/Makefile.conf.osf1	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Makefile.conf.osf1	(revision 447)
@@ -0,0 +1,42 @@
+##################################################################
+#
+# config.mk
+#
+# @file        config.mk
+# 
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  ----->>>  includes
+#
+
+INCLUDE_ROOT    = ${ROOTSYS}/include
+INCLUDE_CPLUS   = /usr/include/cxx
+INCLUDE_MBASE   = ./mbase
+
+#
+# compilers
+#
+
+CC            = cc
+CXX           = cxx
+F77           = f77
+
+#
+#  ----->>>   settings for compilation
+#
+
+OPTIM    = -O2 -ieee -arch host
+DEBUG    = -g 
+
+# uncomment this for quiet compilation
+
+.SILENT:
+
+# @endcode
+##EOF
+
+
Index: trunk/MagicSoft/MarsOctober/Makefile.depend
===================================================================
--- trunk/MagicSoft/MarsOctober/Makefile.depend	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Makefile.depend	(revision 447)
@@ -0,0 +1,9 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+
+# DO NOT DELETE
Index: trunk/MagicSoft/MarsOctober/Makefile.rules
===================================================================
--- trunk/MagicSoft/MarsOctober/Makefile.rules	(revision 447)
+++ trunk/MagicSoft/MarsOctober/Makefile.rules	(revision 447)
@@ -0,0 +1,56 @@
+
+depend:
+	@makedepend $(SRCS) $(INCLUDES) -I$(INCLUDE_CPLUS) $(ROOTCFLAGS) \
+        -fMakefile.depend 2> kk.kk ; cat kk.kk
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.cc.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+#
+# The cleaning facility
+#
+
+rmcint:	
+	@echo "Removing cint-stuff..."
+	@rm -f *Cint.*
+
+rmlib:	
+	@echo "Removing libraries..."
+	@rm -f lib*.a
+
+rmobjs:	
+	@echo "Removing object files..."
+	@rm -f *.o
+
+rmcore:	
+	@echo "Removing core files..."
+	@rm -f core*
+
+rmbin:	
+	@echo "Removing binary files..."
+	@rm -f $(PROGRAM) $(SOLIB) so_locations
+
+mrproper:	clean
+	@echo "Removing *~ *.bak kk.kk html/..."
+	@rm -f *~ kk.kk *.bak
+	@rm -rf html
+	@echo "cd mbase"
+	@cd mbase; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mrootformat"
+	@cd mrootformat; make mrproper; cd ..
+	@echo "cd .."
+	@echo "cd mocttest"
+	@cd mocttest; make mrproper; cd ..
+	@echo "cd .."
+
+
+
Index: trunk/MagicSoft/MarsOctober/mars.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mars.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mars.cc	(revision 447)
@@ -0,0 +1,49 @@
+#include <stdlib.h>
+//#include <iostream.h>
+
+#include <TROOT.h>
+#include <TApplication.h>
+#include <TVirtualX.h>
+#include <TGClient.h>   
+
+
+#include "MGOctMain.h"
+
+// **********************************************************************
+//
+//    main program  for the october test. 
+//
+//    The only job of the main program is the initialisation of ROOT and 
+//    the start of the guiinterface for the october test
+//
+//    h. kornmayer      25.oct.2000
+
+
+
+int main(int argc, char **argv )
+{
+  //   cout << "==================================================" << endl ;
+  //   cout << "                    MARS v0.2" << endl;
+  //   cout << "    MAGIC Analysis and Reconstruction Software" << endl ;
+  //   cout << "            Compiled on <" << __DATE__ << ">" << endl ;    
+  //   cout << "==================================================" << endl ;
+  //   cout << endl;
+  
+  //
+  //     initialize ROOT  (this is obligatory here)
+  //
+  // initialise ROOT
+
+  TROOT simple("simple", "SIMONE - statistic of MonteCarlo");
+
+  TApplication theApp("App", &argc, argv);
+
+  MGOctMain mainWin(gClient->GetRoot(), 500, 600);     
+  
+  theApp.Run();
+
+
+  return 0;  
+}
+ 
+
Index: trunk/MagicSoft/MarsOctober/mbase/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/BaseLinkDef.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/BaseLinkDef.h	(revision 447)
@@ -0,0 +1,23 @@
+#ifdef __CINT__
+
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MTime;
+#pragma link C++ class MTask;
+#pragma link C++ class MTaskList;
+
+#pragma link C++ class MParList;
+#pragma link C++ class MParRead;
+#pragma link C++ class MParWrite;
+#pragma link C++ class MParContainer;
+
+#pragma link C++ class MObjBuffer;
+
+#pragma link C++ class MFile;
+#pragma link C++ class MRootFile;
+#pragma link C++ class MMagicFile;
+
+#pragma link C++ class MInputStreamID;
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MEvtLoop.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MEvtLoop.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MEvtLoop.cc	(revision 447)
@@ -0,0 +1,84 @@
+#include "MEvtLoop.h"
+
+#include <iostream.h>
+
+#include <TStopwatch.h>
+
+#include "MParList.h"
+#include "MTaskList.h"
+
+MEvtLoop::MEvtLoop() : fTasks(NULL), fParlist(NULL)
+{
+}
+
+MEvtLoop::~MEvtLoop()
+{
+}
+
+void MEvtLoop::SetTaskList(MTaskList *t)
+{
+    fTasks = t;
+}
+
+void MEvtLoop::SetParList(MParList *p)
+{
+    fParlist = p;
+}
+
+void MEvtLoop::Eventloop(Int_t maxcnt)
+{
+    if (!fTasks || !fParlist)
+    {
+        cout << "Error: either tasklist or parlist not initialized" << endl;
+        return;
+    }
+    //
+    //  execute the preprocess of all tasks
+    //  connect the different tasks with the right containers in
+    //  the parameter list
+
+    if (!fTasks->PreProcess(fParlist))
+    {
+        cout << "Error detected while PreProcessing" << endl;
+        return;
+    }
+
+    //
+    //   loop over all events and process all tasks for
+    //   each event
+    //
+    cout << endl << "Eventloop running (";
+
+    if (maxcnt<0) cout << "all";
+    else          cout << maxcnt;
+
+    cout << " events)..." << flush;
+
+    Int_t dummy = maxcnt<0?0:maxcnt;
+
+    TStopwatch clock;
+    clock.Start();
+
+    if (maxcnt<0)
+        while (fTasks->Process() && ++dummy);
+    else
+        while (fTasks->Process() && dummy--);
+
+    clock.Stop();
+
+    cout << "Ready!" << endl << endl;
+
+    clock.Print();
+
+    cout << endl
+        << "Time: " << clock.CpuTime() << "s"
+        << " for " << (maxcnt<0?dummy:maxcnt) << " Events"
+        << " --> " << (maxcnt<0?dummy:maxcnt)/clock.CpuTime() << " Events/s"
+        << endl << endl;
+
+    //
+    //  execute the post process of all tasks
+    //
+    fTasks->PostProcess();
+}
+
Index: trunk/MagicSoft/MarsOctober/mbase/MEvtLoop.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MEvtLoop.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MEvtLoop.h	(revision 447)
@@ -0,0 +1,25 @@
+#ifndef MEVTLOOP_H
+#define MEVTLOOP_H
+
+#include "Magic.h"
+
+class MTaskList;
+class MParList;
+
+class MEvtLoop
+{
+private:
+    MTaskList *fTasks;
+    MParList  *fParlist;
+
+public:
+    MEvtLoop();
+    ~MEvtLoop();
+
+    void SetTaskList(MTaskList *t);
+    void SetParList(MParList *p);
+
+    void Eventloop(Int_t maxcnt=-1);
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MFile.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MFile.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MFile.cc	(revision 447)
@@ -0,0 +1,58 @@
+#include "MFile.h"
+
+#include "MFileDescr.h"
+
+ClassImp(MFile)
+ClassImp(MRootFile)
+ClassImp(MMagicFile)
+
+/* -- general Base class for all file types used in the magic environment -- */
+MFile::~MFile()
+{
+    if (fIn)
+        delete fIn;
+
+    if (fOut)
+        delete fOut;
+}
+
+/* -- general base class for all MParConmtainer which want to read and
+      write magic files */
+void MMagicFileImp::GetNBytes(fstream& fin, Byte_t *buffer, Char_t cnt)
+{
+    for (int i=cnt-1; i>=0; i--)
+        fin >> *(buffer+i);
+}
+
+void MMagicFileImp::PutNBytes(fstream& fout, Byte_t *buffer, Char_t cnt)
+{
+    for (int i=cnt-1; i>=0; i--)
+        fout << *(buffer+i);
+}
+
+/* -- file descriptor class for a magic root file -- */
+MFileDescrIn *MRootFile::OpenInput(const char *fName, const char *cname)
+{
+    fIn = new MRootFileIn(this, fName, cname);
+    return fIn;
+}
+
+MFileDescrOut *MRootFile::OpenOutput(const char *fName, const char *cname, MParContainer **obj)
+{
+    fOut = new MRootFileOut(fName, cname, obj);
+    return fOut;
+}
+
+/* -- file descriptor class for a magic magic file -- */
+
+MFileDescrIn *MMagicFile::OpenInput(const char *fName, const char *cname)
+{
+    fIn = new MMagicFileIn(fName);
+    return fIn;
+}
+
+MFileDescrOut *MMagicFile::OpenOutput(const char *fName, const char *cname, MParContainer **obj)
+{
+    fOut = new MMagicFileOut(fName, obj);
+    return fOut;
+}
Index: trunk/MagicSoft/MarsOctober/mbase/MFile.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MFile.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MFile.h	(revision 447)
@@ -0,0 +1,81 @@
+#ifndef MFILE_H
+#define MFILE_H
+
+#include "Magic.h"
+
+#include <fstream.h>
+
+#include <TFile.h>
+
+class MFileDescrIn;
+class MFileDescrOut;
+
+class MParContainer;
+
+class MFile
+{
+protected:
+    MFileDescrIn  *fIn;  //!
+    MFileDescrOut *fOut; //!
+public:
+    MFile() : fIn(NULL), fOut(NULL) {}
+    ~MFile();
+
+    virtual MFileDescrIn *OpenInput(const char *fname, const char *cname)
+    {
+        return NULL;
+    };
+
+    virtual MFileDescrOut *OpenOutput(const char *fName, const char *cname, MParContainer **obj)
+    {
+        return NULL;
+    };
+
+    ClassDef(MFile, 1)
+};
+
+/*class MAsciiFile : public MFile
+{
+private:
+public:
+    void ReadNextEntry()
+    {
+        dest->ReadBinEntry(FILE *f);
+    }
+    };*/
+
+class MMagicFileImp
+{
+public:
+    void GetNBytes(fstream& fin, Byte_t *buffer, Char_t cnt);
+    void PutNBytes(fstream& fout, Byte_t *buffer, Char_t cnt);
+};
+
+class MRootFile : public MFile, public TFile
+{
+public:
+    MRootFile() : TFile() {}
+    MRootFile(const char *fname, Option_t *option="", const char *ftitle="", Int_t compress=1)
+        : TFile(fname, option, ftitle, compress)
+    {
+    }
+
+    MFileDescrIn  *OpenInput(const char *fName, const char *cname);
+    MFileDescrOut *OpenOutput(const char *fName, const char *cname, MParContainer **obj);
+
+    ClassDef(MRootFile, 1)
+};
+
+
+class MMagicFile : public MFile
+{
+public:
+    MMagicFile() {}
+    MMagicFile(const char *fname, Option_t *option="") {}
+
+    MFileDescrIn  *OpenInput(const char *fName, const char *cname);
+    MFileDescrOut *OpenOutput(const char *fName, const char *cname, MParContainer **obj);
+
+    ClassDef(MMagicFile, 1)
+};
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MFileDescr.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MFileDescr.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MFileDescr.cc	(revision 447)
@@ -0,0 +1,138 @@
+#include "MFileDescr.h"
+
+#include <iostream.h>
+
+#include <TFile.h>
+#include <TTree.h>
+
+#include "MParContainer.h"
+
+void MRootFileIn::SetAddress(MParContainer **obj)
+{
+    pBranchIn->SetAddress(obj);
+}
+
+void MRootFileIn::GetEvent(Int_t n)
+{
+    pTreeIn->GetEvent(n);
+}
+
+void MRootFileOut::SetAddress(MParContainer **obj)
+{
+    pBranchOut->SetAddress(obj);
+}
+
+void MRootFileOut::Fill()
+{
+    pTreeOut->Fill();
+}
+
+MRootFileIn::MRootFileIn(TFile *f, const char *fName, const char *cname)
+{
+    //
+    // Open the tree in the input file with the same name than
+    // this instance
+    //
+    cout << "Open Tree: " << fName << "... " << flush;
+    pTreeIn = (TTree *) f->Get(fName);
+
+    if (!pTreeIn)
+        cout << "WARNING: Cannot open tree " << fName << "." << endl;
+
+    //
+    // Open the branch in the tree with the same name than
+    // the ClassName of the objects in the buffer
+    //
+    cout << "Branch: " << cname << "... " << flush;
+    pBranchIn = pTreeIn->GetBranch(cname);
+
+    if (!pBranchIn)
+        cout << "WARNING: Cannot open branch " << cname << "." << endl;
+    else
+        cout << "Done." << endl;
+
+    cout << endl;
+
+    //
+    // get number events in branch
+    //
+    // nEvts = pTreeIn->GetEntries();
+}
+
+MRootFileOut::MRootFileOut(const char *fName, const char *cname, MParContainer **obj)
+{
+    //
+    // Open the tree in the output file with the same name than
+    // the this instance
+    //
+    cout << "Create Tree: " << fName << "... " << flush;
+    TTree *pTreeOut = new TTree(fName, ""/*fTitle*/);
+
+    if (!pTreeOut)
+        cout << "WARNING: Cannot open tree " << fName << "." << endl;
+
+
+    //
+    // Create the branch in the tree with the same name than
+    // the ClassName of the objects in the buffer
+    //
+    cout << "Branch: " << cname << "... " << flush;
+    pBranchOut = pTreeOut->Branch("TEST", cname, obj, 100000, 10);
+
+    if (!pBranchOut)
+        cout << "WARNING: Cannot open branch " << cname << "." << endl;
+    else
+        cout << "Done." << endl;
+
+    cout << endl;
+}
+
+MMagicFileIn::MMagicFileIn(const char *fname)
+{
+    fin = new fstream(fname, ios::in);
+    if (!fin)
+        cout << "Warning: Cannot open file '" << fname << "' for reading." << endl;
+}
+
+MMagicFileIn::~MMagicFileIn()
+{
+    if (fin)
+        delete fin;
+}
+
+void MMagicFileIn::SetAddress(MParContainer **obj)
+{
+    fContainer = *obj;
+}
+
+void MMagicFileIn::GetEvent(Int_t n)
+{
+    if (n!=0)
+        cout << "Warning: You cannot seek inside a Magic file <n ignored>" << endl;
+
+    fContainer->GetEventFromMagicFile(*fin);
+}
+
+MMagicFileOut::MMagicFileOut(const char *fname, MParContainer **obj)
+{
+    fout = new fstream(fname, ios::out);
+    //fFile = fopen(fname, "w");
+    if (!fout)
+        cout << "Warning: Cannot open file '" << fname << "' for writing." << endl;
+}
+
+MMagicFileOut::~MMagicFileOut()
+{
+    if (fout)
+        delete fout;
+}
+
+void MMagicFileOut::SetAddress(MParContainer **obj)
+{
+    fContainer = *obj;
+}
+
+void MMagicFileOut::Fill()
+{
+    fContainer->PutEventToMagicFile(*fout);
+}
Index: trunk/MagicSoft/MarsOctober/mbase/MFileDescr.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MFileDescr.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MFileDescr.h	(revision 447)
@@ -0,0 +1,83 @@
+#ifndef MFILEDESCR_H
+#define MFILEDESCR_H
+
+#include "Magic.h"
+
+#include <fstream.h>
+
+class TFile;
+class TTree;
+class TBranch;
+class MParContainer;
+
+class MFileDescrIn
+{
+public:
+    virtual void SetAddress(MParContainer **obj) {};
+    virtual void GetEvent(Int_t n) {};
+};
+
+class MFileDescrOut
+{
+public:
+    virtual void SetAddress(MParContainer **obj) {};
+    virtual void Fill() {};
+};
+
+class MRootFileIn : public MFileDescrIn
+{
+private:
+    TTree   *pTreeIn;     // tree to open for input
+    TBranch *pBranchIn;   // branch to open for input
+
+    Int_t nEvts;          // in Tree
+
+public:
+    MRootFileIn(TFile *f, const char *fName, const char *cname);
+    void SetAddress(MParContainer **obj);
+    void GetEvent(Int_t n);
+};
+
+class MRootFileOut : public MFileDescrOut
+{
+private:
+    TTree   *pTreeOut;    // tree to open for output
+    TBranch *pBranchOut;  // branch to open for output
+
+public:
+    MRootFileOut(const char *fName, const char *cname, MParContainer **obj);
+    void SetAddress(MParContainer **obj);
+    void Fill();
+};
+
+/* -------------------- Magic File --------------------- */
+
+class MMagicFileIn : public MFileDescrIn
+{
+private:
+    fstream *fin;
+    MParContainer *fContainer;         // tree to open for input
+
+public:
+    MMagicFileIn(const char *fname);
+    ~MMagicFileIn();
+
+    void SetAddress(MParContainer **obj);
+    void GetEvent(Int_t n=0);
+};
+
+class MMagicFileOut : public MFileDescrOut
+{
+private:
+    fstream *fout;
+    MParContainer *fContainer;
+
+public:
+    MMagicFileOut(const char *fname, MParContainer **obj);
+    ~MMagicFileOut();
+
+    void SetAddress(MParContainer **obj);
+    void Fill();
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MInputStreamID.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MInputStreamID.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MInputStreamID.cc	(revision 447)
@@ -0,0 +1,18 @@
+#include "MInputStreamID.h"
+
+ClassImp(MInputStreamID);
+
+// ---------------------------------------------------------------------
+
+MInputStreamID::MInputStreamID(const char *name, const char *title) : MParContainer(name, title)
+{
+    //
+    // (default) constructor
+    //
+    fName = name ? name : ClassName();
+    fTitle = title;
+
+    fID = new char[4];
+    strcpy(fID, "All");
+}
+
Index: trunk/MagicSoft/MarsOctober/mbase/MInputStreamID.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MInputStreamID.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MInputStreamID.h	(revision 447)
@@ -0,0 +1,47 @@
+#ifndef MINPUTSTREAMID_H
+#define MINPUTSTREAMID_H
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MInputStreamID                                                    //
+//                                                                   //
+// This is the storage container for general (CaOs, Raw, ...) Event  //
+// Info like the type of the 'actual' event                          //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#include "Magic.h"
+
+#include "MParContainer.h"
+
+// -----------------------------------------------------------------------
+
+class MInputStreamID : public MParContainer
+{
+private:
+    char *fID;		//! which type of task should be processed?
+
+public:
+    MInputStreamID(const char *name=NULL, const char *title=NULL);
+
+    const char *GetEvtType() const
+    {
+	return (const char *)fID;
+    }
+    void SetEvtType(const char *t)
+    {
+        delete fID;
+        fID = new char[strlen(t)+1];
+        strcpy(fID, t);
+    }
+
+    MParContainer* New()
+    {
+        return new MInputStreamID(fName, fTitle);
+    }
+
+    ClassDef(MInputStreamID, 1)	// storage container for general info
+};
+
+// ---------------------------------------------------------------------
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MObjBuffer.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MObjBuffer.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MObjBuffer.cc	(revision 447)
@@ -0,0 +1,118 @@
+////////////////////////////////////////////////////////////////////////
+//
+//  MObjBuffer
+//
+//  This is a ring buffer for TObjects
+//  It should be similar to TObjArray, but with different counting
+//
+////////////////////////////////////////////////////////////////////////
+#include "MObjBuffer.h"
+
+#include "MFileDescr.h"
+#include "MFile.h"
+
+ClassImp (MObjBuffer)
+
+MObjBuffer::MObjBuffer(MParContainer *o, Int_t nevts,
+                       const char *name, const char *title) :
+    fIsInput(kFALSE), fIsOutput(kFALSE), fHasChanged(kFALSE),
+    nPos(0), nObjPos(0)
+{
+    fName  = name  ? name  : o->GetName();
+    fTitle = title ? title : o->GetTitle();
+
+    //
+    // add the given object as first to the buffer
+    //
+    objs.Add(o);
+
+    //
+    // create nevts-1 new objects of the given object and add them to the buffer
+    //
+    for (Int_t i = 1; i<2*nevts+1; i++)
+    {
+        objs.Add(o->New());
+    }
+
+    nPreObjs = nPostObjs = nevts;
+    nEntries = nPreObjs+nPostObjs+1;
+}
+
+void MObjBuffer::SetAsInput(MFile *f, Bool_t i)
+{
+    fIsInput = i;
+
+    if (fIsInput)
+        pFileIn = f->OpenInput(fName, objs[0]->ClassName());
+    //    else
+    //        f->CloseInput();
+}
+
+void MObjBuffer::SetAsOutput(MFile *f, Bool_t o)
+{
+    fIsOutput = o;
+
+    if (fIsOutput)
+        pFileOut = f->OpenOutput(fName, objs[0]->ClassName(), (MParContainer**)&objs[0]);
+}
+
+Int_t MObjBuffer::GetNextEvent(Int_t time)
+{
+    //
+    // one step forward in the ring buffer
+    //
+    nObjPos++;
+    nObjPos %= nEntries;
+
+    //
+    // calculate the address of the object after the last one in the ring buffer
+    //
+    Int_t adr = (nObjPos+nPostObjs+nEntries+1)%nEntries;
+
+    //
+    // get the next entry (some event in the future) from file
+    //
+
+    pFileIn->SetAddress((MParContainer**)&objs[adr]);
+    pFileIn->GetEvent(nPos++);
+
+    //
+    // return number of actual event (present) in tree
+    //
+    return nPos-nPostObjs-1;
+}
+
+void MObjBuffer::PutEvent()
+{
+    //
+    // one step forward in the ring buffer
+    //
+    nObjPos++;
+    nObjPos %= nEntries;
+
+    //
+    // write actual (present) object to file
+    //
+    pFileOut->SetAddress((MParContainer**)&objs[nObjPos]);
+    pFileOut->Fill();
+}
+
+void MObjBuffer::Fill()
+{
+    //
+    // in the future this function has to handle the dynamic buffer
+    //
+    if (nPos)
+        return;
+
+    //
+    // fill PreBuffer (( objects in the future)
+    //
+    for (Int_t i=1; i<nPostObjs+2; i++)
+    {
+        pFileIn->SetAddress((MParContainer**)&objs[i]);
+        pFileIn->GetEvent(nPos++);
+    }
+    nObjPos = 0;
+}
+
Index: trunk/MagicSoft/MarsOctober/mbase/MObjBuffer.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MObjBuffer.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MObjBuffer.h	(revision 447)
@@ -0,0 +1,79 @@
+#ifndef MOBJBUFFER_H
+#define MOBJBUFFER_H
+
+#include "Magic.h"
+
+#include <TTree.h>
+#include <TBranch.h>
+
+#include <TNamed.h>
+#include <TObjArray.h>
+
+#include "MParContainer.h"
+
+class MFile;
+class MFileDescrIn;
+class MFileDescrOut;
+
+//class MRuntimeDb;
+
+class MObjBuffer : public MParContainer
+{
+private:
+    TObjArray objs;
+
+    Int_t nPreObjs;       // number of object in the future
+    Int_t nObjPos;        // pos of present object
+    Int_t nPostObjs;      // number of objects in the past
+    Int_t nEntries;       // number of entries in ring buffer
+
+    Bool_t fIsInput;      // flag: is this an input container?
+    Bool_t fIsOutput;     // flag: is this an output container?
+
+    Bool_t fHasChanged;   // flag: the data of the 'present'-object has changed
+
+    MFileDescrIn  *pFileIn;   //! Input File
+    MFileDescrOut *pFileOut;  //! Input File
+
+    Int_t nPos;           // in Tree
+
+public:
+    MObjBuffer(MParContainer *o, Int_t nevts=1,
+               const char *name=NULL, const char *title=NULL);
+
+    Bool_t IsBuffer()                { return kTRUE; }
+
+    Bool_t IsInput()                 { return fIsInput; }
+    Bool_t IsOutput()                { return fIsOutput; }
+
+    Bool_t HasChanged()              { return fHasChanged; }
+
+    void SetAsInput(MFile *f, Bool_t i=kTRUE);
+    void SetAsOutput(MFile *f, Bool_t o=kTRUE);
+
+    void SetChanged(Bool_t c=kTRUE)  { fHasChanged = c; }
+
+    MParContainer *operator() ()
+    {
+	return (MParContainer*)objs[(nObjPos+nEntries)%nEntries];
+    }
+
+    MParContainer *GetEntry(Int_t i)
+    {
+	return (MParContainer*)objs[(nEntries+nObjPos+i)%nEntries];
+    }
+
+    Int_t GetNextEvent(Int_t time);
+    void PutEvent();
+
+    void Fill();
+
+    Int_t GetEventNr()
+    {
+        return nPos;
+    }
+
+    ClassDef(MObjBuffer, 1)	// buffer for n complete events
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MParBase.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParBase.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParBase.h	(revision 447)
@@ -0,0 +1,18 @@
+#ifndef MPARBASE_H
+#define MPARBASE_H
+
+#include "Magic.h"
+
+class MParBase 
+{
+private:
+    Bool_t fIsBuffer;
+
+public:
+    Bool_t IsBuffer()
+    {
+        return fIsBuffer;
+    }
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MParContainer.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParContainer.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParContainer.cc	(revision 447)
@@ -0,0 +1,43 @@
+#include "MParContainer.h"
+
+#include <iostream.h>
+
+#include "MTime.h"
+
+ClassImp(MParContainer)
+
+MParContainer::MParContainer(const char *name, const char *title)
+{
+    fName = name ? name : ClassName();
+    fTitle = title;
+}
+
+MParContainer::~MParContainer()
+{
+}
+
+MParContainer *MParContainer::New()
+{
+    cout << "Error: No New()-function." << endl;
+    return NULL;
+}
+
+void MParContainer::GetEventFromMagicFile(fstream &fin)
+{
+    cout << "Warning: Reading from Magic file format not defined for " << ClassName() << endl;
+}
+
+void MParContainer::PutEventToMagicFile(fstream &fout)
+{
+    cout << "Warning: Writing to Magic file format not defined for " << ClassName() << endl;
+}
+
+void MParContainer::GetEventFromAsciiFile(fstream &fin)
+{
+    cout << "Warning: Reading from Ascii file format not defined for " << ClassName() << endl;
+}
+
+void MParContainer::PutEventToAsciiFile(fstream &fout)
+{
+    cout << "Warning: Writing to Ascii file format not defined for " << ClassName() << endl;
+}
Index: trunk/MagicSoft/MarsOctober/mbase/MParContainer.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParContainer.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParContainer.h	(revision 447)
@@ -0,0 +1,47 @@
+#ifndef MPARCONTAINER_H
+#define MPARCONTAINER_H
+
+#include "Magic.h"
+
+#include <fstream.h>
+
+#include "MTime.h"
+
+class MParList;
+class MFileDescr;
+
+class MParContainer : public MTime
+{
+private:
+
+public:
+    MParContainer(const char *name=NULL, const char *title=NULL);
+    ~MParContainer();
+
+    virtual Bool_t ReInit(MParList *pList)
+    {
+        //
+        // Reinitialize this container (eg resize)
+        // return kTRUE if no problems occured, else return kFALSE
+        //
+        return kTRUE;
+    }
+
+    virtual MParContainer *New();
+
+    virtual Bool_t IsBuffer()
+    {
+        return kFALSE;
+    }
+
+    void GetEventFromMagicFile(fstream &fin);
+    void PutEventToMagicFile(fstream &fout);
+
+    void GetEventFromAsciiFile(fstream &fin);
+    void PutEventToAsciiFile(fstream &fout);
+
+    ClassDef(MParContainer, 1)
+};
+
+#endif
+
Index: trunk/MagicSoft/MarsOctober/mbase/MParList.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParList.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParList.cc	(revision 447)
@@ -0,0 +1,137 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MParList
+//
+// This class contains a list of different Parameter and Data
+// Containers. 
+//
+// You can add every parameter Container (Named object) to the
+// instance and access it from somewhere else via its Name.
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MParList.h"
+
+#include "MParContainer.h"
+
+ClassImp(MParList)
+
+MParList::MParList() : fNext(NULL)
+{
+  //
+  //  default constructor 
+  //  creates an empty list 
+  //
+
+}
+
+MParList::MParList(MParList &ts)
+{
+  //
+  // copy constructor 
+  //
+
+  fContainer.AddAll(&ts.fContainer);
+}
+
+Bool_t MParList::ReInit(MParList *pList)
+{
+    //
+    // do a reinitialisation of all containers in this list (eg resizining)
+    // return kFALSE if a problem occured, else return kFALSE
+    //
+    cout << "Reinitializing... " << flush;
+
+    if (!pList)
+        pList = this;
+
+    //
+    //  create the Iterator over the list
+    //
+    TIter next(&fContainer);
+
+    MParContainer *pCont;
+
+    //
+    // loop over all containers in the list
+    //
+    while ((pCont=(MParContainer *)next()))
+    {
+        if (pCont->IsBuffer())
+            //
+            // FIXME: Here we have to loop over all entries in the buffer
+            //
+            continue;
+
+        cout << pCont->GetName() << "... " << flush;
+
+        if (!pCont->ReInit(pList))
+            return kFALSE;
+    }
+
+    cout << endl;
+
+    return kTRUE;
+}
+
+Bool_t MParList::AddToList(MParContainer *obj, TNamed *where)
+{
+  // 
+  //  Add an Container to the list.
+  // 
+  //  If 'where' is given, the object will be added after this.
+  //
+  
+  //
+  //  check if the object (you want to add) exists
+  //
+  if (!obj) return kTRUE;
+
+  cout << "Adding " << obj->GetName() << " to " << GetName() << "... " << flush;
+  //
+  //  check if it is in the list yet
+  //
+  if (fContainer.FindObject(obj))
+  {
+      cout << "WARNING: MParList::add: Container already added" << endl;
+      return kTRUE;
+  }
+
+  //
+  //  check if you want to add the new parameter container somewhere 
+  //  special (in that case you specify "where") 
+  //  
+  if (where)
+  {
+      if (!fContainer.FindObject(where))
+      {
+          cout << "ERROR: MParList::add: Cannot find parameter container after which the new one should be added!" << endl;
+          return kFALSE;
+      }
+  }
+
+  fContainer.Add(obj);
+  cout << "Done." << endl;
+
+  return kTRUE;
+}
+
+MParContainer *MParList::FindObject(const char *name)
+{
+    //
+    //  Find an object in the list.
+    //  'name' is the name of the object you are searching for.
+    //
+    return (MParContainer*)fContainer.FindObject(name);
+}
+
+
+void MParList::Print(Option_t *t)
+{
+    //
+    //   print some information about the current status of MParList
+    //
+    cout << "ParList: " << this->GetName() << " <" << this->GetTitle() << ">" << endl;
+    cout << endl;
+}
+
Index: trunk/MagicSoft/MarsOctober/mbase/MParList.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParList.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParList.h	(revision 447)
@@ -0,0 +1,50 @@
+#ifndef MPARLIST_H
+#define MPARLIST_H
+
+#include "Magic.h"
+
+#include <iostream.h>
+
+#include "TObject.h"
+#include "TOrdCollection.h"
+
+class MParContainer;
+
+class MParList : public TObject
+{
+private:
+    TIter *fNext;               //!
+    TOrdCollection fContainer;	// Collection of Parameter and Data Containers
+
+public:
+    MParList();
+    MParList(MParList &ts);
+
+    ~MParList()
+    {
+        if (fNext)
+            delete fNext;
+    }
+
+    Bool_t ReInit(MParList *pList=NULL);
+
+    Bool_t AddToList(MParContainer *obj, TNamed *where = NULL);
+
+    MParContainer *FindObject(const char *name);
+
+    void Reset()
+    {
+        fNext = new TIter(&fContainer);
+    }
+
+    MParContainer *Next()
+    {
+        return (MParContainer*)(*fNext)();
+    }
+
+    void Print(Option_t *t = NULL);
+
+    ClassDef(MParList, 1)	// list of Parameter Containers
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MParRead.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParRead.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParRead.cc	(revision 447)
@@ -0,0 +1,156 @@
+////////////////////////////////////////////////////////////////////////
+//
+//  MParRead
+//
+//  This is the task to read in the cosmic raw data from one file. 
+//  Cosmics are stored in the root file under the Tree "EvtTree". 
+//  This task reads them in to the needed MRawEvtBuf in the Parameter
+//  list.
+//
+////////////////////////////////////////////////////////////////////////
+
+#include "MParRead.h"
+
+#include <iostream.h>
+
+#include "MParList.h"
+#include "MObjBuffer.h"
+#include "MInputStreamID.h"
+
+ClassImp(MParRead)
+
+MParRead::MParRead()
+{
+}
+
+Bool_t MParRead::PreProcess (MParList *pList)
+{
+    //
+    // remember the pointer to the parameter list fur further usage
+    //
+    pParList = pList;
+
+    //
+    //  check if MEvtHeader exists in the Parameter list already.
+    //  if not create one and add them to the list
+    //
+    fID = (MInputStreamID*)pList->FindObject("MInputStreamID");
+    if (!fID)
+    {
+        cout << "MReadEvt::PreProcess - WARNING: MEvtHeader not found... creating." << endl;
+        fID = new MInputStreamID;
+        pList->AddToList(fID);
+    }
+  
+    return kTRUE;
+}
+    
+Bool_t MParRead::Process()
+{
+    //
+    //   Read in the next event
+    //
+
+    //
+    // Make sure that all buffers are filled
+    //
+    MParContainer *pCont;
+
+    //
+    // start with the first entry in the parlist
+    //
+    pParList->Reset();
+    // loop over all entries
+    while ((pCont=pParList->Next()))
+    {
+        // if the entry is a buffer and not only a container
+        // we can ask the container whether it is a input
+        // container or not
+        if (!pCont->IsBuffer())
+            continue;
+
+        MObjBuffer *pBuf = (MObjBuffer*)pCont;
+
+        // if it is an input container we tell the container
+        // that it should be filled if it is not filled already
+        if (pBuf->IsInput())
+            pBuf->Fill();
+    }
+
+    //
+    // look which is the next tree which we have to read
+    //
+    MObjBuffer *evt;
+    Int_t up = 0;
+
+    // start from scratch
+    pParList->Reset();
+    // loop over all emtries
+    while ((pCont=pParList->Next()))
+    {
+        // ask whether it is a buffer or not
+        if (!pCont->IsBuffer())
+            continue;
+
+        MObjBuffer *pBuf = (MObjBuffer*)pCont;
+
+        // ask whether the buffer is set as an input buffer or not
+        if (!pBuf->IsInput())
+            continue;
+
+        // time of event which was processed last time
+        Int_t t1=fTime.GetTime();
+
+        // time of next event in this buffer
+        Int_t t2=pBuf->GetEntry(1)->GetTime();
+
+        // compare the time of the actual event with the next
+        // event in this buffer
+        if (t2<=t1)
+            continue;
+
+        // if no event is scheduled as event to read next
+        // set this container as next
+        if (!up)
+        {
+            up = t2;
+            evt = pBuf;
+        }
+
+        // if this container has a smaller time, than
+        // the 'actual' next event set this container
+        // as next input
+        if (t2<up)
+        {
+            up = t2;
+            evt = pBuf;
+        }
+    }
+
+    //
+    // now we have the time of the next event we want to read
+    // and a pointer to this event in 'up' and 'evt'
+    //
+
+    //
+    // set 'system-time' to time of this event
+    //
+    fTime.SetTime(up);
+
+    //
+    // set event-type to type of this event
+    //
+    fID->SetEvtType(evt->GetName());
+
+    //
+    // Get next event from the determined tree
+    //
+    evt->GetNextEvent(0);
+
+    return kTRUE;
+
+/*
+    return  nr != fPtrTree->GetEntries();
+*/
+}
+
Index: trunk/MagicSoft/MarsOctober/mbase/MParRead.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParRead.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParRead.h	(revision 447)
@@ -0,0 +1,29 @@
+#ifndef MPARREAD_H
+#define MPARREAD_H
+
+#include "Magic.h"
+
+#include "MTask.h"
+#include "MTime.h"
+
+class MParList;
+class MInputStreamID;
+
+class MParRead : public MTask
+{
+private:
+    MTime fTime;
+    MParList *pParList;
+
+    MInputStreamID *fID;
+
+public:
+    MParRead();
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MParRead, 1)	// Read event from root file into event buffer
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MParWrite.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParWrite.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParWrite.cc	(revision 447)
@@ -0,0 +1,51 @@
+////////////////////////////////////////////////////////////////////////
+//
+//  MParWrite
+//
+////////////////////////////////////////////////////////////////////////
+
+#include "MParWrite.h"
+
+#include "MParList.h"
+#include "MParContainer.h"
+#include "MObjBuffer.h"
+
+ClassImp(MParWrite)
+
+MParWrite::MParWrite()
+{
+}
+
+Bool_t MParWrite::PreProcess (MParList *pList)
+{
+    //
+    // remember the pointer to the parameter list fur further usage
+    //
+    pParList = pList;
+
+    return kTRUE;
+}
+
+Bool_t MParWrite::Process()
+{
+    //
+    //   Write Event
+    //
+
+    MParContainer *pCont;
+
+    pParList->Reset();
+    while ((pCont=pParList->Next()))
+    {
+        if (!pCont->IsBuffer())
+            continue;
+
+        MObjBuffer *pBuf = (MObjBuffer*)pCont;
+
+        if (pBuf->IsOutput() && pBuf->HasChanged())
+            pBuf->PutEvent();
+    }
+
+    return kTRUE;
+}
+
Index: trunk/MagicSoft/MarsOctober/mbase/MParWrite.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MParWrite.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MParWrite.h	(revision 447)
@@ -0,0 +1,24 @@
+#ifndef MPARWRITE_H
+#define MPARWRITE_H
+
+#include "Magic.h"
+
+#include "MTask.h"
+
+class MParList;
+
+class MParWrite : public MTask
+{
+private:
+    MParList *pParList;
+
+public:
+    MParWrite();
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+
+    ClassDef(MParWrite, 1)	// Read event from root file into event buffer
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MTask.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MTask.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MTask.cc	(revision 447)
@@ -0,0 +1,86 @@
+///////////////////////////////////////////////////////////////////////
+//
+//   MTask
+// 
+//   Base class for all tasks which can perfomed in a tasklist
+//   For each event processed in the eventloop all the different
+//   tasks in the tasklist will be processed.
+//  
+//   So all tasks must inherit from this baseclass. 
+//
+//   The data member fID is used to indicate the type of events
+//   that are process by this task. There are the following different
+//   event types: 
+//
+//   This is the type of task for which this task should be processed
+//   taskType-bits: 7 6 5 4 3 2 1 0
+//   0 DATA_EVT
+//   1 CALIBRATION_EVT
+//   ? etc. etc. 
+//
+//   Inside this abstract class, there are three fundamental function: 
+//
+//   - PreProcess() :  executed before the eventloop starts. Here you 
+//                     can initiate different things, open files, etc. 
+//
+//   - Process()    :  executed for each event in the eventloop. Do in 
+//                     one task after the other (as the occur in the 
+//                     tasklist) the action of one task. 
+//  
+//   - PostProcess():  executed after the eventloop. Here you can close 
+//                     output files, start display of the run parameter, 
+//                     etc. 
+//  
+//  
+///////////////////////////////////////////////////////////////////////
+
+#include "MTask.h"
+
+#include <string.h>
+#include <iostream.h>
+
+ClassImp(MTask)
+
+void MTask::SetEventType(const char *evt)
+{
+    if (fID)
+        delete fID;
+    fID = new char[strlen(evt)+1];
+    strcpy(fID, evt);
+}
+
+Bool_t MTask::PreProcess( MParList *pList )
+{
+  //
+  // This is processed before the eventloop starts
+  // 
+  // It is the job of the PreProcess to connect the tasks
+  // with the right container in the parameter list. 
+  //
+  // the virtual implementation returns kTRUE
+  //
+  return kTRUE; 
+}
+
+
+Bool_t MTask::Process()
+{
+  //
+  // This is processed for every event in the eventloop 
+  //
+  // the virtual implementation returns kTRUE
+  //
+  return kTRUE;
+}
+
+Bool_t MTask::PostProcess()
+{
+  //
+  // This is processed after the eventloop starts
+  //
+  // the virtual implementation returns kTRUE
+  //
+  return kTRUE;
+}
+
+
Index: trunk/MagicSoft/MarsOctober/mbase/MTask.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MTask.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MTask.h	(revision 447)
@@ -0,0 +1,36 @@
+#ifndef MTASK_H
+#define MTASK_H
+
+#include "Magic.h"
+
+#include "TOrdCollection.h"
+
+class MParList;
+
+class MTask : public TObject
+{
+private:
+    char *fID;	   //! type of raw event which should be processed by this task
+
+public:
+    ~MTask()
+      {
+        if (fID)
+	  delete fID;
+      }
+
+    virtual Bool_t PreProcess(MParList *pList);
+    virtual Bool_t Process();
+    virtual Bool_t PostProcess();
+    
+    void SetEventType(const char *evt);
+    
+    const char *GetEventType() const
+    {
+	return (const char*) fID;
+    }
+
+    ClassDef(MTask, 1)		// Base (abstract) class for a task
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MTaskList.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MTaskList.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MTaskList.cc	(revision 447)
@@ -0,0 +1,201 @@
+///////////////////////////////////////////////////////////////////////
+//                                                                   //
+// MTaskList                                                          //
+//                                                                   //
+// Collection of tasks which should be processed in the eventloop    //
+//                                                                   //
+///////////////////////////////////////////////////////////////////////
+
+#include "MTaskList.h"
+
+#include <iostream.h>
+
+#include "MParList.h"
+#include "MInputStreamID.h"
+
+ClassImp(MTaskList)
+
+MTaskList::MTaskList()
+{
+  // 
+  //  default constructor: create empty task list
+  //
+}
+
+MTaskList::MTaskList(MTaskList &ts)
+{
+  //
+  //   CopyConstructor 
+  //   creates a new TaskList and put the contents of an existing
+  //   TaskList in the new TaskList. 
+  //
+  fTasks.AddAll(&ts.fTasks);
+}
+
+Bool_t MTaskList::AddToList(MTask *task, const char *tType, MTask *where)
+{
+  // schedule task for execution, whether as first task, or after
+  // 'where'. 'tType' is the event type which should be processed
+  if (!task)
+    return kTRUE;
+  
+  // FIXME: We agreed to put the task into list in an ordered way.
+  
+  if (fTasks.FindObject(task))
+    {
+      printf("WARNING: MTaskList::schedule: Task already existing\n");
+      return kTRUE;
+    }
+  
+  if (where)
+    {
+      if (!fTasks.FindObject(where))
+        {
+	  printf("ERROR: MTaskList::schedule: Cannot find task after which the new task should be scheduled!\n");
+	  return kFALSE;
+        }
+    }
+  
+  cout << "Adding " << task->GetName() << " to " << GetName() << " for " << tType << "... " << flush;
+  
+  task->SetEventType(tType);
+  fTasks.Add(task);
+  
+  cout << "Done." << endl;
+  
+  return kTRUE;
+}
+
+
+Bool_t MTaskList::PreProcess( MParList *pList )
+{ 
+  //
+  // do pre processing (before eventloop) of all tasks in the task-list
+  //
+  
+  fID = (MInputStreamID*)pList->FindObject("MInputStreamID");
+  if (!fID)
+    {
+      cout << "MTaskList::PreProcess - WARNING: MInputStreamID not found... creating." << endl;
+      fID = new MInputStreamID;
+      pList->AddToList(fID);
+    }
+  
+  cout << "Preprocessing... " << flush;
+  
+  //
+  //  create the Iterator over the tasklist
+  //
+  TIter next(&fTasks);
+  
+  MTask *task=NULL;
+  
+  //
+  // loop over all tasks for preproccesing
+  //
+  while ( (task=(MTask*)next()) )
+    {
+      cout << task->GetName() << "... " << flush;
+      
+      if (!task->PreProcess( pList ))
+	return kFALSE;
+    }
+  
+  cout << endl;
+  
+  return kTRUE;
+}
+
+Bool_t MTaskList::Process()
+{
+  //
+  // do the event execution of all tasks in the task-list
+  //
+  
+  //
+  //  create the Iterator for the TaskList
+  //
+  TIter next(&fTasks);
+  MTask *task=NULL;
+  
+  //
+  // loop over all tasks for processing 
+  //
+  while ( (task=(MTask*)next()) )
+    {
+      // cout << "MTaskList::Process() " << task->GetEventType() 
+      //   << "  " << fID->GetEvtType() << endl ; 
+
+      if (!strcmp(fID->GetEvtType(), task->GetEventType()) ||
+          !strcmp(task->GetEventType(), "All"))
+	{
+          switch (task->Process())
+	    {
+	    case kTRUE:
+              //
+              // everything was OK: go on
+              //
+              continue;
+	      
+	    case kFALSE:
+              //
+              // an error occured: stop eventloop
+              //
+              return kFALSE;
+	      
+	    case kCONTINUE:
+              //
+              // something occured: skip the rest of the tasks for this event
+              //
+              break;
+	    }
+	}
+    }
+  return kTRUE;
+}
+
+Bool_t MTaskList::PostProcess()
+{
+  //
+  // do post processing (before eventloop) of all tasks in the task-list
+  //
+  
+  cout << "Postprocessing... " << flush;
+  
+  //
+  //  create the Iterator for the TaskList
+  //
+  TIter next(&fTasks);
+  
+  MTask *task=NULL;
+  
+  //
+  //  loop over all tasks for postprocessing
+  //  
+  while ( (task=(MTask*)next()) )
+    {
+      cout << task->GetName() << "... " << flush;
+      
+      if (!task->PostProcess())
+	return kFALSE;
+    }
+  
+  cout << endl;
+  
+  return kTRUE;
+}
+
+
+void MTaskList::Print(Option_t *t)
+{
+  cout << "TaskList: " << this->GetName() << " <" <<  this->GetTitle() << ">" 
+       << endl;
+  
+  fTasks.Print();
+  
+  cout << endl;
+}
+
+
+
+
Index: trunk/MagicSoft/MarsOctober/mbase/MTaskList.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MTaskList.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MTaskList.h	(revision 447)
@@ -0,0 +1,36 @@
+#ifndef MTASKLIST_H
+#define MTASKLIST_H
+
+#include "Magic.h"
+
+#include <TOrdCollection.h>
+
+#include "MTask.h"
+
+class MParList;
+class MInputStreamID;
+
+class MTaskList : public MTask
+{
+private:
+    TOrdCollection fTasks;	// Container for the ordered list of different tasks
+
+    MInputStreamID *fID;
+
+public:
+    MTaskList();
+
+    MTaskList(MTaskList &ts);
+
+    Bool_t AddToList(MTask *task, const char *tType="All", MTask *where = NULL);
+
+    Bool_t PreProcess(MParList *pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    void Print(Option_t *t = NULL);
+
+    ClassDef(MTaskList, 1)	// Collection of tasks to be performed in the eventloop
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/MTime.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MTime.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MTime.cc	(revision 447)
@@ -0,0 +1,10 @@
+///////////////////////////////////////////////////////////////////////
+//
+//   MTime
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MTime.h"
+
+ClassImp(MTime)
+
Index: trunk/MagicSoft/MarsOctober/mbase/MTime.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/MTime.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/MTime.h	(revision 447)
@@ -0,0 +1,51 @@
+#ifndef MTIME_H
+#define MTIME_H
+
+#include "Magic.h"
+
+#include <TNamed.h>
+
+class MTime : public TNamed
+{
+private:
+    UInt_t fTimeStamp; // type of raw event which should be processed by this task
+    UInt_t fDuration;  // time of validity
+
+public:
+
+    MTime(const char *name=NULL, const char *title=NULL) : fTimeStamp(0)
+    {
+        fName = name ? name : ClassName();
+        fTitle = title;
+    }
+
+    MTime(UInt_t t) : fTimeStamp(t)
+    {
+    }
+
+    ~MTime() {}
+
+    void SetTime(UInt_t t)
+    {
+	fTimeStamp = t;
+    }
+
+    void SetDuration(UInt_t t)
+    {
+	fDuration = t;
+    }
+
+    UInt_t GetTime()
+    {
+	return fTimeStamp;
+    }
+
+    UInt_t GetDuration()
+    {
+	return fDuration;
+    }
+
+    ClassDef(MTime, 1)	// Base (abstract) class for a task
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/Magic.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/Magic.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/Magic.h	(revision 447)
@@ -0,0 +1,64 @@
+#ifndef MAGIC_H
+#define MAGIC_H
+///////////////////////////////////////////////////////////////////////////////
+//
+//     Magic.h
+//
+//     defines MAGIC base informations
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#include <TROOT.h>
+
+//
+// Magic number to detect the magic file type
+//
+const UShort_t kMagicNumber = 0xc0c0;
+
+//
+// Values for the eventloop control
+//
+const Int_t kCONTINUE = 2;
+
+//
+//     Number of the Pixels in the Camera
+//
+const Int_t kCAMERA_PIXELS = 577;
+
+//
+//     Number of the Slices of one Fadc. Be carefull this is the number of 
+//     slices for one gain branch. We sample two times this number. 
+//
+const Int_t kFADC_SLICES   = 15;
+
+//
+//     ParticleId for Monte Carlo simulation
+//
+const Int_t kGAMMA  =    0;
+const Int_t kPROTON =   14;
+const Int_t kHELIUM =  402;
+const Int_t kOXIGEN = 1608;
+const Int_t kIRON   = 5626;
+
+//
+// nummber of ADC conversions per pixel
+//
+const Int_t kMAX_ADC = 30;
+
+//
+//camera dimensions and definitions
+//
+const Float_t kPIXEL_DIST       =  10.0;	//cm
+const Int_t   kCAMERA_COLOR     =  13;   	//Background light grey
+const Int_t   kDEFAULT_COLOR    =   1;   	//black
+const Int_t   kPIXEL_LINE_COLOR =  15;	        //dark grey
+const Int_t   kCOLORTABLE_START =  18;	        //Begin of colortable
+const Int_t   kMAX_PH_EL        = 500;   	//upper limit for colortable
+
+//
+// THE MAGIC RUNTIME DATABASE
+//
+//class MRuntimeDb;
+//extern MRuntimeDb *gMagic;
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mbase/Makefile
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/Makefile	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/Makefile	(revision 447)
@@ -0,0 +1,133 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+INCLUDEMK = ../Makefile.conf.${OSTYPE}
+include ${INCLUDEMK}
+
+# @endcode 
+
+# @code 
+
+LIB   = libmbase.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I./
+
+#
+#  ----->>>   root libraries
+#
+
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
+#------------------------------------------------------------------------------
+
+#.SILENT:
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+
+SRCFILES = MTask.cc \
+	   MTaskList.cc \
+	   MParContainer.cc \
+	   MParList.cc \
+	   MParRead.cc \
+	   MParWrite.cc \
+           MTime.cc \
+           MInputStreamID.cc \
+	   MObjBuffer.cc \
+           MFile.cc \
+           MFileDescr.cc \
+           MEvtLoop.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+depend:
+	@makedepend $(SRCS) $(INCLUDES) $(ROOTCFLAGS) \
+        -fMakefile.depend 2> kk.kk ; cat kk.kk
+
+$(LIB): $(OBJS) BaseCint.o
+	@echo "Building Library $(LIB) ... "
+	@ar -r $(LIB) *.o
+
+BaseCint.cc: $(HEADERS) 
+	@echo 
+	@echo "Generating dictionary BaseCint.cc ..."
+
+	@$(ROOTSYS)/bin/rootcint -f BaseCint.cc \
+	-c $(INCLUDES) $(HEADERS) BaseLinkDef.h
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.cc.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+
+#
+# The cleaning facility
+#
+
+rmlib:	
+	@echo "Removing libraries..."
+	@rm -f lib*.a
+
+rmcint:	
+	@echo "Removing cint-stuff..."
+	@rm -f BaseCint.*
+
+rmobjs:	
+	@echo "Removing object files..."
+	@rm -f *.o
+
+rmbin:	
+	@echo "Removing binary files..."
+	@rm -f core
+
+
+clean:	rmlib rmcint rmobjs rmbin
+
+mrproper:	clean
+	@echo "Removing *~ kk.kk html/..."
+	@rm -f *~ kk.kk
+
+cflags: 
+	@echo $(INCLUDES) $(CXXFLAGS)
+
+# @endcode
+
Index: trunk/MagicSoft/MarsOctober/mbase/Makefile.depend
===================================================================
--- trunk/MagicSoft/MarsOctober/mbase/Makefile.depend	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mbase/Makefile.depend	(revision 447)
@@ -0,0 +1,26 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+
+# DO NOT DELETE
+
+MTask.o: MTask.h Magic.h /cern/root/include/TROOT.h
+MTask.o: /cern/root/include/TOrdCollection.h
+MTaskList.o: MTaskList.h Magic.h /cern/root/include/TROOT.h
+MTaskList.o: /cern/root/include/TOrdCollection.h MTask.h
+MParContainer.o: MParContainer.h Magic.h /cern/root/include/TROOT.h
+MParContainer.o: /cern/root/include/TObject.h
+MParList.o: MParList.h Magic.h /cern/root/include/TROOT.h
+MParList.o: /cern/root/include/TObject.h /cern/root/include/TOrdCollection.h
+MTree.o: MTree.h Magic.h /cern/root/include/TROOT.h
+MTree.o: /cern/root/include/TObject.h /cern/root/include/TFile.h
+MTree.o: /cern/root/include/TTree.h /cern/root/include/TBranch.h MObjBuffer.h
+MTree.o: /cern/root/include/TNamed.h /cern/root/include/TObjArray.h
+MTree.o: MParContainer.h
+MObjBuffer.o: MObjBuffer.h Magic.h /cern/root/include/TROOT.h
+MObjBuffer.o: /cern/root/include/TNamed.h /cern/root/include/TObjArray.h
+MObjBuffer.o: MParContainer.h /cern/root/include/TObject.h
Index: trunk/MagicSoft/MarsOctober/mgeom/MGeomCam.cxx
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/MGeomCam.cxx	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/MGeomCam.cxx	(revision 447)
@@ -0,0 +1,1 @@
+
Index: trunk/MagicSoft/MarsOctober/mgeom/MGeomCam.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/MGeomCam.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/MGeomCam.h	(revision 447)
@@ -0,0 +1,35 @@
+////////////////////////////////////////////////////////////////////////
+//
+//   class MGeomCam 
+//
+#ifndef __MGeomCam__ 
+#define __MGeomCam__ 
+
+#include "TObject.h" 
+
+class MGeomCam : public TObject { 
+  //
+  //  Geometry of the MAGIC camera. 
+  //
+  //  all geometric information about the camera is inside this class
+  //
+
+ private: 
+  
+  Int_t   fNumPixel ;    // number of Pixel in the Camera 
+  
+  Float_t  *fXcoord ;    // X coordinate of the pixels
+  Float_t  *fYcoord ;    // Y coordinate of the pixels
+  Float_t  *fRadius ;    // radius of the pixels
+
+  Int_t    *fNumNeigbor  ; 
+  Int_t   (*fNextNeigbor)[6] ;
+  
+
+
+
+ protected: 
+  
+ public: 
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mgeom/MGeomPixel.cxx
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/MGeomPixel.cxx	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/MGeomPixel.cxx	(revision 447)
@@ -0,0 +1,42 @@
+////////////////////////////////////////////////////////////////////////
+//  
+//    class MGeomPixel 
+//
+//
+
+include "MGeomPixel.h"
+
+ClassImp(MGeomPixel)
+
+
+MGeomPixel::MGeomPixel () { 
+  //
+  //     default constructor 
+  //
+  //     all values are set to zero. 
+  //     Boolean are set to kFALSE 
+  //
+
+  fPixId   = 0  ; 
+
+  fXcoord  = 0. ; 
+  fYcoord  = 0. ; 
+  fRadius  = 0. ; 
+
+  fNumNeigbor = 0 ; 
+  
+  for (Int_t i=0; i<6; i++ ) { 
+    fNextNeigbor = 0 ; 
+    fXCorner     = 0. ; 
+    fYCorner     = 0. ; 
+  } 
+
+  
+  IsInstalled = kFALSE ; 
+  IsOk        = kFALSE ; 
+} 
+
+
+
+
+
Index: trunk/MagicSoft/MarsOctober/mgeom/MGeomPixel.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/MGeomPixel.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/MGeomPixel.h	(revision 447)
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////////////////
+//
+//   class MGeomPixel 
+//
+#ifndef __MGeomPixel__ 
+#define __MGeomPixel__ 
+
+#include "TObject.h" 
+
+class MGeomCam : public TObject { 
+  //
+  //  Geometry of the MAGIC camera. 
+  //
+  //  all geometric information about the camera is inside this class
+  //
+
+ private: 
+  
+  Int_t    fPixId ;     // number of this Pixel 
+  
+  Float_t  fXcoord ;    // X coordinate of the pixels (central position) 
+  Float_t  fYcoord ;    // Y coordinate of the pixels (central position) 
+  Float_t  fRadius ;    // radius of the pixels
+
+  Int_t    fNumNeigbor     ; 
+  Int_t    fNextNeigbor[6] ;
+
+  Float_t  fXCorners[6] ; 
+  Float_t  fYCorners[6] ; 
+
+  Bool_t   IsInstalled ; 
+  Bool_t   IsOk        ; 
+  
+ protected: 
+  
+ public: 
+  
+  MGeomPixel() ; 
+
+  MGeomPixel(Int_t iP) ; 
+  
+  MGeomPixel(Int_t iP, fX, fY, fR ) ; 
+
+ClassDef(MGeomPixel, 1)          // class for a Pixel geometry
+
+
+#endif
+
Index: trunk/MagicSoft/MarsOctober/mgeom/Makefile
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/Makefile	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/Makefile	(revision 447)
@@ -0,0 +1,123 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+INCLUDEMK = ../Makefile.conf.${OSTYPE}
+include ${INCLUDEMK}
+
+
+# @endcode 
+
+# @code 
+
+LIB   = libmgeom.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I./
+
+#
+#  ----->>>   root libraries
+#
+
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
+#------------------------------------------------------------------------------
+
+#.SILENT:
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+
+SRCFILES = MGeomPixel.cxx
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cxx=.h)
+OBJS    = $(SRCFILES:.cxx=.o) 
+
+############################################################
+
+all: $(LIB)
+
+depend:
+	@makedepend $(SRCS) $(INCLUDES) $(ROOTCFLAGS) \
+        -fMakefile.depend 2> kk.kk ; cat kk.kk
+
+$(LIB): $(OBJS) BaseCint.o
+	@echo "Building Library $(LIB) ... "
+	@ar -r $(LIB) *.o
+
+BaseCint.cc: $(HEADERS) 
+	@echo 
+	@echo "Generating dictionary BaseCint.cc ..."
+
+	@$(ROOTSYS)/bin/rootcint -f BaseCint.cc \
+	-c $(INCLUDES) $(HEADERS) BaseLinkDef.h
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.cc.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+
+#
+# The cleaning facility
+#
+
+rmlib:	
+	@echo "Removing libraries..."
+	@rm -f lib*.a
+
+rmcint:	
+	@echo "Removing cint-stuff..."
+	@rm -f BaseCint.*
+
+rmobjs:	
+	@echo "Removing object files..."
+	@rm -f *.o
+
+rmbin:	
+	@echo "Removing binary files..."
+	@rm -f core
+
+
+clean:	rmlib rmcint rmobjs rmbin
+
+mrproper:	clean
+	@echo "Removing *~ kk.kk html/..."
+	@rm -f *~ kk.kk
+
+cflags: 
+	@echo $(INCLUDES) $(CXXFLAGS)
+
+# @endcode
+
Index: trunk/MagicSoft/MarsOctober/mgeom/Makefile.depend
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/Makefile.depend	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/Makefile.depend	(revision 447)
@@ -0,0 +1,9 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+
+# DO NOT DELETE
Index: trunk/MagicSoft/MarsOctober/mgeom/kk.kk
===================================================================
--- trunk/MagicSoft/MarsOctober/mgeom/kk.kk	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mgeom/kk.kk	(revision 447)
@@ -0,0 +1,1 @@
+makedepend: warning:  ignoring option -nostdnew
Index: trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/BaseLinkDef.h	(revision 447)
@@ -0,0 +1,13 @@
+#ifdef __CINT__
+
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MGOctMain ;
+#pragma link C++ class MGDisplayAdc ;
+
+#pragma link C++ class MHistosAdc ;
+#pragma link C++ class MAdcSpect ;
+#pragma link C++ class MShowSpect ;
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mocttest/MAdcSpect.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MAdcSpect.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MAdcSpect.cc	(revision 447)
@@ -0,0 +1,118 @@
+#include "MAdcSpect.h"
+
+#include <iostream.h>
+#include <stdlib.h>
+
+#include <TFile.h>
+
+#include "MRawEvt.h"
+#include "MParList.h"
+#include "MHistosAdc.h"
+
+
+////////////////////////////////////////////////////////////////////////
+//
+//  MAdcSpect.h
+//
+//  A Task to fill the raw ADC values in the histograms to create 
+//  the ADC raw spectra
+//
+
+ClassImp(MAdcSpect)
+
+MAdcSpect::MAdcSpect( char* treeName, char *rootfile)
+{
+  //
+  //   default constructor
+  //
+  sprintf(fTreeName, "%s", treeName ) ; 
+
+  sprintf(fOutFile, "%s", rootfile);
+}
+
+
+Bool_t MAdcSpect::PreProcess(MParList *pList)
+{
+  //
+  //   Do the preprocessing for MAdcSpect
+  // 
+  //   Connects the event in MRawEvtBuf as the input for this task
+  //   and the MHistosAdc container as the output 
+  //
+
+  //
+  //   first look for the input buffer MRawEvtBuf
+  //  
+  fEvtBuf = (MObjBuffer*) pList->FindObject(fTreeName);
+  if (!fEvtBuf)
+    {
+      cout << "ERROR: MAdcSpect::PreProc(): " << fTreeName << " not found!" << endl;
+      exit(1);
+    }
+
+  //
+  //  second connect the output container 
+  //
+  fHists = (MHistosAdc*) pList->FindObject("MHistosAdc");
+  
+  if (!fHists)
+    {
+      cout << "ERROR: MAdcSpect::PreProc(): MHistosAdc not found!" << endl;
+      exit(1);
+    }
+  
+  return kTRUE ; 
+}
+
+Bool_t MAdcSpect::Process()
+{
+  //
+  //  fill the raw data values in the corresponding histograms
+  //
+  
+  //
+  //   loop over the pixels in the events
+  //
+  
+  MRawEvt *fRawEvt = (MRawEvt*)(*fEvtBuf)();
+  
+  for ( Int_t i=0 ;  i< (Int_t) fRawEvt->GetMultPixel(); i++ )
+    {
+      fHists->FillAdcHist ( fRawEvt->GetPixelId(i),
+			    fRawEvt->GetPixelData(i) );
+      
+    }
+  
+  return kTRUE ;
+}
+
+
+Bool_t MAdcSpect::PostProcess()
+{
+    //
+    //  PostProessing
+    //
+    //  after the loop over all events this routine is executed.
+    //  Here the postprecessing is checking the contents of
+    //  fOutFile.
+    //  If it is "nooutput", nothing is done.
+    //  Else the histograms in the MHistosAdc are written to a file.
+    //
+
+    if (strcmp (fOutFile, "nooutput"))
+    {
+        //
+        //   write the histograms to File
+        //
+        cout << endl << "--> INFO: write the histograms to file: "
+            << fOutFile  << endl ;
+
+        //
+        //   call the containers save function
+        //
+
+        fHists->SaveHist(fOutFile);
+    }
+
+    return kTRUE;
+}
Index: trunk/MagicSoft/MarsOctober/mocttest/MAdcSpect.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MAdcSpect.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MAdcSpect.h	(revision 447)
@@ -0,0 +1,32 @@
+#ifndef MADCSPECT_H
+#define MADCSPECT_H
+
+#include "Magic.h"
+
+#include "MTask.h"
+#include "MObjBuffer.h"
+
+class MHistosAdc;
+class MParList;
+
+class MAdcSpect : public MTask
+{
+private:
+    MObjBuffer * fEvtBuf;	// Pointer to MObjBuffer for Event Tree
+
+    MHistosAdc *fHists;		// Pointer to Container with the histograms
+
+    char fTreeName[256];	// Name of the tree to fill 
+    char fOutFile[256];		// Name of the output file
+
+public:
+    MAdcSpect(Char_t* treeName = "EvtTree", Char_t * rootfile = "nooutput");
+
+    Bool_t PreProcess(MParList * pList);
+    Bool_t Process();
+    Bool_t PostProcess();
+
+    ClassDef(MAdcSpect, 1)	// Fill the raw ADC in the histograms
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.cc	(revision 447)
@@ -0,0 +1,238 @@
+#include "MGDisplayAdc.h" 
+
+MGDisplayAdc::MGDisplayAdc ( MHistosAdc *Histos,
+			     const TGWindow *p, const TGWindow *main, 
+			     UInt_t w, UInt_t h, 
+			     UInt_t options) 
+  : TGTransientFrame(p, main, w, h, options ) 
+{
+  //   default constructor
+
+  fHists = Histos ; 
+
+  //   the top frame for the list and some buttons and the Canvas 
+
+  fFrameTop = new TGHorizontalFrame (this, 60,20,  kFitWidth ) ;
+
+  //    left part of top frame
+  fFT1 =  new TGVerticalFrame (fFrameTop, 80,300,  kFitWidth ) ; 
+
+  fHistoList = new TGListBox ( fFT1, M_LIST_HISTO ) ; 
+  fHistoList->Associate( this ) ; 
+  fFT1->AddFrame ( fHistoList, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 10 ) )  ; 
+  fHistoList->Resize(80, 300 ) ; 
+
+  fFrameTop->AddFrame (fFT1, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ; 
+
+
+  //    middle part of top frame
+ 
+  fFT2 =  new TGVerticalFrame (fFrameTop, 80,20,  kFitWidth ) ;  
+
+  fButtonPrev = new TGTextButton ( fFT2, "Prev Histo", M_BUTTON_PREV ) ; 
+  fButtonPrev->Associate (this) ; 
+  fFT2->AddFrame ( fButtonPrev, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 50, 10 ) )  ; 
+
+  fButtonNext = new TGTextButton ( fFT2, "Next Histo", M_BUTTON_NEXT ) ; 
+  fButtonNext->Associate (this) ; 
+  fFT2->AddFrame ( fButtonNext, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 10, 5 ) )  ; 
+
+  fFrameTop->AddFrame (fFT2, new TGLayoutHints ( kLHintsTop , 10, 10, 10, 10 ) ) ; 
+
+  //    right part of top frame
+  
+  fFT3 =  new TGVerticalFrame (fFrameTop, 60, 60,  kFitWidth ) ;
+
+  fECanv = new TRootEmbeddedCanvas("fECanv", fFT3, 400, 400 ) ; 
+  fFT3->AddFrame( fECanv, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ; 
+
+  fCanv = fECanv->GetCanvas() ; 
+
+  fFrameTop->AddFrame (fFT3, new TGLayoutHints ( kLHintsCenterX | kLHintsCenterY | kLHintsExpandX | kLHintsExpandY , 10, 10, 10, 10 ) ) ; 
+  
+  AddFrame ( fFrameTop, new TGLayoutHints ( kLHintsTop | kLHintsExpandX , 10, 10, 10, 10 ) ) ; 
+
+  //
+  //   the low frame for the control buttons
+  //
+  fFrameLow = new TGHorizontalFrame (this, 60,20, kFixedWidth ) ;
+    
+  fButtonSave = new TGTextButton ( fFrameLow, "Save", M_BUTTON_SAVE ) ; 
+  fButtonSave->Associate (this) ; 
+  fFrameLow->AddFrame ( fButtonSave, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ; 
+
+  fButtonPrint = new TGTextButton ( fFrameLow, "Print", M_BUTTON_PRINT ) ; 
+  fButtonPrint->Associate (this) ; 
+  fFrameLow->AddFrame ( fButtonPrint, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ; 
+
+  fButtonPrintAll = new TGTextButton ( fFrameLow, "PrintAll", M_BUTTON_PRINTALL ) ; 
+  fButtonPrintAll->Associate (this) ; 
+  fFrameLow->AddFrame ( fButtonPrintAll, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ; 
+
+  fButtonClose = new TGTextButton ( fFrameLow, "Close", M_BUTTON_CLOSE ) ; 
+  fButtonClose->Associate (this) ; 
+  fFrameLow->AddFrame ( fButtonClose, new TGLayoutHints (kLHintsLeft | kLHintsTop, 10, 10, 5, 5 ) )  ; 
+  AddFrame ( fFrameLow, new TGLayoutHints ( kLHintsBottom | kLHintsExpandX , 10, 10, 10, 10 ) ) ; 
+
+  //
+  //
+  //
+  BuildHistoList() ; 
+
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("ADC Spectra");
+  SetIconName("ADC Spectra");
+  
+  MapWindow(); 
+}  
+  
+// ======================================================================
+// ======================================================================
+
+
+
+MGDisplayAdc::~MGDisplayAdc () 
+{ 
+  delete fButtonSave ; 
+  delete fButtonPrint ; 
+  delete fButtonPrintAll ; 
+  delete fButtonClose ; 
+ 
+  delete fButtonPrev; 
+  delete fButtonNext ; 
+  
+  delete fECanv ; 
+  delete fHistoList ; 
+  delete fFT1 ; 
+  delete fFT2 ; 
+  delete fFT3 ; 
+  delete fFrameLow ; 
+  delete fFrameTop ; 
+  
+}  
+
+// ======================================================================
+// ======================================================================
+
+void MGDisplayAdc::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+  delete this ; 
+  //  TGTransientFrame::CloseWindow();
+  //  TGMainFrame::CloseWindow();
+  //   gROOT->GetApplication()->Terminate(0)  ; 
+}
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGDisplayAdc::BuildHistoList() 
+{ 
+  //   looks in the container of the AdcSpectra and reads in the 
+  //   Histogramms in there. 
+  //
+  //   In the class MHistosAdc are in fact two lists. One for the high and
+  //   one for the low gain. Here we will use only the high gain list!!!
+  //   With some special options (settings in the gui) we will also be able
+  //   to plot the low gain
+  
+  for ( Int_t i=0 ; i < fHists->GetHighEntries(); i++ ) { 
+ 
+    fHistoList->AddEntry(fHists->GetHighList()->At(i)->GetName(), i+1) ; 
+  } 
+  
+  fHistoList->MapSubwindows() ; 
+  fHistoList->Layout() ; 
+
+  return (kTRUE) ; 
+} 
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGDisplayAdc::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+  // Process events generated by the buttons in the frame.
+  
+  Int_t   buttons = 4, retval = 0 ; 
+  Char_t  wort[100] ;
+  Char_t  extens[5] ;
+  Char_t  command[110] ;
+ 
+  TGFileItem *item ;     // to process items in the file view container
+  void *np = NULL ;      // null pointer
+
+  switch (GET_MSG(msg)) 
+    {
+    case kC_COMMAND:
+      switch (GET_SUBMSG(msg)) 
+	{
+	case kCM_BUTTON:
+	  
+	  switch (parm1)
+	    {  
+
+	    case M_BUTTON_SAVE: 
+	      break ; 
+	      
+	    case M_BUTTON_CLOSE: 
+	      CloseWindow() ; 
+	      break ; 
+	      
+	    default:
+	      break ;
+	    } 
+
+	case kCM_MENU:
+	  switch (parm1) {
+	  }
+	  break ;
+	  
+	default:
+	  break ;
+	  
+	}
+
+    case kCM_LISTBOX:
+      switch  (GET_SUBMSG(msg)) 
+	{
+	case M_LIST_HISTO: 
+	  fCanv->cd() ; 
+	  
+	  fHists->GetHighList()->At( fHistoList->GetSelected()-1)->Draw() ; 
+
+	  fCanv->Modified() ; 
+	  fCanv->Update() ; 
+	  
+	  break; 
+	  
+	default:
+	  break ;
+	}
+
+    case kC_CONTAINER: 
+      switch (GET_SUBMSG(msg)) {
+	      
+      case kCT_ITEMDBLCLICK: 
+	
+	break; 
+	
+      default:
+	break ;
+      }
+      
+      
+      
+    default:
+      break;
+    }
+  return kTRUE;
+} 
Index: trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MGDisplayAdc.h	(revision 447)
@@ -0,0 +1,79 @@
+#ifndef MGDISPLAYADC_H
+#define MGDISPLAYADC_H
+
+#include <iostream.h>
+#include <TROOT.h> 
+#include <TApplication.h> 
+#include <TSystem.h> 
+#include <TGClient.h> 
+#include <TGButton.h>
+#include <TGMenu.h>
+#include <TGTab.h> 
+#include <TGListBox.h> 
+#include <TGPicture.h>
+#include <TRootEmbeddedCanvas.h>
+#include <TCanvas.h>
+#include <TGFSContainer.h>
+#include <TGMsgBox.h>
+
+#include <TVirtualX.h>
+#include <TGClient.h>   
+
+#include "MHistosAdc.h"
+
+class MHistosAdc;
+
+enum ComIdentDisplayAdc {
+  M_BUTTON_SAVE,
+  M_BUTTON_PRINT,
+  M_BUTTON_PRINTALL,
+  M_BUTTON_CLOSE , 
+
+  M_BUTTON_PREV, 
+  M_BUTTON_NEXT,
+
+  M_LIST_HISTO 
+  
+} ; 
+
+class MGDisplayAdc : public TGTransientFrame {
+ private:
+  
+  MHistosAdc *fHists;		// Pointer to Container with the histograms
+  
+  // Create a main frame with a number of different buttons.
+    
+  TGCompositeFrame  *fFrameTop ;   // top part of the main window
+  TGCompositeFrame  *fFrameLow ;   // low part of the main window
+  
+  TGVerticalFrame   *fFT1, *fFT2, *fFT3 ;
+
+  TGListBox         *fHistoList ; 
+  TGTextButton      *fButtonPrev, *fButtonNext ; 
+  
+  TRootEmbeddedCanvas  *fECanv ; 
+
+  TGTextButton   *fButtonSave, *fButtonPrint, *fButtonPrintAll, *fButtonClose ; 
+  
+  TCanvas            *fCanv ; 
+
+ public:
+  
+  MGDisplayAdc(MHistosAdc *fHists , 
+	       const TGWindow *p, const TGWindow *main, 
+  	       UInt_t w, UInt_t h, 
+	       UInt_t options = kMainFrame | kVerticalFrame ) ;
+
+  ~MGDisplayAdc(); 
+  
+  void  CloseWindow()  ; 
+  
+  Bool_t BuildHistoList() ; 
+
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+  
+} ; 
+
+#endif
+
+
Index: trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.cc	(revision 447)
@@ -0,0 +1,388 @@
+#include "MGOctMain.h"
+
+#define S_ISDIR(m) (((m)&(0170000)) == (0040000))  
+
+MGOctMain::MGOctMain(const TGWindow *p, UInt_t w, UInt_t h)
+  : TGMainFrame(p, w, h)
+{
+  //
+  //    Main window to controll the october test
+  //
+
+  //    set non-gui members to starting values 
+
+  sprintf ( fInputFile, "\n" ) ; 
+
+  //
+  //    First create the MenuBar.   
+  //
+
+  //     Layout objects for menue. 
+
+  fLayMenuBar = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 2, 2, 2, 2 ) ; 
+  fLayMenuItem = new TGLayoutHints ( kLHintsTop | kLHintsLeft , 0, 4, 0, 0 ) ; 
+  
+  //  crate the menu bar
+
+  fFileMenu = new TGPopupMenu ( fClient->GetRoot() ) ; 
+  fFileMenu->AddEntry ("Exit", M_FILE_EXIT ) ; 
+  fFileMenu->Associate(this) ; 
+
+  //  the button messages are handled by main frame (this) 
+
+  fMenuBar = new TGMenuBar ( this, 1, 1, kHorizontalFrame ) ; 
+  fMenuBar->AddPopup("File", fFileMenu, fLayMenuItem ) ;   
+  AddFrame(fMenuBar, fLayMenuBar ) ; 
+  
+  //
+  //    Create the top window with a lot of buttons 
+  //
+
+  fFrameTop = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
+  
+  fButEvtDisp = new TGTextButton(fFrameTop, "EventDisplay", M_BUTTON_EVTDISP );
+  fButEvtDisp->Associate(this) ;   
+  fFrameTop->AddFrame (fButEvtDisp, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+  fButPedADC = new TGTextButton(fFrameTop, "ADC Spectra of Pedestals", M_BUTTON_PEDADC );
+  fButPedADC->Associate(this) ;   
+  fFrameTop->AddFrame (fButPedADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+  fButCrADC = new TGTextButton(fFrameTop, "ADC Specta of Cosmics", M_BUTTON_CRADC );
+  fButCrADC->Associate(this) ;   
+  fFrameTop->AddFrame (fButCrADC, new TGLayoutHints(kLHintsTop | kLHintsLeft, 10, 10, 5, 5) );
+
+ 
+  AddFrame(fFrameTop, new TGLayoutHints (kLHintsExpandX ) ) ;   
+
+  //
+  //    Create the low window with a tabs in it
+  //
+
+  fFrameLow = new TGCompositeFrame (this, 300,100, kHorizontalFrame ) ; 
+  
+  fLayTab = new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX  , 5, 5, 5, 5 ) ;
+
+  //    create the first tab
+
+  fTab = new TGTab ( fFrameLow, 400, 400 ) ;   
+
+  TGCompositeFrame *tf = fTab->AddTab("Input File") ; 
+  
+  fTabF1 = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1, fLayTab ) ; 
+
+  
+  fTabF1a = new TGCompositeFrame (tf, 100, 100, kHorizontalFrame) ; 
+  tf->AddFrame(fTabF1a,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+  fTabF1b = new TGCompositeFrame (tf, 100, 100, kVerticalFrame) ; 
+  //  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsTop | kLHintsLeft | kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+  tf->AddFrame(fTabF1b,  new TGLayoutHints ( kLHintsExpandX | kLHintsExpandY  , 5, 5, 5, 5 ) ) ; 
+
+  
+  fDir = new TGListBox(fTabF1a, -1) ; 
+  fDir->Resize(350,20) ;
+  char temp[100] ; 
+  //  sprintf ( temp, "%s", START_DIRECTORY ) ; 
+  sprintf ( temp, "%s", gSystem->WorkingDirectory()  ) ; 
+  fDir->AddEntry(temp, 1) ; 
+  fTabF1a->AddFrame( fDir, new TGLayoutHints(kLHintsTop | kLHintsLeft | kLHintsExpandX, 5, 5, 5, 5 ) ) ; 
+
+
+  fPicCdup = fClient->GetPicture("tb_uplevel.xpm") ; 
+  fCdup = new TGPictureButton(fTabF1a, fPicCdup, M_PBUTTON_CDIR_UP ) ; 
+  fCdup->SetToolTipText("One Level up!") ; 
+  fCdup->Associate(this) ; 
+  fTabF1a->AddFrame (fCdup, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicList = fClient->GetPicture("tb_list.xpm") ; 
+  fListMode = new TGPictureButton(fTabF1a, fPicList, M_PBUTTON_LIST_MODE ) ; 
+  fListMode->SetToolTipText("List Mode") ; 
+  fListMode->Associate(this) ; 
+  fListMode->SetState(kButtonUp) ; 
+  fListMode->AllowStayDown(kTRUE) ; 
+  fTabF1a->AddFrame (fListMode, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+  fPicDetail = fClient->GetPicture("tb_details.xpm") ; 
+  fDetail = new TGPictureButton(fTabF1a, fPicDetail, M_PBUTTON_DETAIL_MODE ) ; 
+  fDetail->SetToolTipText("Details Mode") ; 
+  fDetail->Associate(this) ; 
+  fDetail->SetState(kButtonEngaged) ; 
+  fDetail->AllowStayDown(kTRUE) ; 
+  fTabF1a->AddFrame (fDetail, new TGLayoutHints(kLHintsLeft | kLHintsTop, 5, 5, 5, 5) ) ; 
+
+    
+  fFileView = new TGListView(fTabF1b, 540, 380 ) ; 
+  fFileCont = new TGFileContainer(fFileView->GetViewPort(), 100, 100,
+				  kVerticalFrame, fgWhitePixel) ; 
+
+  fFileCont->Associate(this) ; 
+  fFileView->GetViewPort()->SetBackgroundColor(fgWhitePixel) ; 
+  fFileView->SetContainer(fFileCont) ; 
+  fFileCont->SetFilter("*") ; 
+  //  fFileCont->ChangeDirectory(START_DIRECTORY) ; 
+  fFileCont->ChangeDirectory(gSystem->WorkingDirectory()) ; 
+  fFileView->SetViewMode(kLVDetails); 
+  fFileCont->Sort(kSortByName) ; 
+  
+  fTabF1b->AddFrame(fFileView, new TGLayoutHints(kLHintsTop | kLHintsExpandX, 5, 5, 5, 5) ) ; 
+
+   
+  tf->AddFrame(fTabF1, fLayTab) ; 
+  fFrameLow->AddFrame ( fTab, new TGLayoutHints(kLHintsBottom | kLHintsExpandX | kLHintsExpandY, 5, 5, 5, 5) ); 
+
+  AddFrame(fFrameLow, new TGLayoutHints (kLHintsExpandX|kLHintsExpandY) ) ; 
+
+  //
+  //   Map the window, set up the layout, etc. 
+  //
+
+  MapSubwindows();
+  
+  Layout();
+  
+  SetWindowName("MARS Main Window");
+  SetIconName("MARS");
+  
+  MapWindow();
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+MGOctMain::~MGOctMain()
+{
+  delete   fFrameTop, fFrameLow ; 
+
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+void MGOctMain::CloseWindow()
+{
+   // Got close message for this MainFrame. Calls parent CloseWindow()
+   // (which destroys the window) and terminate the application.
+   // The close message is generated by the window manager when its close
+   // window menu item is selected.
+
+   TGMainFrame::CloseWindow();
+   gROOT->GetApplication()->Terminate(0)  ; 
+}
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGOctMain::InputFileSelected() 
+{
+  //   Checks if there is a selected input root file
+  
+  if ( strcmp ( fInputFile, "\n") == 0 )
+    { 
+      return ( kFALSE ) ; 
+    } 
+  
+  return (kTRUE) ; 
+} 
+
+
+// ======================================================================
+// ======================================================================
+
+Bool_t MGOctMain::ProcessMessage(Long_t msg, Long_t parm1, Long_t)
+{     
+  // Process events generated by the buttons in the frame.
+  
+  Int_t   buttons = 4, retval = 0 ; 
+  Char_t  wort[100] ;
+  Char_t  extens[5] ;
+  Char_t  command[110] ;
+ 
+  TGFileItem *item ;     // to process items in the file view container
+  void *np = NULL ;      // null pointer
+
+  switch (GET_MSG(msg)) 
+    {
+    case kC_COMMAND:
+      switch (GET_SUBMSG(msg)) 
+	{
+	case kCM_BUTTON:
+	  
+	  switch (parm1)
+	    {  
+
+	    case M_BUTTON_EVTDISP:
+	      
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this,
+			     "ERROR!", 
+			     "No Input (root) File selected!", 
+			     kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }
+	      //   just a warning that the EventDisplay  doesn't exist
+	      new TGMsgBox(fClient->GetRoot(), this,
+			   "WARNING!", 
+			   "EventDisplay not yet implemented! Gabi works on it!!", 
+			   kMBIconExclamation, buttons, &retval);
+	      
+	      break ; 
+	    
+	    case M_BUTTON_PEDADC:
+	      	
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
+			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }      
+	      
+	      fOctober.PedAdcSpectra(fInputFile) ; 
+
+	      break ; 
+		  
+
+	    case M_BUTTON_CRADC:
+	      
+	      if ( InputFileSelected() == kFALSE ) {              // it is not selected
+		
+		new TGMsgBox(fClient->GetRoot(), this, "ERROR!", 
+			     "No Input (root) File selected!", kMBIconExclamation, buttons, &retval);
+		break ; 
+	      }
+	      
+	      fOctober.CrAdcSpectra(fInputFile) ; 
+
+	      break ; 
+      
+	    case M_PBUTTON_CDIR_UP :
+
+	      //  goto the parent directory
+	      
+	      gSystem->ChangeDirectory("..") ; 
+	      fDir->RemoveEntry(1) ; 
+	      sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+	      fDir->AddEntry(wort,1) ; 
+	      fDir->MapSubwindows() ; 
+	      fDir->Layout() ; 
+	      fFileCont->ChangeDirectory( wort ) ; 
+	      fFileCont->DisplayDirectory() ; 
+	      
+	      break ; 
+	    
+	    case M_PBUTTON_LIST_MODE:
+	      fFileView->SetViewMode(kLVList) ; 
+	      fDetail->SetState(kButtonUp) ; 
+	      
+	      break ; 
+	      
+	    case M_PBUTTON_DETAIL_MODE:
+	      fFileView->SetViewMode(kLVDetails) ; 
+	      fListMode->SetState(kButtonUp) ; 
+	      
+	      break ;
+	      
+	    default:
+	      break ;
+	    } 
+
+	case kCM_MENU:
+	  switch (parm1) {
+	  case M_FILE_EXIT: 
+	    CloseWindow() ;
+	    break; 
+	    
+	  }
+	  break ;
+	  
+	default:
+	  break ;
+	  
+	}
+      
+    case kC_CONTAINER: 
+      switch (GET_SUBMSG(msg)) {
+	
+	//      case kCT_ITEMCLICK:
+	// 	printf ("itemclick\n"); 
+	//      break; 
+	
+      
+      case kCT_ITEMDBLCLICK: 
+	//
+	//  process the double click in the file view container
+	//
+	
+	if ( parm1 == kButton1) {
+	  if ( fFileCont->NumSelected() == 1 ) {   
+	    //
+	    //  one file selected
+	    //	  
+	    item = (TGFileItem *) fFileCont->GetNextSelected(&np) ; 
+	    
+	    if ( S_ISDIR(item->GetType()) )   // file is directory
+	      {  
+		//  goto directory 
+		
+		sprintf (wort, "%s", item->GetItemName()->GetString()) ;
+		fFileCont->ChangeDirectory ( wort ) ; 
+		gSystem->ChangeDirectory( wort ) ; 
+		
+		sprintf (wort, "%s", gSystem->WorkingDirectory() ) ; 
+		fDir->RemoveEntry(1) ; 
+		fDir->AddEntry( wort, 1 ) ; 
+		fDir->MapSubwindows() ; 
+		fDir->Layout() ; 
+	      }
+	    else                              // file is no directory, is a file 
+	      { 
+		sprintf (wort, "%s", item->GetItemName()->GetString() ) ; 
+	    
+		//    determine the file type by extensions
+		
+		for (Int_t i = 0 ; i<5; i++) 
+		  extens[i] = '\0' ; 
+		
+		for ( Int_t i=0; wort[i] != '\0'; i++) {
+		  if ( wort[i] == '.') {
+		    strncpy (extens, &wort[i+1], 4 ) ; 
+		    break ; 
+		  }
+		}
+		
+		if ( ! strcmp(extens, "ps") ) {              //     postscript file
+		  sprintf ( command, "gv %s/%s &", 
+			    gSystem->WorkingDirectory(), 
+			    wort ) ; 
+		  gSystem->Exec(command) ; 
+		  break ; 
+		}
+		else if  ( ! strcmp(extens, "root") ) {      //     root file
+		  sprintf ( fInputFile, "%s/%s" , gSystem->WorkingDirectory(), wort ) ;  
+
+		  printf (" %s \n", fInputFile ) ; 
+		  break ; 
+		}
+		
+	      } 
+	  }
+	}
+	break; 
+	
+      default:
+	break ;
+      }
+      
+      
+      
+    default:
+      break;
+    }
+  return kTRUE;
+} 
Index: trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MGOctMain.h	(revision 447)
@@ -0,0 +1,103 @@
+#ifndef MGOCTMAIN_H
+#define MGOCTMAIN_H
+
+#include <TROOT.h> 
+#include <TApplication.h> 
+#include <TSystem.h> 
+#include <TGClient.h> 
+#include <TGButton.h>
+#include <TGMenu.h>
+#include <TGTab.h> 
+#include <TGListBox.h> 
+#include <TGPicture.h>
+#include <TGFSContainer.h>
+#include <TGMsgBox.h>
+
+#include <TVirtualX.h>
+#include <TGClient.h>   
+
+/* #include <TGTextEntry.h> */
+/* #include <TGLabel.h> */
+/* #include <TRootEmbeddedCanvas.h> */
+/* #include <TNtuple.h> */
+/* #include <TFile.h> */
+/* #include <TCanvas.h> */
+
+#include "MOctTest.h" 
+
+enum CommandIdentifiers {
+  M_FILE_EXIT ,
+  M_FILE_ABOUT , 
+
+  M_BUTTON_EVTDISP , 
+  M_BUTTON_PEDADC, 
+  M_BUTTON_CRADC, 
+
+  M_PBUTTON_CDIR_UP, 
+  M_PBUTTON_LIST_MODE, 
+  M_PBUTTON_DETAIL_MODE 
+} ; 
+
+
+class MGOctMain : public TGMainFrame {
+ private:
+  
+  //
+  // Create a main frame with a number of different buttons.
+  //
+
+  //   some member not connected with Gui 
+  
+  Char_t       fInputFile[200] ; 
+  MOctTest     fOctober ; 
+
+  //  the things for the menu bar 
+    
+  TGMenuBar         *fMenuBar ; 
+  TGPopupMenu       *fFileMenu ;
+
+  //   divide the Window in two different parts
+  
+  TGCompositeFrame  *fFrameTop ;   // top part of the main window
+  TGCompositeFrame  *fFrameLow ;   // low part of the main window
+  TGTab             *fTab      ;   // different tabs in the low window
+  
+  //   the buttons in the Top Part
+  
+  TGTextButton      *fButEvtDisp ; 
+  TGTextButton      *fButPedADC, *fButCrADC  ; 
+  
+  //   the things in the file selector
+
+  TGCompositeFrame  *fTabF1 ;                       // first tab of low part 
+  TGCompositeFrame  *fTabF1a, *fTabF1b ;            // subpart of the file selector in low window
+  TGListBox         *fDir ; 
+  TGPictureButton   *fCdup, *fListMode, *fDetail ; 
+  TGFileContainer   *fFileCont ; 
+  TGListView        *fFileView ;
+
+  //     Layout hints for different uses 
+  
+  TGLayoutHints     *fLayMenuBar, *fLayMenuItem ; 
+  TGLayoutHints     *fLayTab ; 
+  
+  //     some icons and pictures often used
+  
+  const TGPicture   *fPicCdup, *fPicList, *fPicDetail ; 
+  
+ public: 
+  MGOctMain(const TGWindow *p, UInt_t w, UInt_t h) ;
+  
+  ~MGOctMain(); 
+  
+  void   CloseWindow()  ; 
+
+  Bool_t InputFileSelected() ; 
+  
+  Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2);
+
+} ; 
+
+#endif
+
+
Index: trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.cc	(revision 447)
@@ -0,0 +1,130 @@
+///////////////////////////////////////////////////////////////////////
+//
+// MHistosAdc
+//
+// This class contains a list of all ADC spektra histograms
+//
+///////////////////////////////////////////////////////////////////////
+
+#include "MHistosAdc.h"
+
+#include <iostream.h>
+
+#include <TH1.h>
+#include <TFile.h>
+
+ClassImp(MHistosAdc)
+
+MHistosAdc::MHistosAdc ()
+{
+    //
+    //  default constructor
+    //  creates an a list of histograms for all pixels and both gain channels
+    //
+
+    fHistHigh = new TObjArray(577);
+    fHistLow  = new TObjArray(577);
+
+    //
+    //   set the name and title of this object
+    //
+
+    fName  = "MHistosAdc" ;
+    fTitle = "Container for ADC spectra histograms" ;
+
+    //
+    //   loop over all Pixels and create two histograms
+    //   one for the Low and one for the High gain
+    //   connect all the histogram with the container fHist
+    //
+
+    Char_t  tmp1[40];
+    Char_t  tmp2[40];
+    TH1F    *h1;
+
+    for ( Int_t i = 0 ; i < 577 ; i++)
+    {
+        sprintf ( tmp1, "high%d", i ) ;
+        sprintf ( tmp2, "high gain Pixel %d", i ) ;
+
+        h1 = new TH1F ( tmp1, tmp2, 256, 0., 255. ) ;
+
+        fHistHigh->Add( h1 ) ;
+
+        sprintf ( tmp1, "low %d", i ) ;
+        sprintf ( tmp2, "low gain Pixel %d", i ) ;
+
+        h1 = new TH1F ( tmp1, tmp2, 256, 0., 255. ) ;
+
+        fHistLow->Add( h1 ) ;
+
+    }
+}
+
+MHistosAdc::~MHistosAdc ()
+{
+  
+  //   default destructor 
+  //
+  delete fHistHigh ; 
+  delete fHistLow  ; 
+}
+
+void MHistosAdc::Print(Option_t *)
+{
+  for ( Int_t i = 0 ; i < 576 ; i++)
+    {
+      fHistHigh[i].Print() ;
+    }
+}
+
+void MHistosAdc::FillAdcHist ( Int_t iPix, UChar_t* data)
+{
+  //  cout << " MHistosAdc::FillAdcHist " << endl ; 
+
+  //
+  //   fill all slices (contained in data) in the Histogram
+  //   of iPix. If iPix > 10000 this is a low gain channel
+  
+  //
+  //   check which container list is needed
+  //   for high or for low gain
+  //
+  if ( iPix < 10000 )
+    {
+      //
+      //   loop over data
+      //
+      for (Int_t i=0; i< 15; i++ )
+	{
+	  ((TH1F*) (fHistHigh->At(iPix)))->Fill( (Float_t) data[i]) ;
+	}
+    }
+  else
+    {
+      //
+      //   loop over data
+      //
+      for (Int_t i=0; i< 15; i++ )
+        {
+	  ((TH1F*) (fHistLow->At(iPix)))->Fill( (Float_t) data[i]) ;
+        }
+    }
+}
+
+void MHistosAdc::SaveHist ( char *name )
+{
+    //
+    //   save all histogram in this class to a root file
+    //
+
+    TFile out( name, "recreate") ;
+
+    //
+    //  loop over all pixels and write the files out
+    //
+
+    fHistLow->Write() ;
+    fHistHigh->Write() ;
+}
+
Index: trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MHistosAdc.h	(revision 447)
@@ -0,0 +1,46 @@
+#ifndef MHISTOSADC_H
+#define MHISTOSADC_H
+
+#include "Magic.h"
+
+#include <TObjArray.h>
+
+#include "MParContainer.h"
+
+class MHistosAdc : public MParContainer
+{
+private:
+    TObjArray *fHistHigh;	// List of High gain Histograms
+    TObjArray *fHistLow;	// List of Low  gain Histograms
+
+public:
+     MHistosAdc();
+    ~MHistosAdc();
+
+    void FillAdcHist(Int_t iPix, UChar_t * data);
+    void SaveHist(char *name);
+
+    void Print(Option_t * t = NULL);
+
+
+    TObjArray* GetHighList() 
+      { 
+	return ( fHistHigh ) ; 
+      } 
+    
+    Int_t GetHighEntries() 
+      { 
+	return (fHistHigh->GetEntries() ) ;  
+      } 
+
+    Int_t GetLowEntries() 
+      { 
+	return (fHistLow->GetEntries() ) ;  
+      } 
+
+      
+    ClassDef(MHistosAdc, 1)	// list of Histograms with ADC spectra
+};
+
+#endif
+
Index: trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MOctTest.cc	(revision 447)
@@ -0,0 +1,214 @@
+#include <stdlib.h>
+
+
+#include "MOctTest.h" 
+
+
+MOctTest::MOctTest() 
+{
+  // default constructor  
+} 
+
+MOctTest::~MOctTest() 
+{
+  // default destructor  
+} 
+
+
+// ================================================================================
+// ================================================================================
+// ================================================================================
+// ================================================================================
+
+
+Bool_t MOctTest::PedAdcSpectra ( Char_t *inputfile ) 
+{
+  //
+  //  
+  
+  printf ("PedAdcSpectra:: Analyse the file %s \n", inputfile ) ; 
+  
+  //   create a loop for this specific job. 
+  
+  MEvtLoop loop ; 
+  
+  // open input file
+    
+  MRootFile *fileIn = new MRootFile( inputfile );
+
+  //   set up the ParameterList, 
+  //   connect it to the loop
+  
+  MParList *plist = new MParList;
+  loop.SetParList(plist);
+
+  //   set up the TaskList for this program
+  //   and connect it to the loop 
+  
+  MTaskList *tasks  = new MTaskList;
+  tasks->SetEventType("PedTree") ;
+
+  loop.SetTaskList(tasks);
+
+  //    now set up all parameter(data) containers and put them 
+  //    in the parameter list
+  
+  //    the buffer for the RawEvts, here for the Pedestals
+  
+  MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("PedTree"));  /* this buffer contains 
+								 *  only one entry
+								 */
+  pedbuf->SetAsInput(fileIn);
+  plist->AddToList(pedbuf);
+  
+  //  now it is neccessary to define the input stream, that means
+  //  we set the input only to PedTree
+
+  MInputStreamID  *inputStream = new MInputStreamID()  ;
+  inputStream->SetEvtType("PedTree") ; 
+  plist->AddToList(inputStream);
+  
+  //
+  //     the data container for the histograms
+  
+  MHistosAdc *his = new MHistosAdc;
+  
+  plist->AddToList(his);
+  //  his->SetAsOutput();
+  // This tells the writer that this is an Output Container, which should
+  // be written to a file ( not working yet)
+  
+  
+  //   set up the tasks and add them to the list
+  
+  MParRead *readin = new MParRead;
+  tasks->AddToList(readin, "PedTree");
+
+  MAdcSpect *fillAdc = new MAdcSpect ("PedTree" ) ;
+  tasks->AddToList(fillAdc, "PedTree");
+
+  MShowSpect *showAdc = new MShowSpect () ;
+  tasks->AddToList(showAdc, "PedTree");
+
+  //    MParWrite *write = new MParWrite;
+  //    tasks->AddToList(write);
+
+  cout << endl;
+  
+  //
+  //  Print the structure of the parameter list plist
+  //
+  tasks->Print();
+
+  cout << endl;
+  
+  //////////////////////////////////////////////////////////////
+  //
+  //   call the event loop for 5000 Events
+  //
+  
+  loop.Eventloop (50);
+  
+  cout << endl << "THE END." << endl ;
+  
+  
+
+  return ( kTRUE ) ; 
+} 
+
+// ================================================================================
+// ================================================================================
+// ================================================================================
+// ================================================================================
+
+
+Bool_t MOctTest::CrAdcSpectra ( Char_t *inputfile ) 
+{
+  //
+  //  
+
+  printf ("MOctTest::CrAdcSpectra -- Analyse the file %s \n", inputfile ) ; 
+  //   create a loop for this specific job. 
+  
+  MEvtLoop loop ; 
+  
+  // open input file
+    
+  MRootFile *fileIn = new MRootFile( inputfile );
+
+  //   set up the ParameterList, 
+  //   connect it to the loop
+  
+  MParList *plist = new MParList;
+  loop.SetParList(plist);
+
+  //   set up the TaskList for this program
+  //   and connect it to the loop 
+  
+  MTaskList *tasks  = new MTaskList;
+  loop.SetTaskList(tasks);
+
+  //    now set up all parameter(data) containers and put them 
+  //    in the parameter list
+  
+  //    the buffer for the RawEvts, here for the Pedestals
+  
+  MObjBuffer *pedbuf = new MObjBuffer(new MRawEvt("EvtTree"));  /* this buffer contains 
+								 *  only one entry
+								 */
+  pedbuf->SetAsInput(fileIn);
+  plist->AddToList(pedbuf);
+    
+  //  now it is neccessary to define the input stream, that means
+  //  we set the input only to EvtTree
+
+  MInputStreamID  *inputStream = new MInputStreamID()  ;
+  inputStream->SetEvtType("EvtTree") ; 
+  plist->AddToList(inputStream);
+
+  //     the data container for the histograms
+  
+  MHistosAdc *his = new MHistosAdc;
+  
+  plist->AddToList(his);
+  //  his->SetAsOutput();
+  // This tells the writer that this is an Output Container, which should
+  // be written to a file ( not working yet)
+  
+  
+  //   set up the tasks and add them to the list
+  
+  MParRead *readin = new MParRead;
+  tasks->AddToList(readin, "EvtTree");
+
+  MAdcSpect *fillAdc = new MAdcSpect ("EvtTree" ) ;
+  tasks->AddToList(fillAdc, "EvtTree");
+
+  MShowSpect *showAdc = new MShowSpect () ;
+  tasks->AddToList(showAdc, "PedTree");
+
+  //    MParWrite *write = new MParWrite;
+  //    tasks->AddToList(write);
+
+  cout << endl;
+  
+  //
+  //  Print the structure of the parameter list plist
+  //
+  tasks->Print();
+
+  cout << endl;
+  
+  //////////////////////////////////////////////////////////////
+  //
+  //   call the event loop for 5000 Events
+  //
+  
+  loop.Eventloop (5000);
+  
+  cout << endl << "THE END." << endl ;
+  
+  
+
+  return ( kTRUE ) ; 
+} 
Index: trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MOctTest.h	(revision 447)
@@ -0,0 +1,47 @@
+#ifndef MOCTTEST_H
+#define MOCTTEST_H
+#include "Magic.h"
+
+#include <iostream.h>
+
+#include <TH1.h>
+#include <TFile.h>
+#include <TTree.h>
+#include <TObjArray.h>
+#include <TStopwatch.h>
+#include <TObject.h>
+
+#include "MRawEvt.h"
+#include "MParList.h"
+#include "MParRead.h"
+#include "MParWrite.h"
+#include "MAdcSpect.h"
+#include "MShowSpect.h"
+#include "MTaskList.h"
+#include "MHistosAdc.h"
+#include "MObjBuffer.h"
+#include "MFile.h"
+#include "MEvtLoop.h"
+#include "MInputStreamID.h"
+
+class MOctTest { 
+
+ private:
+  
+ public:
+  
+  MOctTest() ; 
+  
+  ~MOctTest() ; 
+  
+  Bool_t PedAdcSpectra( Char_t *inputFile ) ; 
+  Bool_t CrAdcSpectra ( Char_t *inputFile ) ; 
+  
+  
+} ; 
+
+#endif 
+
+
+
+
Index: trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.cc	(revision 447)
@@ -0,0 +1,69 @@
+#include "MShowSpect.h"
+
+#include <stdlib.h>
+
+#include <TROOT.h> 
+#include <TApplication.h> 
+#include <TSystem.h> 
+#include <TGClient.h> 
+#include <TGFileDialog.h> 
+#include <TVirtualX.h>
+
+#include "MRawEvt.h"
+#include "MParList.h"
+#include "MHistosAdc.h"
+
+
+////////////////////////////////////////////////////////////////////////
+//
+//  MGShowSpect.h
+//
+//  A Gui Task to show the raw ADC values in the histograms
+//
+
+ClassImp(MShowSpect)
+
+MShowSpect::MShowSpect( ) 
+{ 
+  // default constructor 
+} 
+
+
+Bool_t MShowSpect::PreProcess(MParList *pList)
+{
+  //
+  //   Do the preprocessing for MShowSpect
+  // 
+  //   Connects Histogramms in the MHistosAdc container as the input
+  //
+
+  fHists = (MHistosAdc*) pList->FindObject("MHistosAdc");
+  
+  if (!fHists)
+    {
+      cout << "ERROR: MShowSpect::PreProc(): MHistosAdc not found!" << endl;
+      exit(1);
+    }
+  
+  return (kTRUE) ; 
+} 
+
+
+Bool_t MShowSpect::PostProcess()
+{
+  //   just start the gui for displaying the adc spectra
+
+  new MGDisplayAdc(fHists, gClient->GetRoot(), gClient->GetRoot(), 600, 600);
+
+  return (kTRUE) ; 
+} 
+
+
+
+
+
+
+
+
+
+
Index: trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/MShowSpect.h	(revision 447)
@@ -0,0 +1,29 @@
+#ifndef MSHOWSPECT_H
+#define MSHOWSPECT_H
+
+#include "Magic.h"
+
+#include "MTask.h"
+#include "MObjBuffer.h"
+#include "MGDisplayAdc.h"
+
+class MGDisplayAdc ; 
+
+class MHistosAdc;
+class MParList ;
+
+class MShowSpect : public MTask 
+{
+private:
+  MHistosAdc *fHists;		// Pointer to Container with the histograms
+  
+ public:
+  MShowSpect();
+  
+  Bool_t PreProcess(MParList * pList);
+  Bool_t PostProcess();
+  
+  ClassDef(MShowSpect, 1)	// Fill the raw ADC in the histograms
+};
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mocttest/Makefile
===================================================================
--- trunk/MagicSoft/MarsOctober/mocttest/Makefile	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mocttest/Makefile	(revision 447)
@@ -0,0 +1,130 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+INCLUDEMK = ../Makefile.conf.${OSTYPE}
+include ${INCLUDEMK}
+
+# @endcode 
+
+# @code 
+
+LIB   = libmocttest.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I./ -I../ -I../mbase/ -I../mrootformat/
+
+#
+#  ----->>>   root libraries
+#
+
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
+#------------------------------------------------------------------------------
+
+#.SILENT:
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+
+SRCFILES = MGOctMain.cc \
+	   MOctTest.cc \
+	   MHistosAdc.cc \
+	   MAdcSpect.cc \
+	   MShowSpect.cc \
+	   MGDisplayAdc.cc 
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+depend:
+	@makedepend $(SRCS) $(INCLUDES) $(ROOTCFLAGS) \
+        -fMakefile.depend 2> kk.kk ; cat kk.kk
+
+$(LIB): $(OBJS) OcttestCint.o
+	@echo "Building Library $(LIB) ... "
+	@ar -r $(LIB) *.o
+
+OcttestCint.cc: $(HEADERS) 
+	@echo 
+	@echo "Generating dictionary OcttestCint.cc ..."
+
+	@$(ROOTSYS)/bin/rootcint -f OcttestCint.cc \
+	-c $(INCLUDES) $(HEADERS) BaseLinkDef.h
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.cc.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+
+#
+# The cleaning facility
+#
+
+rmlib:	
+	@echo "Removing libraries..."
+	@rm -f lib*.a
+
+rmcint:	
+	@echo "Removing cint-stuff..."
+	@rm -f OcttestCint.*
+
+rmobjs:	
+	@echo "Removing object files..."
+	@rm -f *.o
+
+rmbin:	
+	@echo "Removing binary files..."
+	@rm -f core
+
+
+clean:	rmlib rmcint rmobjs rmbin
+
+mrproper:	clean
+	@echo "Removing *~ kk.kk html/..."
+	@rm -f *~ kk.kk
+
+cflags: 
+	@echo $(INCLUDES) $(CXXFLAGS)
+
+# @endcode
+
+
+
+
Index: trunk/MagicSoft/MarsOctober/mrootformat/BaseLinkDef.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mrootformat/BaseLinkDef.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mrootformat/BaseLinkDef.h	(revision 447)
@@ -0,0 +1,10 @@
+#ifdef __CINT__
+
+#pragma link off all classes;
+#pragma link off all functions;
+
+#pragma link C++ class MRawEvt;
+#pragma link C++ class MRawPixel;
+
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mrootformat/MRawEvt.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mrootformat/MRawEvt.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mrootformat/MRawEvt.cc	(revision 447)
@@ -0,0 +1,308 @@
+#include "MRawEvt.h"
+
+#include <iostream.h>
+#include <stdlib.h>
+
+#include "TString.h"
+#include "TRandom.h"
+
+#include "MRawPixel.h"
+
+//==========
+// MRawEvt 
+//    
+// One Event is a sample of FADC measurements of different Pixels 
+// (Photomultipliers) from the Camera of MAGIC. So all data (FADC) of the 
+// interesting pixels are the modules of an event. To describe pixels the 
+// class MRawPixel is used.  To define a single events
+// some other data members are needed (Time of the events, kind of event..).
+//
+// To describe one event on the level of FADC values the Class MRawEvt is
+// created. It has the following data members: 
+//
+// ----------
+//
+// UInt_t    EvtNo    
+//
+// This it the number of the Event in one 
+// data run. The first event in this run get
+// the number zero. The next one is one bigger.
+//
+// Assuming that one run takes 1 hour and a
+// triggerrate of 1kHz the number must be able
+// to reach 3.6e6 Events. To reach this number
+// you need at least 22 bits. This is the reason
+// why we use an integer (of root type UInt_t)
+// with a range to 4.2e9. 
+//
+// ----------
+//
+// ULong_t   fTimeStamp
+//   
+// Time of the event. 
+// The start point of the time determination can be
+// the millenium. From that start point the time is
+// measured in 200ns-count. One day for example
+// contains 432.e9 counts. An unsigned Long is able to 
+// contain 1.8e19 200ns-counts. This corresponds to 41.e6
+// days. This should be more than the livetime of MAGIC.
+//
+// ----------
+//
+// UChar_t   EvtStatus 
+//
+// Status of Event. 
+// This is a Byte (8 bit) to indicated the status of 
+// the event (Pedestal, Calibration, etc). 
+//
+// ----------
+//
+// UShort_t  Trig1st
+//
+// Number of first level trigger
+// This member counts the number of First Level Trigger
+// between the last and this event. May be that due to 
+// dead time of the DAQ this number is different from 1.
+// If the DAQ is fast enough, this value should be 1. 
+// This may be usefull in GammaRayBursts and if we 
+// apply a data reduction in the DAQ-chain, which selects
+// only good events. 
+//
+// ----------
+//
+// UShort_t  MultPixel
+//
+// Multiplicity of Pixels
+// Each event consists of a specific number of 
+// pixels. This is the number of pixels in one event. 
+// The array of ClonesPixels (taClonesArray) is of this
+// size. 
+//
+// ----------
+//
+// TClonesArray  *Pixels
+//
+// Array of Pixels 
+// The Clones array is a list of the Pixels used in one
+// event with the information about the Pixels. 
+//
+//
+
+//
+
+ClassImp(MRawEvt)
+
+MRawEvt::MRawEvt(const char *name, const char *title) : MParContainer(name, title)
+{
+    //
+    //   Implementation of the default constructor
+    //
+    //   set all member to zero, init the pointer to ClonesArray,
+
+    EvtNo       = 0 ;
+    fTimeStamp  = 0 ;
+    EvtStatus   = 0 ;
+    Trig1st     = 0 ;
+    MultPixel   = 0 ;
+
+    //
+    //   Then we have to initialize the ClonesArray list for the Pixels.
+    //   This is neccessary once!
+    //
+    //   initialize the list to this global pointer
+
+    Pixels = new TClonesArray ("MRawPixel", 2*kCAMERA_PIXELS ) ;
+
+    //  cout << " default constructor " << endl ;
+}
+
+
+MRawEvt::~MRawEvt()
+{
+    //
+    //   Implementation of the default destructor
+    //
+    delete Pixels ;
+    //  cout << " default destructor " << endl ;
+}
+
+void MRawEvt::GetFadcNoise ( UChar_t asF[] )
+{
+    static TRandom Gen ;
+    static Float_t z1, z2 ;
+    for (Int_t i=0; i<kFADC_SLICES; i++ )
+    {
+        Gen.Rannor(z1, z2) ;
+        asF[i] = 10 + (UChar_t)(z1*4) ;
+        // if (asF[i] < 0 ) asF[i] = 0 ;
+    }
+}
+
+void MRawEvt::Clear(Option_t *t)
+{
+    //
+    //   Implementation of the Clear function
+    //
+    //   Resets all members to zero, clear the list of Pixels
+    //
+    EvtNo      = 0 ;
+    fTimeStamp = 0 ;
+    EvtStatus  = 0 ;
+    Trig1st    = 0 ;
+    MultPixel  = 0 ;
+
+    Pixels->Clear() ;
+}
+
+void MRawEvt::Print(Option_t *t)
+{
+    //
+    //  This member function prints all Data of one Event on screen.
+    //
+
+    // Prints out the data of one Pixel
+    cout << endl << "EventNumber      " << EvtNo          ;
+    cout << endl << "Event Time Stamp " << fTimeStamp      ;
+    cout << endl << "Event Status     " << (int) EvtStatus      ;
+    cout << endl << "Trigger 1. Level " << Trig1st        ;
+    cout << endl << "Number of Pixels " << MultPixel      ;
+
+    for (Int_t i=0 ; i<MultPixel; i++ )
+    {
+        ((MRawPixel *)Pixels->At(i))->Print() ;
+    }
+}
+
+Int_t MRawEvt::GetPixelId(Int_t iList)
+{
+    //
+    //  returns the pixelId of the iList.th Pixels in the pixels list
+    //
+
+    if (iList < MultPixel)
+    {
+        return (Int_t )  ((MRawPixel *)Pixels->At(iList))->GetPixelId() ;
+    }
+    else
+    {
+        cout << "ERROR: MRawEvt::GetPixelId:  iList is bigger than MultPixel"
+            << endl ;
+        exit(1);
+    }
+    return 0;
+}
+
+UChar_t* MRawEvt::GetPixelData(Int_t iList)
+{
+    //
+    //  returns the pointer to the data of the iList.th pixel in
+    //  the pixel list.
+    //
+
+    if ( iList < MultPixel )
+    {
+        return (UChar_t*)  ((MRawPixel *)Pixels->At(iList))->GetPixelData() ;
+    }
+    else
+    {
+        cout << "ERROR: MRawEvt::GetPixelId:  iList is bigger than MultPixel"
+            << endl ;
+        exit(1) ;
+    }
+    return 0;
+}
+
+
+void MRawEvt::FillRandom ( UInt_t uiN, ULong_t ulT,  UShort_t usMuPi )
+{
+    //
+    //  This is neccessary to fill the MRawEvt Class with randomized FADC
+    //  values. The EventNumber, EventTime and the Number of Pixels are given
+    //  as parameters.
+    //
+
+    EvtNo      = uiN ;
+    fTimeStamp  = ulT ;
+
+    UChar_t   ucA[kFADC_SLICES] ;
+
+    for (UShort_t i = 0 ; i< usMuPi; i++ )
+    {
+        GetFadcNoise ( ucA ) ;
+
+        TClonesArray &caP = *Pixels ;
+        new ( caP[MultPixel++] ) MRawPixel((MultPixel), 0, ucA) ;
+    }
+}
+
+void MRawEvt::FillHeader ( UInt_t uiN, ULong_t ulT, UChar_t ucSta )
+{
+   
+  EvtNo      = uiN;
+  fTimeStamp = ulT;
+  
+  EvtStatus  = ucSta;
+  Trig1st    = 0;
+  MultPixel  = 0;
+
+  Pixels->Clear();
+}
+
+void MRawEvt::FillPixel ( UShort_t uiPix, Float_t *array )
+{
+  //
+  //  This is to fill the data of one pixel to the MRawEvt Class. 
+  //  The parameters are the pixelnumber and the FADC_SLICES values of ADCs
+  // 
+
+  UChar_t   ucA[kFADC_SLICES] ;
+
+  for (UShort_t i = 0 ; i< kFADC_SLICES ; i++ )
+  {
+    ucA[i] = (UShort_t) array[i] ; 
+  } 
+  
+  TClonesArray &caP = *Pixels ;
+  new ( caP[MultPixel++] ) MRawPixel((uiPix), 0, ucA) ; 
+}
+
+void MRawEvt::FillMontCarl ( UInt_t uiN, ULong_t ulT,  Float_t *array )
+{
+  //
+  //  This is neccessary to fill the MRawEvt Class with randomized FADC
+  //  values. The EventNumber, EventTime and the Number of Pixels are given 
+  //  as parameters. 
+  // 
+
+  EvtNo      = uiN ; 
+  fTimeStamp  = ulT ; 
+
+  MultPixel = 0 ; 
+
+  UChar_t   ucA[kFADC_SLICES] ;
+
+  for (UShort_t i = 0 ; i< kCAMERA_PIXELS; i++ )
+  {
+      if ( array[i] > 0. )
+      {
+          for ( Int_t ii = 0 ; ii < kFADC_SLICES ; ii++ )
+          {
+              ucA[ii] = 0 ;
+          }
+          ucA[5] = (UShort_t) (array[i]) ;
+
+          TClonesArray &caP = *Pixels ;
+          caP[MultPixel++] = new MRawPixel(i, 0, ucA);
+      }
+  }
+}
+
+UShort_t MRawEvt::GetMultPixel()
+{
+  //
+  //  returns the pixel multiplicity of the Event
+  //
+  return MultPixel;
+}
+
+
Index: trunk/MagicSoft/MarsOctober/mrootformat/MRawEvt.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mrootformat/MRawEvt.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mrootformat/MRawEvt.h	(revision 447)
@@ -0,0 +1,61 @@
+#ifndef MRAWEVT_H
+#define MRAWEVT_H
+
+#include "Magic.h"
+
+#include "MParContainer.h"
+
+#include <TClonesArray.h>
+
+class MRawEvt : public MParContainer
+{
+
+private:
+    UInt_t EvtNo;		// Number of Event
+    ULong_t fTimeStamp;		// Time of the Event
+    UChar_t EvtStatus;		// Status of this event (DAQ, Pedestal, ..) 
+    UShort_t Trig1st;		// Number of 1st level tiggers between 2 events
+    UShort_t MultPixel;		// Multiplicity of the Pixels in this event   
+
+    TClonesArray *Pixels;	// list of the events
+
+public:
+
+    MRawEvt(const char *name=NULL, const char *title=NULL);
+    ~MRawEvt();
+
+    MParContainer *New()
+    {
+	return new MRawEvt;
+    }
+
+    void Clear(Option_t *t = NULL);
+    void Print(Option_t *t = NULL);
+
+    void FillRandom(UInt_t, ULong_t, UShort_t);
+    void FillHeader(UInt_t, ULong_t, UChar_t = 0);
+    void FillPixel(UShort_t, Float_t*);
+    void FillMontCarl(UInt_t, ULong_t, Float_t*);
+
+    UShort_t GetMultPixel();
+    Int_t GetPixelId(Int_t iList);
+    UChar_t *GetPixelData(Int_t iList);
+    void GetFadcNoise(UChar_t asF[]);
+
+    TClonesArray *&GetPixelList()
+    {
+	//
+	//   returns a Pointer to the pixel list
+	//
+	return Pixels;
+    }
+
+    ULong_t GetTimeStamp()
+    {
+	return fTimeStamp;
+    }
+
+    ClassDef(MRawEvt, 1)
+};				// end of class definition of MRawEvt
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mrootformat/MRawPixel.cc
===================================================================
--- trunk/MagicSoft/MarsOctober/mrootformat/MRawPixel.cc	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mrootformat/MRawPixel.cc	(revision 447)
@@ -0,0 +1,160 @@
+#include "MRawPixel.h"
+
+#include <iostream.h>
+
+#include "TClonesArray.h"
+#include "TString.h"
+#include "TRandom.h"
+
+//==========
+// MRawPixel 
+//    
+// One Event in the Camera of MAGIC consists of measurements of different
+// Photomultiplier. The measurements are taken with FADCs. So the raw 
+// informations of one pixel are the ADC values of the FADCs. MAGIC will
+// measure the amplitude of one Photomulitplier in different branches 
+// - one high and one low gain branch. The first is for small signals, the 
+// other for big signals. With this method it is possible to increase the 
+// dynamic range.  
+//
+// The Class MRawPixel is used to manage this raw information. 
+//
+// The data members are described in detail here: 
+//
+// ---------
+//
+// UShort_t     PixelId     ;   
+//
+// This is to identify the Pixel.
+// The Camera consists of CAMERA_PIXELS Pixels. Each one has a specific Id.
+// The center of the camera is zero and a spiral numbering is chosen.
+//
+// To reduce the amount of data, we store the information of the 
+// low-gain-branch of the Fadc´s only if there is a signal in. Then the 
+// PixelId is:
+//                   PixelId = 10000 + PixelId   . 
+//
+// For the high gain Fadc values the rule is:
+//                   PixelId = PixelId . 
+//
+//
+// ---------
+//
+// UChar_t      PixelStatus ;   
+//
+// The PixelStatus may contain information if the Pixel has triggered 
+// this event. Also the kind of gain-branch (high or low) may be indicated 
+// by one bit of the PixelStatus. etc
+//
+// ---------
+//
+// UChar_t      Fadc[ kFADC_SLICES ]  ; 
+//
+// The values of kFADC_SLICES fadc-slices. This is the information of the 
+// measured ADC values for one branch (high gain or low gain). The typ of 
+// branch is indicated in the usPixelNumber and in the PixelStatus.
+
+ClassImp(MRawPixel) 
+
+MRawPixel::MRawPixel()
+{
+  //
+  //  The default constructor sets all members to zero. 
+  //
+    
+    PixelId     = 0 ; 
+    PixelStatus = 0 ; 
+    
+    for (Int_t i = 0; i<kFADC_SLICES; i++) 
+      Fadc[i]   = 0 ; 
+}
+
+
+MRawPixel::MRawPixel(UShort_t PId)
+{
+  //
+  //  constructor II  overloaded
+  //
+  //  Parameter is the PixelId. All other data member are set to zero
+  
+  PixelId     = PId ; 
+  PixelStatus = 0 ; 
+  
+  for (Int_t i = 0; i<kFADC_SLICES; i++) 
+    Fadc[i]   = 0 ; 
+}
+
+
+MRawPixel::MRawPixel(UShort_t usPId, UChar_t ucSt, UChar_t ucF[])
+{
+  //
+  // constructor III overloaded 
+  //
+  // parameters are PixelId, Status and an array with Fadc numbers.
+  
+  PixelId     = usPId ; 
+  PixelStatus = ucSt  ; 
+  
+  for (Int_t i = 0; i<kFADC_SLICES; i++) 
+    Fadc[i]   = ucF[i] ; 
+}
+
+MRawPixel::~MRawPixel()
+{
+  //
+  //  default destructor
+  //
+}
+
+void MRawPixel::Clear(Option_t *t)
+{
+  //
+  //  Sets the data member back to zero
+  //
+  PixelId     = 0 ; 
+  PixelStatus = 0 ; 
+  
+  for (Int_t i = 0; i<kFADC_SLICES; i++) 
+    Fadc[i]   = 0 ; 
+} 
+
+
+void MRawPixel::Print(Option_t *t) 
+{
+  //
+  //  This member function prints all Data of one Pixel on screen. 
+  //
+
+  cout << endl << "PixId " << PixelId;
+  cout << " Stat " << (Int_t) PixelStatus << " --> ";
+
+  //  cout << "memory " << (UChar_t*)Fadc ; 
+  for (Int_t i=0 ; i<kFADC_SLICES ; i++ ) {
+    cout<<" / " << (int) Fadc[i] ; 
+  } 
+}
+  
+UShort_t MRawPixel::GetPixelId()
+{
+  //
+  // returns back the PixelId of the Pixel
+  //
+  return PixelId;
+}
+
+UChar_t*  MRawPixel::GetPixelData()
+{
+  //
+  // returns back the pointer to the pixel data array
+  //
+  return (UChar_t *) Fadc;
+}
+
+UChar_t MRawPixel::GetFadcSlice( Int_t iSli )
+{
+  //
+  // returns back the fadc content of the slice iSli 
+  //
+  return ( Fadc[iSli] ) ; 
+}
+
Index: trunk/MagicSoft/MarsOctober/mrootformat/MRawPixel.h
===================================================================
--- trunk/MagicSoft/MarsOctober/mrootformat/MRawPixel.h	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mrootformat/MRawPixel.h	(revision 447)
@@ -0,0 +1,32 @@
+#ifndef MRAWPIXEL_H
+#define MRAWPIXEL_H
+
+#include "Magic.h"
+
+#include "TObject.h"
+
+class MRawPixel : public TObject
+{
+private:
+    UShort_t PixelId;		//  Identification of PixelNumber and gain branch
+    UChar_t PixelStatus;	//  The Status of the pixel
+    UChar_t Fadc[kFADC_SLICES];	// The values of fadc-slices.
+
+public:
+     MRawPixel();
+     MRawPixel(UShort_t);
+     MRawPixel(UShort_t, UChar_t, UChar_t *);
+
+    ~MRawPixel();
+
+    void Clear(Option_t * t = NULL);
+    void Print(Option_t * t = NULL);
+
+    UShort_t GetPixelId();
+    UChar_t *GetPixelData();
+    UChar_t GetFadcSlice(Int_t);
+
+    ClassDef(MRawPixel, 1)
+};				// end of class definition of MRawPixel 
+
+#endif
Index: trunk/MagicSoft/MarsOctober/mrootformat/Makefile
===================================================================
--- trunk/MagicSoft/MarsOctober/mrootformat/Makefile	(revision 447)
+++ trunk/MagicSoft/MarsOctober/mrootformat/Makefile	(revision 447)
@@ -0,0 +1,124 @@
+##################################################################
+#
+#   makefile
+# 
+#   for the MARS software
+#
+##################################################################
+# @maintitle 
+
+# @code
+
+#
+#  please change all system depend values in the 
+#  config.mk.${OSTYPE} file 
+#
+#
+INCLUDEMK = ../Makefile.conf.${OSTYPE}
+include ${INCLUDEMK}
+
+# @endcode 
+
+# @code 
+
+LIB   = libmrootformat.a
+
+#
+#  connect the include files defined in the config.mk file
+#
+INCLUDES = -I./ \
+	   -I../mbase/
+
+#
+#  ----->>>   root libraries
+#
+
+ROOTLIBS   =  `root-config --libs`
+ROOTGLIBS  =  `root-config --glibs`
+ROOTCFLAGS =  `root-config --cflags`
+
+#
+#  compiler flags
+#
+
+CXXFLAGS  = $(ROOTCFLAGS) $(INCLUDES) $(OPTIM) $(DEBUG)
+CFLAGS    = $(CXXFLAGS)
+FFLAGS    = $(CXXFLAGS)
+
+#------------------------------------------------------------------------------
+
+#.SILENT:
+
+.SUFFIXES: .c .cc .cxx .h .hxx .o 
+
+
+SRCFILES = MRawPixel.cc \
+	   MRawEvt.cc
+
+SRCS    = $(SRCFILES)
+HEADERS = $(SRCFILES:.cc=.h)
+OBJS    = $(SRCFILES:.cc=.o) 
+
+############################################################
+
+all: $(LIB)
+
+depend:
+	@makedepend $(SRCS) $(INCLUDES) $(ROOTCFLAGS) \
+        -fMakefile.depend 2> kk.kk ; cat kk.kk
+
+$(LIB): $(OBJS) RootformatCint.o
+	@echo "Building Library $(LIB) ... "
+	@ar -r $(LIB) *.o
+
+RootformatCint.cc: $(HEADERS) 
+	@echo 
+	@echo "Generating dictionary RootformatCint.cc ..."
+
+	@$(ROOTSYS)/bin/rootcint -f RootformatCint.cc \
+	-c $(INCLUDES) $(HEADERS) BaseLinkDef.h
+
+.cxx.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.cc.o:	
+	@echo "Compiling " $<
+	$(CXX) $(CXXFLAGS) -c $< -o $@
+
+.c.o:	
+	@echo "Compiling " $<
+	$(CC) $(CFLAGS) -c $< -o $@
+
+#
+# The cleaning facility
+#
+
+rmlib:	
+	@echo "Removing libraries..."
+	@rm -f lib*.a
+
+rmcint:	
+	@echo "Removing cint-stuff..."
+	@rm -f RootformatCint.*
+
+rmobjs:	
+	@echo "Removing object files..."
+	@rm -f *.o
+
+rmbin:	
+	@echo "Removing binary files..."
+	@rm -f core
+
+
+clean:	rmlib rmcint rmobjs rmbin
+
+mrproper:	clean
+	@echo "Removing *~ kk.kk html/..."
+	@rm -f *~ kk.kk
+
+cflags: 
+	@echo $(INCLUDES) $(CXXFLAGS)
+
+# @endcode
+
