User Tools

Site Tools


community:hepsim:usage_truth

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
community:hepsim:usage_truth [2016/04/28 15:31]
asc
community:hepsim:usage_truth [2016/11/04 19:23] (current)
asc [Converting to LCIO]
Line 17: Line 17:
 platform (Linux, Mac, Windows) and does not require installation of any platform-specific program.  platform (Linux, Mac, Windows) and does not require installation of any platform-specific program. 
 As before, make sure that [[http://java.com/en/download/index.jsp| Java 7]] and above is installed (check it as "java -version"). As before, make sure that [[http://java.com/en/download/index.jsp| Java 7]] and above is installed (check it as "java -version").
- 
  
 ===== Method I. Running in a batch mode without downloaded ProMC files ===== ===== Method I. Running in a batch mode without downloaded ProMC files =====
Line 304: Line 303:
      
  
- +Please look at HepSim [[community:hepsim:usage_truth|programming tutorials]] on how to design Jython scripts.
-====== Supported languages ====== +
- +
-  * C++/ROOT +
-  * CPython  (Python implemented in C++) or PyROOT +
-  * Java +
-  * Jython (Python on the Java platform) +
-  * Groovy  (scripting language) +
-  * BeanShell (scripting language) +
-  * JRuby (Ruby on the Java platform) +
- +
- +
-Some variations of the Java languages are also possible (such as Scala). For all Java-derived languages, see the [[http://jwork.org/dmelt/ | DatMelt]] project. +
-The Android platform has a limited support (but the files should be readable on Android).  +
- +
- +
-Although all example scripts are based on the Python language, the actual implementation of the validation online scripts is done in Jython (Java). +
-You can program in Java as well. C++/CPython will be discussed later. +
- +
- +
- +
- +
- +
-===== Using Jython ===== +
- +
-Jython and Java are chosen  to write validation scripts and to run such scripts using web pages. +
-Please look at [[community:refhepsim_analysisHepSim Analysis Primer]] manual. +
- +
-===== Using C++ ===== +
 Please refer [[asc:promc| ProMC web page]] on how to read/write ProMC files. Please refer [[asc:promc| ProMC web page]] on how to read/write ProMC files.
  
Line 345: Line 315:
 </code> </code>
 Read "README" inside this directory. Do not forget to populate the directory "data" with MC files before running this example. Read "README" inside this directory. Do not forget to populate the directory "data" with MC files before running this example.
- 
-===== Using CPython ===== 
- 
- 
-Use the example above to generate CPython code to read data. 
-This is documentation for CPython approach 
- 
- 
-      * [[http://atlaswww.hep.anl.gov/asc/promc/doc/cpython_promc/html/index.html | annotated classes]] - for complete MC event records 
-      * [[http://atlaswww.hep.anl.gov/asc/promc/doc/cpython_pronlo/html/index.html | annotated classes]] - for NLO event records 
- 
- 
-Read the description of [[http://atlaswww.hep.anl.gov/asc/promc/ | ProMC format]] about how to generate CPython code. 
- 
  
  
Line 374: Line 330:
 ./promc2root [promc file] output.root ./promc2root [promc file] output.root
 </code> </code>
 +
 +====== Converting to LCIO ======
 +
 +ProMC files can be converted to LCIO files for full detector simulations.  This is an example of such conversion (it requires Java installed):
 +
 +<code bash>
 +wget http://atlaswww.hep.anl.gov/asc/promc/download/current.php -O ProMC.tgz
 +tar -zvxf ProMC.tgz
 +cd examples/promc2lcio
 +source setup.sh
 +javac promc2lcio.java
 +java promc2lcio file.promc file.slcio
 +</code>
 +The last commends creates  file.slcio with "MCparticle" container. 
 +
 +
 +====== Converting to other formats ======
 +Look at other directories in "examples/". You can convert ProMC files to many other formats (most converters require  installation of the ProMC C++ package).
 +====== Extracting events  ======
 +
 +A file can be reduced in size by extracting N events as this:
 +
 +<code>
 +hs-extract signal.promc N
 +</code>
 +where signal.promc is the original file, and N is the number of events to extract.
 +
 +====== Comparing MC and data  ======
 +
 +HepSim maintains analysis scripts that can be used for comparing Monte Carlo simulations with data from [[http://durpdg.dur.ac.uk/|Durham HepData database]].
 +For example, click the link with  [[http://durpdg.dur.ac.uk/view/ins1253852| AAD 2013]] (Search for new phenomena in photon+jet events collected in proton--proton collisions at sqrt(s) = 8 TeV with the ATLAS detector) paper
 +  * Navigate to "DataMelt" and use right-mouse and select "Copy link location"
 +  * Start DMelt if you did not  yet, and select [File]-[Read script from URL]. Copy and paster the URL link from the HepData database
 +  * Click "run".
 +
 +HepData maintain Jython scripts that use the same syntax as HepSim. You can start from a HepSim validation script, and before the "export" command, append
 +the scripts with data from [[http://durpdg.dur.ac.uk/|Durham HepData database]]. Or you can start from a HepData "SCaVis" script and add parts from HepSim validation script that reads data from HepSim. Note that SCaVis and DMelt are equivalent.
  
  
Line 414: Line 407:
 </hidden> </hidden>
  
-====== How to program using Python ======+====== Programming with HepSim ====== 
  
  
-This [[community:hepsim:usage_analysis|analysis tutorial]] shows how to create Python scripts to read ProMC files from HepSim.+Please look at the [[community:hepsim:usage_truth|tutorials]] which show how to create Python/Jython scripts to read ProMC files. 
  
  Send comments to:  --- //[[[email protected]|Sergei Chekanov (ANL)]] 2016/02/08 10:26//  Send comments to:  --- //[[[email protected]|Sergei Chekanov (ANL)]] 2016/02/08 10:26//
community/hepsim/usage_truth.1461857509.txt.gz · Last modified: 2016/04/28 15:31 by asc