ATLAS Offline Software
Loading...
Searching...
No Matches
cmdline.cxx File Reference
#include "CxxUtils/checker_macros.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <getopt.h>
#include "cmdline.h"
Include dependency graph for cmdline.cxx:

Go to the source code of this file.

Classes

union  generic_value
 generic value variable More...
struct  generic_list
 holds temporary values for multiple options More...

Enumerations

enum  cmdline_parser_arg_type {
  ARG_NO , ARG_FLAG , ARG_STRING , ARG_INT ,
  ARG_DOUBLE
}

Functions

static void clear_given (struct gengetopt_args_info *args_info)
static void clear_args (struct gengetopt_args_info *args_info)
static int cmdline_parser_internal (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error)
static int cmdline_parser_required2 (struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
static char * gengetopt_strdup (const char *s)
 replacement of strdup, which is not standard
static void init_args_info (struct gengetopt_args_info *args_info)
void cmdline_parser_print_version (void)
 Print the version.
static void print_help_common (void)
void cmdline_parser_print_help (void)
 Print the help.
void cmdline_parser_init (struct gengetopt_args_info *args_info)
 Initializes the passed gengetopt_args_info structure's fields (also set default values for options that have a default)
void cmdline_parser_params_init (struct cmdline_parser_params *params)
 Initializes all the fields a cmdline_parser_params structure to their default values.
struct cmdline_parser_paramscmdline_parser_params_create (void)
 Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their default values.
static void free_string_field (char **s)
static void add_node (struct generic_list **list)
 add a node at the head of the list
static void free_multiple_field (unsigned int len, void *arg, char ***orig)
 The passed arg parameter is NOT set to 0 from this function.
static void free_multiple_string_field (unsigned int len, char ***arg, char ***orig)
static void cmdline_parser_release (struct gengetopt_args_info *args_info)
static void write_into_file (FILE *outfile, const char *opt, const char *arg, const char *[])
static void write_multiple_into_file (FILE *outfile, int len, const char *opt, char **arg, const char *values[])
int cmdline_parser_dump (FILE *outfile, struct gengetopt_args_info *args_info)
 Save the contents of the option struct into an already open FILE stream.
int cmdline_parser_file_save (const char *filename, struct gengetopt_args_info *args_info)
 Save the contents of the option struct into a (text) file.
void cmdline_parser_free (struct gengetopt_args_info *args_info)
 Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the structure itself)
static char * get_multiple_arg_token (const char *arg)
static const char * get_multiple_arg_token_next (const char *arg)
static int check_multiple_option_occurrences (const char *prog_name, unsigned int option_given, unsigned int min, unsigned int max, const char *option_desc)
int cmdline_parser (int argc, char **argv, struct gengetopt_args_info *args_info)
 The command line parser.
int cmdline_parser_ext (int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params)
 The command line parser (version with additional parameters)
