CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Functions
confdbOfflineConverter Namespace Reference

Classes

class  OfflineConverter
 

Functions

def help
 
def main
 

Function Documentation

def confdbOfflineConverter.help ( )

Definition at line 138 of file confdbOfflineConverter.py.

Referenced by main().

139 def help():
140  sys.stdout.write("""Usage: %s OPTIONS
141 
142  --v1|--v2 (specify the ConfDB version [default: v1])
143 
144  --offline|--online|--adg (specify the target db [default: offline])
145 
146  Note that for v1
147  --orcoff is a synonim of --adg
148  --offline is a synonim of --hltdev
149 
150  --configId <id> (specify the configuration by id)
151  --configName <name> (specify the configuration by name)
152  --runNumber <run> (specify the configuration by run number)
153  [exactly one of --configId OR --configName OR --runNumber is required]
154 
155  --cff (retrieve configuration *fragment*)
156  --input <f1.root[,f2.root]> (insert PoolSource with specified fileNames)
157  --input <files.list> (read a text file which lists input ROOT files)
158  --output <out.root> (insert PoolOutputModule w/ specified fileName)
159  --nopsets (exclude all globale psets)
160  --noedsources (exclude all edsources)
161  --noes (exclude all essources *and* esmodules)
162  --noessources (exclude all essources)
163  --noesmodules (exclude all esmodules)
164  --noservices (exclude all services)
165  --nooutput (exclude all output modules)
166  --nopaths (exclude all paths [+=referenced seqs&mods])
167  --nosequences (don't define sequences [+=referenced s&m])
168  --nomodules (don't define modules)
169  --psets <pset1[,pset2]> (include only specified global psets)
170  --psets <-pset1[,-pset2]> (include all global psets but the specified)
171  --essources <ess1[,ess2]> (include only specified essources)
172  --essources <-ess1[,-ess2]> (include all essources but the specified)
173  --esmodules <esm1[,esm2]> (include only specified esmodules)
174  --esmodules <-esm1[,-esm2]> (include all esmodules but the specified)
175  --services <svc1[,svc2]> (include only specified services)
176  --services <-svc1[,-svc2]> (include all services but the specified)
177  --paths <p1[,p2]> (include only specified paths)
178  --paths <-p1[,-p2]> (include all paths but the specified)
179  --streams <s1[,s2]> (include only specified streams)
180  --datasets <d1[,d2]> (include only specified datasets)
181  --sequences <s1[,s2]> (include sequences, referenced or not!)
182  --modules <p1[,p2]> (include modules, referenced or not!)
183  --blocks <m1::p1[,p2][,m2]> (generate parameter blocks)
184 
185  --verbose (print additional details)
186 """)
187 
def confdbOfflineConverter.main ( )

Definition at line 188 of file confdbOfflineConverter.py.

References help(), and join().

189 def main():
190  args = sys.argv[1:]
191  version = 'v1'
192  db = 'hltdev'
193  verbose = False
194 
195  if not args:
196  help()
197  sys.exit(1)
198 
199  if '--help' in args or '-h' in args:
200  help()
201  sys.exit(0)
202 
203  if '--verbose' in args:
204  verbose = True
205  args.remove('--verbose')
206 
207  if '--v1' in args and '--v2' in args:
208  sys.stderr.write( "ERROR: conflicting database version specifications \"--v1\" and \"--v2\"\n" )
209  sys.exit(1)
210 
211  if '--v1' in args:
212  version = 'v1'
213  db = 'hltdev'
214  args.remove('--v1')
215 
216  if '--v2' in args:
217  version = 'v2'
218  db = 'offline'
219  args.remove('--v2')
220 
221  _dbs = {}
222  _dbs['v1'] = [ '--%s' % _db for _db in OfflineConverter.databases['v1'] ] + [ '--runNumber' ]
223  _dbs['v2'] = [ '--%s' % _db for _db in OfflineConverter.databases['v2'] ] + [ '--runNumber' ]
224  _dbargs = set(args) & set(sum(_dbs.values(), []))
225 
226  if _dbargs:
227  if len(_dbargs) > 1:
228  sys.stderr.write( "ERROR: too many database specifications: \"" + "\", \"".join( _dbargs) + "\"\n" )
229  sys.exit(1)
230 
231  _arg = _dbargs.pop()
232  db = _arg[2:]
233  if db == 'runNumber':
234  db = 'adg'
235  else:
236  args.remove(_arg)
237 
238  if not db in OfflineConverter.databases[version]:
239  sys.stderr.write( "ERROR: database version \"%s\" incompatible with specification \"%s\"\n" % (version, db) )
240  sys.exit(1)
241 
242  converter = OfflineConverter(version = version, database = db, verbose = verbose)
243  out, err = converter.query( * args )
244  if 'ERROR' in err:
245  sys.stderr.write( "%s: error while retriving the HLT menu\n\n%s\n\n" % (sys.argv[0], err) )
246  sys.exit(1)
247  else:
248  sys.stdout.write( out )
249 
static std::string join(char **cmd)
Definition: RemoteFile.cc:18