Table of Contents

<< back to HepSim manual

Electron ion collier studies

A mini-tutorial for EIC LDRD work

A first version of an “all-silicon” detector for EIC is posted to the HepSim detector geometry repository. Look for the detector called sieic1. The description link describes this detector. A working name of this detector is SiEIC (v1). Take time and study 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 Jas4pp program and run these commands to install the hepsim package:

wget http://atlaswww.hep.anl.gov/asc/jas4pp/download/current.php -O jas4pp.tgz
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 “jas4pp” is:

wget http://atlaswww.hep.anl.gov/hepsim/soft/detectors/sieic1/sieic1.heprep

Now we can visualize the detector as [File]-[Open data source]-[HepRep] XML and select file “sidloi3.heprep”. This is how to do this using the command line:

jas4pp sieic1.heprep

Now you should see the detector layout. Read more on Jas4pp here.

You can also visualize the detector using ROOT. Here are a few steps:

wget http://atlaswww.hep.anl.gov/hepsim/soft/detectors/sieic1/sieic1.gdml.gz
gunzip sieic1.gdml.gz
root # start root and type:
TGeoManager::Import("sieic1.gdml");
gGeoManager->GetTopVolume()->Draw("ogl");

You can get an image like this. You can explore different volumes by making them visible/invisible.

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 pgun_elec_eta45_30gev. Use this EVGEN tutorial for studying such files. Check the files as:

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:

wget http://mc.hep.anl.gov/asc/hepsim/events/misc/pgun/pgun_eta45_p30_elec/macros/check_promc_single.py
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 Analysis tutorial.

You can download all files as:

hs-get pgun_elec_eta45_30gev
If you use Windows, start “jaspp” program and open the “check_promc_single.py” file inside the editor. The you can run this file. If you use C++, you will need to install ProMC C++ library

Reconstructed events

Each detector in HepSim has “reconstruction” tag, i.e. a data folder where files after simulation and reconstruction are located. How to find the name of such folder? Click this link: check sieic1 tag. It shows that this detector has the rfull051 tag. The reconstruction tags are shown in the info page of this sample pgun_elec_eta45_30gev. List available files after the full simulation and reconstruction using rfull051 tag:

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:

hs-get pgun_elec_eta45_30gev%rfull051

You can analyse LCIO files using either Python scripts or C++. For Python/Jython scripts, use examples located in the directory “examples” of the Jas4pp program. You can run such scripts using “fpad” (Linux/Mac) or jaspp GUI (Windows).

Look at the tutorial here which shows how to use C++/ROOT for reading SLCIO files. We show this Python example since it does not require compilation, and you can run it on Windows. For more sophisticated studies that involve FastJet and other tools, use C++/ROOT.

Here is an example of plotting the distribution of pseudorapidity for truth and reconstructed electrons: mc_electrons.py. After you have finished downloading the files, you will see the directory “pgun_elec_eta45_30gev%rfull051”. Run the example python code as:

hs-get pgun_elec_eta45_30gev%rfull051  # get all data
wget https://atlaswww.hep.anl.gov/asc/wikidoc/lib/exe/fetch.php?media=fcs:eic:mc_electrons.py -O mc_electrons.py
fpad mc_electrons.py                   # make a plot with Eta

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: eic:mc_hits_time.py

hs-get pgun_elec_eta4_pt30gev%rfull052 data # 2 100  get 100 files in 2 threads in the directory "data"
fpad eic:mc_hits_time.py

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 mc_truth_flat.py for the MCparticle container inside LCIO file. We will use the “flat pT” sample called pgun_elec_eta4_pt30gev reconstructed with the tag “rfull052” (SiEIC with 1T solenoid):

hs-get pgun_elec_eta4_pt30gev%rfull052 data  2 100 # get 100 files in 2 threads in the directory "data"
fpad mc_truth_flat.py

The resulting image is:

Now, let's calculate track resolution. We will use this script track_resolution.py which makes fit of pT(reco)/pT(truth) and plots the resolution as a function of pT(truth). This command shown below makes resolution plots, fits with a Gaussian function, and plot resolution as a function of pT:

hs-get pgun_elec_eta4_pt30gev%rfull052 data  2 20 # get 20 files in 2 threads in the directory "data"
fpad track_resolution.py

The final plot is shown below:

How to continue

Now you can use this template to study:

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 rfull051.

