1 / 28

HYDRA Framework

HYDRA Framework. Setup of software environment Using the documentation How to compile a program HYDRA Design Event structure Data container How to write a analysis program How to read the data The DST macro Track Embedding. How to use the documentation. For ROOT classes

angelamagee
Download Presentation

HYDRA Framework

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. HYDRA Framework

  2. Setup of software environment • Using the documentation • How to compile a program • HYDRA • Design • Event structure • Data container • How to write a analysis program • How to read the data • The DST macro • Track Embedding

  3. How to use the documentation • For ROOT classes http://root.cern.ch tutorials http://root.cern.ch/root/html/tutorials/ http://root.cern.ch/drupal/content/howtos manual http://root.cern.ch/drupal/content/users-guide For HYDRA classes http://www-hades.gsi.de/docs/hydra/classDocumentation/ tutorials and example programs /misc/hadesprojects/analysis_workshop/2012 code version https://subversion.gsi.de/hades/hydra2 https://subversion.gsi.de/hades/hgeant2 https://subversion.gsi.de/hades/pluto Computing http://hades-wiki.gsi.de/cgi-bin/view/Computing

  4. How to setup HYDRA environment (@ GSI) • install a .rootrc file in your homedir. • Use only multiple local .rootrc files if you are sure what you are doing. • READ the ROOT manual for the options to customize your root start up. • Software location: • /misc/hadessoftware/etch32/install/ : several ROOT , HYDRA • /misc/hadessoftware/etch32/hades/ : location to compile HYDRA • /misc/hadessoftware/etch32/admin/ : collection of scripts • Setup your environment run script for a specific HYDRA version: /misc/hadessoftware/etch32/install/hydra2-1.7/defall.sh • The script sets up all variables to run a given ROOT/HYDRA combination • If you need an own development version: copy defall.sh to your place and edit it

  5. Setup the Environment • .rootrc • defall.sh environment script

  6. Load HYDRA into ROOT • Check your setup • type “root” on the terminal. ROOT should start loading all standard HYDRA libs. • The rootlogon.C macro sets the ROOT environment such that you can compile HYDRA macros to libs using the ACLIC compiler of ROOT (in the ROOT interpreter type “.L mymacro.C++”). • READ the ROOT manual for the start options and introduction to CINT. • To load private libraries or PLUTO modify rootlogon.C in your private directory

  7. Howto write an Application • Write a program instead of a macro to run it on the batch farm

  8. How to compile • Setup your environment (see previous topic) • Write your macro (including main function) • Include all needed header files • Check your compilation using ldd to see whether you are loading the libraries from the correct locations

  9. The HYDRA framework • ROOT based object oriented framework • most objects derived from TObject/TNamed: • provides fast binary IO • extended functionality in CINT (Dictinonary) • C++ code can be run without compiling • Browsing of data and Objects with TBrowser • fast evaluation of data with T->Draw() • Histogram classes • Fitting functions • Data input • hld-files (list mode data from experimental data) • root files (already analyzed data) • HGeant output root files for simulation • Data output • hld (filtered) or root • Event loop to analyze the data • List of tasks (programs) which should be executed during event loop • unpacking of raw data • calibration • reconstruction of particles • physics anaysis • Handling of parameters needed for the analysis • via ASCII, ROOT or ORACLE • Calibration,alignment,reconstruction,pid parameters • analysis cuts

  10. General scheme of the analysis Event Generator Simulation Experiment • Generator: PLUTO, UrQMD etc. • Detector simulation: HGEANT • Data objects for the simulation are derived from their corresponding partners of the real data • Digitizer: Simulation of the detector response • The reconstruction after calibrated data Level should see no difference between real and simulated data • First the hits in the individual detectors are reconstructed • The detectors hits are correlated to track candidates • Finally Particle species are assigned to the set of correlated detector hits HldFile RootFile Unpacker Digitizer Calibrater HitReconstruction Correlation PID

  11. HYDRA design HADES HSpectrometer • HADES : THE central Object which owns everything. • HSpectrometer like in reality • consists of several HDetectors (like HMdcDetector) • A Detector consists of several Modules • HDataSource and the derived classes provides reading of input data (HLD, ROOT,RFIO…..) • HRuntimeDb handles up to 2 different ParameterIOs (ASCII,ROOT,OCALE) • HTaskSet • a list of user defined HReconstructor programs HDetector HDataSource: Data IO HRuntimeDb: Parameter handling HParIo: Parameter IO HTaskSet HReconstructor

  12. The data event structure HRecEvent HEventHeader TObjArray HaCategory (like catMdcCal1) TClonesArray Data Object derived from TObject (like HMdcCal1)

  13. HLinearCategory The data container HCategory HMatrixCategory • HLinearCategory for objects of not exactly known number (like particles) or order • HMatrixCategory for objects with given address like sector, module, layer, cell where one address is unique or allow to loop for a given part of the data (for example sector…) • Categories own a TClonesArray where the data are stored. • A TClonesArray is a collection of Objects of same type • The Categories are optimized for performance: • Objects are never deleted when the event is cleared, they are created in the same memory. • Objects can be retrieved via • TObject* HCategory::getObject(HLocation& loc) • TObject* HCategory::getObject(Int_t index) • One can loop over the category using the iterators • Categories be switched on/off for writing to the output file by setting: • HCategory::setPersistency(Bool_t persistent)

  14. How to analyze data • Derive a new Class from HReconstructor • Overwrite the virtual functions • HReconstructor::init() : • called during Hades::init() • get Pointers to needed Parameter containers • get Pointers to needed input data categories • create your output data categories • create your objects which should stay for the time of analysis (create histograms etc…) • HReconstructor::reinit() : • called after Hades::init() • get access to initialyzed parameter containers • HReconstructor::execute() : • called by Hades::eventLoop() • perform the operation on the data (filling histograms etc….) • HReconstructor::finalize() : • called after last event • perform operations which should happen after all analysis (write Histograms to file etc…) • Add your Class to the TaskList in your macro: • for example : gHades->getTaskset(”real”)->add(new MyClass())

  15. HReconstructor

  16. How the Categories are storedto the ROOT file • Writing a ROOT outputfile: • In normal case the categories are written splitted to the output HTree (derived from TTree) • Objects (like HMdcCal1) will not be visible as one Object in TBrowser, but all data members will be visible as Leaves • The single variables are mapped to branches each owning a basket • The Event structure as present in memory during the analysis is not preserved • The mapping to the Tree is performed by Hades automatically • The filling of the Tree is performed in the eventLoop() of Hades • Reading an Hydra outputfile: • Simple analysis tasks can be performed opening the file with ROOT and using the T->Draw() in CINT • Problem: No Correlations between objects from different categories can be correctly plotted since the event structure is not preserved • For a full analysis the event structure has to be restored • use HRootSource to read and restore the event structure

  17. Reading a HYDRA root file • fast way of writing a macro without creating a class • penalty: performance is worse compared to a class derived from HReconstructor

  18. Efficiency calculation ROOT file (simulation) Embedding DST: Reconstructor task for efficiency Ntuple Efficiency Matrix • Simulated tracks are transported through HGEANT • REAL events are read from Hld file • Merging of real/simulated data on CAL/HIT level (depending on detector) • Output is stored in simulation like Dataobjects • Simulated tracks carry HGEANT track numbers (>1) • Real tracks carry dummy track number (-500) • See http://hades-wiki.gsi.de/cgi-bin/view/SimAna/TrackEmbedding Macro Hld file

  19. DST macro structure

  20. 1.) Setup the Spectrometer

  21. 2.) Setup the Data Io

  22. 3.) Setup the Parameter Io

  23. 4.) Setup the Data Unpacking

  24. 5.) Create the Tasksets

  25. 6.) Connect the Tasksets

  26. 7.) Init and Loop

  27. Parameter Io

  28. Parameter Io

More Related