hepsim:dev_fast
Differences
This shows you the differences between two versions of the page.
— | hepsim:dev_fast [2024/07/01 21:25] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
+ | |||
+ | |||
+ | [[: | ||
+ | |||
+ | ====== Creating Delphes files ====== | ||
+ | |||
+ | |||
+ | Fast simulations in the HepSim are posted under the [[http:// | ||
+ | |||
+ | Generally, you do not need to install Delphes to run fast simulations. You can run fast simulations using the HepSim singularity container. This topic is described in [[hepsim: | ||
+ | |||
+ | Below is the description how to use Delphes if you do not want to use the HepSim docker container. | ||
+ | |||
+ | ===== 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. The detectors configurations for Delphes together with appropriate Delphes package are posted to [[http:// | ||
+ | Copy the ZIP file with Delphes card and Delphes package and compile it. | ||
+ | |||
+ | Here is an example of how to re-create fast simulations for " | ||
+ | corresponds to the detector " | ||
+ | |||
+ | <code bash> | ||
+ | det=" | ||
+ | wget http:// | ||
+ | unzip $det.zip | ||
+ | cd $det | ||
+ | tar --strip-components=1 -zvxf Delphes*.tar.gz # untar in the current directory | ||
+ | ./ | ||
+ | </ | ||
+ | The last command should create the binary file " | ||
+ | |||
+ | <code bash> | ||
+ | wget http:// | ||
+ | ./ | ||
+ | </ | ||
+ | This commands creates a ROOT file with fast simulations. | ||
+ | |||
+ | < | ||
+ | Detector configuration files [detector].zip include the Delphes source code used to make the simulation tag, | ||
+ | and the input control card " | ||
+ | </ | ||
+ | |||
+ | You can create a complete list of input files. Here is how to do this: | ||
+ | |||
+ | <code bash> | ||
+ | hs-ls [setname] simple | ||
+ | hs-ls [setname] simple-url > input_url.list # list with URL from the main server | ||
+ | # create a setup array with input files | ||
+ | declare -a wwwarray | ||
+ | n=0 | ||
+ | while read -r line | ||
+ | do | ||
+ | name=$line | ||
+ | wwwarray[$n]=$name | ||
+ | let "n = $n + 1" | ||
+ | done < " | ||
+ | </ | ||
+ | where [setname] is the dataset name, such as " | ||
+ | If you know URL of the mirror, replaces [setname] with qualified URL pointing to your dataset. Now, you have the necessary tools. Fetch the list of URLs with input files, and make a loop over files. | ||
+ | |||
+ | |||
+ | One can also run Delphes in an automated mode, without the above scripts. You need to use " | ||
+ | <code bash> | ||
+ | hs-exec DelphesProMC card.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 " | ||
+ | |||
+ | Here is a small example: | ||
+ | <code bash> | ||
+ | hs-exec DelphesProMC card.tcl output.root http:// | ||
+ | </ | ||
+ | which processes 5 files from [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | ====== Creating files manually ====== | ||
+ | |||
+ | |||
+ | If you want to create a new simulations with updated Delphes and input cards, follow these steps: | ||
+ | |||
+ | |||
+ | (1) Download [[http:// | ||
+ | <code bash> | ||
+ | tar -zvxf Delphes-X.X.Xtar.gz | ||
+ | cd Delphes-X.X.X.tar.gz | ||
+ | ./configure | ||
+ | make | ||
+ | </ | ||
+ | where " | ||
+ | |||
+ | (2) Copy and modify the detector configuration files. The configuration files with the extension " | ||
+ | |||
+ | Often, | ||
+ | |||
+ | 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> | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | ===== On the fly reconstruction ===== | ||
+ | HepSim can be used to create ROOT (Delphes) files 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 of the [[https:// | ||
+ | |||
+ | Follow these steps: | ||
+ | |||
+ | <code bash> | ||
+ | wget http:// | ||
+ | tar -zvxf FastHepSim.tgz | ||
+ | cd FastHepSim/ | ||
+ | ./ | ||
+ | </ | ||
+ | |||
+ | This installs " | ||
+ | |||
+ | <code bash> | ||
+ | cd .. # go to the root directory | ||
+ | source setup.sh | ||
+ | </ | ||
+ | |||
+ | 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 creates a file " | ||
+ | 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 " | ||
+ | |||
+ | |||
+ | <note important> | ||
+ | {{ : | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== 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 " | ||
+ | |||
+ | |||
+ | |||
+ | ====== 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. | ||
+ | |||