00001 /// $Id$ 00002 /// 00003 /// \mainpage 00004 /// 00005 /// \section intro_sec Introduction 00006 /// 00007 /// This "ROOT analyzer" package is a collection of C++ classes to 00008 /// simplify online and offline analysis of data 00009 /// collected using the MIDAS data acquisition system. 00010 /// 00011 /// To permit standalone data analysis in mobile and "home institution" 00012 /// environments, this package does not generally require that MIDAS 00013 /// itself be present or installed. 00014 /// 00015 /// It is envisioned that the user will use this package to develop 00016 /// their experiment specific analyzer using the online data 00017 /// connection to a MIDAS experiment. Then they could copy all the code 00018 /// and data (.mid files) to their laptop and continue further analysis 00019 /// without depending on or requiring installation of MIDAS software. 00020 /// 00021 /// It is assumed that data will be analyzed using the ROOT 00022 /// toolkit. However, to permit the most wide use of this 00023 /// package, most base classes do not use or require ROOT. 00024 /// 00025 /// \section features_sec Features 00026 /// 00027 /// - C++ classes for reading MIDAS events from .mid files, including compressed midas files and remote midas files through ssh and dcache pipes, see TMidasFile::Open() 00028 /// - C++ classes for reading MIDAS events from a running 00029 /// MIDAS experiment via the mserver or directly from the MIDAS 00030 /// shared memory (this requires linking with MIDAS libraries) (see TMidasOnline, analyzer.cxx and event_dump.cxx) 00031 /// - C++ classes for accessing XML ODB data from .mid files (see XmlOdb) 00032 /// - C++ classes for accessing ODB through HTTP/mhttpd (see HttpOdb) 00033 /// - C++ classes for accessing ODB from MIDAS shared memory (see TMidasOnline, 00034 /// requires linking with MIDAS libraries). 00035 /// - an example event dump program 00036 /// - an example C++ analyzer main program 00037 /// - the example analyzer creates a graphical ROOT application permitting full 00038 /// use of ROOT graphics in online and offline modes. 00039 /// - for looking at "live" histograms using the ROODY graphical histogram viewer, 00040 /// included is the "TNetDirectory" package for accessing remote ROOT objects. 00041 /// 00042 /// \section links_sec Links to external packages 00043 /// 00044 /// - ROOT data analysis toolkit: http://root.cern.ch 00045 /// - MIDAS data acquisition system: http://midas.psi.ch 00046 /// - ROODY graphical histogram viewer: http://daq-plone.triumf.ca/SR/ROODY/ 00047 /// 00048 /// \section docs_sec Documentation 00049 /// 00050 /// - important classes: <a href="classTMidasEvent.html">MIDAS event</a>, <a href="classTMidasFile.html">MIDAS file reader</a>, <a href="classTMidasOnline.html">MIDAS online connection</a>, <a href="structVirtualOdb.html">access ODB data</a> 00051 /// - <a href="analyzer_8cxx-source.html">example analyzer</a> 00052 /// - <a href="annotated.html">all ROOTANA classes</a> 00053 /// - <a href="files.html">all ROOTANA files</a> 00054 /// 00055 /// \section starting_sec Getting started 00056 /// 00057 /// - "get" the sources: svn checkout https://ladd00.triumf.ca/svn/rootana/trunk rootana 00058 /// - cd rootana 00059 /// - make 00060 /// - make dox (generate this documentation); cd html; mozilla index.html 00061 /// - edit analyzer.cxx, look at how different MIDAS events are handled in HandleMidasEvent() and how event data is passed to the example user function HandleSample(). Create your own HandleFoo() functions to handle your data. 00062 /// - for more advanced analysis, use rootana as a library: in your own analysis directory, copy the example analyzer.cxx (rename it according to your tastes, popular choices are "alpharoot", "dragonroot", "fgdroot", etc), place the HandleFoo() functions into separate files HandleFoo{.h,.cxx}. 00063 /// 00064 /// \section config_sec Configuration 00065 /// 00066 /// - env.variable ROOTSYS controls support for ROOT (also the C++ define -DHAVE_ROOT). Most rootana classes require ROOT, so if ROOTSYS is not defined, only code that works without ROOT will be compiled - TMidasEvent and TMidasFile at this moment. 00067 /// - env.variable MIDASSYS controls support for connecting to live MIDAS data (also the C++ define -DHAVE_MIDAS). All of rootana is supposed to work without MIDAS, except for the TMidasOnline class. 00068 /// - C++ define -DHAVE_LIBNETDIRECTORY enables use of the newer "libNetDirectory" interface for Roody. This replaces the "-DOLD_SERVER" functions that use the "MIDAS server" from MIDAS mana.c. 00069 /// - C++ define "-DOLD_SERVER" enables the obsolete MIDAS server from MIDAS mana.c. Please use the newer libNetDirectory instead. 00070 /// 00071 /// 00072 /// \section histo_sec Creating histograms, etc 00073 /// 00074 /// Think of the example ROOT analyzer as a normal ROOT application where 00075 /// you can do all the normal ROOT things to create histograms, plots, etc 00076 /// 00077 /// However, one needs to be aware of two things traditionally done by MIDAS analyzers. 00078 /// As can be seen by reading the example analyzer, it creates an output ROOT file 00079 /// and it makes histograms, plots, etc available to other aplications 00080 /// using a network socket connection (via the netDirectoryServer or midasServer). Neither 00081 /// of this functions is required and the corresponding code can be safely removed. 00082 /// 00083 /// - interaction with the output ROOT file: by default, for each run, the analyzer opens a new ROOT file outputNNNNN.root 00084 /// and make it the current directory (gOutputFile) for newly created ROOT objects, i.e. those create by "new TH1(...)". 00085 /// At the end of a run, all these objects 00086 /// are saved into the file, the file is closed and all these objects disappear from memory. To create ROOT objects 00087 /// that persist across runs, use some other ROOT directory (i.e. gOnlineHistDir->cd()). 00088 /// 00089 /// - when using the netDirectoryServer (HAVE_LIBNETDIRECTORY), the contents of gOnlineHistDir and gOutputFile 00090 /// are exported to outside applications. Other programs, i.e. ROODY, can use TNetDirectory to "see" 00091 /// the histograms (and other objects) as they are filled. (Note: this does not work for most TTree objects 00092 /// because they cannot be easily "exported"). 00093 /// 00094 /// \section graph_sec Creating interactive graphics, etc 00095 /// 00096 /// Think of the example ROOT analyzer as a normal ROOT application where 00097 /// you can use all the normal ROOT graphics operations - create new TCanvas objects, 00098 /// draw on them, interact with them at will. This is possible because in the online mode, 00099 /// the application is controlled by the ROOT TApplication->Run() method - MIDAS event processing 00100 /// happens from TTimer events. In the offline mode, the example analyzer does not start 00101 /// the ROOT event loop until the last file has been processed. 00102 /// 00103 /// The example analyzer contains graphics code to create a new "main window" with an example 00104 /// menu and provides an example ROOT event handler to execute menu commands and 00105 /// to interact with the user. 00106 /// 00107 /// \section analyzerFramework Analyzer Framework 00108 /// 00109 /// Recently (post 2012) we have also been adding additional framework classes to rootana. You can see 00110 /// more information on this framework here: 00111 /// - \ref analyzerClass 00112 /// - \ref displayClass 00113 /// 00114 00115 00116