int cmdline_parser2 (int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
 The command line parser (version with additional parameters - deprecated)
int cmdline_parser_required (struct gengetopt_args_info *args_info, const char *prog_name)
 Checks that all the required options were specified.
static int update_arg (void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error)
 updates an option
static int update_multiple_arg_temp (struct generic_list **list, unsigned int *prev_given, const char *val, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, const char *long_opt, char short_opt, const char *additional_error)
 store information about a multiple option in a temporary list
static void free_list (struct generic_list *list, short string_arg)
 free the passed list (including possible string argument)
static void update_multiple_arg (void *field, char ***orig_field, unsigned int field_given, unsigned int prev_given, union generic_value *default_value, cmdline_parser_arg_type arg_type, struct generic_list *list)
 updates a multiple option starting from the passed list

Variables

 ATLAS_NO_CHECK_FILE_THREAD_SAFETY
const char * gengetopt_args_info_purpose = ""
 the purpose string of the program
const char * gengetopt_args_info_usage = "Usage: iLumiCalc.exe [OPTIONS]..."
 the usage string of the program
const char * gengetopt_args_info_description = ""
const char * gengetopt_args_info_help []
 all the lines making the help output
static char * package_name = 0

Enumeration Type Documentation

◆ cmdline_parser_arg_type

Enumerator
ARG_NO 
ARG_FLAG 
ARG_STRING 
ARG_INT 
ARG_DOUBLE 

Definition at line 67 of file cmdline.cxx.

67 {ARG_NO
68 , ARG_FLAG
70 , ARG_INT
cmdline_parser_arg_type
Definition cmdline.cxx:67
@ ARG_STRING
Definition cmdline.cxx:69
@ ARG_INT
Definition cmdline.cxx:70
@ ARG_NO
Definition cmdline.cxx:67
@ ARG_DOUBLE
Definition cmdline.cxx:71
@ ARG_FLAG
Definition cmdline.cxx:68

Function Documentation

◆ add_node()

void add_node ( struct generic_list ** list)
static

add a node at the head of the list

Definition at line 310 of file cmdline.cxx.

310 {
311 struct generic_list *new_node = (struct generic_list *) malloc (sizeof (struct generic_list));
312 if (new_node){
313 new_node->next = *list;
314 *list = new_node;
315 new_node->arg.string_arg = 0;
316 new_node->orig = 0;
317 }
318}
list(name, path='/')
Definition histSizes.py:38
holds temporary values for multiple options
Definition cmdline.cxx:301
union generic_value arg
Definition cmdline.cxx:302
char * orig
Definition cmdline.cxx:303
struct generic_list * next
Definition cmdline.cxx:304
char * string_arg
Definition cmdline.cxx:295

◆ check_multiple_option_occurrences()

int check_multiple_option_occurrences ( const char * prog_name,
unsigned int option_given,
unsigned int min,
unsigned int max,
const char * option_desc )
static

Definition at line 607 of file cmdline.cxx.

608{
609 int error = 0;
610
611 if (option_given && (min > 0 || max > 0))
612 {
613 if (min > 0 && max > 0)
614 {
615 if (min == max)
616 {
617 /* specific occurrences */
618 if (option_given != (unsigned int) min)
619 {
620 fprintf (stderr, "%s: %s option occurrences must be %u\n",
621 prog_name, option_desc, min);
622 error = 1;
623 }
624 }
625 else if (option_given < (unsigned int) min
626 || option_given > (unsigned int) max)
627 {
628 /* range occurrences */
629 fprintf (stderr, "%s: %s option occurrences must be between %u and %u\n",
630 prog_name, option_desc, min, max);
631 error = 1;
632 }
633 }
634 else if (min > 0)
635 {
636 /* at least check */
637 if (option_given < min)
638 {
639 fprintf (stderr, "%s: %s option occurrences must be at least %u\n",
640 prog_name, option_desc, min);
641 error = 1;
642 }
643 }
644 else if (max > 0)
645 {
646 /* at most check */
647 if (option_given > max)
648 {
649 fprintf (stderr, "%s: %s option occurrences must be at most %u\n",
650 prog_name, option_desc, max);
651 error = 1;
652 }
653 }
654 }
655
656 return error;
657}
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41

◆ clear_args()

void clear_args ( struct gengetopt_args_info * args_info)
static

Definition at line 122 of file cmdline.cxx.

123{
124 args_info->runnumber_arg = NULL;
125 args_info->runnumber_orig = NULL;
126 args_info->lbstart_arg = NULL;
127 args_info->lbstart_orig = NULL;
128 args_info->lbend_arg = NULL;
129 args_info->lbend_orig = NULL;
130 args_info->xml_arg = NULL;
131 args_info->xml_orig = NULL;
132 args_info->xml_blacklist_arg = NULL;
133 args_info->xml_blacklist_orig = NULL;
134 args_info->tag_arg = NULL;
135 args_info->tag_orig = NULL;
136 args_info->root_arg = NULL;
137 args_info->root_orig = NULL;
138 args_info->tree_arg = NULL;
139 args_info->tree_orig = NULL;
140 args_info->d3pd_dir_arg = NULL;
141 args_info->d3pd_dir_orig = NULL;
142 args_info->lumitag_arg = gengetopt_strdup ("OflLumi-8TeV-002");
143 args_info->lumitag_orig = NULL;
144 args_info->online_flag = 0;
145 args_info->lumichannel_arg = 0;
146 args_info->lumichannel_orig = NULL;
147 args_info->lumimethod_arg = gengetopt_strdup ("");
148 args_info->lumimethod_orig = NULL;
149 args_info->trigger_arg = NULL;
150 args_info->trigger_orig = NULL;
151 args_info->livetrigger_arg = gengetopt_strdup ("L1_EM30");
152 args_info->livetrigger_orig = NULL;
153 args_info->lar_flag = 0;
154 args_info->lartag_arg = gengetopt_strdup ("LARBadChannelsOflEventVeto-UPD4-01");
155 args_info->lartag_orig = NULL;
156 args_info->beamspot_flag = 0;
157 args_info->beamspottag_arg = gengetopt_strdup ("IndetBeamposOnl-HLT-UPD1-001-00");
158 args_info->beamspottag_orig = NULL;
159 args_info->scale_lumi_arg = 1.0;
160 args_info->scale_lumi_orig = NULL;
161 args_info->xml_out_arg = NULL;
162 args_info->xml_out_orig = NULL;
163 args_info->xml_collisionlist_flag = 0;
164 args_info->plots_flag = 0;
165 args_info->verbose_flag = 0;
166 args_info->quiet_flag = 0;
167
168}
static char * gengetopt_strdup(const char *s)
replacement of strdup, which is not standard
Definition cmdline.cxx:509
char * lumimethod_arg
Luminosity estimate method by string (default='ATLAS_PREFERRED').
Definition cmdline.h:93
char * lumichannel_orig
Luminosity estimate method by value original value given at command line.
Definition cmdline.h:91
int lar_flag
Calculate LAr defect fraction (default=off).
Definition cmdline.h:104
char * lumitag_orig
Offline luminosity database tag original value given at command line.
Definition cmdline.h:86
char ** lbend_orig
LumiBlock number end original value given at command line.
Definition cmdline.h:57
char * lartag_orig
LAr noise burst database tag original value given at command line.
Definition cmdline.h:107
char ** runnumber_arg
Run number, range, or comma separated list, e.g.
Definition cmdline.h:46
char * tree_orig
Name of TTree in input ROOT file to which Lumi string is attached original value given at command lin...
Definition cmdline.h:80
char * livetrigger_orig
L1 Trigger used for livetime calculation original value given at command line.
Definition cmdline.h:102
char * lumitag_arg
Offline luminosity database tag (default='OflLumi-8TeV-002').
Definition cmdline.h:85
char * lumimethod_orig
Luminosity estimate method by string original value given at command line.
Definition cmdline.h:94
int online_flag
Use online luminosity estimates instead of offline database (default=off).
Definition cmdline.h:88
char ** root_arg
Input ROOT file name.
Definition cmdline.h:74
char * tree_arg
Name of TTree in input ROOT file to which Lumi string is attached.
Definition cmdline.h:79
int quiet_flag
Quiet output level (default=off).
Definition cmdline.h:126
char ** xml_arg
Input XML file name.
Definition cmdline.h:61
char * d3pd_dir_arg
Name of TDirectory in input ROOT file where Lumi string is stored.
Definition cmdline.h:82
char ** lbstart_orig
LumiBlock number begin original value given at command line.
Definition cmdline.h:52
char * lartag_arg
LAr noise burst database tag (default='LARBadChannelsOflEventVeto-UPD4-01').
Definition cmdline.h:106
double scale_lumi_arg
Scale luminosity with a constant value (default='1.0').
Definition cmdline.h:114
int * lbstart_arg
LumiBlock number begin.
Definition cmdline.h:51
char * xml_out_arg
Output XML file name.
Definition cmdline.h:117
int lumichannel_arg
Luminosity estimate method by value (default='0').
Definition cmdline.h:90
int * lbend_arg
LumiBlock number end.
Definition cmdline.h:56
char ** runnumber_orig
Run number, range, or comma separated list, e.g.
Definition cmdline.h:47
char * xml_out_orig
Output XML file name original value given at command line.
Definition cmdline.h:118
char ** trigger_arg
Trigger chain name used for prescale calculation.
Definition cmdline.h:96
char ** tag_arg
Input TAG file name.
Definition cmdline.h:69
int verbose_flag
Verbose output level (default=off).
Definition cmdline.h:124
char * beamspottag_arg
Online beamspot database tag (default='IndetBeamposOnl-HLT-UPD1-001-00').
Definition cmdline.h:111
char * livetrigger_arg
L1 Trigger used for livetime calculation (default='L1_EM30').
Definition cmdline.h:101
char ** root_orig
Input ROOT file name original value given at command line.
Definition cmdline.h:75
int xml_collisionlist_flag
Output XML file of lists of collision candidates (default=off).
Definition cmdline.h:120
int plots_flag
Create some plots on demand (default=off).
Definition cmdline.h:122
int beamspot_flag
Require online beamspot valid in trigger livefraction (default=off).
Definition cmdline.h:109
char * d3pd_dir_orig
Name of TDirectory in input ROOT file where Lumi string is stored original value given at command lin...
Definition cmdline.h:83
char * scale_lumi_orig
Scale luminosity with a constant value original value given at command line.
Definition cmdline.h:115
char ** tag_orig
Input TAG file name original value given at command line.
Definition cmdline.h:70
char ** xml_orig
Input XML file name original value given at command line.
Definition cmdline.h:62
char ** trigger_orig
Trigger chain name used for prescale calculation original value given at command line.
Definition cmdline.h:97
char * xml_blacklist_orig
Input XML file of blacklist original value given at command line.
Definition cmdline.h:67
char * xml_blacklist_arg
Input XML file of blacklist.
Definition cmdline.h:66
char * beamspottag_orig
Online beamspot database tag original value given at command line.
Definition cmdline.h:112

◆ clear_given()

void clear_given ( struct gengetopt_args_info * args_info)
static

Definition at line 90 of file cmdline.cxx.

91{
92 args_info->help_given = 0 ;
93 args_info->version_given = 0 ;
94 args_info->runnumber_given = 0 ;
95 args_info->lbstart_given = 0 ;
96 args_info->lbend_given = 0 ;
97 args_info->xml_given = 0 ;
98 args_info->xml_blacklist_given = 0 ;
99 args_info->tag_given = 0 ;
100 args_info->root_given = 0 ;
101 args_info->tree_given = 0 ;
102 args_info->d3pd_dir_given = 0 ;
103 args_info->lumitag_given = 0 ;
104 args_info->online_given = 0 ;
105 args_info->lumichannel_given = 0 ;
106 args_info->lumimethod_given = 0 ;
107 args_info->trigger_given = 0 ;
108 args_info->livetrigger_given = 0 ;
109 args_info->lar_given = 0 ;
110 args_info->lartag_given = 0 ;
111 args_info->beamspot_given = 0 ;
112 args_info->beamspottag_given = 0 ;
113 args_info->scale_lumi_given = 0 ;
114 args_info->xml_out_given = 0 ;
115 args_info->xml_collisionlist_given = 0 ;
116 args_info->plots_given = 0 ;
117 args_info->verbose_given = 0 ;
118 args_info->quiet_given = 0 ;
119}
unsigned int lar_given
Whether lar was given.
Definition cmdline.h:146
unsigned int root_given
Whether root was given.
Definition cmdline.h:137
unsigned int xml_out_given
Whether xml_out was given.
Definition cmdline.h:151
unsigned int tree_given
Whether tree was given.
Definition cmdline.h:138
unsigned int beamspottag_given
Whether beamspottag was given.
Definition cmdline.h:149
unsigned int lbend_given
Whether lbend was given.
Definition cmdline.h:133
unsigned int livetrigger_given
Whether livetrigger was given.
Definition cmdline.h:145
unsigned int xml_given
Whether xml was given.
Definition cmdline.h:134
unsigned int lumimethod_given
Whether lumimethod was given.
Definition cmdline.h:143
unsigned int scale_lumi_given
Whether scale_lumi was given.
Definition cmdline.h:150
unsigned int plots_given
Whether plots was given.
Definition cmdline.h:153
unsigned int xml_collisionlist_given
Whether xml_collisionlist was given.
Definition cmdline.h:152
unsigned int xml_blacklist_given
Whether xml_blacklist was given.
Definition cmdline.h:135
unsigned int lumichannel_given
Whether lumichannel was given.
Definition cmdline.h:142
unsigned int trigger_given
Whether trigger was given.
Definition cmdline.h:144
unsigned int lbstart_given
Whether lbstart was given.
Definition cmdline.h:132
unsigned int runnumber_given
Whether runnumber was given.
Definition cmdline.h:131
unsigned int help_given
Whether help was given.
Definition cmdline.h:129
unsigned int lartag_given
Whether lartag was given.
Definition cmdline.h:147
unsigned int quiet_given
Whether quiet was given.
Definition cmdline.h:155
unsigned int tag_given
Whether tag was given.
Definition cmdline.h:136
unsigned int d3pd_dir_given
Whether d3pd_dir was given.
Definition cmdline.h:139
unsigned int version_given
Whether version was given.
Definition cmdline.h:130
unsigned int lumitag_given
Whether lumitag was given.
Definition cmdline.h:140
unsigned int verbose_given
Whether verbose was given.
Definition cmdline.h:154
unsigned int beamspot_given
Whether beamspot was given.
Definition cmdline.h:148
unsigned int online_given
Whether online was given.
Definition cmdline.h:141

◆ cmdline_parser()

int cmdline_parser ( int argc,
char ** argv,
struct gengetopt_args_info * args_info )

The command line parser.

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 659 of file cmdline.cxx.

660{
661 return cmdline_parser2 (argc, argv, args_info, 0, 1, 1);
662}
int cmdline_parser2(int argc, char **argv, struct gengetopt_args_info *args_info, int override, int initialize, int check_required)
The command line parser (version with additional parameters - deprecated)
Definition cmdline.cxx:681

◆ cmdline_parser2()

int cmdline_parser2 ( int argc,
char ** argv,
struct gengetopt_args_info * args_info,
int override,
int initialize,
int check_required )

The command line parser (version with additional parameters - deprecated)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
overridewhether to override possibly already present options
initializewhether to initialize the option structure my_args_info
check_requiredwhether to check that all required options were provided
Returns
0 if everything went fine, NON 0 if an error took place
Deprecated
use cmdline_parser_ext() instead

Definition at line 681 of file cmdline.cxx.

682{
683 int result;
685
686 params.override = override;
687 params.initialize = initialize;
688 params.check_required = check_required;
689 params.check_ambiguity = 0;
690 params.print_errors = 1;
691
692 result = cmdline_parser_internal (argc, argv, args_info, &params, 0);
693
694 if (result == EXIT_FAILURE)
695 {
696 cmdline_parser_free (args_info);
697 exit (EXIT_FAILURE);
698 }
699
700 return result;
701}
static int cmdline_parser_internal(int argc, char **argv, struct gengetopt_args_info *args_info, struct cmdline_parser_params *params, const char *additional_error)
Definition cmdline.cxx:1025
void cmdline_parser_free(struct gengetopt_args_info *args_info)
Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the struc...
Definition cmdline.cxx:502
void initialize()
The additional parameters to pass to parser functions.
Definition cmdline.h:161
int check_required
whether to check that all required options were provided (default 1)
Definition cmdline.h:164

◆ cmdline_parser_dump()

int cmdline_parser_dump ( FILE * outfile,
struct gengetopt_args_info * args_info )

Save the contents of the option struct into an already open FILE stream.

Parameters
outfilethe stream where to dump options
args_infothe option struct to dump
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 418 of file cmdline.cxx.

419{
420 int i = 0;
421
422 if (!outfile)
423 {
424 fprintf (stderr, "%s: cannot dump options to stream\n", CMDLINE_PARSER_PACKAGE);
425 return EXIT_FAILURE;
426 }
427
428 if (args_info->help_given)
429 write_into_file(outfile, "help", 0, 0 );
430 if (args_info->version_given)
431 write_into_file(outfile, "version", 0, 0 );
432 write_multiple_into_file(outfile, args_info->runnumber_given, "runnumber", args_info->runnumber_orig, 0);
433 write_multiple_into_file(outfile, args_info->lbstart_given, "lbstart", args_info->lbstart_orig, 0);
434 write_multiple_into_file(outfile, args_info->lbend_given, "lbend", args_info->lbend_orig, 0);
435 write_multiple_into_file(outfile, args_info->xml_given, "xml", args_info->xml_orig, 0);
436 if (args_info->xml_blacklist_given)
437 write_into_file(outfile, "xml_blacklist", args_info->xml_blacklist_orig, 0);
438 write_multiple_into_file(outfile, args_info->tag_given, "tag", args_info->tag_orig, 0);
439 write_multiple_into_file(outfile, args_info->root_given, "root", args_info->root_orig, 0);
440 if (args_info->tree_given)
441 write_into_file(outfile, "tree", args_info->tree_orig, 0);
442 if (args_info->d3pd_dir_given)
443 write_into_file(outfile, "d3pd_dir", args_info->d3pd_dir_orig, 0);
444 if (args_info->lumitag_given)
445 write_into_file(outfile, "lumitag", args_info->lumitag_orig, 0);
446 if (args_info->online_given)
447 write_into_file(outfile, "online", 0, 0 );
448 if (args_info->lumichannel_given)
449 write_into_file(outfile, "lumichannel", args_info->lumichannel_orig, 0);
450 if (args_info->lumimethod_given)
451 write_into_file(outfile, "lumimethod", args_info->lumimethod_orig, 0);
452 write_multiple_into_file(outfile, args_info->trigger_given, "trigger", args_info->trigger_orig, 0);
453 if (args_info->livetrigger_given)
454 write_into_file(outfile, "livetrigger", args_info->livetrigger_orig, 0);
455 if (args_info->lar_given)
456 write_into_file(outfile, "lar", 0, 0 );
457 if (args_info->lartag_given)
458 write_into_file(outfile, "lartag", args_info->lartag_orig, 0);
459 if (args_info->beamspot_given)
460 write_into_file(outfile, "beamspot", 0, 0 );
461 if (args_info->beamspottag_given)
462 write_into_file(outfile, "beamspottag", args_info->beamspottag_orig, 0);
463 if (args_info->scale_lumi_given)
464 write_into_file(outfile, "scale_lumi", args_info->scale_lumi_orig, 0);
465 if (args_info->xml_out_given)
466 write_into_file(outfile, "xml_out", args_info->xml_out_orig, 0);
467 if (args_info->xml_collisionlist_given)
468 write_into_file(outfile, "xml_collisionlist", 0, 0 );
469 if (args_info->plots_given)
470 write_into_file(outfile, "plots", 0, 0 );
471 if (args_info->verbose_given)
472 write_into_file(outfile, "verbose", 0, 0 );
473 if (args_info->quiet_given)
474 write_into_file(outfile, "quiet", 0, 0 );
475
476
477 i = EXIT_SUCCESS;
478 return i;
479}
static void write_multiple_into_file(FILE *outfile, int len, const char *opt, char **arg, const char *values[])
Definition cmdline.cxx:409
static void write_into_file(FILE *outfile, const char *opt, const char *arg, const char *[])
Definition cmdline.cxx:399
#define CMDLINE_PARSER_PACKAGE
the program name (used for printing errors)
Definition cmdline.h:28

◆ cmdline_parser_ext()

int cmdline_parser_ext ( int argc,
char ** argv,
struct gengetopt_args_info * args_info,
struct cmdline_parser_params * params )

The command line parser (version with additional parameters)

Parameters
argcthe number of command line options
argvthe command line options
args_infothe structure where option information will be stored
paramsadditional parameters for the parser
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 665 of file cmdline.cxx.

667{
668 int result;
669 result = cmdline_parser_internal (argc, argv, args_info, params, 0);
670
671 if (result == EXIT_FAILURE)
672 {
673 cmdline_parser_free (args_info);
674 exit (EXIT_FAILURE);
675 }
676
677 return result;
678}

◆ cmdline_parser_file_save()

int cmdline_parser_file_save ( const char * filename,
struct gengetopt_args_info * args_info )

Save the contents of the option struct into a (text) file.

This file can be read by the config file parser (if generated by gengetopt)

Parameters
filenamethe file where to save
args_infothe option struct to save
Returns
0 if everything went fine, NON 0 if an error took place

Definition at line 482 of file cmdline.cxx.

483{
484 FILE *outfile;
485 int i = 0;
486
487 outfile = fopen(filename, "w");
488
489 if (!outfile)
490 {
491 fprintf (stderr, "%s: cannot open file for writing: %s\n", CMDLINE_PARSER_PACKAGE, filename);
492 return EXIT_FAILURE;
493 }
494
495 i = cmdline_parser_dump(outfile, args_info);
496 fclose (outfile);
497
498 return i;
499}
int cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info)
Save the contents of the option struct into an already open FILE stream.
Definition cmdline.cxx:418

◆ cmdline_parser_free()

void cmdline_parser_free ( struct gengetopt_args_info * args_info)

Deallocates the string fields of the gengetopt_args_info structure (but does not deallocate the structure itself)

Parameters
args_infothe structure to deallocate

Definition at line 502 of file cmdline.cxx.

503{
504 cmdline_parser_release (args_info);
505}
static void cmdline_parser_release(struct gengetopt_args_info *args_info)
Definition cmdline.cxx:359

◆ cmdline_parser_init()

void cmdline_parser_init ( struct gengetopt_args_info * args_info)

Initializes the passed gengetopt_args_info structure's fields (also set default values for options that have a default)

Parameters
args_infothe structure to initialize

Definition at line 252 of file cmdline.cxx.

253{
254 clear_given (args_info);
255 clear_args (args_info);
256 init_args_info (args_info);
257}
static void clear_given(struct gengetopt_args_info *args_info)
Definition cmdline.cxx:90
static void clear_args(struct gengetopt_args_info *args_info)
Definition cmdline.cxx:122
static void init_args_info(struct gengetopt_args_info *args_info)
Definition cmdline.cxx:171

◆ cmdline_parser_internal()

int cmdline_parser_internal ( int argc,
char ** argv,
struct gengetopt_args_info * args_info,
struct cmdline_parser_params * params,
const char * additional_error )
static

Definition at line 1025 of file cmdline.cxx.

1028{
1029 int c; /* Character of the parsed option. */
1030
1031 struct generic_list * runnumber_list = NULL;
1032 struct generic_list * lbstart_list = NULL;
1033 struct generic_list * lbend_list = NULL;
1034 struct generic_list * xml_list = NULL;
1035 struct generic_list * tag_list = NULL;
1036 struct generic_list * root_list = NULL;
1037 struct generic_list * trigger_list = NULL;
1038 int error = 0;
1039 struct gengetopt_args_info local_args_info;
1040
1041 int override;
1042 int initialize;
1043 int check_required;
1044 int check_ambiguity;
1045
1046 package_name = argv[0];
1047
1048 override = params->override;
1049 initialize = params->initialize;
1050 check_required = params->check_required;
1051 check_ambiguity = params->check_ambiguity;
1052
1053 if (initialize)
1054 cmdline_parser_init (args_info);
1055
1056 cmdline_parser_init (&local_args_info);
1057
1058 optarg = 0;
1059 optind = 0;
1060 opterr = params->print_errors;
1061 optopt = '?';
1062
1063 while (1)
1064 {
1065 int option_index = 0;
1066
1067 static struct option long_options[] = {
1068 { "help", 0, NULL, 'h' },
1069 { "version", 0, NULL, 0 },
1070 { "runnumber", 1, NULL, 'r' },
1071 { "lbstart", 1, NULL, 0 },
1072 { "lbend", 1, NULL, 0 },
1073 { "xml", 1, NULL, 'x' },
1074 { "xml_blacklist", 1, NULL, 0 },
1075 { "tag", 1, NULL, 'T' },
1076 { "root", 1, NULL, 0 },
1077 { "tree", 1, NULL, 0 },
1078 { "d3pd_dir", 1, NULL, 0 },
1079 { "lumitag", 1, NULL, 0 },
1080 { "online", 0, NULL, 0 },
1081 { "lumichannel", 1, NULL, 0 },
1082 { "lumimethod", 1, NULL, 0 },
1083 { "trigger", 1, NULL, 't' },
1084 { "livetrigger", 1, NULL, 0 },
1085 { "lar", 0, NULL, 0 },
1086 { "lartag", 1, NULL, 0 },
1087 { "beamspot", 0, NULL, 0 },
1088 { "beamspottag", 1, NULL, 0 },
1089 { "scale_lumi", 1, NULL, 0 },
1090 { "xml_out", 1, NULL, 0 },
1091 { "xml_collisionlist", 0, NULL, 0 },
1092 { "plots", 0, NULL, 0 },
1093 { "verbose", 0, NULL, 'V' },
1094 { "quiet", 0, NULL, 0 },
1095 { 0, 0, 0, 0 }
1096 };
1097
1098 c = getopt_long (argc, argv, "hr:x:T:t:V", long_options, &option_index);
1099
1100 if (c == -1) break; /* Exit from `while (1)' loop. */
1101
1102 switch (c)
1103 {
1104 case 'h': /* Print help and exit. */
1106 cmdline_parser_free (&local_args_info);
1107 exit (EXIT_SUCCESS);
1108
1109 case 'r': /* Run number, range, or comma separated list, e.g. 177986-178109,179710. */
1110
1111 if (update_multiple_arg_temp(&runnumber_list,
1112 &(local_args_info.runnumber_given), optarg, 0, 0, ARG_STRING,
1113 "runnumber", 'r',
1114 additional_error))
1115 goto failure;
1116
1117 break;
1118 case 'x': /* Input XML file name. */
1119
1120 if (update_multiple_arg_temp(&xml_list,
1121 &(local_args_info.xml_given), optarg, 0, 0, ARG_STRING,
1122 "xml", 'x',
1123 additional_error))
1124 goto failure;
1125
1126 break;
1127 case 'T': /* Input TAG file name. */
1128
1129 if (update_multiple_arg_temp(&tag_list,
1130 &(local_args_info.tag_given), optarg, 0, 0, ARG_STRING,
1131 "tag", 'T',
1132 additional_error))
1133 goto failure;
1134
1135 break;
1136 case 't': /* Trigger chain name used for prescale calculation. */
1137
1138 if (update_multiple_arg_temp(&trigger_list,
1139 &(local_args_info.trigger_given), optarg, 0, 0, ARG_STRING,
1140 "trigger", 't',
1141 additional_error))
1142 goto failure;
1143
1144 break;
1145 case 'V': /* Verbose output level. */
1146
1147
1148 if (update_arg((void *)&(args_info->verbose_flag), 0, &(args_info->verbose_given),
1149 &(local_args_info.verbose_given), optarg, 0, 0, ARG_FLAG,
1150 check_ambiguity, override, 1, 0, "verbose", 'V',
1151 additional_error))
1152 goto failure;
1153
1154 break;
1155
1156 case 0: /* Long option with no short option */
1157 if (strcmp (long_options[option_index].name, "version") == 0) {
1159 cmdline_parser_free (&local_args_info);
1160 exit (EXIT_SUCCESS);
1161 }
1162
1163 /* LumiBlock number begin. */
1164 if (strcmp (long_options[option_index].name, "lbstart") == 0)
1165 {
1166
1167 if (update_multiple_arg_temp(&lbstart_list,
1168 &(local_args_info.lbstart_given), optarg, 0, 0, ARG_INT,
1169 "lbstart", '-',
1170 additional_error))
1171 goto failure;
1172
1173 }
1174 /* LumiBlock number end. */
1175 else if (strcmp (long_options[option_index].name, "lbend") == 0)
1176 {
1177
1178 if (update_multiple_arg_temp(&lbend_list,
1179 &(local_args_info.lbend_given), optarg, 0, 0, ARG_INT,
1180 "lbend", '-',
1181 additional_error))
1182 goto failure;
1183
1184 }
1185 /* Input XML file of blacklist. */
1186 else if (strcmp (long_options[option_index].name, "xml_blacklist") == 0)
1187 {
1188
1189
1190 if (update_arg( (void *)&(args_info->xml_blacklist_arg),
1191 &(args_info->xml_blacklist_orig), &(args_info->xml_blacklist_given),
1192 &(local_args_info.xml_blacklist_given), optarg, 0, 0, ARG_STRING,
1193 check_ambiguity, override, 0, 0,
1194 "xml_blacklist", '-',
1195 additional_error))
1196 goto failure;
1197
1198 }
1199 /* Input ROOT file name. */
1200 else if (strcmp (long_options[option_index].name, "root") == 0)
1201 {
1202
1203 if (update_multiple_arg_temp(&root_list,
1204 &(local_args_info.root_given), optarg, 0, 0, ARG_STRING,
1205 "root", '-',
1206 additional_error))
1207 goto failure;
1208
1209 }
1210 /* Name of TTree in input ROOT file to which Lumi string is attached. */
1211 else if (strcmp (long_options[option_index].name, "tree") == 0)
1212 {
1213
1214
1215 if (update_arg( (void *)&(args_info->tree_arg),
1216 &(args_info->tree_orig), &(args_info->tree_given),
1217 &(local_args_info.tree_given), optarg, 0, 0, ARG_STRING,
1218 check_ambiguity, override, 0, 0,
1219 "tree", '-',
1220 additional_error))
1221 goto failure;
1222
1223 }
1224 /* Name of TDirectory in input ROOT file where Lumi string is stored. */
1225 else if (strcmp (long_options[option_index].name, "d3pd_dir") == 0)
1226 {
1227
1228
1229 if (update_arg( (void *)&(args_info->d3pd_dir_arg),
1230 &(args_info->d3pd_dir_orig), &(args_info->d3pd_dir_given),
1231 &(local_args_info.d3pd_dir_given), optarg, 0, 0, ARG_STRING,
1232 check_ambiguity, override, 0, 0,
1233 "d3pd_dir", '-',
1234 additional_error))
1235 goto failure;
1236
1237 }
1238 /* Offline luminosity database tag. */
1239 else if (strcmp (long_options[option_index].name, "lumitag") == 0)
1240 {
1241
1242
1243 if (update_arg( (void *)&(args_info->lumitag_arg),
1244 &(args_info->lumitag_orig), &(args_info->lumitag_given),
1245 &(local_args_info.lumitag_given), optarg, 0, "OflLumi-8TeV-002", ARG_STRING,
1246 check_ambiguity, override, 0, 0,
1247 "lumitag", '-',
1248 additional_error))
1249 goto failure;
1250
1251 }
1252 /* Use online luminosity estimates instead of offline database. */
1253 else if (strcmp (long_options[option_index].name, "online") == 0)
1254 {
1255
1256
1257 if (update_arg((void *)&(args_info->online_flag), 0, &(args_info->online_given),
1258 &(local_args_info.online_given), optarg, 0, 0, ARG_FLAG,
1259 check_ambiguity, override, 1, 0, "online", '-',
1260 additional_error))
1261 goto failure;
1262
1263 }
1264 /* Luminosity estimate method by value. */
1265 else if (strcmp (long_options[option_index].name, "lumichannel") == 0)
1266 {
1267
1268
1269 if (update_arg( (void *)&(args_info->lumichannel_arg),
1270 &(args_info->lumichannel_orig), &(args_info->lumichannel_given),
1271 &(local_args_info.lumichannel_given), optarg, 0, "0", ARG_INT,
1272 check_ambiguity, override, 0, 0,
1273 "lumichannel", '-',
1274 additional_error))
1275 goto failure;
1276
1277 }
1278 /* Luminosity estimate method by string. */
1279 else if (strcmp (long_options[option_index].name, "lumimethod") == 0)
1280 {
1281
1282
1283 if (update_arg( (void *)&(args_info->lumimethod_arg),
1284 &(args_info->lumimethod_orig), &(args_info->lumimethod_given),
1285 &(local_args_info.lumimethod_given), optarg, 0, "ATLAS_PREFERRED", ARG_STRING,
1286 check_ambiguity, override, 0, 0,
1287 "lumimethod", '-',
1288 additional_error))
1289 goto failure;
1290
1291 }
1292 /* L1 Trigger used for livetime calculation. */
1293 else if (strcmp (long_options[option_index].name, "livetrigger") == 0)
1294 {
1295
1296
1297 if (update_arg( (void *)&(args_info->livetrigger_arg),
1298 &(args_info->livetrigger_orig), &(args_info->livetrigger_given),
1299 &(local_args_info.livetrigger_given), optarg, 0, "L1_EM30", ARG_STRING,
1300 check_ambiguity, override, 0, 0,
1301 "livetrigger", '-',
1302 additional_error))
1303 goto failure;
1304
1305 }
1306 /* Calculate LAr defect fraction. */
1307 else if (strcmp (long_options[option_index].name, "lar") == 0)
1308 {
1309
1310
1311 if (update_arg((void *)&(args_info->lar_flag), 0, &(args_info->lar_given),
1312 &(local_args_info.lar_given), optarg, 0, 0, ARG_FLAG,
1313 check_ambiguity, override, 1, 0, "lar", '-',
1314 additional_error))
1315 goto failure;
1316
1317 }
1318 /* LAr noise burst database tag. */
1319 else if (strcmp (long_options[option_index].name, "lartag") == 0)
1320 {
1321
1322
1323 if (update_arg( (void *)&(args_info->lartag_arg),
1324 &(args_info->lartag_orig), &(args_info->lartag_given),
1325 &(local_args_info.lartag_given), optarg, 0, "LARBadChannelsOflEventVeto-UPD4-01", ARG_STRING,
1326 check_ambiguity, override, 0, 0,
1327 "lartag", '-',
1328 additional_error))
1329 goto failure;
1330
1331 }
1332 /* Require online beamspot valid in trigger livefraction. */
1333 else if (strcmp (long_options[option_index].name, "beamspot") == 0)
1334 {
1335
1336
1337 if (update_arg((void *)&(args_info->beamspot_flag), 0, &(args_info->beamspot_given),
1338 &(local_args_info.beamspot_given), optarg, 0, 0, ARG_FLAG,
1339 check_ambiguity, override, 1, 0, "beamspot", '-',
1340 additional_error))
1341 goto failure;
1342
1343 }
1344 /* Online beamspot database tag. */
1345 else if (strcmp (long_options[option_index].name, "beamspottag") == 0)
1346 {
1347
1348
1349 if (update_arg( (void *)&(args_info->beamspottag_arg),
1350 &(args_info->beamspottag_orig), &(args_info->beamspottag_given),
1351 &(local_args_info.beamspottag_given), optarg, 0, "IndetBeamposOnl-HLT-UPD1-001-00", ARG_STRING,
1352 check_ambiguity, override, 0, 0,
1353 "beamspottag", '-',
1354 additional_error))
1355 goto failure;
1356
1357 }
1358 /* Scale luminosity with a constant value. */
1359 else if (strcmp (long_options[option_index].name, "scale_lumi") == 0)
1360 {
1361
1362
1363 if (update_arg( (void *)&(args_info->scale_lumi_arg),
1364 &(args_info->scale_lumi_orig), &(args_info->scale_lumi_given),
1365 &(local_args_info.scale_lumi_given), optarg, 0, "1.0", ARG_DOUBLE,
1366 check_ambiguity, override, 0, 0,
1367 "scale_lumi", '-',
1368 additional_error))
1369 goto failure;
1370
1371 }
1372 /* Output XML file name. */
1373 else if (strcmp (long_options[option_index].name, "xml_out") == 0)
1374 {
1375
1376
1377 if (update_arg( (void *)&(args_info->xml_out_arg),
1378 &(args_info->xml_out_orig), &(args_info->xml_out_given),
1379 &(local_args_info.xml_out_given), optarg, 0, 0, ARG_STRING,
1380 check_ambiguity, override, 0, 0,
1381 "xml_out", '-',
1382 additional_error))
1383 goto failure;
1384
1385 }
1386 /* Output XML file of lists of collision candidates. */
1387 else if (strcmp (long_options[option_index].name, "xml_collisionlist") == 0)
1388 {
1389
1390
1391 if (update_arg((void *)&(args_info->xml_collisionlist_flag), 0, &(args_info->xml_collisionlist_given),
1392 &(local_args_info.xml_collisionlist_given), optarg, 0, 0, ARG_FLAG,
1393 check_ambiguity, override, 1, 0, "xml_collisionlist", '-',
1394 additional_error))
1395 goto failure;
1396
1397 }
1398 /* Create some plots on demand. */
1399 else if (strcmp (long_options[option_index].name, "plots") == 0)
1400 {
1401
1402
1403 if (update_arg((void *)&(args_info->plots_flag), 0, &(args_info->plots_given),
1404 &(local_args_info.plots_given), optarg, 0, 0, ARG_FLAG,
1405 check_ambiguity, override, 1, 0, "plots", '-',
1406 additional_error))
1407 goto failure;
1408
1409 }
1410 /* Quiet output level. */
1411 else if (strcmp (long_options[option_index].name, "quiet") == 0)
1412 {
1413
1414
1415 if (update_arg((void *)&(args_info->quiet_flag), 0, &(args_info->quiet_given),
1416 &(local_args_info.quiet_given), optarg, 0, 0, ARG_FLAG,
1417 check_ambiguity, override, 1, 0, "quiet", '-',
1418 additional_error))
1419 goto failure;
1420
1421 }
1422
1423 break;
1424 case '?': /* Invalid option. */
1425 /* `getopt_long' already printed an error message. */
1426 goto failure;
1427
1428 default: /* bug: option not considered. */
1429 fprintf (stderr, "%s: option unknown: %c%s\n", CMDLINE_PARSER_PACKAGE, c, (additional_error ? additional_error : ""));
1430 abort ();
1431 } /* switch */
1432 } /* while */
1433
1434
1435 update_multiple_arg((void *)&(args_info->runnumber_arg),
1436 &(args_info->runnumber_orig), args_info->runnumber_given,
1437 local_args_info.runnumber_given, 0,
1438 ARG_STRING, runnumber_list);
1439 update_multiple_arg((void *)&(args_info->lbstart_arg),
1440 &(args_info->lbstart_orig), args_info->lbstart_given,
1441 local_args_info.lbstart_given, 0,
1442 ARG_INT, lbstart_list);
1443 update_multiple_arg((void *)&(args_info->lbend_arg),
1444 &(args_info->lbend_orig), args_info->lbend_given,
1445 local_args_info.lbend_given, 0,
1446 ARG_INT, lbend_list);
1447 update_multiple_arg((void *)&(args_info->xml_arg),
1448 &(args_info->xml_orig), args_info->xml_given,
1449 local_args_info.xml_given, 0,
1450 ARG_STRING, xml_list);
1451 update_multiple_arg((void *)&(args_info->tag_arg),
1452 &(args_info->tag_orig), args_info->tag_given,
1453 local_args_info.tag_given, 0,
1454 ARG_STRING, tag_list);
1455 update_multiple_arg((void *)&(args_info->root_arg),
1456 &(args_info->root_orig), args_info->root_given,
1457 local_args_info.root_given, 0,
1458 ARG_STRING, root_list);
1459 update_multiple_arg((void *)&(args_info->trigger_arg),
1460 &(args_info->trigger_orig), args_info->trigger_given,
1461 local_args_info.trigger_given, 0,
1462 ARG_STRING, trigger_list);
1463
1464 args_info->runnumber_given += local_args_info.runnumber_given;
1465 local_args_info.runnumber_given = 0;
1466 args_info->lbstart_given += local_args_info.lbstart_given;
1467 local_args_info.lbstart_given = 0;
1468 args_info->lbend_given += local_args_info.lbend_given;
1469 local_args_info.lbend_given = 0;
1470 args_info->xml_given += local_args_info.xml_given;
1471 local_args_info.xml_given = 0;
1472 args_info->tag_given += local_args_info.tag_given;
1473 local_args_info.tag_given = 0;
1474 args_info->root_given += local_args_info.root_given;
1475 local_args_info.root_given = 0;
1476 args_info->trigger_given += local_args_info.trigger_given;
1477 local_args_info.trigger_given = 0;
1478
1479 if (check_required)
1480 {
1481 error += cmdline_parser_required2 (args_info, argv[0], additional_error);
1482 }
1483
1484 cmdline_parser_release (&local_args_info);
1485
1486 if ( error )
1487 return (EXIT_FAILURE);
1488
1489 return 0;
1490
1491failure:
1492 free_list (runnumber_list, 1 );
1493 free_list (lbstart_list, 0 );
1494 free_list (lbend_list, 0 );
1495 free_list (xml_list, 1 );
1496 free_list (tag_list, 1 );
1497 free_list (root_list, 1 );
1498 free_list (trigger_list, 1 );
1499
1500 cmdline_parser_release (&local_args_info);
1501 return (EXIT_FAILURE);
1502}
static int update_multiple_arg_temp(struct generic_list **list, unsigned int *prev_given, const char *val, const char *possible_values[], const char *default_value, cmdline_parser_arg_type arg_type, const char *long_opt, char short_opt, const char *additional_error)
store information about a multiple option in a temporary list
Definition cmdline.cxx:875
static char * package_name
Definition cmdline.cxx:754
static void update_multiple_arg(void *field, char ***orig_field, unsigned int field_given, unsigned int prev_given, union generic_value *default_value, cmdline_parser_arg_type arg_type, struct generic_list *list)
updates a multiple option starting from the passed list
Definition cmdline.cxx:941
static void free_list(struct generic_list *list, short string_arg)
free the passed list (including possible string argument)
Definition cmdline.cxx:920
void cmdline_parser_print_version(void)
Print the version.
Definition cmdline.cxx:220
void cmdline_parser_init(struct gengetopt_args_info *args_info)
Initializes the passed gengetopt_args_info structure's fields (also set default values for options th...
Definition cmdline.cxx:252
void cmdline_parser_print_help(void)
Print the help.
Definition cmdline.cxx:243
static int cmdline_parser_required2(struct gengetopt_args_info *args_info, const char *prog_name, const char *additional_error)
Definition cmdline.cxx:721
static int update_arg(void *field, char **orig_field, unsigned int *field_given, unsigned int *prev_given, char *value, const char *possible_values[], const char *, cmdline_parser_arg_type arg_type, int check_ambiguity, int override, int no_free, int multiple_option, const char *long_opt, char short_opt, const char *additional_error)
updates an option
Definition cmdline.cxx:775
list long_options
Definition handi.py:42
Where the command line options are stored.
Definition cmdline.h:43

◆ cmdline_parser_params_create()

struct cmdline_parser_params * cmdline_parser_params_create ( void )

Allocates dynamically a cmdline_parser_params structure and initializes all its fields to their default values.

Returns
the created and initialized cmdline_parser_params structure

Definition at line 273 of file cmdline.cxx.

274{
276 (struct cmdline_parser_params *)malloc(sizeof(struct cmdline_parser_params));
278 return params;
279}
void cmdline_parser_params_init(struct cmdline_parser_params *params)
Initializes all the fields a cmdline_parser_params structure to their default values.
Definition cmdline.cxx:260

◆ cmdline_parser_params_init()

void cmdline_parser_params_init ( struct cmdline_parser_params * params)

Initializes all the fields a cmdline_parser_params structure to their default values.

Parameters
paramsthe structure to initialize

Definition at line 260 of file cmdline.cxx.

261{
262 if (params)
263 {
264 params->override = 0;
265 params->initialize = 1;
266 params->check_required = 1;
267 params->check_ambiguity = 0;
268 params->print_errors = 1;
269 }
270}

◆ cmdline_parser_print_help()

void cmdline_parser_print_help ( void )

Print the help.

Definition at line 243 of file cmdline.cxx.

244{
245 int i = 0;
247 while (gengetopt_args_info_help[i])
248 printf("%s\n", gengetopt_args_info_help[i++]);
249}
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition cmdline.cxx:33
static void print_help_common(void)
Definition cmdline.cxx:227

◆ cmdline_parser_print_version()

void cmdline_parser_print_version ( void )

Print the version.

Definition at line 220 of file cmdline.cxx.

221{
222 printf ("%s %s\n",
225}
#define CMDLINE_PARSER_VERSION
the program version
Definition cmdline.h:38
#define CMDLINE_PARSER_PACKAGE_NAME
the complete program name (used for help and version)
Definition cmdline.h:33

◆ cmdline_parser_release()

void cmdline_parser_release ( struct gengetopt_args_info * args_info)
static

Definition at line 359 of file cmdline.cxx.

360{
361
362 free_multiple_string_field (args_info->runnumber_given, &(args_info->runnumber_arg), &(args_info->runnumber_orig));
363 free_multiple_field (args_info->lbstart_given, (void *)(args_info->lbstart_arg), &(args_info->lbstart_orig));
364 args_info->lbstart_arg = 0;
365 free_multiple_field (args_info->lbend_given, (void *)(args_info->lbend_arg), &(args_info->lbend_orig));
366 args_info->lbend_arg = 0;
367 free_multiple_string_field (args_info->xml_given, &(args_info->xml_arg), &(args_info->xml_orig));
368 free_string_field (&(args_info->xml_blacklist_arg));
370 free_multiple_string_field (args_info->tag_given, &(args_info->tag_arg), &(args_info->tag_orig));
371 free_multiple_string_field (args_info->root_given, &(args_info->root_arg), &(args_info->root_orig));
372 free_string_field (&(args_info->tree_arg));
373 free_string_field (&(args_info->tree_orig));
374 free_string_field (&(args_info->d3pd_dir_arg));
375 free_string_field (&(args_info->d3pd_dir_orig));
376 free_string_field (&(args_info->lumitag_arg));
377 free_string_field (&(args_info->lumitag_orig));
378 free_string_field (&(args_info->lumichannel_orig));
379 free_string_field (&(args_info->lumimethod_arg));
380 free_string_field (&(args_info->lumimethod_orig));
381 free_multiple_string_field (args_info->trigger_given, &(args_info->trigger_arg), &(args_info->trigger_orig));
382 free_string_field (&(args_info->livetrigger_arg));
383 free_string_field (&(args_info->livetrigger_orig));
384 free_string_field (&(args_info->lartag_arg));
385 free_string_field (&(args_info->lartag_orig));
386 free_string_field (&(args_info->beamspottag_arg));
387 free_string_field (&(args_info->beamspottag_orig));
388 free_string_field (&(args_info->scale_lumi_orig));
389 free_string_field (&(args_info->xml_out_arg));
390 free_string_field (&(args_info->xml_out_orig));
391
392
393
394 clear_given (args_info);
395}
static void free_multiple_string_field(unsigned int len, char ***arg, char ***orig)
Definition cmdline.cxx:340
static void free_string_field(char **s)
Definition cmdline.cxx:282
static void free_multiple_field(unsigned int len, void *arg, char ***orig)
The passed arg parameter is NOT set to 0 from this function.
Definition cmdline.cxx:324

◆ cmdline_parser_required()

int cmdline_parser_required ( struct gengetopt_args_info * args_info,
const char * prog_name )

Checks that all the required options were specified.

Parameters
args_infothe structure to check
prog_namethe name of the program that will be used to print possible errors
Returns

Definition at line 704 of file cmdline.cxx.

705{
706 int result = EXIT_SUCCESS;
707
708 if (cmdline_parser_required2(args_info, prog_name, 0) > 0)
709 result = EXIT_FAILURE;
710
711 if (result == EXIT_FAILURE)
712 {
713 cmdline_parser_free (args_info);
714 exit (EXIT_FAILURE);
715 }
716
717 return result;
718}

◆ cmdline_parser_required2()

int cmdline_parser_required2 ( struct gengetopt_args_info * args_info,
const char * prog_name,
const char * additional_error )
static

Definition at line 721 of file cmdline.cxx.

722{
723 int error = 0;
724
725 /* checks for required options */
726 if (check_multiple_option_occurrences(prog_name, args_info->runnumber_given, args_info->runnumber_min, args_info->runnumber_max, "'--runnumber' ('-r')"))
727 error = 1;
728
729 if (check_multiple_option_occurrences(prog_name, args_info->lbstart_given, args_info->lbstart_min, args_info->lbstart_max, "'--lbstart'"))
730 error = 1;
731
732 if (check_multiple_option_occurrences(prog_name, args_info->lbend_given, args_info->lbend_min, args_info->lbend_max, "'--lbend'"))
733 error = 1;
734
735 if (check_multiple_option_occurrences(prog_name, args_info->xml_given, args_info->xml_min, args_info->xml_max, "'--xml' ('-x')"))
736 error = 1;
737
738 if (check_multiple_option_occurrences(prog_name, args_info->tag_given, args_info->tag_min, args_info->tag_max, "'--tag' ('-T')"))
739 error = 1;
740
741 if (check_multiple_option_occurrences(prog_name, args_info->root_given, args_info->root_min, args_info->root_max, "'--root'"))
742 error = 1;
743
744 if (check_multiple_option_occurrences(prog_name, args_info->trigger_given, args_info->trigger_min, args_info->trigger_max, "'--trigger' ('-t')"))
745 error = 1;
746
747
748 /* checks for dependences among options */
749
750 return error;
751}
static int check_multiple_option_occurrences(const char *prog_name, unsigned int option_given, unsigned int min, unsigned int max, const char *option_desc)
Definition cmdline.cxx:607
unsigned int runnumber_min
Run number, range, or comma separated list, e.g.
Definition cmdline.h:48
unsigned int lbstart_min
LumiBlock number begin's minimum occurreces.
Definition cmdline.h:53
unsigned int xml_max
Input XML file name's maximum occurreces.
Definition cmdline.h:64
unsigned int lbend_min
LumiBlock number end's minimum occurreces.
Definition cmdline.h:58
unsigned int lbend_max
LumiBlock number end's maximum occurreces.
Definition cmdline.h:59
unsigned int lbstart_max
LumiBlock number begin's maximum occurreces.
Definition cmdline.h:54
unsigned int runnumber_max
Run number, range, or comma separated list, e.g.
Definition cmdline.h:49
unsigned int tag_max
Input TAG file name's maximum occurreces.
Definition cmdline.h:72
unsigned int trigger_min
Trigger chain name used for prescale calculation's minimum occurreces.
Definition cmdline.h:98
unsigned int tag_min
Input TAG file name's minimum occurreces.
Definition cmdline.h:71
unsigned int xml_min
Input XML file name's minimum occurreces.
Definition cmdline.h:63
unsigned int trigger_max
Trigger chain name used for prescale calculation's maximum occurreces.
Definition cmdline.h:99
unsigned int root_min
Input ROOT file name's minimum occurreces.
Definition cmdline.h:76
unsigned int root_max
Input ROOT file name's maximum occurreces.
Definition cmdline.h:77

◆ free_list()

void free_list ( struct generic_list * list,
short string_arg )
static

free the passed list (including possible string argument)

Definition at line 920 of file cmdline.cxx.

921{
922 if (list) {
923 struct generic_list *tmp;
924 while (list)
925 {
926 tmp = list;
927 if (string_arg && list->arg.string_arg)
928 free (list->arg.string_arg);
929 if (list->orig)
930 free (list->orig);
931 list = list->next;
932 free (tmp);
933 }
934 }
935}

◆ free_multiple_field()

void free_multiple_field ( unsigned int len,
void * arg,
char *** orig )
static

The passed arg parameter is NOT set to 0 from this function.

Definition at line 324 of file cmdline.cxx.

325{
326 unsigned int i;
327 if (arg) {
328 for (i = 0; i < len; ++i)
329 {
330 free_string_field(&((*orig)[i]));
331 }
332
333 free (arg);
334 free (*orig);
335 *orig = 0;
336 }
337}

◆ free_multiple_string_field()

void free_multiple_string_field ( unsigned int len,
char *** arg,
char *** orig )
static

Definition at line 340 of file cmdline.cxx.

341{
342 unsigned int i;
343 if (*arg) {
344 for (i = 0; i < len; ++i)
345 {
346 free_string_field(&((*arg)[i]));
347 free_string_field(&((*orig)[i]));
348 }
349 free_string_field(&((*arg)[0])); /* free default string */
350
351 free (*arg);
352 *arg = 0;
353 free (*orig);
354 *orig = 0;
355 }
356}

◆ free_string_field()

void free_string_field ( char ** s)
static

Definition at line 282 of file cmdline.cxx.

283{
284 if (*s)
285 {
286 free (*s);
287 *s = 0;
288 }
289}

◆ gengetopt_strdup()

char * gengetopt_strdup ( const char * s)
static

replacement of strdup, which is not standard

Definition at line 509 of file cmdline.cxx.

510{
511 char *result = 0;
512 if (!s)
513 return result;
514
515 result = (char*)malloc(strlen(s) + 1);
516 if (result == (char*)0)
517 return (char*)0;
518 strcpy(result, s);
519 return result;
520}

◆ get_multiple_arg_token()

char * get_multiple_arg_token ( const char * arg)
static

Definition at line 523 of file cmdline.cxx.

524{
525 const char *tok;
526 char *ret;
527 size_t len, num_of_escape, i, j;
528
529 if (!arg)
530 return 0;
531
532 tok = strchr (arg, ',');
533 num_of_escape = 0;
534
535 /* make sure it is not escaped */
536 while (tok)
537 {
538 if (*(tok-1) == '\\')
539 {
540 /* find the next one */
541 tok = strchr (tok+1, ',');
542 ++num_of_escape;
543 }
544 else
545 break;
546 }
547
548 if (tok)
549 len = (size_t)(tok - arg + 1);
550 else
551 len = strlen (arg) + 1;
552
553 len -= num_of_escape;
554
555 ret = (char *) malloc (len);
556 if (ret){
557
558 i = 0;
559 j = 0;
560 while (arg[i] && (j < len-1))
561 {
562 if (arg[i] == '\\' &&
563 arg[ i + 1 ] &&
564 arg[ i + 1 ] == ',')
565 ++i;
566
567 ret[j++] = arg[i++];
568 }
569
570 ret[len-1] = '\0';
571 }
572 return ret;
573}

◆ get_multiple_arg_token_next()

const char * get_multiple_arg_token_next ( const char * arg)
static

Definition at line 576 of file cmdline.cxx.

577{
578 const char *tok;
579
580 if (!arg)
581 return 0;
582
583 tok = strchr (arg, ',');
584
585 /* make sure it is not escaped */
586 while (tok)
587 {
588 if (*(tok-1) == '\\')
589 {
590 /* find the next one */
591 tok = strchr (tok+1, ',');
592 }
593 else
594 break;
595 }
596
597 if (! tok || strlen(tok) == 1)
598 return 0;
599
600 return tok+1;
601}

◆ init_args_info()

void init_args_info ( struct gengetopt_args_info * args_info)
static

Definition at line 171 of file cmdline.cxx.

172{
173
174
175 args_info->help_help = gengetopt_args_info_help[0] ;
176 args_info->version_help = gengetopt_args_info_help[1] ;
178 args_info->runnumber_min = 0;
179 args_info->runnumber_max = 0;
180 args_info->lbstart_help = gengetopt_args_info_help[4] ;
181 args_info->lbstart_min = 0;
182 args_info->lbstart_max = 0;
183 args_info->lbend_help = gengetopt_args_info_help[5] ;
184 args_info->lbend_min = 0;
185 args_info->lbend_max = 0;
186 args_info->xml_help = gengetopt_args_info_help[6] ;
187 args_info->xml_min = 0;
188 args_info->xml_max = 0;
190 args_info->tag_help = gengetopt_args_info_help[8] ;
191 args_info->tag_min = 0;
192 args_info->tag_max = 0;
193 args_info->root_help = gengetopt_args_info_help[9] ;
194 args_info->root_min = 0;
195 args_info->root_max = 0;
196 args_info->tree_help = gengetopt_args_info_help[10] ;
197 args_info->d3pd_dir_help = gengetopt_args_info_help[11] ;
198 args_info->lumitag_help = gengetopt_args_info_help[13] ;
199 args_info->online_help = gengetopt_args_info_help[14] ;
202 args_info->trigger_help = gengetopt_args_info_help[17] ;
203 args_info->trigger_min = 0;
204 args_info->trigger_max = 0;
206 args_info->lar_help = gengetopt_args_info_help[19] ;
207 args_info->lartag_help = gengetopt_args_info_help[20] ;
208 args_info->beamspot_help = gengetopt_args_info_help[21] ;
211 args_info->xml_out_help = gengetopt_args_info_help[25] ;
213 args_info->plots_help = gengetopt_args_info_help[27] ;
214 args_info->verbose_help = gengetopt_args_info_help[28] ;
215 args_info->quiet_help = gengetopt_args_info_help[29] ;
216
217}
const char * xml_collisionlist_help
Output XML file of lists of collision candidates help description.
Definition cmdline.h:121
const char * lumitag_help
Offline luminosity database tag help description.
Definition cmdline.h:87
const char * lartag_help
LAr noise burst database tag help description.
Definition cmdline.h:108
const char * plots_help
Create some plots on demand help description.
Definition cmdline.h:123
const char * verbose_help
Verbose output level help description.
Definition cmdline.h:125
const char * lumichannel_help
Luminosity estimate method by value help description.
Definition cmdline.h:92
const char * tree_help
Name of TTree in input ROOT file to which Lumi string is attached help description.
Definition cmdline.h:81
const char * lumimethod_help
Luminosity estimate method by string help description.
Definition cmdline.h:95
const char * runnumber_help
Run number, range, or comma separated list, e.g.
Definition cmdline.h:50
const char * lbstart_help
LumiBlock number begin help description.
Definition cmdline.h:55
const char * beamspot_help
Require online beamspot valid in trigger livefraction help description.
Definition cmdline.h:110
const char * root_help
Input ROOT file name help description.
Definition cmdline.h:78
const char * d3pd_dir_help
Name of TDirectory in input ROOT file where Lumi string is stored help description.
Definition cmdline.h:84
const char * scale_lumi_help
Scale luminosity with a constant value help description.
Definition cmdline.h:116
const char * lbend_help
LumiBlock number end help description.
Definition cmdline.h:60
const char * beamspottag_help
Online beamspot database tag help description.
Definition cmdline.h:113
const char * quiet_help
Quiet output level help description.
Definition cmdline.h:127
const char * trigger_help
Trigger chain name used for prescale calculation help description.
Definition cmdline.h:100
const char * lar_help
Calculate LAr defect fraction help description.
Definition cmdline.h:105
const char * online_help
Use online luminosity estimates instead of offline database help description.
Definition cmdline.h:89
const char * xml_help
Input XML file name help description.
Definition cmdline.h:65
const char * version_help
Print version and exit help description.
Definition cmdline.h:45
const char * xml_blacklist_help
Input XML file of blacklist help description.
Definition cmdline.h:68
const char * tag_help
Input TAG file name help description.
Definition cmdline.h:73
const char * livetrigger_help
L1 Trigger used for livetime calculation help description.
Definition cmdline.h:103
const char * xml_out_help
Output XML file name help description.
Definition cmdline.h:119
const char * help_help
Print help and exit help description.
Definition cmdline.h:44

◆ print_help_common()

void print_help_common ( void )
static

Definition at line 227 of file cmdline.cxx.

227 {
229
230 if (strlen(gengetopt_args_info_purpose) > 0)
231 printf("\n%s\n", gengetopt_args_info_purpose);
232
233 if (strlen(gengetopt_args_info_usage) > 0)
234 printf("\n%s\n", gengetopt_args_info_usage);
235
236 printf("\n");
237
238 if (strlen(gengetopt_args_info_description) > 0)
239 printf("%s\n\n", gengetopt_args_info_description);
240}
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition cmdline.cxx:27
const char * gengetopt_args_info_usage
the usage string of the program
Definition cmdline.cxx:29
const char * gengetopt_args_info_description
Definition cmdline.cxx:31

◆ update_arg()

int update_arg ( void * field,
char ** orig_field,
unsigned int * field_given,
unsigned int * prev_given,
char * value,
const char * possible_values[],
const char * ,
cmdline_parser_arg_type arg_type,
int check_ambiguity,
int override,
int no_free,
int multiple_option,
const char * long_opt,
char short_opt,
const char * additional_error )
static

updates an option

Parameters
fieldthe generic pointer to the field to update
orig_fieldthe pointer to the orig field
field_giventhe pointer to the number of occurrence of this option
prev_giventhe pointer to the number of occurrence already seen
valuethe argument for this option (if null no arg was specified)
possible_valuesthe possible values for this option (if specified)
default_valuethe default value (in case the option only accepts fixed values)
arg_typethe type of this option
check_ambiguity
See also
cmdline_parser_params.check_ambiguity
Parameters
override
See also
cmdline_parser_params.override
Parameters
no_freewhether to free a possible previous value
multiple_optionwhether this is a multiple option
long_optthe corresponding long option
short_optthe corresponding short option (or '-' if none)
additional_errorpossible further error specification

Definition at line 775 of file cmdline.cxx.

784{
785 char *stop_char = 0;
786 const char *val = value;
787 int found;
788 char **string_field;
789
790 stop_char = 0;
791 found = 0;
792
793 if (!multiple_option && field_given && prev_given && (*prev_given || (check_ambiguity && *field_given)))
794 {
795 if (short_opt != '-')
796 fprintf (stderr, "%s: `--%s' (`-%c') option given more than once%s\n",
797 package_name, long_opt, short_opt,
798 (additional_error ? additional_error : ""));
799 else
800 fprintf (stderr, "%s: `--%s' option given more than once%s\n",
801 package_name, long_opt,
802 (additional_error ? additional_error : ""));
803 return 1; /* failure */
804 }
805
806 if (field_given && *field_given && ! override)
807 return 0;
808 if (prev_given)
809 (*prev_given)++;
810 if (field_given)
811 (*field_given)++;
812 if (possible_values)
813 val = possible_values[found];
814
815 switch(arg_type) {
816 case ARG_FLAG:
817 *((int *)field) = !*((int *)field);
818 break;
819 case ARG_INT:
820 if (val) *((int *)field) = strtol (val, &stop_char, 0);
821 break;
822 case ARG_DOUBLE:
823 if (val) *((double *)field) = strtod (val, &stop_char);
824 break;
825 case ARG_STRING:
826 if (val) {
827 string_field = (char **)field;
828 if (!no_free && *string_field)
829 free (*string_field); /* free previous string */
830 *string_field = gengetopt_strdup (val);
831 }
832 break;
833 default:
834 break;
835 };
836
837 /* check numeric conversion */
838 switch(arg_type) {
839 case ARG_INT:
840 case ARG_DOUBLE:
841 if (val && !(stop_char && *stop_char == '\0')) {
842 fprintf(stderr, "%s: invalid numeric value: %s\n", package_name, val);
843 return 1; /* failure */
844 }
845 break;
846 default:
847 ;
848 };
849
850 /* store the original value */
851 switch(arg_type) {
852 case ARG_NO:
853 case ARG_FLAG:
854 break;
855 default:
856 if (value && orig_field) {
857 if (no_free) {
858 *orig_field = value;
859 } else {
860 if (*orig_field)
861 free (*orig_field); /* free previous string */
862 *orig_field = gengetopt_strdup (value);
863 }
864 }
865 };
866
867 return 0; /* OK */
868}

◆ update_multiple_arg()

void update_multiple_arg ( void * field,
char *** orig_field,
unsigned int field_given,
unsigned int prev_given,
union generic_value * default_value,
cmdline_parser_arg_type arg_type,
struct generic_list * list )
static

updates a multiple option starting from the passed list

Definition at line 941 of file cmdline.cxx.

945{
946 int i;
947 struct generic_list *tmp;
948
949 if (prev_given && list) {
950 *orig_field = (char **) realloc (*orig_field, (field_given + prev_given) * sizeof (char *));
951
952 switch(arg_type) {
953 case ARG_INT:
954 *((int **)field) = (int *)realloc (*((int **)field), (field_given + prev_given) * sizeof (int)); break;
955 case ARG_DOUBLE:
956 *((double **)field) = (double *)realloc (*((double **)field), (field_given + prev_given) * sizeof (double)); break;
957 case ARG_STRING:
958 *((char ***)field) = (char **)realloc (*((char ***)field), (field_given + prev_given) * sizeof (char *)); break;
959 default:
960 break;
961 };
962
963 for (i = (prev_given - 1); i >= 0; --i)
964 {
965 tmp = list;
966
967 switch(arg_type) {
968 case ARG_INT:
969 (*((int **)field))[i + field_given] = tmp->arg.int_arg; break;
970 case ARG_DOUBLE:
971 (*((double **)field))[i + field_given] = tmp->arg.double_arg; break;
972 case ARG_STRING:
973 (*((char ***)field))[i + field_given] = tmp->arg.string_arg; break;
974 default:
975 break;
976 }
977 (*orig_field) [i + field_given] = list->orig;
978 list = list->next;
979 free (tmp);
980 }
981 } else { /* set the default value */
982 if (default_value && ! field_given) {
983 switch(arg_type) {
984 case ARG_INT:
985 if (! *((int **)field)) {
986 int* pi = (int *)malloc (sizeof (int));
987 if (pi){
988 *((int **)field) = pi;
989 (*((int **)field))[0] = default_value->int_arg;
990 }
991 }
992 break;
993 case ARG_DOUBLE:
994 if (! *((double **)field)) {
995 double * pd = (double *)malloc (sizeof (double));
996 if (pd){
997 *((double **)field) = pd;
998 (*((double **)field))[0] = default_value->double_arg;
999 }
1000 }
1001 break;
1002 case ARG_STRING:
1003 if (! *((char ***)field)) {
1004 char ** pc = (char **)malloc (sizeof (char *));
1005 if (pc){
1006 *((char ***)field) = pc;
1007 (*((char ***)field))[0] = gengetopt_strdup(default_value->string_arg);
1008 }
1009 }
1010 break;
1011 default: break;
1012 }
1013 if (!(*orig_field)) {
1014 char ** pc = (char **)malloc (sizeof (char *));
1015 if (pc){
1016 *orig_field = pc;
1017 (*orig_field)[0] = 0;
1018 }
1019 }
1020 }
1021 }
1022}
#define pi
double double_arg
Definition cmdline.cxx:294

◆ update_multiple_arg_temp()

int update_multiple_arg_temp ( struct generic_list ** list,
unsigned int * prev_given,
const char * val,
const char * possible_values[],
const char * default_value,
cmdline_parser_arg_type arg_type,
const char * long_opt,
char short_opt,
const char * additional_error )
static

store information about a multiple option in a temporary list

Parameters
listwhere to (temporarily) store multiple options

Definition at line 875 of file cmdline.cxx.

881{
882 /* store single arguments */
883 char *multi_token;
884 const char *multi_next;
885
886 if (arg_type == ARG_NO) {
887 (*prev_given)++;
888 return 0; /* OK */
889 }
890
891 multi_token = get_multiple_arg_token(val);
892 multi_next = get_multiple_arg_token_next (val);
893
894 while (1)
895 {
896 add_node (list);
897 if (update_arg((void *)&((*list)->arg), &((*list)->orig), 0,
898 prev_given, multi_token, possible_values, default_value,
899 arg_type, 0, 1, 1, 1, long_opt, short_opt, additional_error)) {
900 if (multi_token) free(multi_token);
901 return 1; /* failure */
902 }
903
904 if (multi_next)
905 {
906 multi_token = get_multiple_arg_token(multi_next);
907 multi_next = get_multiple_arg_token_next (multi_next);
908 }
909 else
910 break;
911 }
912
913 return 0; /* OK */
914}
static char * get_multiple_arg_token(const char *arg)
Definition cmdline.cxx:523
static void add_node(struct generic_list **list)
add a node at the head of the list
Definition cmdline.cxx:310
static const char * get_multiple_arg_token_next(const char *arg)
Definition cmdline.cxx:576

◆ write_into_file()

void write_into_file ( FILE * outfile,
const char * opt,
const char * arg,
const char * [] )
static

Definition at line 399 of file cmdline.cxx.

400{
401 if (arg) {
402 fprintf(outfile, "%s=\"%s\"\n", opt, arg);
403 } else {
404 fprintf(outfile, "%s\n", opt);
405 }
406}

◆ write_multiple_into_file()

void write_multiple_into_file ( FILE * outfile,
int len,
const char * opt,
char ** arg,
const char * values[] )
static

Definition at line 409 of file cmdline.cxx.

410{
411 int i;
412
413 for (i = 0; i < len; ++i)
414 write_into_file(outfile, opt, (arg ? arg[i] : 0), values);
415}

Variable Documentation

◆ ATLAS_NO_CHECK_FILE_THREAD_SAFETY

ATLAS_NO_CHECK_FILE_THREAD_SAFETY

Definition at line 12 of file cmdline.cxx.

◆ gengetopt_args_info_description

const char* gengetopt_args_info_description = ""

Definition at line 31 of file cmdline.cxx.

◆ gengetopt_args_info_help

const char* gengetopt_args_info_help[]

all the lines making the help output

Definition at line 33 of file cmdline.cxx.

33 {
34 " -h, --help Print help and exit",
35 " --version Print version and exit",
36 "\nFlags to specify data sample:",
37 " -r, --runnumber=STRING Run number, range, or comma separated list, e.g. \n 177986-178109,179710",
38 " --lbstart=INT LumiBlock number begin",
39 " --lbend=INT LumiBlock number end",
40 " -x, --xml=STRING Input XML file name",
41 " --xml_blacklist=STRING Input XML file of blacklist",
42 " -T, --tag=STRING Input TAG file name",
43 " --root=STRING Input ROOT file name",
44 " --tree=STRING Name of TTree in input ROOT file to which Lumi \n string is attached",
45 " --d3pd_dir=STRING Name of TDirectory in input ROOT file where Lumi \n string is stored",
46 "\nFlags to control luminosity calculation:",
47 " --lumitag=STRING Offline luminosity database tag \n (default=`OflLumi-8TeV-002')",
48 " --online Use online luminosity estimates instead of \n offline database (default=off)",
49 " --lumichannel=INT Luminosity estimate method by value \n (default=`0')",
50 " --lumimethod=STRING Luminosity estimate method by string \n (default=`ATLAS_PREFERRED')",
51 " -t, --trigger=STRING Trigger chain name used for prescale calculation",
52 " --livetrigger=STRING L1 Trigger used for livetime calculation \n (default=`L1_EM30')",
53 " --lar Calculate LAr defect fraction (default=off)",
54 " --lartag=STRING LAr noise burst database tag \n (default=`LARBadChannelsOflEventVeto-UPD4-01')",
55 " --beamspot Require online beamspot valid in trigger \n livefraction (default=off)",
56 " --beamspottag=STRING Online beamspot database tag \n (default=`IndetBeamposOnl-HLT-UPD1-001-00')",
57 " --scale_lumi=DOUBLE Scale luminosity with a constant value \n (default=`1.0')",
58 "\nFlags to control output:",
59 " --xml_out=STRING Output XML file name",
60 " --xml_collisionlist Output XML file of lists of collision candidates \n (default=off)",
61 " --plots Create some plots on demand (default=off)",
62 " -V, --verbose Verbose output level (default=off)",
63 " --quiet Quiet output level (default=off)",
64 0
65};

◆ gengetopt_args_info_purpose

const char* gengetopt_args_info_purpose = ""

the purpose string of the program

Definition at line 27 of file cmdline.cxx.

◆ gengetopt_args_info_usage

const char* gengetopt_args_info_usage = "Usage: iLumiCalc.exe [OPTIONS]..."

the usage string of the program

Definition at line 29 of file cmdline.cxx.

◆ package_name

char* package_name = 0
static

Definition at line 754 of file cmdline.cxx.