1 / 13

C++ / G4MICE Course

C++ / G4MICE Course. Models vs Representations Persistency Real Data Formats Reader. Session 7. Models vs Representations. So far we have been making models of various experiments using the MiceModule class.

helmut
Download Presentation

C++ / G4MICE Course

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. C++ / G4MICE Course Models vs Representations Persistency Real Data Formats Reader Session 7

  2. Models vs Representations • So far we have been making models of various experiments using the MiceModule class. • When we run the simulation, event display, reconstruction, etc, some information from the model is required. • This information needs to be supplied in a manner appropriate to the use of the model (e.g. GEANT4 vs RecPack) • To solve the potential problem of having the modelling code depend on every potential use that it could be put to, we make the distinction between models and representations.

  3. If We Only had a Model Simulation Event Display Reconstruction Model GEANT4 ROOT RecPack HepRep

  4. With Representations Simulation Reconstruction Simulation Representation Reconstruction Representation Model GEANT4 RecPack

  5. G4MICE Representations • Simulation: • DetModel and EngModel • Take the MiceModule model and create the necessary G4 objects • Reconstruction: • SetupKalman (Recon/SciFi) • Event Display: • Visualization • Uses HepRep XML writer.

  6. “The Data” • When using G4MICE or writing use applications, we don’t think about the data files or the data formats. • The data exists in instances of various classes (e.g. SciFiHit, VlpcHit, etc...) • So when you want to find “some data” what you really need to do is work out what class(es) represent that data and what method(s) can provide it.

  7. Persistency • The classes that represent the data only exist in the computer’s memory while the program is running – they are transient. • We want to store the classes in some format so that they can “live” beyond the execution of the program – make them persistent. • This can involve writing them to disk, to a database, ...

  8. Gzipped Text File • The current persistency method that is implemented is a gzipped text file. • The Zlib library is used to perform zipping and unzipping as the files are written or read. • The format is plain text so can be read for debugging purposes. • You should never write your own code to read this (or any other format) file unless you are specifically involved in the development of the persistency code.

  9. Persistency Design SciFiHitMySQL SciFiHitTextFileIo Transient Class (e.g. SciFiHit) Gzipped Text File MySQL

  10. Real Data Formats • We currently have code that reads a number of other specific file formats associated with different DAQs that have been used in MICE to date: • KEK test beam (2 different formats) • Tracker test with Visual Basic (2 different formats) • Work is in progress to implement the code to read in the DATE format files and produce the relevant classes.

  11. Reader • All of the classes that read the various file formats (whether persistent text file, or test beam or other DAQ formats) are derived from a purely virtual base class called Reader. • It requires all the derived classes to implement a few methods: • readEvent() • isOK() • closeInputFile() • skipEvents()

  12. Code Inspection • Have a look at: • Interface/include/Reader.hh • Persist/textFile/include/TextFileReader.hh • RealData/include/VlsbReadout2006.hh • See how each of the classes implements a version of (a kind of!) the Reader class. • See how this is used in: • Applications/common/GlobalReader.hh • Applications/KekOct2005/Kek2005.cc • Applications/KekOct2005/cards.in

  13. Remaining Time this Session • Continue work on the MuScat modelling and simulation assignment...

More Related