ATLAS Offline Software
cmdline.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
12 #ifndef CMDLINE_H
13 #define CMDLINE_H
14 
15 /* If we use autoconf. */
16 #ifdef HAVE_CONFIG_H
17 #include "config.h"
18 #endif
19 
20 #include <stdio.h> /* for FILE */
21 
22 #ifdef __cplusplus
23 extern "C" {
24 #endif /* __cplusplus */
25 
26 #ifndef CMDLINE_PARSER_PACKAGE
27 
28 #define CMDLINE_PARSER_PACKAGE "iLumiCalc.exe"
29 #endif
30 
31 #ifndef CMDLINE_PARSER_PACKAGE_NAME
32 
33 #define CMDLINE_PARSER_PACKAGE_NAME "iLumiCalc.exe"
34 #endif
35 
36 #ifndef CMDLINE_PARSER_VERSION
37 
38 #define CMDLINE_PARSER_VERSION "00-00-00"
39 #endif
40 
43 {
44  const char *help_help;
45  const char *version_help;
46  char ** runnumber_arg;
47  char ** runnumber_orig;
48  unsigned int runnumber_min;
49  unsigned int runnumber_max;
50  const char *runnumber_help;
51  int* lbstart_arg;
52  char ** lbstart_orig;
53  unsigned int lbstart_min;
54  unsigned int lbstart_max;
55  const char *lbstart_help;
56  int* lbend_arg;
57  char ** lbend_orig;
58  unsigned int lbend_min;
59  unsigned int lbend_max;
60  const char *lbend_help;
61  char ** xml_arg;
62  char ** xml_orig;
63  unsigned int xml_min;
64  unsigned int xml_max;
65  const char *xml_help;
68  const char *xml_blacklist_help;
69  char ** tag_arg;
70  char ** tag_orig;
71  unsigned int tag_min;
72  unsigned int tag_max;
73  const char *tag_help;
74  char ** root_arg;
75  char ** root_orig;
76  unsigned int root_min;
77  unsigned int root_max;
78  const char *root_help;
79  char * tree_arg;
80  char * tree_orig;
81  const char *tree_help;
82  char * d3pd_dir_arg;
83  char * d3pd_dir_orig;
84  const char *d3pd_dir_help;
85  char * lumitag_arg;
86  char * lumitag_orig;
87  const char *lumitag_help;
89  const char *online_help;
92  const char *lumichannel_help;
93  char * lumimethod_arg;
94  char * lumimethod_orig;
95  const char *lumimethod_help;
96  char ** trigger_arg;
97  char ** trigger_orig;
98  unsigned int trigger_min;
99  unsigned int trigger_max;
100  const char *trigger_help;
103  const char *livetrigger_help;
104  int lar_flag;
105  const char *lar_help;
106  char * lartag_arg;
107  char * lartag_orig;
108  const char *lartag_help;
110  const char *beamspot_help;
113  const char *beamspottag_help;
114  double scale_lumi_arg;
116  const char *scale_lumi_help;
117  char * xml_out_arg;
118  char * xml_out_orig;
119  const char *xml_out_help;
123  const char *plots_help;
125  const char *verbose_help;
127  const char *quiet_help;
129  unsigned int help_given ;
130  unsigned int version_given ;
131  unsigned int runnumber_given ;
132  unsigned int lbstart_given ;
133  unsigned int lbend_given ;
134  unsigned int xml_given ;
135  unsigned int xml_blacklist_given ;
136  unsigned int tag_given ;
137  unsigned int root_given ;
138  unsigned int tree_given ;
139  unsigned int d3pd_dir_given ;
140  unsigned int lumitag_given ;
141  unsigned int online_given ;
142  unsigned int lumichannel_given ;
143  unsigned int lumimethod_given ;
144  unsigned int trigger_given ;
145  unsigned int livetrigger_given ;
146  unsigned int lar_given ;
147  unsigned int lartag_given ;
148  unsigned int beamspot_given ;
149  unsigned int beamspottag_given ;
150  unsigned int scale_lumi_given ;
151  unsigned int xml_out_given ;
152  unsigned int xml_collisionlist_given ;
153  unsigned int plots_given ;
154  unsigned int verbose_given ;
155  unsigned int quiet_given ;
157 } ;
158 
161 {
162  int override;
167 } ;
168 
170 extern const char *gengetopt_args_info_purpose;
172 extern const char *gengetopt_args_info_usage;
174 extern const char *gengetopt_args_info_help[];
175 
183 int cmdline_parser (int argc, char **argv,
184  struct gengetopt_args_info *args_info);
185 
197 int cmdline_parser2 (int argc, char **argv,
198  struct gengetopt_args_info *args_info,
199  int override, int initialize, int check_required);
200 
209 int cmdline_parser_ext (int argc, char **argv,
210  struct gengetopt_args_info *args_info,
211  struct cmdline_parser_params *params);
212 
219 int cmdline_parser_dump(FILE *outfile,
220  struct gengetopt_args_info *args_info);
221 
229 int cmdline_parser_file_save(const char *filename,
230  struct gengetopt_args_info *args_info);
231 
235 void cmdline_parser_print_help(void);
240 
247 
254 
260 void cmdline_parser_init (struct gengetopt_args_info *args_info);
266 void cmdline_parser_free (struct gengetopt_args_info *args_info);
267 
275 int cmdline_parser_required (struct gengetopt_args_info *args_info,
276  const char *prog_name);
277 
278 
279 #ifdef __cplusplus
280 }
281 #endif /* __cplusplus */
282 #endif /* CMDLINE_H */
gengetopt_args_info::lartag_arg
char * lartag_arg
LAr noise burst database tag (default='LARBadChannelsOflEventVeto-UPD4-01').
Definition: cmdline.h:106
gengetopt_args_info::help_given
unsigned int help_given
Whether help was given.
Definition: cmdline.h:129
gengetopt_args_info::d3pd_dir_orig
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
gengetopt_args_info::xml_out_orig
char * xml_out_orig
Output XML file name original value given at command line.
Definition: cmdline.h:118
gengetopt_args_info::tag_arg
char ** tag_arg
Input TAG file name.
Definition: cmdline.h:69
gengetopt_args_info::tag_given
unsigned int tag_given
Whether tag was given.
Definition: cmdline.h:136
gengetopt_args_info::online_flag
int online_flag
Use online luminosity estimates instead of offline database (default=off).
Definition: cmdline.h:88
gengetopt_args_info::lumimethod_help
const char * lumimethod_help
Luminosity estimate method by string help description.
Definition: cmdline.h:95
gengetopt_args_info::beamspot_given
unsigned int beamspot_given
Whether beamspot was given.
Definition: cmdline.h:148
gengetopt_args_info::lbend_arg
int * lbend_arg
LumiBlock number end.
Definition: cmdline.h:56
gengetopt_args_info::beamspottag_help
const char * beamspottag_help
Online beamspot database tag help description.
Definition: cmdline.h:113
gengetopt_args_info_purpose
const char * gengetopt_args_info_purpose
the purpose string of the program
Definition: cmdline.cxx:27
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 defau...
Definition: cmdline.cxx:273
gengetopt_args_info::lumitag_given
unsigned int lumitag_given
Whether lumitag was given.
Definition: cmdline.h:140
gengetopt_args_info::verbose_help
const char * verbose_help
Verbose output level help description.
Definition: cmdline.h:125
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.
Definition: cmdline.cxx:480
gengetopt_args_info::runnumber_min
unsigned int runnumber_min
Run number, range, or comma separated list, e.g.
Definition: cmdline.h:48
gengetopt_args_info::xml_blacklist_orig
char * xml_blacklist_orig
Input XML file of blacklist original value given at command line.
Definition: cmdline.h:67
gengetopt_args_info::verbose_flag
int verbose_flag
Verbose output level (default=off).
Definition: cmdline.h:124
gengetopt_args_info::quiet_flag
int quiet_flag
Quiet output level (default=off).
Definition: cmdline.h:126
gengetopt_args_info::trigger_given
unsigned int trigger_given
Whether trigger was given.
Definition: cmdline.h:144
gengetopt_args_info::scale_lumi_help
const char * scale_lumi_help
Scale luminosity with a constant value help description.
Definition: cmdline.h:116
gengetopt_args_info::tree_given
unsigned int tree_given
Whether tree was given.
Definition: cmdline.h:138
gengetopt_args_info::xml_blacklist_help
const char * xml_blacklist_help
Input XML file of blacklist help description.
Definition: cmdline.h:68
gengetopt_args_info::d3pd_dir_arg
char * d3pd_dir_arg
Name of TDirectory in input ROOT file where Lumi string is stored.
Definition: cmdline.h:82
gengetopt_args_info::xml_collisionlist_flag
int xml_collisionlist_flag
Output XML file of lists of collision candidates (default=off).
Definition: cmdline.h:120
initialize
void initialize()
Definition: run_EoverP.cxx:894
gengetopt_args_info::tree_help
const char * tree_help
Name of TTree in input ROOT file to which Lumi string is attached help description.
Definition: cmdline.h:81
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 th...
Definition: cmdline.cxx:252
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.
Definition: cmdline.cxx:416
gengetopt_args_info::lbstart_max
unsigned int lbstart_max
LumiBlock number begin's maximum occurreces.
Definition: cmdline.h:54
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 struc...
Definition: cmdline.cxx:500
gengetopt_args_info::root_max
unsigned int root_max
Input ROOT file name's maximum occurreces.
Definition: cmdline.h:77
cmdline_parser_print_help
void cmdline_parser_print_help(void)
Print the help.
Definition: cmdline.cxx:243
cmdline_parser
int cmdline_parser(int argc, char **argv, struct gengetopt_args_info *args_info)
The command line parser.
Definition: cmdline.cxx:656
gengetopt_args_info::lbstart_orig
char ** lbstart_orig
LumiBlock number begin original value given at command line.
Definition: cmdline.h:52
gengetopt_args_info::lumichannel_arg
int lumichannel_arg
Luminosity estimate method by value (default='0').
Definition: cmdline.h:90
gengetopt_args_info::beamspottag_orig
char * beamspottag_orig
Online beamspot database tag original value given at command line.
Definition: cmdline.h:112
gengetopt_args_info::lartag_given
unsigned int lartag_given
Whether lartag was given.
Definition: cmdline.h:147
gengetopt_args_info::lbstart_arg
int * lbstart_arg
LumiBlock number begin.
Definition: cmdline.h:51
gengetopt_args_info::tag_max
unsigned int tag_max
Input TAG file name's maximum occurreces.
Definition: cmdline.h:72
gengetopt_args_info::lumitag_orig
char * lumitag_orig
Offline luminosity database tag original value given at command line.
Definition: cmdline.h:86
gengetopt_args_info::lumimethod_arg
char * lumimethod_arg
Luminosity estimate method by string (default='ATLAS_PREFERRED').
Definition: cmdline.h:93
gengetopt_args_info::runnumber_orig
char ** runnumber_orig
Run number, range, or comma separated list, e.g.
Definition: cmdline.h:47
gengetopt_args_info::lbstart_help
const char * lbstart_help
LumiBlock number begin help description.
Definition: cmdline.h:55
gengetopt_args_info::xml_collisionlist_help
const char * xml_collisionlist_help
Output XML file of lists of collision candidates help description.
Definition: cmdline.h:121
gengetopt_args_info::trigger_arg
char ** trigger_arg
Trigger chain name used for prescale calculation.
Definition: cmdline.h:96
cmdline_parser_print_version
void cmdline_parser_print_version(void)
Print the version.
Definition: cmdline.cxx:220
gengetopt_args_info::scale_lumi_orig
char * scale_lumi_orig
Scale luminosity with a constant value original value given at command line.
Definition: cmdline.h:115
gengetopt_args_info::verbose_given
unsigned int verbose_given
Whether verbose was given.
Definition: cmdline.h:154
gengetopt_args_info::version_given
unsigned int version_given
Whether version was given.
Definition: cmdline.h:130
gengetopt_args_info::xml_arg
char ** xml_arg
Input XML file name.
Definition: cmdline.h:61
gengetopt_args_info::root_given
unsigned int root_given
Whether root was given.
Definition: cmdline.h:137
gengetopt_args_info::lumichannel_orig
char * lumichannel_orig
Luminosity estimate method by value original value given at command line.
Definition: cmdline.h:91
gengetopt_args_info::lumitag_help
const char * lumitag_help
Offline luminosity database tag help description.
Definition: cmdline.h:87
gengetopt_args_info::tree_orig
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
gengetopt_args_info::lbend_min
unsigned int lbend_min
LumiBlock number end's minimum occurreces.
Definition: cmdline.h:58
gengetopt_args_info::lartag_help
const char * lartag_help
LAr noise burst database tag help description.
Definition: cmdline.h:108
gengetopt_args_info::scale_lumi_arg
double scale_lumi_arg
Scale luminosity with a constant value (default='1.0').
Definition: cmdline.h:114
gengetopt_args_info::lbend_max
unsigned int lbend_max
LumiBlock number end's maximum occurreces.
Definition: cmdline.h:59
gengetopt_args_info::runnumber_given
unsigned int runnumber_given
Whether runnumber was given.
Definition: cmdline.h:131
gengetopt_args_info::beamspot_flag
int beamspot_flag
Require online beamspot valid in trigger livefraction (default=off).
Definition: cmdline.h:109
gengetopt_args_info::xml_blacklist_arg
char * xml_blacklist_arg
Input XML file of blacklist.
Definition: cmdline.h:66
gengetopt_args_info_help
const char * gengetopt_args_info_help[]
all the lines making the help output
Definition: cmdline.cxx:33
LArCellNtuple.argv
argv
Definition: LArCellNtuple.py:152
gengetopt_args_info::lartag_orig
char * lartag_orig
LAr noise burst database tag original value given at command line.
Definition: cmdline.h:107
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)
Definition: cmdline.cxx:662
gengetopt_args_info::lar_flag
int lar_flag
Calculate LAr defect fraction (default=off).
Definition: cmdline.h:104
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.
Definition: cmdline.cxx:260
gengetopt_args_info::lbstart_given
unsigned int lbstart_given
Whether lbstart was given.
Definition: cmdline.h:132
DQHistogramMergeRegExp.argc
argc
Definition: DQHistogramMergeRegExp.py:20
gengetopt_args_info::xml_orig
char ** xml_orig
Input XML file name original value given at command line.
Definition: cmdline.h:62
gengetopt_args_info::lar_help
const char * lar_help
Calculate LAr defect fraction help description.
Definition: cmdline.h:105
gengetopt_args_info::lumimethod_given
unsigned int lumimethod_given
Whether lumimethod was given.
Definition: cmdline.h:143
gengetopt_args_info::lbstart_min
unsigned int lbstart_min
LumiBlock number begin's minimum occurreces.
Definition: cmdline.h:53
cmdline_parser_params::check_ambiguity
int check_ambiguity
whether to check for options already specified in the option structure gengetopt_args_info (default 0...
Definition: cmdline.h:165
gengetopt_args_info::lumitag_arg
char * lumitag_arg
Offline luminosity database tag (default='OflLumi-8TeV-002').
Definition: cmdline.h:85
gengetopt_args_info::xml_min
unsigned int xml_min
Input XML file name's minimum occurreces.
Definition: cmdline.h:63
gengetopt_args_info::xml_blacklist_given
unsigned int xml_blacklist_given
Whether xml_blacklist was given.
Definition: cmdline.h:135
gengetopt_args_info::trigger_min
unsigned int trigger_min
Trigger chain name used for prescale calculation's minimum occurreces.
Definition: cmdline.h:98
gengetopt_args_info::plots_given
unsigned int plots_given
Whether plots was given.
Definition: cmdline.h:153
gengetopt_args_info::xml_collisionlist_given
unsigned int xml_collisionlist_given
Whether xml_collisionlist was given.
Definition: cmdline.h:152
gengetopt_args_info::runnumber_max
unsigned int runnumber_max
Run number, range, or comma separated list, e.g.
Definition: cmdline.h:49
gengetopt_args_info::xml_out_given
unsigned int xml_out_given
Whether xml_out was given.
Definition: cmdline.h:151
gengetopt_args_info::xml_out_arg
char * xml_out_arg
Output XML file name.
Definition: cmdline.h:117
gengetopt_args_info::tag_min
unsigned int tag_min
Input TAG file name's minimum occurreces.
Definition: cmdline.h:71
gengetopt_args_info::livetrigger_given
unsigned int livetrigger_given
Whether livetrigger was given.
Definition: cmdline.h:145
gengetopt_args_info::tag_help
const char * tag_help
Input TAG file name help description.
Definition: cmdline.h:73
gengetopt_args_info::lbend_orig
char ** lbend_orig
LumiBlock number end original value given at command line.
Definition: cmdline.h:57
gengetopt_args_info::tag_orig
char ** tag_orig
Input TAG file name original value given at command line.
Definition: cmdline.h:70
gengetopt_args_info::quiet_given
unsigned int quiet_given
Whether quiet was given.
Definition: cmdline.h:155
gengetopt_args_info::version_help
const char * version_help
Print version and exit help description.
Definition: cmdline.h:45
gengetopt_args_info::scale_lumi_given
unsigned int scale_lumi_given
Whether scale_lumi was given.
Definition: cmdline.h:150
gengetopt_args_info::beamspot_help
const char * beamspot_help
Require online beamspot valid in trigger livefraction help description.
Definition: cmdline.h:110
gengetopt_args_info::lumimethod_orig
char * lumimethod_orig
Luminosity estimate method by string original value given at command line.
Definition: cmdline.h:94
cmdline_parser_params::print_errors
int print_errors
whether getopt_long should print an error message for a bad option (default 1)
Definition: cmdline.h:166
gengetopt_args_info::xml_help
const char * xml_help
Input XML file name help description.
Definition: cmdline.h:65
gengetopt_args_info::livetrigger_orig
char * livetrigger_orig
L1 Trigger used for livetime calculation original value given at command line.
Definition: cmdline.h:102
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)
Definition: cmdline.cxx:678
gengetopt_args_info::d3pd_dir_given
unsigned int d3pd_dir_given
Whether d3pd_dir was given.
Definition: cmdline.h:139
gengetopt_args_info::root_help
const char * root_help
Input ROOT file name help description.
Definition: cmdline.h:78
gengetopt_args_info::lbend_given
unsigned int lbend_given
Whether lbend was given.
Definition: cmdline.h:133
gengetopt_args_info::beamspottag_arg
char * beamspottag_arg
Online beamspot database tag (default='IndetBeamposOnl-HLT-UPD1-001-00').
Definition: cmdline.h:111
gengetopt_args_info::online_given
unsigned int online_given
Whether online was given.
Definition: cmdline.h:141
gengetopt_args_info::root_min
unsigned int root_min
Input ROOT file name's minimum occurreces.
Definition: cmdline.h:76
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.
Definition: cmdline.cxx:701
gengetopt_args_info
Where the command line options are stored.
Definition: cmdline.h:43
CaloCellTimeCorrFiller.filename
filename
Definition: CaloCellTimeCorrFiller.py:24
gengetopt_args_info::xml_given
unsigned int xml_given
Whether xml was given.
Definition: cmdline.h:134
gengetopt_args_info::runnumber_arg
char ** runnumber_arg
Run number, range, or comma separated list, e.g.
Definition: cmdline.h:46
cmdline_parser_params
The additional parameters to pass to parser functions.
Definition: cmdline.h:161
gengetopt_args_info::livetrigger_help
const char * livetrigger_help
L1 Trigger used for livetime calculation help description.
Definition: cmdline.h:103
gengetopt_args_info::lar_given
unsigned int lar_given
Whether lar was given.
Definition: cmdline.h:146
gengetopt_args_info::help_help
const char * help_help
Print help and exit help description.
Definition: cmdline.h:44
gengetopt_args_info::root_orig
char ** root_orig
Input ROOT file name original value given at command line.
Definition: cmdline.h:75
gengetopt_args_info::plots_help
const char * plots_help
Create some plots on demand help description.
Definition: cmdline.h:123
gengetopt_args_info::livetrigger_arg
char * livetrigger_arg
L1 Trigger used for livetime calculation (default='L1_EM30').
Definition: cmdline.h:101
gengetopt_args_info::lumichannel_given
unsigned int lumichannel_given
Whether lumichannel was given.
Definition: cmdline.h:142
gengetopt_args_info::quiet_help
const char * quiet_help
Quiet output level help description.
Definition: cmdline.h:127
gengetopt_args_info::xml_out_help
const char * xml_out_help
Output XML file name help description.
Definition: cmdline.h:119
gengetopt_args_info::runnumber_help
const char * runnumber_help
Run number, range, or comma separated list, e.g.
Definition: cmdline.h:50
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
cmdline_parser_params::initialize
int initialize
whether to initialize the option structure gengetopt_args_info (default 1)
Definition: cmdline.h:163
gengetopt_args_info::online_help
const char * online_help
Use online luminosity estimates instead of offline database help description.
Definition: cmdline.h:89
gengetopt_args_info::tree_arg
char * tree_arg
Name of TTree in input ROOT file to which Lumi string is attached.
Definition: cmdline.h:79
cmdline_parser_params::check_required
int check_required
whether to check that all required options were provided (default 1)
Definition: cmdline.h:164
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
gengetopt_args_info::root_arg
char ** root_arg
Input ROOT file name.
Definition: cmdline.h:74
gengetopt_args_info::lbend_help
const char * lbend_help
LumiBlock number end help description.
Definition: cmdline.h:60
gengetopt_args_info::plots_flag
int plots_flag
Create some plots on demand (default=off).
Definition: cmdline.h:122
gengetopt_args_info::trigger_orig
char ** trigger_orig
Trigger chain name used for prescale calculation original value given at command line.
Definition: cmdline.h:97
gengetopt_args_info::lumichannel_help
const char * lumichannel_help
Luminosity estimate method by value help description.
Definition: cmdline.h:92
gengetopt_args_info::trigger_help
const char * trigger_help
Trigger chain name used for prescale calculation help description.
Definition: cmdline.h:100
gengetopt_args_info_usage
const char * gengetopt_args_info_usage
the usage string of the program
Definition: cmdline.cxx:29
gengetopt_args_info::xml_max
unsigned int xml_max
Input XML file name's maximum occurreces.
Definition: cmdline.h:64
gengetopt_args_info::trigger_max
unsigned int trigger_max
Trigger chain name used for prescale calculation's maximum occurreces.
Definition: cmdline.h:99
gengetopt_args_info::d3pd_dir_help
const char * d3pd_dir_help
Name of TDirectory in input ROOT file where Lumi string is stored help description.
Definition: cmdline.h:84
gengetopt_args_info::beamspottag_given
unsigned int beamspottag_given
Whether beamspottag was given.
Definition: cmdline.h:149