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 131 of file confdbOfflineConverter.py.

Referenced by main().

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

Definition at line 181 of file confdbOfflineConverter.py.

References help(), and join().

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