Presentation is loading. Please wait.

Presentation is loading. Please wait.

HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program.

Similar presentations


Presentation on theme: "HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program."— Presentation transcript:

1 HYDRA Framework

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

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

4 How to setup HYDRA environment (@ GSI) install a.rootrc file in your homedir. install a.rootrc file in your homedir. Use only multiple local.rootrc files if you are sure what you are doing. 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. READ the ROOT manual for the options to customize your root start up. Software location: Software location: /misc/hadessoftware/etch32/install/ : several ROOT, HYDRA /misc/hadessoftware/etch32/install/ : several ROOT, HYDRA /misc/hadessoftware/etch32/hades/ : location to compile HYDRA /misc/hadessoftware/etch32/hades/ : location to compile HYDRA /misc/hadessoftware/etch32/admin/ : collection of scripts /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 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 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 If you need an own development version: copy defall.sh to your place and edit it

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

6 Load HYDRA into ROOT Check your setup Check your setup type “root” on the terminal. ROOT should start loading all standard HYDRA libs. 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++”). 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. 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 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 Write a program instead of a macro to run it on the batch farm

8 How to compile Setup your environment (see previous topic) Setup your environment (see previous topic) Write your macro (including main function) Write your macro (including main function) Include all needed header files Include all needed header files Check your compilation using ldd to see whether you are loading the libraries from the correct locations 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 frameworkROOT based object oriented framework most objects derived from TObject/TNamed: most objects derived from TObject/TNamed: provides fast binary IOprovides fast binary IO extended functionality in CINT (Dictinonary)extended functionality in CINT (Dictinonary) C++ code can be run without compilingC++ code can be run without compiling Browsing of data and Objects with TBrowserBrowsing of data and Objects with TBrowser fast evaluation of data with T->Draw()fast evaluation of data with T->Draw() Histogram classesHistogram classes Fitting functionsFitting functions Data inputData input hld-files (list mode data from experimental data) hld-files (list mode data from experimental data) root files (already analyzed data) root files (already analyzed data) HGeant output root files for simulation HGeant output root files for simulation Data outputData output hld (filtered) or root hld (filtered) or root Event loop to analyze the dataEvent loop to analyze the data List of tasks (programs) which should be executed during event loopList of tasks (programs) which should be executed during event loop unpacking of raw data unpacking of raw data calibration calibration reconstruction of particles reconstruction of particles physics anaysis physics anaysis Handling of parameters needed for the analysisHandling of parameters needed for the analysis via ASCII, ROOT or ORACLE via ASCII, ROOT or ORACLE Calibration,alignment,reconstruction,pid parametersCalibration,alignment,reconstruction,pid parameters analysis cutsanalysis cuts

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

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

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

13 The data container Categories own a TClonesArray where the data are stored. Categories own a TClonesArray where the data are stored. A TClonesArray is a collection of Objects of same type A TClonesArray is a collection of Objects of same type The Categories are optimized for performance: The Categories are optimized for performance: Objects are never deleted when the event is cleared, they are created in the same memory. Objects are never deleted when the event is cleared, they are created in the same memory. Objects can be retrieved via Objects can be retrieved via TObject* HCategory::getObject(HLocation& loc) TObject* HCategory::getObject(HLocation& loc) TObject* HCategory::getObject(Int_t index) TObject* HCategory::getObject(Int_t index) One can loop over the category using the iterators One can loop over the category using the iterators Categories be switched on/off for writing to the output file by setting: Categories be switched on/off for writing to the output file by setting: HCategory::setPersistency(Bool_t persistent) HCategory::setPersistency(Bool_t persistent) HCategory HLinearCategory HMatrixCategory HLinearCategory for objects of not exactly known number (like particles) or orderHLinearCategory 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…)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…)

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 stored to the ROOT file Writing a ROOT outputfile:Writing a ROOT outputfile: In normal case the categories are written splitted to the output HTree (derived from TTree) 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 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 single variables are mapped to branches each owning a basket The Event structure as present in memory during the analysis is not preserved The Event structure as present in memory during the analysis is not preserved The mapping to the Tree is performed by Hades automatically The mapping to the Tree is performed by Hades automatically The filling of the Tree is performed in the eventLoop() of Hades The filling of the Tree is performed in the eventLoop() of Hades Reading an Hydra outputfile:Reading an Hydra outputfile: Simple analysis tasks can be performed opening the file with ROOT and using the T->Draw() in CINT 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 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 For a full analysis the event structure has to be restored use HRootSource to read and restore the event structure 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 fast way of writing a macro without creating a class penalty: performance is worse compared to a class derived from HReconstructor penalty: performance is worse compared to a class derived from HReconstructor

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

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


Download ppt "HYDRA Framework. Setup of software environment Setup of software environment Using the documentation Using the documentation How to compile a program."

Similar presentations


Ads by Google