fcs:eic:intro
Differences
This shows you the differences between two versions of the page.
— | fcs:eic:intro [2024/07/01 21:25] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | [[: | ||
+ | |||
+ | ====== Electron ion collier studies ====== | ||
+ | //A mini-tutorial for EIC LDRD work// | ||
+ | |||
+ | |||
+ | A first version of an " | ||
+ | The description link describes this detector. | ||
+ | |||
+ | ====== Visualizing the detector ====== | ||
+ | |||
+ | You can visualize the SiEIC detector using Java (Jas4pp) or ROOT/C++. | ||
+ | This assumes that you are using the **bash shell** on Linux/Mac with Java8 (Windows will be discussed later). Install [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | wget http:// | ||
+ | tar -zvxf jas4pp.tgz | ||
+ | cd jas4pp | ||
+ | source ./setup.sh # takes 5 sec for first-time optimization | ||
+ | </ | ||
+ | |||
+ | Then copy the detector geometry file to the local directory where the file " | ||
+ | <code bash> | ||
+ | wget http:// | ||
+ | </ | ||
+ | Now we can visualize the detector as **[File]-[Open data source]-[HepRep]** XML and select file " | ||
+ | This is how to do this using the command line: | ||
+ | |||
+ | <code bash> | ||
+ | jas4pp sieic1.heprep | ||
+ | </ | ||
+ | Now you should see the detector layout. Read more on Jas4pp [[https:// | ||
+ | |||
+ | |||
+ | You can also visualize the detector using ROOT. Here are a few steps: | ||
+ | |||
+ | <code bash> | ||
+ | wget http:// | ||
+ | gunzip sieic1.gdml.gz | ||
+ | root # start root and type: | ||
+ | TGeoManager:: | ||
+ | gGeoManager-> | ||
+ | </ | ||
+ | |||
+ | You can get an image like this. You can explore different volumes by making them visible/ | ||
+ | {{: | ||
+ | |||
+ | ====== Data analysis ====== | ||
+ | |||
+ | |||
+ | ===== EVGEN single particle studies ===== | ||
+ | The goal of this tutorial is to show how to benchmark this detector using single electrons. You can calculate Q2 and x_bj from the position of reconstructed electrons, and calculate the resolution and efficiency. | ||
+ | |||
+ | First, look at the prepared sample of electrons. This sample is called [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | hs-ls pgun_elec_eta45_30gev # check truth level files | ||
+ | </ | ||
+ | |||
+ | You can download EVGEN files and run jobs locally. You can also stream data to the analysis program. | ||
+ | Here is a simple validation test assumed that you have setup Jas4pp and Linux/Mac prompt: | ||
+ | |||
+ | <code bash> | ||
+ | wget http:// | ||
+ | fpad check_promc_single.py | ||
+ | </ | ||
+ | It makes a few distributions. You can try to calculate Q2 and x_bj using position and energy of the truth-level electrons. Look at the [[: | ||
+ | |||
+ | You can download all files as: | ||
+ | |||
+ | <code bash> | ||
+ | hs-get pgun_elec_eta45_30gev | ||
+ | </ | ||
+ | |||
+ | <note tip>If you use Windows, start " | ||
+ | |||
+ | ====== Reconstructed events ====== | ||
+ | Each detector in HepSim has " | ||
+ | Click this link: [[http:// | ||
+ | The reconstruction tags are shown in the info page of this sample [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | hs-ls pgun_elec_eta45_30gev%rfull051 | ||
+ | </ | ||
+ | Note that the number of files is less than EVGEN files due to some OSG problem. We usually reconstruct 1000 events from EVGEN files. | ||
+ | To download the fully simulated and reconstructed events in the LCIO format, use: | ||
+ | |||
+ | <code bash> | ||
+ | hs-get pgun_elec_eta45_30gev%rfull051 | ||
+ | </ | ||
+ | |||
+ | You can analyse LCIO files using either Python scripts or C++. For Python/ | ||
+ | You can run such scripts using " | ||
+ | |||
+ | <note tip>Look at the tutorial [[: | ||
+ | |||
+ | Here is an example of plotting the distribution of pseudorapidity for truth and reconstructed electrons: | ||
+ | {{: | ||
+ | Run the example python code as: | ||
+ | |||
+ | <code bash> | ||
+ | hs-get pgun_elec_eta45_30gev%rfull051 | ||
+ | wget https:// | ||
+ | fpad mc_electrons.py | ||
+ | </ | ||
+ | |||
+ | This code creates this image of the SiEIC-v1 detector: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Note that the plot is done for all electrons starting from 1 GeV (a region where the efficiency is quite small). | ||
+ | |||
+ | |||
+ | ====== Hit timing information ====== | ||
+ | |||
+ | |||
+ | |||
+ | You can also look at timing of silicon tracker using this script: {{: | ||
+ | <code bash> | ||
+ | hs-get pgun_elec_eta4_pt30gev%rfull052 data # 2 100 get 100 files in 2 threads in the directory " | ||
+ | fpad eic: | ||
+ | </ | ||
+ | The plot is shown here: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ====== Looking at track resolution ====== | ||
+ | |||
+ | You can also look at single particles with flat pT, Eta and Phi. Here is an example this using a simple validation script {{: | ||
+ | for the MCparticle container inside LCIO file. We will use the "flat pT" sample called [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | hs-get pgun_elec_eta4_pt30gev%rfull052 data 2 100 # get 100 files in 2 threads in the directory " | ||
+ | fpad mc_truth_flat.py | ||
+ | </ | ||
+ | |||
+ | The resulting image is: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | Now, let's calculate track resolution. We will use this script {{: | ||
+ | makes fit of pT(reco)/ | ||
+ | This command shown below makes resolution plots, fits with a Gaussian function, and plot resolution as a function of pT: | ||
+ | <code bash> | ||
+ | hs-get pgun_elec_eta4_pt30gev%rfull052 data 2 20 # get 20 files in 2 threads in the directory " | ||
+ | fpad track_resolution.py | ||
+ | </ | ||
+ | |||
+ | The final plot is shown below: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ====== How to continue ====== | ||
+ | |||
+ | Now you can use this template to study: | ||
+ | |||
+ | * electron efficiency as a function of pT | ||
+ | * electron efficiency as a function of Eta in bins of pT | ||
+ | * resolution as a function of pT and Eta | ||
+ | * duplicate tracks | ||
+ | * fake rate (cannot be done with this sample!) | ||
+ | * calculate Q2 and x_bj, check efficiency and resolutions for these variable | ||
+ | |||
+ | ====== Reconstructed events ====== | ||
+ | |||
+ | |||
+ | If you already setup Jas4pp program, you can visualize the reconstructed events. | ||
+ | we will read the simulated events: Open any *.slcio file you copied from HepSim using the menu | ||
+ | **[File]-[Open data source]-[LCIO]** | ||
+ | For e-p events, use this LCIO file from [[http:// | ||
+ | |||
+ | <code bash> | ||
+ | wget http:// | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | Then click a small button [Go] (top menu bar). It will process | ||
+ | | ||
+ | do this **[File]-[New]-[LCSim Event browser]** | ||
+ | |||
+ | ====== Event display ====== | ||
+ | |||
+ | Here are images of ep collision with a scattered electron identified using the PFA. | ||
+ | The images were done using DIS ep samples [[http:// | ||
+ | Reconstructed electron energy from PFA: E=16.92 GeV | ||
+ | “EVGEN” energy: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | |||
+ | ====== Using C++ ====== | ||
+ | |||
+ | You can read SLCIO files using a C++ program. As usual, your program can look as this: | ||
+ | |||
+ | <code cpp> | ||
+ | string input=" | ||
+ | LCReader* lcReader = LCFactory:: | ||
+ | lcReader-> | ||
+ | LCEvent* | ||
+ | int nEvents=0; | ||
+ | while( (evt = lcReader-> | ||
+ | if (nEvents==0) UTIL:: | ||
+ | cout << " | ||
+ | |||
+ | const LCParameters& | ||
+ | // print stored EVGEN parameters | ||
+ | | ||
+ | int nFloatParameters = params.getFloatKeys( floatKeys ).size() ; | ||
+ | | ||
+ | | ||
+ | FloatVec floatVec ; | ||
+ | params.getFloatVals( | ||
+ | int nFloat | ||
+ | cout << " parameter " << floatKeys[i] << " [float]: " ; | ||
+ | for(int j=0; j< nFloat ; j++ ){ | ||
+ | cout << floatVec[j] << ", " ; | ||
+ | } | ||
+ | cout << endl ; | ||
+ | | ||
+ | | ||
+ | } | ||
+ | lcReader-> | ||
+ | </ | ||
+ | |||
+ | This code example shows how to print float parameters from the EVGEN level (copied from the input ProMC). | ||
+ | Here is the example of all parameters (float, integers, strings): | ||
+ | < | ||
+ | <code cpp> | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | For EIC ep events, the relevant parameters for a given DIS event are: | ||
+ | |||
+ | <code cpp> | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | |||
+ | Note that SLCIO files have two records representing truth level MC: MCParticle and MCInfo. MCInfo includes information on generated events. | ||
+ | See the example how this record was created in [[https:// | ||
+ | |||
+ | --- // | ||