This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
asc:promc:examples [2014/07/16 14:50] asc |
asc:promc:examples [2015/05/10 21:08] (current) asc |
||
---|---|---|---|
Line 6: | Line 6: | ||
(written by S.Chekanov, ANL) | (written by S.Chekanov, ANL) | ||
- | ProMC binary | + | ProMC files are compact and self-describing |
- | to ProMC files. More information is in the [[asc: | + | to ProMC files. More information is in the [[asc: |
Line 18: | Line 18: | ||
wget http:// | wget http:// | ||
wget http:// | wget http:// | ||
- | java -jar browser_promc.jar | + | java -jar browser_promc.jar Pythia8.promc |
</ | </ | ||
This will bring up a GUI window so one can look at separate events and the data layout (see the example below). | This will bring up a GUI window so one can look at separate events and the data layout (see the example below). | ||
Line 33: | Line 33: | ||
Look at the Python examples discussed bellow how to use a random access via the network. | Look at the Python examples discussed bellow how to use a random access via the network. | ||
+ | |||
+ | Note that the browser can open ProMC files of any size, since it loads only a fraction of data. This is especially useful compared to limitations | ||
+ | of some formats that cannot be viewed in text editors if their sizes are too large. | ||
Line 55: | Line 58: | ||
After the installation, | After the installation, | ||
- | < | + | < |
$PROMC/ | $PROMC/ | ||
</ | </ | ||
- | Take a look at them. Each director has "Makefile" | + | If you already know that your file include information from a typical parton-shower Monte Carlo model, |
+ | |||
+ | <code bash> | ||
+ | $PROMC/ | ||
+ | </ | ||
+ | that reads a ProMC file. The makefile links "libpromc.a" | ||
+ | |||
+ | If you know that stored data are from a NLO program, looks at: | ||
+ | |||
+ | <code bash> | ||
+ | $PROMC/examples/ | ||
+ | </ | ||
+ | that links the " | ||
- | ProMC files are self-describing. You can generate | + | ProMC files are self-describing, therefore you can read and write any type of data and generate static libraries from platform-neutral templates. |
+ | You can generate | ||
if you happen to have a ProMC file but do not know how the data are organized inside the file. You need to install [[asc: | if you happen to have a ProMC file but do not know how the data are organized inside the file. You need to install [[asc: | ||
Line 73: | Line 89: | ||
promc_info | promc_info | ||
promc_proto Pythia8.promc | promc_proto Pythia8.promc | ||
- | promc_code | + | promc_code |
- | make # compiles C++ code reader.cc | + | make |
./ | ./ | ||
</ | </ | ||
Line 196: | Line 212: | ||
The example given in the directory " | The example given in the directory " | ||
- | |||
- | ===== Benchmark summary | ||
- | |||
- | Here is a comparison of file sizes for the same event records written by " | ||
- | |||
- | |||
- | ^ File format | ||
- | | ASCII TXT file (" | ||
- | | | ||
- | | ROOT tree (Double32_t) | ||
- | | | ||
- | |||
- | |||
- | As one can see, the ProMC files are 40% more compact than the equivalent ROOT files and 23% more compact than gzipped ASCII TXT (" | ||
Line 240: | Line 242: | ||
</ | </ | ||
- | An example program which fills ProMC file record is given here | + | An example program which fills ProMC file record is given in |
- | [[http://atlaswww.hep.anl.gov/asc/WebSVN/ | + | [[https://github.com/Argonne-National-Laboratory/ProMC/blob/master/examples/pythia/|Pythia8 to ProMC example]] |
Line 330: | Line 332: | ||
===== Reading data using Jython ===== | ===== Reading data using Jython ===== | ||
- | You can make histograms on any platform (Windows/ | + | You can make histograms on any platform (Windows/ |
- | " | + | " |
- | To avoid a clash with the library shipped with Scavis, remove " | + | To avoid a clash with the library shipped with DatMelt, remove " |
<code bash> | <code bash> | ||
rm | rm | ||
</ | </ | ||
- | (in Windows, go to this directory and remove this file) and restart the ScaVis. Then you can write a small Jython script like this: | + | (in Windows, go to this directory and remove this file) and restart the DatMelt. Then you can write a small Jython script like this: |
<code python promc.py> | <code python promc.py> | ||
- | # Reading Pthia8 file in the ProMC format using ScaVis | + | # Reading Pthia8 file in the ProMC format using [[http:// |
# S.Chekanov (ANL) | # S.Chekanov (ANL) | ||
from java.io import * | from java.io import * | ||
Line 346: | Line 348: | ||
from promc.io import * | from promc.io import * | ||
from proto import * # import FileMC | from proto import * # import FileMC | ||
- | from jhplot import * # import | + | from jhplot import * # import |
file = FileMC(" | file = FileMC(" | ||
Line 382: | Line 384: | ||
wget http:// | wget http:// | ||
</ | </ | ||
- | Start SCaVis | + | Start DatMelt |
- | (You can load this file as "scavis.sh promc.py" | + | (You can load this file as "dmelt.sh promc.py" |
Line 462: | Line 464: | ||
- | - [[http://atlaswww.hep.anl.gov/asc/WebSVN/filedetails.php? | + | - [[https://github.com/ |
- | - [[http://atlaswww.hep.anl.gov/asc/WebSVN/filedetails.php? | + | - [[https://github.com/Argonne-National-Laboratory/ProMC/ |
- [[http:// | - [[http:// | ||
+ | - [[https:// | ||
+ | |||
+ | |||
More complex layout files (for example, foe Delphes fast simulation) can be found | More complex layout files (for example, foe Delphes fast simulation) can be found | ||
inside the directory " | inside the directory " | ||
Line 507: | Line 511: | ||
<code php> | <code php> | ||
<?php | <?php | ||
- | $zip = zip_open(" | + | $zip = zip_open(" |
if ($zip) { | if ($zip) { | ||
while ($zip_entry = zip_read($zip)) { | while ($zip_entry = zip_read($zip)) { |