community:hepsim:usage_truth
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
community:hepsim:usage_truth [2016/04/28 15:17] – created asc | community:hepsim:usage_truth [2016/11/04 19:23] (current) – [Converting to LCIO] asc | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | [[community: | ||
+ | |||
====== | ====== | ||
Line 39: | Line 42: | ||
</ | </ | ||
+ | Look at the " | ||
Similarly, you can use a more complex [[http:// | Similarly, you can use a more complex [[http:// | ||
Line 300: | Line 303: | ||
| | ||
- | + | Please look at HepSim | |
- | ====== Supported languages ====== | + | |
- | + | ||
- | * C++/ROOT | + | |
- | * CPython | + | |
- | * Java | + | |
- | * Jython (Python on the Java platform) | + | |
- | * Groovy | + | |
- | * 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:// | + | |
- | 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 | + | |
- | Please look at [[community: | + | |
- | + | ||
- | ===== Using C++ ===== | + | |
Please refer [[asc: | Please refer [[asc: | ||
Line 341: | Line 315: | ||
</ | </ | ||
Read " | Read " | ||
- | |||
- | ===== Using CPython ===== | ||
- | |||
- | |||
- | Use the example above to generate CPython code to read data. | ||
- | This is documentation for CPython approach | ||
- | |||
- | |||
- | * [[http:// | ||
- | * [[http:// | ||
- | |||
- | |||
- | Read the description of [[http:// | ||
- | |||
Line 371: | Line 331: | ||
</ | </ | ||
+ | ====== Converting to LCIO ====== | ||
- | ====== Fast detector simulation ====== | + | ProMC files can be converted to LCIO files for full detector |
- | + | ||
- | ===== On the fly reconstruction ===== | + | |
- | HepSim ca be used o create ROOT files after fast detector | + | |
- | one can analyse events after the Delphes fast simulation program on the fly. | + | |
- | The latter approach allows to make changes to the detector geometry by the end-users and, at the the same time, perform an analysis. | + | |
- | The output ROOT file only includes histograms defined by the user (but you can also add custom ROOT tree). | + | |
- | To do this, use the [[http:// | + | |
- | that includes [[http:// | + | |
- | You can find a description | + | |
- | + | ||
- | Follow these steps: | + | |
<code bash> | <code bash> | ||
- | wget http:// | + | wget http:// |
- | tar -zvxf FastHepSim.tgz | + | tar -zvxf ProMC.tgz |
- | cd FastHepSim/libraries/ | + | cd examples/promc2lcio |
- | ./ | + | |
- | </ | + | |
- | + | ||
- | This installs " | + | |
- | + | ||
- | <code bash> | + | |
- | cd .. # go to the root directory | + | |
source setup.sh | source setup.sh | ||
+ | javac promc2lcio.java | ||
+ | java promc2lcio file.promc file.slcio | ||
</ | </ | ||
- | + | The last commends | |
- | Next, go to the analysis example: | + | |
- | + | ||
- | <code bash> | + | |
- | cd analysis | + | |
- | make | + | |
- | </ | + | |
- | + | ||
- | This compiles the analysis program (analysis.cc) that fills jetPT and muonPT histograms. | + | |
- | Now we need to bring data from [[http:// | + | |
- | we will copy data to the " | + | |
- | + | ||
- | <code bash> | + | |
- | hs-get http:// | + | |
- | </ | + | |
- | This copies 3 files in 2 threads and put them to the directory " | + | |
- | + | ||
- | <code bash> | + | |
- | ./ | + | |
- | ./analysis delphes_card_FCC_basic_notau.tcl histo.root inputdata.txt | + | |
- | </ | + | |
- | + | ||
- | The first command | + | |
- | with output histograms. This example uses " | + | |
- | Note that we have removed | + | |
- | + | ||
- | If you want to access other objects (photons, electrons, b-jets), | + | |
- | use [[https:// | + | |
- | You can put external files into the src/ directory where it will be found by Makefile. | + | |
- | + | ||
- | If you still want to look at the event structure in the form of ROOT tree, run the usual Delphes command: | + | |
- | <code bash> | + | |
- | ../ | + | |
- | </ | + | |
- | where output.root will contain all reconstructed objects. In this case, add " | + | |
- | If the input file contains complete (non-slimmed) record, one can add " | + | |
- | + | ||
- | Try also more sophisticated detector-geometry cards: | + | |
- | + | ||
- | * examples/ | + | |
- | * examples/ | + | |
- | + | ||
- | Note that "TreeWriter" | + | |
- | + | ||
- | ===== Creating Delphes files ===== | + | |
- | + | ||
- | Here we describe how to make fast detector simulation files | + | |
- | using separate external libraries, without installing FastHepSim. | + | |
- | Use the [[https:// | + | |
- | <code bash> | + | |
- | echo $PROMC $ROOTSYS | + | |
- | </ | + | |
- | This should point to the installation paths of ProMC and ROOT. | + | |
- | + | ||
- | Here are the steps to perform a fast detector simulation using ProMC files from the HepSim repository: | + | |
- | + | ||
- | 1) Download [[http:// | + | |
- | <code bash> | + | |
- | wget http:// | + | |
- | tar -zvxf Delphes-3.2.0.tar.gz | + | |
- | cd Delphes-3.2.0 | + | |
- | ./ | + | |
- | make | + | |
- | </ | + | |
- | This creates the converter " | + | |
- | + | ||
- | 2) For FCC studies, copy and modify the detector configuration file " | + | |
- | <code bash> | + | |
- | cp cards/ | + | |
- | </ | + | |
- | Then remove the line " | + | |
- | We do not use the tau tagging module since it requires complete event records with all mother particles. Since ProMC files are often slimmed by removing some unstable low pT particles and showered partons, Delphes will fail on this line. If you need tau tagging, please use ProMC files with complete particle record. | + | |
- | + | ||
- | 3) Download Monte Carlo files from the [[ http:// | + | |
- | For example, get a file with 5000 ttbar events generated for a 100 TeV collider: | + | |
- | <code bash> | + | |
- | wget http:// | + | |
- | </ | + | |
- | + | ||
- | and then create a ROOT file with reconstructed objects after a fast detector simulation (FCC detector): | + | |
- | + | ||
- | <code bash> | + | |
- | ./ | + | |
- | </ | + | |
- | The conversion typically takes 30 seconds. | + | |
- | + | ||
- | + | ||
- | ====== Full detector simulation | + | |
- | + | ||
- | Currently, the full detector simulation can be done using the SLIC software. You will need to convert ProMC files to LCIO files and | + | |
- | use these files for the " | + | |
- | + | ||
- | The physics performance studies are [[fcs: | + | |
- | + | ||
- | How to convert ProMC to LCIO files is described in | + | |
- | [[community: | + | |
- | + | ||
- | ====== Pileups mixing | + | |
- | + | ||
- | One can mix events from a signal ProMC file with | + | |
- | inelastic (minbias) events using a " | + | |
- | <code bash> | + | |
- | hs-pileup pN signal.promc minbias.promc output.promc | + | |
- | </ | + | |
- | Here " | + | |
- | If " | + | |
- | Use large number of events in minbias.promc to minimise reuse of the same events from the minbias.promc. | + | |
- | The barcode of particles inside output.promc indicates the event origin. | + | |
- | + | ||
- | + | ||
- | Here is an example to create events with pileup for the paper [[http:// | + | |
- | We mix h-> HH signal file with MinBias Pythia8 (A2 tune) sample using < | + | |
- | <code bash> | + | |
- | wget http:// | + | |
- | source hs-toolkit/ | + | |
- | wget http:// | + | |
- | wget http:// | + | |
- | hs-pileup p200 tev100_s0higgshiggs_alltau_0001.promc tev100_pythia8_MinBias_l3__A2_001.promc output.promc | + | |
- | </ | + | |
- | Look at the " | + | |
- | + | ||
- | //Note:// pileup mixer is implemented in Java, therefore it uses 64bit zip. For C++ programs, please use ProMCBook(" | + | |
- | files (notice " | + | |
- | + | ||
- | <code cpp> | + | |
- | inputFile = new ProMCBook(argv[i], | + | |
- | </ | + | |
- | in readers/ | + | |
- | <code cpp> | + | |
- | inputFile = new ProMCBook(argv[i], | + | |
- | </ | + | |
+ | ====== Converting to other formats ====== | ||
+ | Look at other directories in " | ||
====== Extracting events | ====== Extracting events | ||
Line 539: | Line 356: | ||
</ | </ | ||
where signal.promc is the original file, and N is the number of events to extract. | where signal.promc is the original file, and N is the number of events to extract. | ||
- | |||
- | |||
- | |||
- | |||
====== Comparing MC and data ====== | ====== Comparing MC and data ====== | ||
Line 555: | Line 368: | ||
the scripts with data from [[http:// | the scripts with data from [[http:// | ||
- | |||
- | ====== How to create ProMC files ====== | ||
- | |||
- | There are several methods to create ProMC files from MC simulations. The most complete description is given [[https:// | ||
- | |||
- | * If you use Pythia8, look at the example " | ||
- | * For other generators, such as Herwig++ and Madgraph, write events in either lhe files or hepmc files. Then use the converters " | ||
- | |||
- | If are working on a description of how to fill ProMC files from Jetphox or MCFM. At this moment, contact us to get help. | ||
- | |||
- | We have very limited support for other formats, since they are typically 1) large files (such as HEPMC); 2) cannot be used for streaming over the network; 3) are not suited in a multi-platform environments (i.e. Windows). | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ====== A note for ANL cluster | ||
- | |||
- | For ANL cluster, you do not need to install Delphes. Simply run the reconstruction as: | ||
- | <code bash> | ||
- | source / | ||
- | $DELPHES/ | ||
- | </ | ||
- | The cards are located in $DELPHES/ | ||
- | |||
- | If you want to run over multiple ProMC files without manual download, use this command: | ||
- | |||
- | <code bash> | ||
- | java -cp hepsim.jar hepsim.Exec DelphesProMC delphes.tcl output.root [URL] [Nfiles] | ||
- | </ | ||
- | where [URL] is HepSim location of files and [Nfiles] is the number of files for processing. | ||
- | The output ROOT will be located inside the " | ||
- | Here is a small example: | ||
- | <code bash> | ||
- | java -cp hepsim.jar hepsim.Exec DelphesProMC delphes.tcl output.root | ||
- | </ | ||
- | which processes 5 files from [[http:// | ||
- | Skip " | ||
- | |||
- | ====== Single-particle gun ====== | ||
- | |||
- | ProMC files with single particles can be created using the ProMC. Download the recent ProMC package and | ||
- | look at the directory: | ||
- | |||
- | <code bash> | ||
- | wget http:// | ||
- | tar -zvxf ProMC.tgz | ||
- | cd examples/ | ||
- | source setup.sh | ||
- | javac promc_gun.java | ||
- | java promc_gun pions.promc 100 211 1000 # E=0-100 GeV, PID=211, events=1000 | ||
- | </ | ||
- | This creates file " | ||
- | The particles are pions (pi+, pid=211). The total number of events 1000. The phi and theta distributions are flat | ||
- | After file creation, look at the events using the file browser. You can also modify the java code to change the single-particle events. | ||
- | |||
- | ====== Converting to LCIO ====== | ||
- | |||
- | ProMC files can be converted to LCIO files for full detector simulation. | ||
- | |||
- | <code bash> | ||
- | wget http:// | ||
- | tar -zvxf ProMC.tgz | ||
- | cd examples/ | ||
- | source setup.sh | ||
- | javac promc2lcio.java | ||
- | java promc2lcio file.promc file.slcio | ||
- | </ | ||
- | |||
- | Look at other directories in " | ||
- | ====== Record slimming ====== | ||
- | Particle records from the generators based on LO/ | ||
- | (PYTHIA, HERWIG, MADGRAPH) are often " | ||
- | records are slimmed, the following algorithm is used: | ||
- | |||
- | <code python> | ||
- | (status=1 && pT>0.3 GeV ) or # keep final states with pT>0.3 GeV | ||
- | (PID=5 || PID=6) | ||
- | (PID>22 && PID< | ||
- | (PID>10 && PID< | ||
- | </ | ||
- | where PID is absolute value of particle codes. Leptons ane neutrinos are also affected by the slimming pT cut. | ||
- | Note: for 100 TeV collisions, the pT cut is increased from 0.3 to 0.4 GeV. | ||
- | For NLO calculations with a few partons + PDF weights, the complete event records are stored. | ||
- | |||
- | In the case when the slimming is applied, file sizes are reduced by x2 - x3. In some situation, slimming | ||
- | can affect detector simulation. For example, you should turn of tau reconstruction in Delphes when slimming is used. | ||
Line 680: | Line 406: | ||
</ | </ | ||
</ | </ | ||
+ | |||
+ | ====== Programming with HepSim ====== | ||
+ | |||
+ | |||
+ | |||
+ | Please look at the [[community: | ||
Send comments to: --- // | Send comments to: --- // |
community/hepsim/usage_truth.1461856649.txt.gz · Last modified: 2016/04/28 15:17 by asc