wget http://atlaswww.hep.anl.gov/hepsim/soft/hs-toolkit.tgz -O - | tar -xz; source hs-toolkit/setup.shThis creates the directory "hs-toolkit" with HepSim commands. Java7/8 and above should be installed. You can view the commands by typing:
hs-helpThis package is used to download, view and processes HepSim files. To work with full simulation files, use the JAS4PP program.
hs-ls [name]where [name] is the dataset name. One can also use the URL of the Info page instead, or the URL of the location of all files. This command shows a table with file names and their sizes.
Here is an example illustrating how to list all files from the Higgs to ttbar Monte Carlo sample:
hs-ls tev100_higgs_ttbar_mg5Similarly, one can use the download URL:
hs-ls http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/higgs_ttbar_mg5/
1) http://atlaswww.hep.anl.gov/hepsim/list.php?find=rfull list MC after full simulations
2) http://atlaswww.hep.anl.gov/hepsim/list.php?find=rfast lists MC after fast simulations
3) http://atlaswww.hep.anl.gov/hepsim/list.php?find=mg5 - lists all Madgraph5 samples
4) http://atlaswww.hep.anl.gov/hepsim/list.php?find=higgs%rfast - lists Higgs samples after fast simulation
If you prefer to use the command-line approach, you can find URL that corresponds a dataset using this command:
hs-find [search word]The search is performed using names of datasets or Monte Carlo models, or in the file description. For example, to find all URL locations that correspond to simulated samples with Higgs, try this:
hs-find higgsIf you are interested in a specific reconstruction tag, use "%" to separate the search string and the tag name. Example:
hs-find pythia%rfast001It will search for Pythia samples after a fast detector simulation with the tag "001". To search for a full detector simulation, replace "rfast" with "rfull".
hs-get [name] [OUTPUT_DIR]where [name] is the dataset name. This also can be the URL of the Info page, or a direct URL pointing to the locations of ProMC files. This example downloads all files from the "tev100_higgs_ttbar_mg5" dataset to the directory "data":
hs-get tev100_higgs_ttbar_mg5 dataAlternatively, this example downloads the same files using the URL of the Info page:
hs-get http://atlaswww.hep.anl.gov/hepsim/info.php?item=2 dataOr, if you know the download URL, use it:
hs-get http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/higgs_ttbar_mg5 dataAll these examples will download all files from the "tev100_higgs_ttbar_mg5" event sample.
One can add an integer value to the end of this command which specifies the number of threads. If a second integer is given, it will be used to set the maximum number of files to download. This example will download 10 files in 3 thread from the dataset "tev100_higgs_ttbar_mg5".
hs-get tev100_higgs_ttbar_mg5 data 3 10One can also download files that have certain pattern in their names. If URL contains files generated with different pT cuts, the names are usually have the substring “pt”, followed by the pT cut. In this case, one can download such files as:
hs-get tev13_higgs_pythia8_ptbins data 3 10 pt100_where the name is tev13_higgs_pythia8_ptbins. The command download files to the "data" directory in 2 threads. The maximum number of download files is 5 and all file names have *pt100* substring (i.e. pT>100 GeV).
The general usage of the hs-get command requires 2, 3, 4 or 5 arguments:
[URL] [OUTPUT_DIR] [Nr of threads (optional)] [Nr of files (optional)] [pattern (optional)]where [URL] is either info URL, [Download URL], or the dataset name.
hs-ls tev100_ttbar_mg5%rfast001 # list ROOT files with the tag "rfast001" hs-get tev100_ttbar_mg5%rfast001 data # download to the "data" directoryThe symbol "%" separates the dataset name ("tev100_ttbar_mg5") from the reconstruction tag ("rfast001"). You can skip "data" in the second example - in this case, data will be copied to the directory "tev100_ttbar_mg5%rfast001".
One can also download files in several threads. If you want to download 10 files in 3 threads, run:
hs-get tev100_ttbar_mg5%rfast001 data 3 10As before, one can also download the files using the URL:
hs-ls http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/ttbar_mg5/rfast001/ # list all files hs-get http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/ttbar_mg5/rfast001/ data
hs-info http://mc.hep.anl.gov/asc/hepsim/events/pp/14tev/higgs/pythia8/pythia8_higgs_1.promcThe last argument can be a file location on the local disk (works faster than URL!). The output of the above command is:
ProMC version = 2 Last modified = 2013-06-05 16:32:18 Description = PYTHIA8;PhaseSpace:mHatMin = 20;PhaseSpace:pTHatMin = 20; ParticleDecays:limitTau0 = on; ParticleDecays:tau0Max = 10;HiggsSM:all = on; Events = 10000 Sigma (pb) = 2.72474E1 ± 1.92589E-1 Lumi (pb-1) = 3.67007E2 Varint units = E:100000 L:1000 Log file: = logfile.txt The file was validated. Exit.You can see that this file includes a complete logfile ("logfile.txt"). We will explain how to extract it later.
hs-info http://mc.hep.anl.gov/asc/hepsim/events/pp/14tev/higgs/pythia8/pythia8_higgs_1.promc 100More conveniently, one can open the file in a GUI mode to look at all events:
hs-view [promc file]This command brings up a GUI window to look at separate events. You should forward X11 to see the GUI. For Windows: download the file hepsim.jar and click on it. Then open the file as [File]-[Open file]. Look at HepSim wiki (hepsim.jar is similar to browser_promc.jar). You can also view events without downloading files. Simply pass a URL to the above command and you will stream Monte Carlo events:
hs-view http://mc.hep.anl.gov/asc/hepsim/events/pp/14tev/qcd/pythia8/pythia8_qcd_1.promcHere we looked at one file of Pythia8 (QCD) sample. Files with NLO predictions will be automatically identified: For such files, you will see a few particles per events and weights for calculations of PDF uncertainties.
unzip -p [promc file] logfile.txtwhere [promc file] is the file name. This command extracts a logfile with original generator-level information. The next command shows the actual number of stored events:
unzip -p [promc file] promc_neventsThis command lists the stored events (each event is a ProtoBuffer binary file):
unzip -l [promc file]
hs-pileup pN signal.promc minbias.promc output.promcHere "p" indicates that events from "minbias.promc" will be mixed with every event from "signal.promc" using a Poisson distribution with the mean "N". If "p" before N is not given, then exactly N (random) events from minbias.promc will be added to every event from "signal.promc". Use large numbers of events in "minbias.promc" to minimise reuse of the same events. The barcode of particles inside "output.promc" indicates the event origin (0 is set for particles from "signal.promc"). Look at the example in the section Pileup Mixing Wiki.
Here is a Delphes command to create a ROOT file with the fast detector simulation using "delphes.tcl" card:
DelphesProMC delphes.tcl output.root [promc file]If [promc file] is slimmed, remove the line “TauTagging” from delphes_card.tcl to avoid a crash. If you want to run over multiple ProMC files without manual download, use this command:
hs-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 "hepsim_output" directory. Here is a small example:
hs-exec DelphesProMC delphes.tcl output.root http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/higgs_ttbar_mg5 5which processes 5 files from HiggsToTTbar sample. Skip "5" at the end to process all files.
To use Java Web Start, you should configure Java permissions: For Linux/Mac, run "ControlPanel", go to the "Security" tab and add "http://atlaswww.hep.anl.gov" to the exception list. For Windows, find "Java Control Panel" and do the same. Read Why are Java applications blocked by your security settings. In addition, if you are a Mac user, you should allow execution of programs outside Mac App Store.
wget http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/ttbar_mg5/macros/ttbar_mg5.pyThen process this code in a batch mode as:
hs-run ttbar_mg5.pyIf you do not want a pop-up canvas with the output histogram, change the line 71 to "c1.visible(0)" (or "c1.visible(False)") and add "sys.exit(0)" at the very end of the "ttbar_mg5.py" macro.
One can view, edit and run the analysis file using a simple GUI editor.
hs-ide ttbar_mg5.pyIt opens this file for editing. One can run it by clicking on the "run" button. It also provides an interactive Jython shell.
When possible, use the downloaded ProMC files, rather than streaming the data over the network. The calculations will run faster since the program does calculations using local files. Let assume that we put all ProMC files to the directory "data". Then run the script as:
hs-run ttbar_mg5.py dataHere is a complete example: we download data to the directory "ttbar_mg5", then we download the analysis script, and then we run this script over the local data using 10000 events:
hs-get http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/ttbar_mg5 ttbar_mg5 hs-run ttbar_mg5 10000
get -O dmelt.zip http://jwork.org/dmelt/download/current.php; unzip dmelt.zip; ./dmelt/dmelt_batch.sh ttbar_mg5.pyYou can also pass URL with data as an argument and limit the calculation to 10000 events:
./dmelt/dmelt_batch.sh ttbar_mg5.py http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/ttbar_mg5/ 10000
As before, use the batch mode using downloaded ProMC files. Let assume that we put all ProMC files to the directory "data". Then run DataMelt over the data as:
./dmelt/dmelt_batch.sh ttbar_mg5.py dataHere is a complete example: we download data to the directory "ttbar_mg5", then we download the analysis script, and then we run this script over the local data using 10000 events:
hs-get http://mc.hep.anl.gov/asc/hepsim/events/pp/100tev/ttbar_mg5 ttbar_mg5 ./dmelt/dmelt_batch.sh ttbar_mg5.py ttbar_mg5 10000Then click "run" (or [F8]). One can also start DataMelt without input files:
./dmelt/dmelt.shon Linux/Mac. On Windows, run "dmelt.bat" instead. You will see the DatMelt IDE. Locate an URL location of the analysis script, such as ttbar_mg5 (can be found under "Info" link). Then copy this link using the right mouse button ("Copy URL Location"). Next, in the ScaVis menu, go to "File"→"Read script from URL". Copy the URL link of the *.py file to the pop-up DataMelt URL dialog and click "run". The program will start reading data from the Web. At the end of the run, you will see a pop-up window with a histogram. This method works for Python/Jython, Java, Ruby, Groovy, BeanShell languages.
$PROMC/examples/reader_mc/ - shows how to read ProMC files from a typical Monte Carlo generator $PROMC/examples/reader_nlo/ - shows how to read ProMC files with NLO calculations (i.e. MCFM) $PROMC/examples/promc2root/ - shows how to read PROMC files and create ROOT Tree.One can read ProMC files in C++/ROOT or CPython as explained in the HepSim wiki. For C++/ROOT, you should download files a priory since the streaming over the network is not supported.
wget http://atlaswww.hep.anl.gov/asc/hepsim/soft/hepsim-cpp.tgz -O - | tar -xz; cd hepsim-cpp/; makeRead the file "README" inside this directory.
You can find all samples that contain fast simulations using this link.
You can find all samples that contain full simulations using this link.
cp -rf $PROMC/examples/promc2root . cd promc2root make ./promc2root [promc file] output.rootThe output file will contain ROOT branches with px,py,pz,e, etc.
One can also convert ProMC to HEPMC using the example $PROMC/examples/promc2hepmc (see the ProMC manual). In addition, the directory $PROMC/examples/ has examples showing how to convert ProMC to HEPEVT records (promc2hepevnt), STDHEP (promc2stdhep), LHE (promc2lhe) and LCIO (promc2lcio).
2013-2016. S. Chekanov (ANL)
JLAB.ORG (read only)