ROOTANA: Difference between revisions

From MidasWiki
Jump to navigation Jump to search
No edit summary
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Pagelinks}}
= Links =
= Links =


Line 11: Line 13:


<pre>
<pre>
echo $ROOTSYS # check correct installation of ROOT
root-config # check correct installation of ROOT
git clone https://bitbucket.org/tmidas/rootana.git
git clone https://bitbucket.org/tmidas/rootana.git
cd rootana
cd rootana
make
make
make dox
make dox
more analyzer.cxx
more analyzer.cxx
more event_dump.cxx
more event_dump.cxx
Line 21: Line 27:
= Introduction =
= Introduction =


Welcome to ROOTANA - a simple ROOT based analyzer for MIDAS.  
Welcome to ROOTANA, the ROOT (https://root.cern.ch) based data analysis package for the MIDAS Data Acquisition system (https://midas.triumf.ca).


When compiled together with the optional MIDAS libraries, this package can be used to process live online data and to access the live online MIDAS ODB.  
The ROOTANA package includes 5 major components:
* a standalone library for reading and writing data files in the MIDAS .mid format, and for decoding the XML dump of MIDAS ODB typically embedded in every MIDAS data file. (libMidasInterface)
* a C++ interface class for connecting to an active MIDAS experiment, accessing ODB (read and write) and getting event data. (libMidasInterface)
* a set of C++ classes for exporting ROOT histogram and other objects to an external viewer for interactive visualization of live data, typically using the ROODY histogram viewer or using a standard web browser (experimental feature). (libMidasServer, libNetDirectory, libXmlServer)
* simple examples of using these components (a graphical analyzer, an event dump and an event skim programs) (analyzer.cxx, event_dump.cxx, event_skim.cxx)
* a full featured framework for graphical data analysis including code to unpack typical VME and CAMAC modules ( see [[rootana Analyzer Framework]] and [[rootana Display Framework]])


Without the optional MIDAS libraries, one can analyze existing MIDAS .mid files and access the copy of ODB stored inside the .mid file in the XML format. This mode is suitable for offline data analysis in a mobile environement.


In either mode, this root analyzer can be used in conjunction with ROODY to look at the data as it is being analyzed.  
The ROOTANA package can be used without installing ROOT and MIDAS:
* without both ROOT and MIDAS one can only read (and write) existing .mid files. Only event_dump and event_skim will be built.
* if only the MIDAS package is installed, access to live data and access to live ODB becomes possible. Only event_dump and event_skim will be built.
* decoding of XML ODB dumps embedded in MIDAS files requires ROOT TXML and TDOMParser components (a version of XML decoder using libxml2 used to exist in the past).
* if the ROOT package is installed but MIDAS is absent, full function of ROOTANA is available, except for access to live data. This mode is suitable for offline data analysis, i.e. the user has a copy of MIDAS data files on their laptop and wants to analyze them.


The origins of this package date back a few years when I wrote some C++ classes to read MIDAS files for the Dragon experiment. Jonty Pearson and Joe Chuma have since improved and added to my work. Then during the Summer of 2006, I wrote some more C++ classes for access to live data and for access to the live ODB, for use by the
ALPHA experiment at CERN. This code was then reused for couple of test DAQ stations at TRIUMF. With the addition of ROODY access using the "midas server", ripped out from mana.c, it is now used for the PIENU beam test.


The sources for ROOTANA are managed by SVN at http://ladd00.triumf.ca/viewcvs/rootana/trunk.
The sources for ROOTANA are managed at https://bitbucket.org/tmidas/rootana.
 
To get your very own copy of the package, say "svn checkout https://ladd00.triumf.ca/svn/rootana/trunk rootana".
 
To build the ROOTANA library and the example analyzer, say "make". To build the documentation, say "make dox", then open "html/index.html" in your favourite web browser.
 
(UPDATE 26-MAR-2007) The code was tested on 32-bit and 64-bit Linux/x86 and on 32-bit MacOS/PPC. The 64-bit compilation issues have been mostly cleaned up. MacosX/x86 not tested yet.
 
(UPDATE 01-JUL-2007) Added ability to read gzipped midas files (using zlib).
 
(UPDATE 16-AUG-2007) Added ODB access functions odbReadArraySize() and odbReadDouble(). Fully implemented the XmlOdb interface (Except for odbReadAny()).
 
(UPDATE 02-OCT-2007) Tested with ROOT version 5.16. Implemented enough TNetDirectory code to replace the midasServer code for serving data to ROODY.
 
(UPDATE 04-MAR-2008) Implemented option for polling midas events, updated documentation.
 
(UPDATE 06-OCT-2008) Implemented pipes for reading remote midas files through ssh and dcache tunnels.
 
(UPDATE 21-DEC-2008) Implemented HttpOdb to access ODB through MIDAS HTTP server mhttpd
 
(UPDATE 03-MAR-2015) Converted from svn hosted at TRIUMF to git hosted on bitbucket.


= Components =
= Components =
Line 58: Line 50:
== MIDAS Interface ==
== MIDAS Interface ==


TMidasEvent, TMidasFile, TMidasOnline, VirtualODB, etc
These classes provide the actual access to MIDAS data
 
* TMidasEvent: a class encapulating a MIDAS event.
* TMidasFile: a class encapsulating a MIDAS file
* TMidasOnline: a class that allows access to online MIDAS events; this class requires that the MIDAS libraries be installed
* VirtualODB: a class that provides access to ODB variables, either through ODB dumps at the start of files or by directly connecting to the online ODB.


== XML Server ==
== XML Server ==
Line 74: Line 71:
rootana provides low-level access to the MIDAS data files and online MIDAS data.  Using these low-level functionality users can design whatever sort of programs they want for accessing and analyzing the data.
rootana provides low-level access to the MIDAS data files and online MIDAS data.  Using these low-level functionality users can design whatever sort of programs they want for accessing and analyzing the data.


rootana also provides a more structured, higher-level framework for organizing analysis programs.  The framework includes a standard event loop class and a standard display program.  Details on this higher-level framework are available here
rootana also provides a more structured, higher-level framework for organizing analysis programs.  The framework includes a standard event loop class and a standard display program.  Details on this higher-level framework available in [[rootana Analyzer Framework]] and  [[rootana Display Framework]].
 
http://ladd00.triumf.ca/~olchansk/rootana/analyzerClass.html
 
http://ladd00.triumf.ca/~olchansk/rootana/displayClass.html
 
= Quick start =
 
The rootana/examples directory contains analysis code appropriate for
processing 'standard' TRIUMF MIDAS data taken with CAEN V792, V1190, CAMAC TL2249 and Agilent data.


To use the example code in this directory, we recommend the following steps
= Contacts =  
 
1) Install rootana in usual place ($HOME/packages) and make (cd $HOME/packages/rootana; make)
 
