IFR Ambient Data Monitoring
Location of the web pages |
Recipe for compiling and running |
Running OdcNtupleMaker |
makentuple script options |
WEB PAGES OVERVIEW
All are linked from the main IFR page:
Several steps are necessary to get to the plots on the
A daily cronjob (using trscrontab, a cron utility giving an afs
token) runs a shellscript once daily which perfroms steps 2
- The ambient data monitoring the status of the detector
are being constantly stored in the ambient database, which
is an Objectivity database. The process filling this database
is called archiver and is a central BABAR utility. Its setup
contains information on what to write and how often.
- The application OdcNtupleMaker is used to extract data from
the ambient database into ntuples. Several ntuples are
produced to contain High Voltage CAEN data, dark currents
from GMBs, temperature readings and single rates respectively.
- A Set of C++ applications read the ntuples produced by OdcNtupleMaker,
perform some analysis on it, produce histograms or data in ASCII
format for history plots.
- Several paw kumac read the output from the applications in 3) to
- The plots are moved to the web area and the web pages are updated if
QUICK RECIPE FOR COMPILING AND RUNNING
Get the archive file at:
(you'll need your BABAR HyperNews password)
and untar in some directory of your choice:
> gtar xvzf ifrmon.tgz
Compile and link:
> mkdir -p .Linux/obj
> mkdir .Linux/lib
Create some directories for temporary output:
> mkdir .ntuples
> mkdir .psfiles
> mkdir .temp
> mkdir .dark
> mkdir .single
At the beginning of the file makentuple (a shell script) edit the lines
(replace the brackets "<...>" with actual directory names)
And be brave and run! :)
That should do all steps from 2 to 5 in the overview.
The OdcNtupleMaker can now be found in a standard offline release. It takes
> OdcNtupleMaker [inputfile] [outputntuple]
- [inputfile]: is the inputfile defining which ambient variables to plot and
over which time interval. Its format is:
- The first two lines contain the start and stop time, respectively, in
[year] [month] [date] [hour] [minute] [second]
- The third line contains the time interval, in seconds, over which to average
- The following lines indicate which variables to plot, in the format:
[ntuplevariablename] [RECORDNAME] [index1] [index2]
where [ntuplevariablename] is the name you want to give to the variable
in the ntuple and is completely arbitrary. The three other parameters
identify the variable in the archiver database.
- [outputntuple]: is the name of the HBOOK file where your ntuple will be written.
makentuple script options
The makentuple script takes the following options:
> makentuple [mode] [Name] [year] [month] [date]
- [mode] can be:
update : the default, does monthly plots and updates the web pages
quarterplots : does longer time interval plots (3 months for now)
anything else: will do the monthly plots but without updating the web pages, mostly
for debugging purposes
- [Name] : give it the name of the time period (arbitrary string)
- The other parameters set the time interval to plot, where each can be
either a single number or an interval in the form "i-j". So for instance
makentuple noupdate Fall 2002 9-10 5-28
will do plots for the period from Sept. 9th to October 28th 2002
(without updating the web pages!).
Without arguments, makentuple will do plots for the interval:
- Up to the 6th day of the month: from the 1st of the
previous month to the current date (up to a few hours before the
script is run)
- From the 7th day of the month: from the 1st of the current month
to the current date.
and it will update the web pages with the new plots. When it starts
doing plots for the new month (from the 7th of each month) it should
also update the links.
(it should be checked that this is not broken!).
To perform analysis on the ntuples produced by OdcNtupleMaker, a set of
C++ applications have been written. Class definitions (*.h files )are located
in the include/ directory, while class implemenations (*.cc) and
executables (*.C files, containing a main ) are located in the
src/ directory. The important classes are:
- AmbientNtuple : class describing the ntuple content. It
inherits from NTuple which gives it the capability to read
the content of an HBOOK ntuple. The content of the ntuple is put in
a one dimensional array. It contains a set of method to retrieve
ambient data. All these methods depend heavily on the position of
each particular piece of information in the one dimensional
array (bad design, I agree!).
- AmbientNtupleAnalysis : analysis class to perform
analysis on an AmbientNtuple. It contains the basic feature needed
like iterating over events and has three virtual methods that an
inheriting class performing a specific analysis can implement:
Four different analyses, all inheriting from AmbientNtupleAnalysis, have been
- void Begin(): called once at the beginning for whatever
the analysis needs to initialize.
- void Finish() : called once at the end, for whatever the
analysis wants to do at the end.
- Event() : called in each event.