wget http://mc.hep.anl.gov/asc/hepsim/events/misc/pgun/pgun_eta45_p30_elec/rfull051/pgun_elec30gev_001_pandora.slcio

Then click a small button [Go] (top menu bar). It will process events. Then select again [File]-[New]-[Wired 4 view]. If you want to see how data records are organized inside the slcio file, 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://atlaswww.hep.anl.gov/hepsim/info.php?item=159. Reconstructed electron energy from PFA: E=16.92 GeV “EVGEN” energy: 16.90 GeV

Using C++

You can read SLCIO files using a C++ program. As usual, your program can look as this:

string input="data.slcio";
LCReader* lcReader = LCFactory::getInstance()->createLCReader() ;
lcReader->open( infile1.c_str() ) ;
LCEvent*  evt;
int nEvents=0;
while( (evt = lcReader->readNextEvent()) != 0 ) {
      if (nEvents==0) UTIL::LCTOOLS::dumpEvent( evt ) ;
           cout << "  Run : " << evt->getRunNumber() << " Detector: "      << evt->getDetectorName() <<  endl ;
 
           const LCParameters& params=evt->getParameters();
           // print stored EVGEN parameters
           StringVec floatKeys ;
           int nFloatParameters = params.getFloatKeys( floatKeys ).size() ;
 
           for(int i=0; i< nFloatParameters ; i++ ){
              FloatVec floatVec ;
              params.getFloatVals(  floatKeys[i], floatVec ) ;
              int nFloat  = floatVec.size()  ;
              cout << " parameter " << floatKeys[i] << " [float]: " ;
              for(int j=0; j< nFloat ; j++ ){
                    cout << floatVec[j] << ", " ;
                }
               cout << endl ;
               }     
   nEvents ++ ;
   }
  lcReader->close() ;

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):

Click to display ⇲

Click to hide ⇱

 parameter EVGEN:Code [int]: 10, 
 parameter EVGEN:DIS:ISR [int]: 0, 
 parameter EVGEN:ID1 [int]: 11, 
 parameter EVGEN:ID2 [int]: 2212, 
 parameter EVGEN:ProcessID [int]: 10, 
 parameter EVGEN:AlphaQCD [float]: 0.00255778, 
 parameter EVGEN:AlphaQED [float]: 0.243193, 
 parameter EVGEN:DIS:Q2 [float]: 12.4407, 
 parameter EVGEN:DIS:W [float]: 69.6586, 
 parameter EVGEN:DIS:XBJ [float]: 0.00255778, 
 parameter EVGEN:DIS:YBJ [float]: 0.243193, 
 parameter EVGEN:EventsRequested [float]: 50000, 
 parameter EVGEN:PDF1 [float]: 0, 
 parameter EVGEN:PDF2 [float]: 0, 
 parameter EVGEN:Scale [float]: 69.6586, 
 parameter EVGEN:ScalePDF [float]: 12.4407, 
 parameter EVGEN:SigmaErrorPB [float]: 737.376, 
 parameter EVGEN:SigmaPB [float]: 164882, 
 parameter EVGEN:Weight [float]: 1, 
 parameter EVGEN:X1 [float]: 0.00255778, 
 parameter EVGEN:X2 [float]: 0.243193, 
 parameter EVGEN:eCM [float]: 141, 
 parameter _weight [float]: 1, 
 parameter EVGEN:Process [string]: e-p, 
 parameter GEANT4_VERSION [string]: 10.2.0, 
 parameter HepSim [string]: 1.1, 
 parameter ProcessID [string]: -1, 
 parameter SLIC_VERSION [string]: 5.0.0, 

For EIC ep events, the relevant parameters for a given DIS event are:

 parameter EVGEN:eCM [float]: 141 
 parameter EVGEN:Process [string]: e-p
 parameter EVGEN:ID1 [int]: 11
 parameter EVGEN:ID2 [int]: 2212 
 parameter EVGEN:ProcessID [int]: 10 
 parameter EVGEN:DIS:Q2 [float]: 12.4407      // Truth-level Q^2
 parameter EVGEN:DIS:W [float]: 69.6586       // Truth-level W
 parameter EVGEN:DIS:XBJ [float]: 0.00255778  // Truth_level x_bjorken
 parameter EVGEN:DIS:YBJ [float]: 0.243193    // Truth_level y_bjorken

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 promc2lcio.java

Sergei Chekanov 2016/09/19 07:06