Esempio n. 1
0
  try:
    pass
    api.insertFiles (block, [ file ])
  except DbsCgiObjectExists, ex:
    print "Object existed already, passing"
  
  # Attempt to insert hit and digi event collections
  print "creating ev object"
  #ech = DbsEventCollection (collectionName="HC2", numberOfEvents=long(1), collectionStatus='NEW', fileList=[file])
  ech = DbsEventCollection (collectionName="HC2", numberOfEvents=long(1),  fileList=[file])
  ecd = DbsEventCollection (collectionName="DC2", numberOfEvents=long(1), fileList=[file],
			    parentageList=[ { 'parent' : ech, 'type' : 'Hit' } ])
  ecs = DbsEventCollection (collectionName="SC2", numberOfEvents=long(1), fileList=[file],
		      	    parentageList=[ { 'parent' : ecd, 'type' : 'Digi' } ])
  print "Inserting event collections\n %s\n %s\n %s" % (ech, ecd, ecs)
  try:
    api.insertEventCollections (hits, [ ech ])
    api.insertEventCollections (digi, [ ecd ])
    api.insertEventCollections (dst, [ ecs ])
  except DbsCgiObjectExists, ex:
    print "Object existed already, passing"
  
except InvalidDataTier, ex:
  print "Caught InvalidDataTier API exception: %s" % (ex.getErrorMessage())
except DbsApiException, ex:
  print "Caught API exception %s: %s" % (ex.getClassName(), ex.getErrorMessage())
except DbsException, ex:
  print "Caught exception %s: %s" % (ex.getClassName(), ex.getErrorMessage())

print "Done"
Esempio n. 2
0
        parentageList=[{"parent": e5, "type": "Hit"}],
    )

    print ""
    print "Inserting file "
    try:
        pass
        api.insertFiles(block, [file1, file2, file3, file4, file5, file6, fileout])
    except DbsCgiObjectExists, ex:
        print "Object existed already, passing"

    print "Inserting event collections\n %s " % (eout1)
    try:
        # pass

        api.insertEventCollections(hits, [e1])
        api.insertEventCollections(hits, [e2])
        api.insertEventCollections(hits, [e3])
        api.insertEventCollections(hits, [e4])
        api.insertEventCollections(hits, [e5])
        api.insertEventCollections(hits, [e6])
        api.insertEventCollections(digi, [eout1])
        api.insertEventCollections(dst, [eout2])
    except DbsCgiObjectExists, ex:
        print "Object existed already, passing", ex
    except:
        print "Unexpected error:", sys.exc_info()[0]

    print "Remapping file\n %s\n " % (file2)
    print "and file\n %s\n " % (file5)
    try:
Esempio n. 3
0
      files.append (f)
      evcs.append (e)

  print "Creating primary dataset %s" % primary
  api.createPrimaryDataset (primary)

  print "Creating processing %s" % processing
  api.createProcessing (processing)

  print "Creating file block %s" % block
  api.createFileBlock (block)

  print "Creating processed dataset %s" % gen
  api.createProcessedDataset (gen)

  for (files, evcs) in all:
    print "Inserting %d files into %s" % (len(files), block)
    api.insertFiles (block, files)

    print "Inserting %d evcs into %s" % (len(evcs), gen)
    api.insertEventCollections (gen, evcs)

except InvalidDataTier, ex:
  print "Caught InvalidDataTier API exception: %s" % (ex.getErrorMessage())
except DbsApiException, ex:
  print "Caught API exception %s: %s" % (ex.getClassName(), ex.getErrorMessage())
except DbsException, ex:
  print "Caught exception %s: %s" % (ex.getClassName(), ex.getErrorMessage())

print "Done"