hepsim:quick
Differences
This shows you the differences between two versions of the page.
— | hepsim:quick [2024/07/01 21:25] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
+ | |||
+ | [[: | ||
+ | |||
+ | ====== Quick start ====== | ||
+ | |||
+ | Install the HepSim software toolkit using the " | ||
+ | |||
+ | <code bash> | ||
+ | bash # | ||
+ | wget https:// | ||
+ | source hs-toolkit/ | ||
+ | </ | ||
+ | |||
+ | This creates the directory " | ||
+ | [[https:// | ||
+ | You can view the commands using the bash shell by typing : | ||
+ | |||
+ | <code bash> | ||
+ | bash> hs-help | ||
+ | </ | ||
+ | |||
+ | The directory contains several bash scripts for Linux/Mac, and Windows batch (BAT) files to process events on Windows OS. | ||
+ | The package is used for download, view and analyze truth-level events in the [[https:// | ||
+ | |||
+ | <note tip> | ||
+ | Use [[https:// | ||
+ | (*.lcio) files with Geant4 simulations. | ||
+ | This program can also be used for truth-level records in the [[https:// | ||
+ | </ | ||
+ | |||
+ | ====== Finding data files ====== | ||
+ | |||
+ | Let us show how to find the files associated with a given Monte Carlo event sample. | ||
+ | Go to [[https:// | ||
+ | It shows URL of truth-level files (" | ||
+ | |||
+ | You can use the command line tool to list files associated with a dataset as: | ||
+ | |||
+ | <code bash> | ||
+ | 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. | ||
+ | |||
+ | Here is an example illustrating how to list all files from the | ||
+ | [[http:// | ||
+ | <code bash> | ||
+ | hs-ls tev100pp_higgs_ttbar_mg5 | ||
+ | </ | ||
+ | (" | ||
+ | Similarly, one can use the download URL: | ||
+ | <code bash> | ||
+ | hs-ls https:// | ||
+ | </ | ||
+ | Note that in this approach, one can use URL mirrors close to your geographical location. | ||
+ | |||
+ | If you need to create list for downloads with all files, use this syntax: | ||
+ | |||
+ | <code bash> | ||
+ | hs-ls [name] simple | ||
+ | hs-ls [name] simple-url > input_url.list # make list with URL from the main server | ||
+ | </ | ||
+ | where [name] is the name of dataset. You can also use a URL if you want to create a list of files from certain (mirror) servers. | ||
+ | |||
+ | ====== Searching for datasets ====== | ||
+ | |||
+ | The best method to find the needed sample is to use the web page with | ||
+ | [[https:// | ||
+ | |||
+ | Enter " | ||
+ | see samples with fast simulations. If you search for " | ||
+ | for Higgs. Also you can use complex searches, such as " | ||
+ | |||
+ | You can also use convenient URL links that search for some datasets. Here are a few examples: | ||
+ | |||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | |||
+ | 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 | ||
+ | For example, to find all URL locations that correspond to simulated samples with Higgs, try this: | ||
+ | |||
+ | < | ||
+ | hs-find higgs | ||
+ | </ | ||
+ | |||
+ | If you are interested in a specific reconstruction tag, use " | ||
+ | Example: | ||
+ | |||
+ | < | ||
+ | hs-find pythia%rfast001 | ||
+ | </ | ||
+ | It will search for Pythia samples after a fast detector simulation with the tag " | ||
+ | " | ||
+ | |||
+ | ====== Downloading EVGEN files ===== | ||
+ | |||
+ | One can download all EVGEN files for a given dataset as: | ||
+ | < | ||
+ | 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 " | ||
+ | to the directory " | ||
+ | |||
+ | < | ||
+ | hs-get tev100pp_higgs_ttbar_mg5 data | ||
+ | </ | ||
+ | |||
+ | Alternatively, | ||
+ | |||
+ | < | ||
+ | hs-get https:// | ||
+ | </ | ||
+ | |||
+ | Or, if you know the download URL, use it: | ||
+ | |||
+ | < | ||
+ | hs-get https:// | ||
+ | </ | ||
+ | All these examples will download all files from the " | ||
+ | |||
+ | |||
+ | 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 " | ||
+ | |||
+ | < | ||
+ | hs-get tev100pp_higgs_ttbar_mg5 data 3 10 | ||
+ | </ | ||
+ | One 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 string “pt”, followed by the pT cut. In this case, one can download such files as: | ||
+ | |||
+ | < | ||
+ | hs-get tev13pp_higgs_pythia8_ptbins | ||
+ | </ | ||
+ | where the name is [[https:// | ||
+ | |||
+ | The command download files to the " | ||
+ | |||
+ | |||
+ | The general usage of the **hs-get** command requires 2, 3, 4 or 5 arguments: | ||
+ | |||
+ | < | ||
+ | hs-get [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. | ||
+ | |||
+ | |||
+ | ====== Downloading RECO files ====== | ||
+ | |||
+ | Many datasets contain data files after Geant4 detector simulation and reconstruction (" | ||
+ | The files are in " | ||
+ | Reconstructed files are stored inside the directories with the tag " | ||
+ | where " | ||
+ | You can identify detector geometries that correspond to the tags using [[http:// | ||
+ | For example, [[https:// | ||
+ | sample includes the link " | ||
+ | |||
+ | <code bash> | ||
+ | hs-ls tev100pp_ttbar_mg5%rfast001 | ||
+ | hs-get tev100pp_ttbar_mg5%rfast001 data # download to the " | ||
+ | </ | ||
+ | The symbol " | ||
+ | You can skip " | ||
+ | |||
+ | |||
+ | One can also download files in several threads. If you want to download 10 files in 3 threads, run: | ||
+ | <code bash> | ||
+ | hs-get | ||
+ | </ | ||
+ | As before, one can also download the files using the URL: | ||
+ | <code bash> | ||
+ | hs-ls https:// | ||
+ | hs-get https:// | ||
+ | </ | ||
+ | |||
+ | ====== File validation ====== | ||
+ | |||
+ | One can check file consistency and print additional information as: | ||
+ | |||
+ | <code bash> | ||
+ | hs-info https:// | ||
+ | </ | ||
+ | |||
+ | The last argument can be a file location on the local disk (works faster than URL!). | ||
+ | The output of the above command will look something like this: | ||
+ | |||
+ | < | ||
+ | < | ||
+ | ProMC version = 2 | ||
+ | Last modified = 2013-06-05 16:32:18 | ||
+ | | ||
+ | ParticleDecays: | ||
+ | ParticleDecays: | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | Log file: = logfile.txt | ||
+ | The file was validated. Exit. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | You can see that this file includes a complete logfile (" | ||
+ | |||
+ | ====== Looking at separate events ====== | ||
+ | |||
+ | One can print separate EVGEN events using the above command after passing an integer argument that specifies | ||
+ | the event to be looked at. This command prints the event number " | ||
+ | |||
+ | < | ||
+ | hs-info https:// | ||
+ | </ | ||
+ | |||
+ | More conveniently, | ||
+ | < | ||
+ | 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 [[https:// | ||
+ | |||
+ | |||
+ | <note tip>If you use Windows OS, click " | ||
+ | |||
+ | |||
+ | You can also view EVGEN events without downloading files. Simply pass a URL to the above command and you will stream Monte Carlo events: | ||
+ | |||
+ | < | ||
+ | hs-view https:// | ||
+ | </ | ||
+ | Here we looked at one file of [[http:// | ||
+ | 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. | ||
+ | |||
+ | ====== Monte Carlo logfile ====== | ||
+ | |||
+ | Each ProMC/ProIO file includes a logfile from the Monte Carlo generator. Show this file on the screen as: | ||
+ | |||
+ | < | ||
+ | hs-log [file] | ||
+ | </ | ||
+ | where [file] is either a ProMC or ProIO file (you can use URL instead of the full path on the local computer). | ||
+ | |||
+ | In the case of ProMC files, one can use the standard Linux commands, such as " | ||
+ | |||
+ | < | ||
+ | unzip -p [promc file] logfile.txt | ||
+ | </ | ||
+ | |||
+ | where [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_nevents | ||
+ | </ | ||
+ | This command lists the stored events (each event is a ProtoBuffer binary file): | ||
+ | < | ||
+ | unzip -l [promc file] | ||
+ | </ | ||
+ | |||
+ | ====== Pileup mixing ====== | ||
+ | |||
+ | |||
+ | One can mix events from a signal ProMC file with | ||
+ | inelastic (minbias) events using the " | ||
+ | < | ||
+ | hs-pileup pN signal.promc minbias.promc output.promc | ||
+ | </ | ||
+ | Here " | ||
+ | with every event from " | ||
+ | If " | ||
+ | Use large numbers of events in " | ||
+ | The barcode of particles inside " | ||
+ | |||
+ | |||
+ | |||
+ | ====== Analysing EVNT files ====== | ||
+ | |||
+ | One can analyse Monte Carlo events on Window, Linux and Mac with [[https:// | ||
+ | Many HepSim samples include *.py scripts to calculate differential cross sections. One can run | ||
+ | validation scripts from the Web using [[https:// | ||
+ | Also, one can run scripts using a desktop and streaming | ||
+ | or using downloaded files (in which case you pass the directory with *promc files as an argument). | ||
+ | Here are a few approaches showing how to read *.py scripts: | ||
+ | |||
+ | |||
+ | ===== Using Java Web start ===== | ||
+ | |||
+ | |||
+ | Many " | ||
+ | One can run such scripts from the web browsers | ||
+ | using the [[https:// | ||
+ | Click the " | ||
+ | |||
+ | |||
+ | To use [[https:// | ||
+ | Java permissions: | ||
+ | For Linux/Mac, run " | ||
+ | For Windows, find "Java Control Panel" and do the same. | ||
+ | Read [[https:// | ||
+ | In addition, if you are a Mac user, you should allow execution of programs [[http:// | ||
+ | |||
+ | ===== Using stand-alone Python ===== | ||
+ | |||
+ | In this example, we will run a Python (to be more exact, Jython) script and, at the same time, will stream data from the web. | ||
+ | Find a HepSim event sample by clicking the info " | ||
+ | For example, look at a ttbar sample from Madgraph: [[https:// | ||
+ | Find the URL of the analysis script (" | ||
+ | |||
+ | <code bash> | ||
+ | wget https:// | ||
+ | </ | ||
+ | |||
+ | Then process this code in a batch mode as: | ||
+ | |||
+ | < | ||
+ | hs-run ttbar_mg5.py | ||
+ | </ | ||
+ | If you do not want a pop-up canvas with the output histogram, change the line 71 to " | ||
+ | and add " | ||
+ | |||
+ | |||
+ | One can view, edit and run the analysis file using a simple GUI editor. | ||
+ | < | ||
+ | hs-ide ttbar_mg5.py | ||
+ | </ | ||
+ | It opens this file for editing. One can run it by clicking on the " | ||
+ | It also provides an interactive Jython shell. | ||
+ | |||
+ | <note tip>If you use Windows OS, click the file " | ||
+ | |||
+ | |||
+ | When possible, use the downloaded ProMC files, rather than streaming the data over the network. | ||
+ | The calculations will run faster since the program | ||
+ | Let assume that we put all ProMC files to the directory " | ||
+ | |||
+ | < | ||
+ | hs-run ttbar_mg5.py data | ||
+ | </ | ||
+ | |||
+ | Here is a complete example: we download data to the directory " | ||
+ | then we download the analysis script, and then we run this script over the local data using 10000 events: | ||
+ | < | ||
+ | hs-get https:// | ||
+ | hs-run ttbar_mg5 10000 | ||
+ | </ | ||
+ | |||
+ | |||
+ | ===== Using a Java IDE ===== | ||
+ | |||
+ | The above example has some limitations since it uses rather simple editor. | ||
+ | Another approach is to use the full-featured [[http:// | ||
+ | [[https:// | ||
+ | <code bash> | ||
+ | wget -O dmelt.zip http:// | ||
+ | unzip dmelt.zip; | ||
+ | ./ | ||
+ | </ | ||
+ | You can also pass URL with data as an argument and limit the calculation to 10000 events: | ||
+ | <code bash> | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | As before, use the batch mode using downloaded ProMC files. | ||
+ | Let assume that we put all ProMC files to the directory " | ||
+ | |||
+ | <code bash> | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | Here is a complete example: we download data to the directory " | ||
+ | then we download the analysis script, and then we run this script over the local data using 10000 events: | ||
+ | < | ||
+ | hs-get https:// | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | |||
+ | Then click " | ||
+ | One can also start [[https:// | ||
+ | < | ||
+ | ./ | ||
+ | </ | ||
+ | on Linux/Mac. On Windows, run " | ||
+ | Locate | ||
+ | Next, in the DMelt menu, go to " | ||
+ | URL dialog and click " | ||
+ | window with a histogram. | ||
+ | This method works for Python/ | ||
+ | |||
+ | |||
+ | ===== Using C++/ROOT ===== | ||
+ | |||
+ | |||
+ | Install [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | $PROMC/ | ||
+ | $PROMC/ | ||
+ | $PROMC/ | ||
+ | </ | ||
+ | For C++/ROOT, you should download files <i>a priory</ | ||
+ | There is a simple example showing how to read multiple Monte Carlo files from HepSim, | ||
+ | build anti-KT jets using FastJet, and fill ROOT histograms. Download | ||
+ | [[https:// | ||
+ | |||
+ | < | ||
+ | wget http:// | ||
+ | cd hepsim-cpp/; | ||
+ | </ | ||
+ | Read the file " | ||
+ | |||
+ | ====== Analyzing RECO data ====== | ||
+ | |||
+ | HepSim includes data after fast and full detector simulations. There are several methods to analyse such files. | ||
+ | |||
+ | ===== Analyzing Delphes ROOT files (fast simulation) ===== | ||
+ | |||
+ | The Delphes ROOT files are typically posted using the reconstruction tag " | ||
+ | Use search to find such samples. Read the [[https:// | ||
+ | about how to read Delphes ROOT files. | ||
+ | |||
+ | You can find all samples that contain fast simulations using [[https:// | ||
+ | |||
+ | ===== Full simulation: LCIO files ===== | ||
+ | |||
+ | Events afer detector simulation and reconstruction (" | ||
+ | We use [[http:// | ||
+ | Such files have an extension " | ||
+ | [[https:// | ||
+ | you to read files using the Python syntax. | ||
+ | |||
+ | If you need to read LCIO files in C++ code with ROOT/ | ||
+ | | ||
+ | |||
+ | You can find all samples that contain full simulations using [[https:// | ||
+ | |||
+ | |||
+ | ===== Conversion to ROOT, HEPMC, HEPEVT, LHE, STDHEP, LCIO ===== | ||
+ | |||
+ | One can convert ProMC file to ROOT to look at branches. If the ProMC package is installed, run the converter: | ||
+ | <code bash> | ||
+ | cp -rf $PROMC/ | ||
+ | cd promc2root | ||
+ | make | ||
+ | ./ | ||
+ | </ | ||
+ | The output file will contain ROOT branches with px,py,pz,e, etc. | ||
+ | |||
+ | |||
+ | One can also convert ProMC to HEPMC using the example | ||
+ | < | ||
+ | $PROMC/ | ||
+ | </ | ||
+ | |||
+ | (see the ProMC manual). In addition, the directory | ||
+ | < | ||
+ | $PROMC/ | ||
+ | </ | ||
+ | has examples | ||
+ | ProMC to HEPEVT records (promc2hepevnt), | ||
+ | |||
+ | |||
+ | ====== Anomaly detection with HepSim ====== | ||
+ | |||
+ | You can use [[http:// | ||
+ | In addition, [[http:// | ||
+ | |||
+ | |||
+ | ====== Comparing with HepData ====== | ||
+ | |||
+ | Durham [[http:// | ||
+ | with [[https:// | ||
+ | For example, look at the link [[http:// | ||
+ | download a " | ||
+ | You can run this script inside | ||
+ | commands from hs-tools. | ||
+ | Then one can combine this script with a HepSim script | ||
+ | (from the " | ||
+ | that runs over HepSim Monte Carlo data, | ||
+ | creating plots showing agreement between data and theoretical calculations. | ||
+ | | ||
+ | |||
+ | --- // | ||
hepsim/quick.txt · Last modified: 2024/07/01 21:25 by 127.0.0.1