CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions
CLIHelper.CLIHelper Class Reference
Inheritance diagram for CLIHelper.CLIHelper:

Public Member Functions

def add_parser_options
 
def fill_required_options_dict
 
def fill_required_options_prepare_dict
 
def get_check_options_parser
 
def get_common_options_parser
 
def get_dump_options_parser
 
def get_input_db_options_parser
 
def get_local_input_db_options_parser
 
def get_submission_options_parser
 
def get_write_options_parser
 

Detailed Description

Definition at line 3 of file CLIHelper.py.

Member Function Documentation

def CLIHelper.CLIHelper.add_parser_options (   cls,
  parser 
)

Definition at line 29 of file CLIHelper.py.

29 
30  def add_parser_options(cls, parser):
31  # Subparsers are used to choose a calibration workflow
32  workflow_subparsers = parser.add_subparsers( help="workflow option help", dest="workflow" )
33  return workflow_subparsers
34 
def CLIHelper.CLIHelper.fill_required_options_dict (   self)

Definition at line 39 of file CLIHelper.py.

References bitset_utilities.append(), and DTWorkflow.DTWorkflow.required_options_dict.

39 
41  common_required = ["run"]
42  self.required_options_dict["submit"] = common_required
43  self.required_options_dict["submit"].append("datasetpath")
44  self.required_options_dict["submit"].append("globaltag")
45 
46  self.required_options_dict["correction"] = common_required
47  self.required_options_dict["correction"].append("globaltag")
48 
def fill_required_options_dict
Definition: CLIHelper.py:39
boost::dynamic_bitset append(const boost::dynamic_bitset<> &bs1, const boost::dynamic_bitset<> &bs2)
this method takes two bitsets bs1 and bs2 and returns result of bs2 appended to the end of bs1 ...
def CLIHelper.CLIHelper.fill_required_options_prepare_dict (   self)

Definition at line 35 of file CLIHelper.py.

References DTWorkflow.DTWorkflow.required_options_prepare_dict.

35 
37  common_required = []
38  self.required_options_prepare_dict["submit"] = ["globaltag"]
def fill_required_options_prepare_dict
Definition: CLIHelper.py:35
def CLIHelper.CLIHelper.get_check_options_parser (   cls)
Return a parser object with options relevant to check the status of remote submission

Definition at line 113 of file CLIHelper.py.

114  def get_check_options_parser(cls):
115  """ Return a parser object with options relevant to check the status of remote submission"""
116  check_opts_parser = argparse.ArgumentParser(add_help=False)
117  check_opts_group = check_opts_parser.add_argument_group(
118  description ="Options for Job submission")
119  check_opts_group.add_argument("--check-interval", default = 600,type=int,
120  help="Time in seconds between check operations default: %(default)s")
121  check_opts_group.add_argument("--max-checks", default =1000, type=int,
122  help="Maximum number of checks before check is considered failed default: %(default)s")
123  return check_opts_parser
def get_check_options_parser
Definition: CLIHelper.py:113
def CLIHelper.CLIHelper.get_common_options_parser (   cls)
Return a parser with common options for each workflow

Definition at line 5 of file CLIHelper.py.

5 
7  """ Return a parser with common options for each workflow"""
8  common_opts_parser = argparse.ArgumentParser(add_help=False)
9  common_opts_group = common_opts_parser.add_argument_group(
10  description ="General options")
11  common_opts_group.add_argument("-r","--run", type=int,
12  help="set reference run number (typically first or last run in list)")
13  common_opts_group.add_argument("--trial", type=int, default = 1,
14  help="trial number used in the naming of output directories")
15  common_opts_group.add_argument("--label", default="dtCalibration",
16  help="label used in the naming of workflow output default:%(default)s")
17  common_opts_group.add_argument("--datasettype", default = "Data",
18  choices=["Data", "Cosmics", "MC"], help="Type of input dataset default: %(default)s")
19  common_opts_group.add_argument("--config-path",
20  help="Path to alternative workflow config json file, e.g. used to submit the job")
21  common_opts_group.add_argument("--user", default="",
22  help="User used e.g. for submission. Defaults to user HN name")
23  common_opts_group.add_argument("--working-dir",
24  default=os.getcwd(), help="connect string default:%(default)s")
25  common_opts_group.add_argument("--no-exec",
26  action="store_true", help="Do not execute or submit any workflow")
27  return common_opts_parser
def get_common_options_parser
Definition: CLIHelper.py:5
def CLIHelper.CLIHelper.get_dump_options_parser (   cls)

Definition at line 135 of file CLIHelper.py.

