GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EFC / dev > gdfilter / rhel6-64


Interface   Data Structures   File List   Data Fields   Globals  

filter_rto.c File Reference

Utility routines to parse the command line parameters and fill in the run time filter options, implementation. More...

#include <stdio.h>
#include <stdlib.h>
#include <EDS/io/EBF_stream.h>
#include <EFC/GFC_resultsPrint.h>
#include <EFC/GFC_V2_status.h>
#include <EFC/EFC_display.h>
#include <EFC/EDM.h>
#include <CDM/CDM_pubdefs.h>
#include <filter_rto.h>

Defines

#define SEGSIZE_K_DEFAULT   -1
#define DEF_K_BLKREAD   1

Functions

static unsigned int getEnergyOpt (const char *opts)
 Extracts the energy classification type.
static unsigned int getSummaryOpts (const char *opts)
 Extracts the event summary options.
static unsigned int getPrintOpts (const char *opts)
 Extracts the print options.
static int loadLib (const char *library_name, int verbose)
 Dynamically loads the specified configuration library.
int filter_rtoFill (FilterRto *rto, int argc, char *argv[])
 Examines the command line parameters and fills the print control structure.
void filter_rtoUsageReport (void)
 Describes the command line parameters for daqeb_print.
void filter_rtoPrint (const FilterRto *rto)
 Prints the contents of the print control context.


Detailed Description

Utility routines to parse the command line parameters and fill in the run time filter options, implementation.

Author:
JJRussell - russell@slac.stanford.edu

  CVS $Id: filter_rto.c,v 1.13 2012/12/20 21:37:52 russell Exp $

There is really no good reason why this code is not included directly in the filter.c code other than it was getting unwieldy.

Function Documentation

int filter_rtoFill ( FilterRto rto,
int  argc,
char *  argv[] 
)

Examines the command line parameters and fills the print control structure.

Return values:
0 Everything is okay.
-1 Incorrect command usage. Usually this means that the input file name was absent.
Parameters:
rto The runtime options structure to fill.
argc The number of command line parameters.
argv The array of pointers to the command line parameters.
Usage and Warnings
This routine uses 'getopt' to process the command line parameters. This is routine does not provide for lot of flexibility. It rigidly demands that all optional arguments, i.e. the -x type must precede the command line parameters (here the input file name). Getopt provides no positive binding, so all command line options which can accept an option must be provided with one. For instance
      $> filter -n10 -s -PACG my_file

The -s parameter is without a value, well kind of. Its, value, whether intentional or not, is my_file. This behaviour makes providing different defaults whether the option is specified or not specified, impossible. (Here a reasonable interpretation is to set the skip count to 1, rather than 0 if it wasn't specified.)

List options
In order to make the best use of the limited number of available options ([a-zA-Z0-9], some options introduce a list. What follows the list is another set of single character options, but these options are interpreted in the context of that list. This allows characters to be reused.

The current set of lists are

  • M = Message Level List
  • P = Print List
  • S = Summary List
  • E = Which energy to use

Message Level List
A message level list -M options is followed by one or more characters from one of the two sets. The first set establishes the current message level, the second character or characters identifies a target that participates in the message services. The current message level is applied to any and all targets that follow, until a new current message level is establish. The message levels are:
  • D = DEBUG
  • I = INFO
  • W = WARNING
  • E = ERROR
  • F = FATAL

The list of targets is

  • x = all
  • d = EFC_filter, driver routine
  • p = TFC projection tower find
  • s = TFC skirt, track skirt projections
  • f = filter
  • v = TFC_acd, track/acd match

Example

        -MDpsIfv

This indicates the TFC projection tower finding and the TFC skirt matching routines should issue messages at the DEBUG level or higher and that the filter and TFC ACD matching routines should issue messages at the INFO level or higher. Hey, it ain't pretty, but what you gonna do with such a brain-dead facility?

Print List Options
The Print list options are
  • X = all
  • A = Acd
  • C = Cal
  • G = Gem
  • T = Tkr
  • P = Projections
  • g = geometry

Example

        -PACPg

This displays information about the ACD, CAL and found Projections along with a dump of the geometry.

Summary List Options
The summary list options are

  • e = short event summary
  • E = Event-by-Event summary
  • M = use the MC actual (generated) energy as the classifier

       -Se

This requests a short event summary

Energy List
This selects which energy to use in the result vector
  • C = use calculated energy for the CAL
  • O = use MC observed energy
  • G = use MC generated energy

The last two are available iff the input sample is a GLEAM Monte Carlo sample with these values included in the event header.

References _FilterRto::allRead, _FilterRto::clevel, _FilterRto::config, _FilterRto::energy, _FilterRto::esummary, FLT_M_GEO, FLT_RESULT_ENERGY_K_CALCULATED, FLT_STATS_EBIN_M_DEF, _FilterRto::geometry, getEnergyOpt(), getPrintOpts(), getSummaryOpts(), _FilterRto::grbfile, _FilterRto::list, loadLib(), _FilterRto::name, _FilterRto::ofile, _FilterRto::otype, _FilterRto::quiet, _FilterRto::resultCnt, _FilterRto::segSize, _FilterRto::ss_to_print, _FilterRto::statsfile, _FilterRto::to_print, _FilterRto::to_process, _FilterRto::to_skip, _FilterRto::type, and _FilterRto::vetoes.

Referenced by main().

void filter_rtoPrint ( const FilterRto rto  ) 

Prints the contents of the print control context.

Parameters:
rto Pointer to the print control context block.

References _FilterRto::allRead, _FilterRto::clevel, _FilterRto::energy, _FilterRto::name, _FilterRto::ofile, _FilterRto::otype, _FilterRto::segSize, _FilterRto::statsfile, _FilterRto::to_print, _FilterRto::to_process, and _FilterRto::to_skip.

Referenced by doFilter().

static unsigned int getEnergyOpt ( const char *  opts  )  [static]

Extracts the energy classification type.

Returns:
Bit mask of the display options
Parameters:
opts Character string of the options

References FLT_RESULT_ENERGY_K_CALCULATED, FLT_RESULT_ENERGY_K_GENERATED, and FLT_RESULT_ENERGY_K_OBSERVED.

Referenced by filter_rtoFill().

static unsigned int getPrintOpts ( const char *  opts  )  [static]

Extracts the print options.

Returns:
Bit mask of the print options
Parameters:
opts Character string of the options

References FLT_M_GEO, and FLT_M_PRJS.

Referenced by filter_rtoFill().

static unsigned int getSummaryOpts ( const char *  opts  )  [static]

Extracts the event summary options.

Returns:
Bit mask of the display options
Parameters:
opts Character string of the options

References FLT_STATS_EBIN_M_ALT, and FLT_STATS_EBIN_M_DEF.

Referenced by filter_rtoFill().

static int loadLib ( const char *  library_name,
int  verbose 
) [static]

Dynamically loads the specified configuration library.

Return values:
0,success 
-1,failure 
Parameters:
library_name The name of the library to load
verbose The verbosity level

Referenced by filter_rtoFill().


Generated on Wed Jan 16 13:35:25 2013 by  doxygen 1.5.8