CMS 3D CMS Logo

Classes | Functions
condhdf5tohdf5 Namespace Reference

Classes

class  H5DataProduct
 
class  H5GlobalTag
 
class  H5Payload
 
class  H5Tag
 
class  IOVSyncValue
 

Functions

def main ()
 

Function Documentation

◆ main()

def condhdf5tohdf5.main ( )

Definition at line 128 of file condhdf5tohdf5.py.

References beamvalidation.exit(), print(), and hdf5Writer.writeH5File().

128 def main():
129  parser = argparse.ArgumentParser(description='Read from HDF5 file and write to HDF5 file')
130  parser.add_argument('input', help="Name of file to read")
131  parser.add_argument('name', nargs='+', help="Name of the global tag.")
132 
133  parser.add_argument('--exclude', '-e', nargs='*', help = 'list of records to exclude from the file (can not be used with --include)')
134  parser.add_argument('--include', '-i', nargs='*', help = 'lost of the only records that should be included in the file (can not be used with --exclude')
135  parser.add_argument('--output', '-o', default='test.h5cond', help='name of hdf5 output file to write')
136  parser.add_argument('--compressor', '-c', default='zlib', choices=['zlib', 'lzma', 'none'], help="compress data using 'zlib', 'lzma' or 'none'")
137  args = parser.parse_args()
138 
139  if args.exclude and args.include:
140  print("Can not use --exclude and --include at the same time")
141  exit(-1)
142 
143  excludeRecords = set()
144  if args.exclude:
145  excludeRecords = set(args.exclude)
146  includeRecords = set()
147  if args.include:
148  includeRecords = set(args.include)
149 
150  writeH5File(args.output, args.name, excludeRecords, includeRecords, lambda x: H5GlobalTag(args.input, x), args.compressor)
def writeH5File(fileName, globalTags, excludeRecords, includeRecords, tagReader, compressorName)
Definition: hdf5Writer.py:70
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def exit(msg="")