<< back to HepSim manual

Analysis of LCIO files

Currently, the Geant4-based detector simulation can be done using the SLIC software. You will need to convert ProMC files to LCIO files and use these files for the “slic” Geant4-based program. To process SLCIO files, you will need Jas4pp program.

The files with full simulations are located under the “rfullNNN” tags (“NNN” is a number) Here how you can find all samples that have “rfull” tag for download. Click here: https://atlaswww.hep.anl.gov/hepsim/list.php?find=rfull. The description of the detector tags is given in Detector description. If you need to find all files for a give tag, say rfull005, use this command:

hs-find tev10mumu%rfull005

which searches for all samples with the dataset name “tev10mumu” (mu+mu-, 40 TeV samples). Then download a selected sample as:

hs-get tev10mumu_pythia6_zprime10tev_qqbar%rfull005 

The detector repository contains the description of available detectors. Each “rfullNNN” tag corresponds to the detector given in the detector repository.

The physics performance studies based on full simulation files from HepSim are listed here.

Processing LCIO files

To perform data analysis using LCIO files, use the Jas4pp data-analysis package. The installation does not have external dependencies besides Java. Make sure Java7 and above is installed. Then run these commands to install the package using Linux/Mac with the “bash” shell:

wget https://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

The last command optimizes Java packages for the Python language. Now you are ready to run over any file with truth-level and datector-simulation files, such as LCIO and ProMC. This program can be used for:

  • Downloading and searching HepSim data
  • Processing ProMC files from HepSim
  • Running over SLCIO files with Geant4 simulated / reconstructed events.
  • Data analysis (jets, physics vectors, histogram packages)
  • Visualisation of reconstructed events using Wired4 display

You can find more details in Jas4pp manual. The examples showing how to run over SLCIO files using Jas4pp are located in the “examples/slic” directory of the Jas4pp package.

The standard set of containers is available from the LCIO files posted on HepSim. Read Manual. The API is described in LCIO Java API description.

Look the Java API definition of the needed objects in org.lcsim.lcio. The data containers are shown below:

Click to display ⇲

Click to hide ⇱


Using C++/ROOT with LCIO

If you need to read LCIO files in C++ code with ROOT/FastJet, use the example package https://github.com/chekanov/HepSim.

git clone https://github.com/chekanov/HepSim
cd HepSim/analysis/cpp_lcio

Look at README file to see how to install the “LCIO” package required by this example. Your LCIO“ files from HepSim should be in the directory “data”.

Generally, you program to read SLCIO files can look as this:

Click here to show the code example

Click here to show the code example

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 ;
           // print stored EVGEN parameters
           const LCParameters& params=evt->getParameters();
           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 ;
  // extract PFA objects             
  IMPL::LCCollectionVec* col = (IMPL::LCCollectionVec*) evt->getCollection( "PandoraPFOCollection"  ) ;
  int nPFO = col->getNumberOfElements() ;
  for(int i=0 ; i<nPFO ; ++i){
      EVENT::ReconstructedParticle* mcp =  (EVENT::ReconstructedParticle*) col->getElementAt(i) ;
      double px = mcp->getMomentum()[0];
      double py = mcp->getMomentum()[1];
      double pz = mcp->getMomentum()[2];
  // look at tracks  
  IMPL::LCCollectionVec* col3 = (IMPL::LCCollectionVec*) evt->getCollection( "Tracks"  ) ;
  int nTRK = col3->getNumberOfElements() ;
    for(int i=0 ; i<nTRK ; ++i){
      EVENT::Track* mcp =  (EVENT::Track*) col3->getElementAt(i) ;
   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, 

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

Visualizing events with Jas+Wired

You can run Jas+Wired to visualize the simulated events. The Wired program is included in Jas4pp, so you simply run it as:


This will start a Jas3-like environment with all needed plugins. Then copy the detector geometry file from the detector repository.

wget http://atlaswww.hep.anl.gov/hepsim/soft/detectors/sidloi3.tgz -O - | tar -xz;

This will create a directory “sidloi3”. This detector corresponds to “rfull001” tag used for the reconstruction of pythia6_zpole_ee (Z→e+e-).

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

./jaspp  sidloi3.heprep

You will see the detector layout:

Whired4 event display

Now, we will read the event: Open any *.slcio file you copied from HepSim as [File]-[Open data source]-[LCIO] file. Then click a small button [Go] (top menu bar). It will process events. Then select again [File]-[New]-[Wired 4 view]. You will get an image in the Wired4 display. Now press [Go] again to look at next event.

If you want to see how data records are organized inside the slcio file, do this [File]-[New]-[LCSim Event browser]

Generally, when you open a SLCIO file from the HepSim, you do not need to load the geometry file. The geometry file will be downloaded automatically from HepSim and will be put to ”.lcsim/cache/“ inside your home directory.

Visualizing geometry using ROOT

(contribution from N.Nikiforou):

You can also visualize the detector using ROOT. Here are a few steps: Locate the file detector.gdml inside the file detector.zip (where “detector” shows the name of the detector).

show more details here

show more details here

This file is created using this command during the detector design stage

slic -g detector.lcdd -G detector.gdml

Once you have the GDML file, you can use ROOT to visualize it. You just need to make sure the ROOT installation has openGL/GDML support (CERN AFS installations have it for sure). At the ROOT prompt do:


This should popup an OpenGL display with the detector which you can clip, pan, rotate etc. You will the image as shown here:


  • S.Chekanov (ANL, main developer)
  • E.May (ANL, debugging, Wired4)

Additional help