hepsim:usage_full
Differences
This shows you the differences between two versions of the page.
— | hepsim:usage_full [2024/07/01 21:25] (current) – created - external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | {{indexmenu_n> | ||
+ | |||
+ | [[: | ||
+ | |||
+ | ====== 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 " | ||
+ | To process SLCIO files, you will need [[http:// | ||
+ | |||
+ | The files with full simulations are located under the " | ||
+ | Here how you can find all samples that have " | ||
+ | The description of the detector tags is given in [[: | ||
+ | If you need to find all files | ||
+ | for a give tag, say rfull005, use this command: | ||
+ | |||
+ | <code bash> | ||
+ | hs-find tev10mumu%rfull005 | ||
+ | </ | ||
+ | which searches for all samples with the dataset name " | ||
+ | Then download a selected sample as: | ||
+ | |||
+ | <code bash> | ||
+ | hs-get tev10mumu_pythia6_zprime10tev_qqbar%rfull005 | ||
+ | </ | ||
+ | |||
+ | |||
+ | The [[https:// | ||
+ | Each " | ||
+ | |||
+ | The physics performance studies based on full simulation files from HepSim | ||
+ | are [[fcs: | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ | ====== Processing LCIO files ====== | ||
+ | |||
+ | To perform data analysis using LCIO files, use the [[https:// | ||
+ | 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 " | ||
+ | |||
+ | <code bash> | ||
+ | wget https:// | ||
+ | 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 [[hepsim: | ||
+ | |||
+ | The standard set of containers is available from the LCIO files posted on HepSim. Read [[http:// | ||
+ | |||
+ | Look the Java API definition of the needed objects in [[http:// | ||
+ | |||
+ | < | ||
+ | < | ||
+ | BeamCalHits | ||
+ | CalorimeterHitRelations | ||
+ | EM_BARREL | ||
+ | EM_ENDCAP | ||
+ | EcalBarrelHits | ||
+ | EcalEndcapHits | ||
+ | HAD_BARREL | ||
+ | HAD_ENDCAP | ||
+ | HcalBarrelHits | ||
+ | HcalEndcapHits | ||
+ | HelicalTrackHitRelations | ||
+ | HelicalTrackHits | ||
+ | HelicalTrackMCRelations | ||
+ | LumiCalHits | ||
+ | MCParticle | ||
+ | MUON_BARREL | ||
+ | MUON_ENDCAP | ||
+ | MuonBarrelHits | ||
+ | MuonEndcapHits | ||
+ | PandoraPFOCollection | ||
+ | ReconClusters | ||
+ | SiTrackerBarrelHits | ||
+ | SiTrackerEndcapHits | ||
+ | SiTrackerForwardHits | ||
+ | SiVertexBarrelHits | ||
+ | SiVertexEndcapHits | ||
+ | StateAtECal | ||
+ | StateAtEnd | ||
+ | StateAtStart | ||
+ | TKR_RawTrackerHits | ||
+ | TKR_TrackerHits | ||
+ | Tracks | ||
+ | VXD_RawTrackerHits | ||
+ | VXD_TrackerHits | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | |||
+ | ====== Using C++/ROOT with LCIO ====== | ||
+ | |||
+ | If you need to read LCIO files in C++ code with ROOT/ | ||
+ | |||
+ | <code bash> | ||
+ | git clone https:// | ||
+ | cd HepSim/ | ||
+ | </ | ||
+ | Look at README file to see how to install the " | ||
+ | |||
+ | |||
+ | Generally, you program to read SLCIO files can look as this: | ||
+ | |||
+ | <hidden Click here to show the code example> | ||
+ | <code cpp> | ||
+ | string input=" | ||
+ | LCReader* lcReader = LCFactory:: | ||
+ | lcReader-> | ||
+ | LCEvent* | ||
+ | int nEvents=0; | ||
+ | while( (evt = lcReader-> | ||
+ | if (nEvents==0) UTIL:: | ||
+ | cout << " | ||
+ | // print stored EVGEN parameters | ||
+ | const LCParameters& | ||
+ | | ||
+ | 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 ; | ||
+ | | ||
+ | |||
+ | // extract PFA objects | ||
+ | IMPL:: | ||
+ | int nPFO = col-> | ||
+ | for(int i=0 ; i<nPFO ; ++i){ | ||
+ | EVENT:: | ||
+ | double px = mcp-> | ||
+ | double py = mcp-> | ||
+ | double pz = mcp-> | ||
+ | | ||
+ | | ||
+ | // look at tracks | ||
+ | IMPL:: | ||
+ | int nTRK = col3-> | ||
+ | for(int i=0 ; i<nTRK ; ++i){ | ||
+ | EVENT:: | ||
+ | } | ||
+ | | ||
+ | |||
+ | | ||
+ | } | ||
+ | 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> | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | |||
+ | 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:// | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | --- // | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | ====== Visualizing events with Jas+Wired ====== | ||
+ | |||
+ | You can run Jas+Wired to visualize the simulated events. | ||
+ | <code bash> | ||
+ | ./jaspp | ||
+ | </ | ||
+ | This will start a Jas3-like environment | ||
+ | Then copy the detector geometry file from the [[http:// | ||
+ | <code bash> | ||
+ | wget http:// | ||
+ | </ | ||
+ | This will create a directory " | ||
+ | |||
+ | Now we can visualize the detector as **[File]-[Open data source]-[HepRep]** XML and select the file " | ||
+ | This is how to do this using the command line: | ||
+ | |||
+ | <code bash> | ||
+ | ./ | ||
+ | </ | ||
+ | You will see the detector layout: | ||
+ | |||
+ | {{: | ||
+ | |||
+ | 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 | ||
+ | | ||
+ | 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 " | ||
+ | |||
+ | |||
+ | |||
+ | ====== 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 " | ||
+ | |||
+ | |||
+ | <hidden 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: | ||
+ | |||
+ | <code cpp> | ||
+ | TGeoManager:: | ||
+ | gGeoManager-> | ||
+ | </ | ||
+ | This should popup an OpenGL display with the detector which you can clip, pan, rotate etc. You will the image as shown here: | ||
+ | |||
+ | {{: | ||
+ | ====== People ====== | ||
+ | |||
+ | * S.Chekanov (ANL, main developer) | ||
+ | * E.May (ANL, debugging, Wired4) | ||
+ | |||
+ | |||
+ | ====== Additional help ====== | ||
+ | |||
+ | |||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[http:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[https:// | ||
+ | * [[http:// | ||
+ | |||
+ | |||
+ | |||
+ | --- // | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||