136  def get_dump_options_parser(cls):
137  dump_opts_parser = argparse.ArgumentParser(add_help=False)
138  dump_opts_group = dump_opts_parser.add_argument_group(
139  description ="Options for dump db file")
140  dump_opts_group.add_argument("--input-dumpDB",
141  help="Input database file to dump."\
142  " Defaults to existing corrected database from correction command"\
143  " if run, label, trial or input config are specified")
144  return dump_opts_group
145 
def CLIHelper.CLIHelper.get_input_db_options_parser (   cls)
Return a parser object with options relevant for input databases

Definition at line 50 of file CLIHelper.py.

50 
52  """ Return a parser object with options relevant for input databases"""
53  db_opts_parser = argparse.ArgumentParser(add_help=False)
54  dp_opts_group = db_opts_parser.add_argument_group(
55  description ="Options for Input databases")
56  db_opts_parser.add_argument("--inputDBRcd",
57  help="Record used for PoolDBESSource")
58  db_opts_parser.add_argument("--inputDBTag",
59  help="Tag used for PoolDBESSource")
60  db_opts_parser.add_argument("--connectStrDBTag",
61  default='frontier://FrontierProd/CMS_COND_31X_DT',
62  help="connect string default:%(default)s")
63  return db_opts_parser
def get_input_db_options_parser
Definition: CLIHelper.py:50
def CLIHelper.CLIHelper.get_local_input_db_options_parser (   cls)
Return a parser object with options relevant for input databases

Definition at line 65 of file CLIHelper.py.

65 
67  """ Return a parser object with options relevant for input databases"""
68  db_opts_parser = argparse.ArgumentParser(add_help=False)
69  db_opts_group = db_opts_parser.add_argument_group(
70  description ="Options for local input databases")
71  db_opts_group.add_argument("--inputVDriftDB",
72  help="Local alternative VDrift database")
73  db_opts_group.add_argument("--inputCalibDB",
74  help="Local alternative Ttrig database")
75  db_opts_group.add_argument("--inputT0DB",
76  help="Local alternative T0 database")
77  return db_opts_parser
def get_local_input_db_options_parser
Definition: CLIHelper.py:65
def CLIHelper.CLIHelper.get_submission_options_parser (   cls)
Return a parser object with options relevant to remote submission

Definition at line 79 of file CLIHelper.py.

79 
81  """ Return a parser object with options relevant to remote submission"""
82  submission_opts_parser = argparse.ArgumentParser(add_help=False)
83  submission_opts_group = submission_opts_parser.add_argument_group(
84  description ="Options for Job submission")
85  submission_opts_group.add_argument("--datasetpath",
86  help="dataset name to process")
87  submission_opts_group.add_argument("--run-on-RAW", action = "store_true",
88  help="Flag if run on RAW dataset")
89  submission_opts_group.add_argument("--fromMuons", action = "store_true",
90  help="Segment selection using muon-segment matching")
91  submission_opts_group.add_argument("--globaltag",
92  help="global tag identifier (with the '::All' string, if necessary)")
93  submission_opts_group.add_argument("--histoRange", default = 0.4,
94  help="Range or residual histogram, default is 0.4cm")
95  submission_opts_group.add_argument("--runselection", default = [], nargs="+",
96  help="run list or range")
97  submission_opts_group.add_argument("--filesPerJob", default = 5,
98  help="Number of files to process for MC grid jobs")
99  submission_opts_group.add_argument("--lumisPerJob", default = 10000,
100  help="Number of lumi sections to process for RAW / Comsics grid jobs")
101  submission_opts_group.add_argument("--preselection", dest="preselection",
102  help="configuration fragment and sequence name, separated by a ':', defining a pre-selection filter")
103  submission_opts_group.add_argument("--output-site", default = "T2_DE_RWTH",
104  help="Site used for stage out of results")
105  submission_opts_group.add_argument("--ce-black-list", default = [], nargs="+",
106  help="add sites to black list when run on Grid")
107  submission_opts_group.add_argument("--ce-white-list", default = [], nargs="+",
108  help="add sites to white list when run on Grid")
109  submission_opts_group.add_argument("--no-log",
110  action="store_true", help="Do not transfer crab logs:%(default)s")
111  return submission_opts_parser
def get_submission_options_parser
Definition: CLIHelper.py:79
def CLIHelper.CLIHelper.get_write_options_parser (   cls)
Return a parser object with options relevant to write results to dbs

Definition at line 125 of file CLIHelper.py.

126  def get_write_options_parser(cls):
127  """ Return a parser object with options relevant to write results to dbs"""
128  check_opts_parser = argparse.ArgumentParser(add_help=False)
129  check_opts_group = check_opts_parser.add_argument_group(
130  description ="Options for write jobs")
131  check_opts_group.add_argument("--skip-stageout", action="store_true",
132  help="Skip stageout to local disk and merging")
133  return check_opts_parser
def get_write_options_parser
Definition: CLIHelper.py:125