====== Analysis ====== There are already several files which help you to analyse root files from primasoft: - PrimaSimAnalysis (can be found here: /geant4/src/PRIMASimAnalysis.cc, /geant4/include/PRIMASimAnalysis.hh) - Config file for Analysis (examples can be found here: /geant4/sim_ana_utilities/ana_default.conf) - Rootmacros (examples can be found here: /geant4/rootmacros) This is what they do: == PrimaSimAnalysis == * The deposited energy in every crystal is stored: "calEdep" * The signal energy in every crystal is simulated: "calSignal" * Hits are sorted into clusters: "calClusters", where the individual hits are stored and the total cluster energy is accessible * The momentum direction and the energy of the initial particle is stored: "P" * Single crystal threshold is applied. The value can be set in the config file, default is 2 MeV. This is analogue the to hit detection threshold in a measurement. * Different crystal-setups can be used. The setup can be chosen in the config file, default is to use all 786 crystals. These are the options: * all crystals are used (768) * the inner 640 crystals are used symmetrically (640) * the inner 640 crystals are used in an oval shape (640_oval) * the inner 560 crystals are used symmetrically (560) * Scintillation hits is still under developement ..... * 3 functions are left empty (BeginOfRun(), DoEvent(), EndOfRun()). These need to be defined in the rootmacro. == Rootmacro == * an example how to read the .root files can be found in rootmacros/test.C * execute a rootmacro (here: test.C): /primasoft/geant4$ root -l rootmacros/test.C+ * the root files include information about the primary particles, the deposited energy in the calorimeter and in the tagger. * in the rootmacros the functions BeginOfRun(), DoEvent() and EndOfRun() need to be defined, please have a look at the examples * in OpenTreeFiles() you can define the root file which will be analysed and you can optionally choose a config file: c.OpenTreeFiles("test_bwec.root","sim_ana_utilities/ana_default.conf"); If the path is relative and not absolute for the root and config file, pay attention that the relative path changes when you execute the rootmacro from a different folder. * test.C is a basic example * energy_res.C and acceptance.C are more advanced examples * event_display.C the energy signal for each crystal for one event (usage: ''geant4$ root -l 'rootmacros/event_display.C("path/file.root",eventnumber)''')