2) Set environment variable ROOTANASYS to rootana location (usually $HOME/packages/rootana)
 
3) Copy this directory (rootana/examples) to somewhere to play with code and build
 
mkdir ~/analyzer/.
cp ~/packages/rootana/examples/* ~/analyzer/.
cd ~/analyzer
make
 
4) You will have now build a default analyzer display (anaDisplay.exe) and batch-mode analyzer (ana.exe)
that you can use to display CAEN V792 and V1190 data.
 
You can then modify the files to create new plots.
 
The files anaDisplay.cxx and ana.cxx contain precompiler flags to quickly enable and disable certain combination
of hardware.  For instance, the default configuration
<pre>
#define USE_V792
#define USE_V1190
//#define USE_L2249
//#define USE_AGILENT
</pre>
will create histograms of V792 and V1190 data.  By changing the commented out precompiler flags you can
modify the expected hardware.
 
== Migration from ROOTANA pre-svn revision 91 ==
 
<pre>
From: Alisher Sanetullaev <sanetulla@triumf.ca>
Subject: Re: rootana svn version
 
I think I have resolved the problem. I had to bring the anaIris code up to date with the latest rootana. Now it compiles.
 
1. added #include "stdint.h" in src/HandleMesytec.cxx.
2. Commented out the #include "midasserver.h" lines from all files.
3. Changed $(ROOTANA)/librootana.o to $(ROOTANA)/lib/librootana.o in the Makefile. (That file has moved to a different
directory in rootana directory.)
4.  Changed eventHeader_t to TMidas_EVENT_HEADER in src/anaIris.cxx.
</pre>


NOTE: I think one also needs to add -I$ROOTANA)/include to the CFLAGS
* Before conversion from svn to git, ROOTANA was managed by members of the TRIUMF DAQ group
* The git version hosted on bitbucket is managed by the members of the MIDAS developers group.
* to report bugs, request improvements, contribute bug fixes - please go to the ROOTANA issue tracker https://bitbucket.org/tmidas/rootana/issues
* for questions and discussion - please go to the MIDAS discussion forum https://midas.triumf.ca/forum

Latest revision as of 13:26, 4 March 2016


Links

Download and Quick start

echo $ROOTSYS # check correct installation of ROOT
root-config # check correct installation of ROOT

git clone https://bitbucket.org/tmidas/rootana.git
cd rootana
make
make dox

more analyzer.cxx
more event_dump.cxx

Introduction

Welcome to ROOTANA, the ROOT (https://root.cern.ch) based data analysis package for the MIDAS Data Acquisition system (https://midas.triumf.ca).

The ROOTANA package includes 5 major components:

  • a standalone library for reading and writing data files in the MIDAS .mid format, and for decoding the XML dump of MIDAS ODB typically embedded in every MIDAS data file. (libMidasInterface)
  • a C++ interface class for connecting to an active MIDAS experiment, accessing ODB (read and write) and getting event data. (libMidasInterface)
  • a set of C++ classes for exporting ROOT histogram and other objects to an external viewer for interactive visualization of live data, typically using the ROODY histogram viewer or using a standard web browser (experimental feature). (libMidasServer, libNetDirectory, libXmlServer)
  • simple examples of using these components (a graphical analyzer, an event dump and an event skim programs) (analyzer.cxx, event_dump.cxx, event_skim.cxx)
  • a full featured framework for graphical data analysis including code to unpack typical VME and CAMAC modules ( see rootana Analyzer Framework and rootana Display Framework)


The ROOTANA package can be used without installing ROOT and MIDAS:

  • without both ROOT and MIDAS one can only read (and write) existing .mid files. Only event_dump and event_skim will be built.
  • if only the MIDAS package is installed, access to live data and access to live ODB becomes possible. Only event_dump and event_skim will be built.
  • decoding of XML ODB dumps embedded in MIDAS files requires ROOT TXML and TDOMParser components (a version of XML decoder using libxml2 used to exist in the past).
  • if the ROOT package is installed but MIDAS is absent, full function of ROOTANA is available, except for access to live data. This mode is suitable for offline data analysis, i.e. the user has a copy of MIDAS data files on their laptop and wants to analyze them.


The sources for ROOTANA are managed at https://bitbucket.org/tmidas/rootana.

Components

MIDAS Interface

These classes provide the actual access to MIDAS data

  • TMidasEvent: a class encapulating a MIDAS event.
  • TMidasFile: a class encapsulating a MIDAS file
  • TMidasOnline: a class that allows access to online MIDAS events; this class requires that the MIDAS libraries be installed
  • VirtualODB: a class that provides access to ODB variables, either through ODB dumps at the start of files or by directly connecting to the online ODB.

XML Server

xmlServer & co

example programs

  • event_dump
  • event_skim
  • standalone graphical analyzer.cxx

ROOT Analyzer framework

rootana provides low-level access to the MIDAS data files and online MIDAS data. Using these low-level functionality users can design whatever sort of programs they want for accessing and analyzing the data.

rootana also provides a more structured, higher-level framework for organizing analysis programs. The framework includes a standard event loop class and a standard display program. Details on this higher-level framework available in rootana Analyzer Framework and rootana Display Framework.

Contacts

  • Before conversion from svn to git, ROOTANA was managed by members of the TRIUMF DAQ group
  • The git version hosted on bitbucket is managed by the members of the MIDAS developers group.
  • to report bugs, request improvements, contribute bug fixes - please go to the ROOTANA issue tracker https://bitbucket.org/tmidas/rootana/issues
  • for questions and discussion - please go to the MIDAS discussion forum https://midas.triumf.ca/forum