Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
hepsim:usage_full [2017/02/07 02:39]
hepsim17
hepsim:usage_full [2020/05/22 02:50] (current)
hepsim17
Line 3: Line 3:
 [[:|<< back to HepSim manual]] [[:|<< back to HepSim manual]]
  
-====== Full detector simulations  ======+====== 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 Currently, the Geant4-based detector simulation can be done using the SLIC software. You will need to convert ProMC files to LCIO files and
Line 10: Line 10:
  
 The files with full simulations are located under the "rfullNNN" tags ("NNN" is a number) 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: [[http://atlaswww.hep.anl.gov/hepsim/list.php?find=rfull]].+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 [[:hepsim:usage_detectors|Detector description]]. The description of the detector tags is given in [[:hepsim:usage_detectors|Detector description]].
  If you need to find all  files  If you need to find all  files
Line 26: Line 26:
  
  
-The [[http://atlaswww.hep.anl.gov/hepsim/soft/detectors/| detector repository]] contains the description of available detectors. +The [[https://atlaswww.hep.anl.gov/hepsim/soft/detectors/| detector repository]] contains the description of available detectors. 
-Each "rfullNNN" tag corresponds to the  detector given in the  [[http://atlaswww.hep.anl.gov/hepsim/soft/detectors/| detector repository]].+Each "rfullNNN" tag corresponds to the  detector given in the  [[https://atlaswww.hep.anl.gov/hepsim/soft/detectors/| detector repository]].
  
 The physics performance studies based on full simulation files from HepSim  The physics performance studies based on full simulation files from HepSim 
Line 43: Line 43:
  
 <code bash> <code bash>
-wget http://atlaswww.hep.anl.gov/asc/jas4pp/download/current.php -O jas4pp.tgz+wget https://atlaswww.hep.anl.gov/asc/jas4pp/download/current.php -O jas4pp.tgz
 tar -zvxf jas4pp.tgz tar -zvxf jas4pp.tgz
 cd jas4pp cd jas4pp
Line 57: Line 57:
   * Visualisation of reconstructed events using Wired4 display   * Visualisation of reconstructed events using Wired4 display
  
-You can find more details in [[asc:jas4pp|Jas4pp manual]]. The examples showing how to run over SLCIO files using [[https://atlaswww.hep.anl.gov/asc/jas4pp/|Jas4pp]] are located in the "examples/slic" directory of the Jas4pp package.+You can find more details in [[hepsim:jas4pp|Jas4pp manual]]. The examples showing how to run over SLCIO files using [[https://atlaswww.hep.anl.gov/asc/jas4pp/|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 [[http://lcio.desy.de/v02-04-03/doc/manual_html/manual.html|Manual]]. The API is described in [[http://lcio.desy.de/v02-04-03/doc/api/| LCIO Java API description]].
- +
-The standard set of containers is available from the LCIO files posted on HepSim. Read +
-[[http://lcio.desy.de/v02-04-03/doc/manual_html/manual.html|Manual]]. The API is described in  +
-[[http://lcio.desy.de/v02-04-03/doc/api/| LCIO Java API description]].+
  
 Look the Java API definition of the needed objects in [[http://www.lcsim.org/sites/lcsim/apidocs/org/lcsim/lcio/package-summary.html|org.lcsim.lcio]]. The data containers are shown below: Look the Java API definition of the needed objects in [[http://www.lcsim.org/sites/lcsim/apidocs/org/lcsim/lcio/package-summary.html|org.lcsim.lcio]]. The data containers are shown below:
Line 110: Line 106:
 ====== Using C++/ROOT with LCIO ====== ====== Using C++/ROOT with LCIO ======
  
-If you need to read LCIO files in C++ code with ROOT/FastJet, use this example package:+If you need to read LCIO files in C++ code with ROOT/FastJet, use the example package [[https://github.com/chekanov/HepSim]].
  
 <code bash> <code bash>
-wget http://atlaswww.hep.anl.gov/hepsim/soft/lcio-cpp.tgz -O - | tar -xz; +git clone https://github.com/chekanov/HepSim 
-cd lcio-cpp; make +cd HepSim/analysis/cpp_lcio
 </code> </code>
-It will compile "example.cpp" file linking FastJet package. 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".+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:
 +
 +<hidden Click here to show the code example>
 +<code cpp>
 +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() ;
 +</code>
 +</hidden>
 +
 +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):
 +<hidden>
 +<code cpp>
 + 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, 
 +</code>
 +</hidden>
 +
 +
 +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://github.com/Argonne-National-Laboratory/ProMC/blob/master/examples/promc2lcio/promc2lcio.java|promc2lcio.java]].
 +
 +
 +
 +
 + --- //[[[email protected]|Sergei Chekanov]] 2016/09/19 07:06//
  
      
Line 180: Line 271:
 gGeoManager->GetTopVolume()->Draw("ogl"); gGeoManager->GetTopVolume()->Draw("ogl");
 </code> </code>
-This should popup an OpenGL display with the detector which you can +This should popup an OpenGL display with the detector which you can clip, pan, rotate etc. You will the image as shown here:
-clip, pan, rotate etc. You will the image as shown here: +
- +
-{{:asc:image.png?400|}} +
  
 +{{:hepsim:detector_jas4pp.png?400|}}
 ====== People ====== ====== People ======